美团外卖json接口data数据解密
美团外卖json接口data数据解密
风情万种 发表于5个月前
美团外卖json接口data数据解密
  • 发表于 5个月前
  • 阅读 21
  • 收藏 0
  • 点赞 0
  • 评论 0

标题:腾讯云 新注册用户域名抢购1元起>>>   

前端都需要 CryptoJS

require代码

define("module/aesCrypto", [],
function(e) {
  const t = "240789B06A4D4FAG",
  n = "1513D520B9C1459C",
  r = "sxaa1k89dc";
  return {
    validate: function(e) {
      var t = this;
      if (e.length < 32) return ! 1;
      var n = e.slice(0, 32),
      r = e.slice(32),
      i = this.decrypto(r);
      return i
    },
    decrypto: function(e) {
      var r = CryptoJS.enc.Utf8.parse(t),
      i = CryptoJS.enc.Utf8.parse(n),
      s = CryptoJS.AES.decrypt(e, r, {
        iv: i,
        mode: CryptoJS.mode.CBC
      }),
      o = CryptoJS.enc.Utf8.stringify(s).toString();
      try {
        location.href.indexOf("debug") > -1 && console.log(JSON.parse(o || "{}"))
      } catch(u) {}
      return o
    }
  }
});
require(["module/aesCrypto"],function(l) {
	var data = 'BE913098F7F0168092A1CB0FE0D2234F0HFzT4iW96PEYHXp6B%2FqtuE8gwfQK5a74nCajEuHXiZdB%2Fv7Ysoe%2BVlNw7U7FhvfmBvPvvjVAwKoRxx2yuKhj0%2BwC0EBUmV0gYweUChgmHuEivna4hIhFCoEqYOyI5BqGklzGN7IYURxX9UxMsADLVKnSKvCmBe8xgC0cFVqz1K4QQMd2aL4e7HsIXiOLpCGXQ27sRT5wrNsAQy16pp0%2FASfurCeNJXCKZP%2BEGKggieZhTl0oY6S8a5V5n3dBXLvrI6PgyRgN7I9DehWJZJ0uVOTXei1d3nAiuHIAmz45TvmFnn7TG63s%2Bta3cARuPViJvXzTpC1q3pMAS1Bd9D6UOJCfEVzmfSd1AE124r979WhZAFXGqtzh%2B%2FNRei7t3tT5aT36oFXYpi81x8zi1XCD7FNAZoqDQ6s8Bor3yo%2FkPuWtMZIgQHx4Iy3vU9GvMZG%2FSC2UNSIufzL75Gmm6vAcMmPNw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sB2Z0tRYpgotcZYqFvWCy4M8EReHPRkV9POgv%2BqhoYVMlN%2FPs8OV24TQbY0%2B7JnuJXqv1RquzNSub4%3D';
	data = decodeURIComponent(data),
	data = JSON.parse(l.validate(data) || "{}")
	console.log(data);
});

本来准备用php解密,但解密出来是串乱码 很奇怪,望高人指点

php代码如下:

