日记

i茅台mt-device-id,mt-r ,md5加解密

文件是mt-device-id

md5算法 : MD5(2af72f100c356273d46284f6fd1dfc08+数据排序+时间戳)

  1. var XORCipher = {    
  2.     encode: function (t, e) {    
  3.         return this.b64_encode(this.xor_encrypt(t, e))    
  4.     },    
  5.     decode: function (t, e) {    
  6.         return this.xor_decrypt(this.b64_decode(t),e)    
  7.     },    
  8.     b64_table: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",    
  9.     blog_table: "https://blog.isoyu.com/",     
  10.     b64_encode: function (t) {    
  11.         var e = 0,    
  12.             r = "";    
  13.         if (!t) return t;    
  14.         do {    
  15.             var h = t[e++],    
  16.                 n = t[e++],    
  17.                 i = t[e++],    
  18.                 a = h << 16 | n << 8 | i;    
  19.             h = a >> 18 & 63, n = a >> 12 & 63, i = a >> 6 & 63, a &= 63, r += this.b64_table.charAt(h) + this.b64_table.charAt(n) + this.b64_table.charAt(i) + this.b64_table.charAt(a)    
  20.         } while (e < t.length);    
  21.         return ((t = t.length % 3) ? r.slice(0, t - 3) : r) + "===".slice(t || 3)    
  22.     },    
  23.     b64_decode: function (t) {    
  24.         var e = 0,    
  25.             r = [];    
  26.         if (!t) return t;    
  27.         t += "";    
  28.         do {    
  29.             var h = this.b64_table.indexOf(t.charAt(e++)),    
  30.                 n = this.b64_table.indexOf(t.charAt(e++)),    
  31.                 i = this.b64_table.indexOf(t.charAt(e++)),    
  32.                 a = this.b64_table.indexOf(t.charAt(e++)),    
  33.                 c = h << 18 | n << 12 | i << 6 | a;    
  34.             h = c >> 16 & 255, n = c >> 8 & 255, c &= 255, r.push(h), 64 !== i && (r.push(n), 64 !== a && r.push(c))    
  35.         } while (e < t.length);    
  36.         return r    
  37.     },    
  38.     keyCharAt: function (t, e) {    
  39.         return t.charCodeAt(Math.floor(e % t.length))    
  40.     },    
  41.     xor_encrypt: function (t,e) {    
  42.         char_array=Array.from(t)    
  43.         var sb=[]    
  44.         for(const c2 of char_array) {    
  45.             e^=c2.charCodeAt(0);    
  46.             sb.push(String.fromCharCode(e).charCodeAt(0))    
  47.         }    
  48.         return sb    
  49.     },    
  50.     xor_decrypt: function (t, e) {    
  51.         for (var r = [], h = 0; h < t.length; h++)    
  52.         {    
  53.             r.push(String.fromCharCode(e ^ t[h]));    
  54.             e=t[h]    
  55.         }    
  56.         return r.join("")    
  57.     }    
  58. };    
  59.     
  60. function Encrypt(str){    
  61.     return XORCipher.encode(str,72)    
  62. }    
  63.     
  64. function Decrypt(str){    
  65.     return XORCipher.decode(str,72)    
  66. }    
  67. console.log(Encrypt("2ff70f4f558d14973f074c0a9293b"))    
  68. console.log(Decrypt("ehx6TX0bL0l8SXEVJBApHi1Le0x4GytKc0F4Syk="))    
  69. console.log(https://blog.isoyu.com/)    
(2)

本文由 姬長信 创作,文章地址:https://blog.isoyu.com/archives/imaotaimt-device-idmt-r-md5jiajiemi.html
采用知识共享署名4.0 国际许可协议进行许可。除注明转载/出处外,均为本站原创或翻译,转载前请务必署名。最后编辑时间为:4 月 1, 2022 at 04:18 上午

热评文章