<?php
$data = "7C1AD78D953258A6A8D2F5585C4BD5A8v17aeCeXo%2FoVLc9kar1ci6o4YnBD7iPOhRjZnL9sDoYilDdnIdGIK5d%2BO0hS0K%2F8jPdvzdAGvSYFdnesc4rMLmaQ0YP603vRId4%2BpvO06ljkpFwIrG1CIQZReZZlIVW79tN1TpplUPBvaC%2F%2BxPc1Qcqwsxv72G59bQPI1eaH1GMOAR1euEBirZ0YWTK%2FenUggh%2B1WbSJ7Tz%2FV3%2BjE7F827anXvMl52XeW07bEI2a31oDnJPKo5t0%2FdGHB0t%2FjXA6yHxcWHZEGHEQ2Terps3K0%2FcUjg1hNDQEqlLTihs0PunL%2Fk%2B9sy1tmiLuc%2F7sRYAzqdMmsSxq5H25td6yN%2FfwwJkgpRSHrpFo77zHzVUB9ToAnmsiAwXkKjkv%2FQMKX6wLeYfx0%2B5mWoMgV4MHQDk7K8gL2P9XiCsPc%2BM6S9hPwvwfVNhxe4RuuReTWsA5q%2Fq0o8u9Qxi1NiR12s%2FoUMWwOW9D78yVpibVlMcaPL4aPu3IdvOdRWrRWTl%2BmBbROy3PZDzhPTol2Ql8AmkjMqVdi9smzb15v9VlT6Zch0%2BmWX0euwh2QZR5qm86Gj3vaVxTEOlFGhmFsBjD03a8687wvSPdS9DwfxsBX%2BvbAZhGbQHCGxCly%2F1KOly%2FTtCgUG5DHucLK2R64xvGiPcBhENeSEEEQrGkf0y35fr8Oc9tW73WHmfb0F97uSP2xDt%2FQWoog%2FwQfamG3SrPw9wViokpvyaHMNPsTujg%2FJmVSDo17Ni8pT3Gfr8r47quwn7GU3d8qJf4n%2BZTFlyA7qB3oTgLHmSEE%2FhW8OCbI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yBhGr%2BGF1Wagseo6b21WLUN6Rvb24K07UhuUGp9IEYmJk92acy0Jx%2FxXTsxtedyI0I6uerX6Q36OnM529euS0%2FLZAysi7beKXLgQ2HOLTrGcA1400in%2B714XxkKLGwNtiG97psEHGAy0AweYPho4xNSIr0iK9kXd9Uhr5ntXYBlydTbdIFqscTQsvrVYRLrK4ivF%2FPXYk2aPWDhJOmvFMse1%2F%2FHgjjsI%2FanLgAuJ87rMT3VgIM6k9fBV0RJ3g%2FQnddmXGH8ConVEyJG4UsOkpKDI6JyCDNCi6TLtuy%2B7jPkJZ5UlpVrAjQdcn8gHdLVllfd3WHJoBC8O2oxOK1rFBml%2Fy8l9wwKBmDxjYgOf18%2BAbUqfC5nFu5TMf26UwLzke0li88gBo48LlUJWEziBVXB7HRHRlsp1B51apzSgyeGDC2h7OZq9sZRRkHvX6B7kY%2FastQoDvaEiYJ9KlRMahAPebs%2FEEPS9irsE6CXyYGSaPNQiGOmcYJTrINEJnEIxWO7fc3BAcdzt4ACUYZ5c9%2BfBiktmf0jcKSdC8KvhRIthPMk9H2gHvNG5Cl3bIJ%2BlJIBHNMhBJ3IAbU9%2FF3rtIFQIGTwdaJGl%2BwGLRhmbyr0lwrpyExQeEINmiEOguemtcRSPm6xlLLZIH9gxFY7uqks4CCjJ7Bxd0zeCxHOXy30D2KZKH8oz1s2o2LrqR%2Fd7PXqKms%3D";
$data = urldecode($data);
$ase = new aesCrypto();
$str = $ase->validate($data);
echo $str;

class aesCrypto
{
    //private $t = "240789B06A4D4FAG";
    private $iv = "1513D520B9C1459C";
    private $key = "sxaa1k89dc";

    public function validate($e){
        if(strlen($e) < 32){ return 0;}
        //$n = substr($e, 0, 32);
        $r = substr($e, 32);
        $i = $this->decrypto($r);
        return  $i;
    }
    public  function decrypto($e){
        //$this->key = pack('H*', $this->key);
        //$this->iv = pack('H*', $this->iv);
        $e = base64_decode($e);
        $s = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $this->key, $e, MCRYPT_MODE_CBC, $this->iv);
        $s = rtrim($s,"\t\0");
        return $s;
    }
    public  function encrypted($e){
        $s = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $this->key, $e, MCRYPT_MODE_CBC, $this->iv);
        return base64_encode($s);
    }
}
?>

 

标签: 解密
共有 人打赏支持
粉丝 21
博文 12
码字总数 13902
×
风情万种
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: