javascript——MD5加密脚本
未经过混淆处理
var hexcase = 0 ;
var b64pad = "" ;
function hex_md5 (s) { return rstr2hex(rstr_md5(str2rstr_utf8(s))); }
function b64_md5 (s) { return rstr2b64(rstr_md5(str2rstr_utf8(s))); }
function any_md5 (s, e) { return rstr2any(rstr_md5(str2rstr_utf8(s)), e); }
function hex_hmac_md5 (k, d)
{ return rstr2hex(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d))); }
function b64_hmac_md5 (k, d)
{ return rstr2b64(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d))); }
function any_hmac_md5 (k, d, e)
{ return rstr2any(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d)), e); }
function md5_vm_test ()
{
return hex_md5("abc" ).toLowerCase() == "900150983cd24fb0d6963f7d28e17f72" ;
}
function rstr_md5 (s)
{
return binl2rstr(binl_md5(rstr2binl(s), s.length * 8 ));
}
function rstr_hmac_md5 (key, data)
{
var bkey = rstr2binl(key);
if (bkey.length > 16 ) bkey = binl_md5(bkey, key.length * 8 );
var ipad = Array (16 ), opad = Array (16 );
for (var i = 0 ; i < 16 ; i++)
{
ipad[i] = bkey[i] ^ 0x36363636 ;
opad[i] = bkey[i] ^ 0x5C5C5C5C ;
}
var hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8 );
return binl2rstr(binl_md5(opad.concat(hash), 512 + 128 ));
}
function rstr2hex (input)
{
try { hexcase } catch (e) { hexcase=0 ; }
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef" ;
var output = "" ;
var x;
for (var i = 0 ; i < input.length; i++)
{
x = input.charCodeAt(i);
output += hex_tab.charAt((x >>> 4 ) & 0x0F )
+ hex_tab.charAt( x & 0x0F );
}
return output;
}
function rstr2b64 (input)
{
try { b64pad } catch (e) { b64pad='' ; }
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" ;
var output = "" ;
var len = input.length;
for (var i = 0 ; i < len; i += 3 )
{
var triplet = (input.charCodeAt(i) << 16 )
| (i + 1 < len ? input.charCodeAt(i+1 ) << 8 : 0 )
| (i + 2 < len ? input.charCodeAt(i+2 ) : 0 );
for (var j = 0 ; j < 4 ; j++)
{
if (i * 8 + j * 6 > input.length * 8 ) output += b64pad;
else output += tab.charAt((triplet >>> 6 *(3 -j)) & 0x3F );
}
}
return output;
}
function rstr2any (input, encoding)
{
var divisor = encoding.length;
var i, j, q, x, quotient;
var dividend = Array (Math .ceil(input.length / 2 ));
for (i = 0 ; i < dividend.length; i++)
{
dividend[i] = (input.charCodeAt(i * 2 ) << 8 ) | input.charCodeAt(i * 2 + 1 );
}
var full_length = Math .ceil(input.length * 8 /
(Math .log(encoding.length) / Math .log(2 )));
var remainders = Array (full_length);
for (j = 0 ; j < full_length; j++)
{
quotient = Array ();
x = 0 ;
for (i = 0 ; i < dividend.length; i++)
{
x = (x << 16 ) + dividend[i];
q = Math .floor(x / divisor);
x -= q * divisor;
if (quotient.length > 0 || q > 0 )
quotient[quotient.length] = q;
}
remainders[j] = x;
dividend = quotient;
}
var output = "" ;
for (i = remainders.length - 1 ; i >= 0 ; i--)
output += encoding.charAt(remainders[i]);
return output;
}
function str2rstr_utf8 (input)
{
var output = "" ;
var i = -1 ;
var x, y;
while (++i < input.length)
{
x = input.charCodeAt(i);
y = i + 1 < input.length ? input.charCodeAt(i + 1 ) : 0 ;
if (0xD800 <= x && x <= 0xDBFF && 0xDC00 <= y && y <= 0xDFFF )
{
x = 0x10000 + ((x & 0x03FF ) << 10 ) + (y & 0x03FF );
i++;
}
if (x <= 0x7F )
output += String .fromCharCode(x);
else if (x <= 0x7FF )
output += String .fromCharCode(0xC0 | ((x >>> 6 ) & 0x1F ),
0x80 | ( x & 0x3F ));
else if (x <= 0xFFFF )
output += String .fromCharCode(0xE0 | ((x >>> 12 ) & 0x0F ),
0x80 | ((x >>> 6 ) & 0x3F ),
0x80 | ( x & 0x3F ));
else if (x <= 0x1FFFFF )
output += String .fromCharCode(0xF0 | ((x >>> 18 ) & 0x07 ),
0x80 | ((x >>> 12 ) & 0x3F ),
0x80 | ((x >>> 6 ) & 0x3F ),
0x80 | ( x & 0x3F ));
}
return output;
}
function str2rstr_utf16le (input)
{
var output = "" ;
for (var i = 0 ; i < input.length; i++)
output += String .fromCharCode( input.charCodeAt(i) & 0xFF ,
(input.charCodeAt(i) >>> 8 ) & 0xFF );
return output;
}
function str2rstr_utf16be (input)
{
var output = "" ;
for (var i = 0 ; i < input.length; i++)
output += String .fromCharCode((input.charCodeAt(i) >>> 8 ) & 0xFF ,
input.charCodeAt(i) & 0xFF );
return output;
}
function rstr2binl (input)
{
var output = Array (input.length >> 2 );
for (var i = 0 ; i < output.length; i++)
output[i] = 0 ;
for (var i = 0 ; i < input.length * 8 ; i += 8 )
output[i>>5 ] |= (input.charCodeAt(i / 8 ) & 0xFF ) << (i%32 );
return output;
}
function binl2rstr (input)
{
var output = "" ;
for (var i = 0 ; i < input.length * 32 ; i += 8 )
output += String .fromCharCode((input[i>>5 ] >>> (i % 32 )) & 0xFF );
return output;
}
function binl_md5 (x, len)
{
x[len >> 5 ] |= 0x80 << ((len) % 32 );
x[(((len + 64 ) >>> 9 ) << 4 ) + 14 ] = len;
var a = 1732584193 ;
var b = -271733879 ;
var c = -1732584194 ;
var d = 271733878 ;
for (var i = 0 ; i < x.length; i += 16 )
{
var olda = a;
var oldb = b;
var oldc = c;
var oldd = d;
a = md5_ff(a, b, c, d, x[i+ 0 ], 7 , -680876936 );
d = md5_ff(d, a, b, c, x[i+ 1 ], 12 , -389564586 );
c = md5_ff(c, d, a, b, x[i+ 2 ], 17 , 606105819 );
b = md5_ff(b, c, d, a, x[i+ 3 ], 22 , -1044525330 );
a = md5_ff(a, b, c, d, x[i+ 4 ], 7 , -176418897 );
d = md5_ff(d, a, b, c, x[i+ 5 ], 12 , 1200080426 );
c = md5_ff(c, d, a, b, x[i+ 6 ], 17 , -1473231341 );
b = md5_ff(b, c, d, a, x[i+ 7 ], 22 , -45705983 );
a = md5_ff(a, b, c, d, x[i+ 8 ], 7 , 1770035416 );
d = md5_ff(d, a, b, c, x[i+ 9 ], 12 , -1958414417 );
c = md5_ff(c, d, a, b, x[i+10 ], 17 , -42063 );
b = md5_ff(b, c, d, a, x[i+11 ], 22 , -1990404162 );
a = md5_ff(a, b, c, d, x[i+12 ], 7 , 1804603682 );
d = md5_ff(d, a, b, c, x[i+13 ], 12 , -40341101 );
c = md5_ff(c, d, a, b, x[i+14 ], 17 , -1502002290 );
b = md5_ff(b, c, d, a, x[i+15 ], 22 , 1236535329 );
a = md5_gg(a, b, c, d, x[i+ 1 ], 5 , -165796510 );
d = md5_gg(d, a, b, c, x[i+ 6 ], 9 , -1069501632 );
c = md5_gg(c, d, a, b, x[i+11 ], 14 , 643717713 );
b = md5_gg(b, c, d, a, x[i+ 0 ], 20 , -373897302 );
a = md5_gg(a, b, c, d, x[i+ 5 ], 5 , -701558691 );
d = md5_gg(d, a, b, c, x[i+10 ], 9 , 38016083 );
c = md5_gg(c, d, a, b, x[i+15 ], 14 , -660478335 );
b = md5_gg(b, c, d, a, x[i+ 4 ], 20 , -405537848 );
a = md5_gg(a, b, c, d, x[i+ 9 ], 5 , 568446438 );
d = md5_gg(d, a, b, c, x[i+14 ], 9 , -1019803690 );
c = md5_gg(c, d, a, b, x[i+ 3 ], 14 , -187363961 );
b = md5_gg(b, c, d, a, x[i+ 8 ], 20 , 1163531501 );
a = md5_gg(a, b, c, d, x[i+13 ], 5 , -1444681467 );
d = md5_gg(d, a, b, c, x[i+ 2 ], 9 , -51403784 );
c = md5_gg(c, d, a, b, x[i+ 7 ], 14 , 1735328473 );
b = md5_gg(b, c, d, a, x[i+12 ], 20 , -1926607734 );
a = md5_hh(a, b, c, d, x[i+ 5 ], 4 , -378558 );
d = md5_hh(d, a, b, c, x[i+ 8 ], 11 , -2022574463 );
c = md5_hh(c, d, a, b, x[i+11 ], 16 , 1839030562 );
b = md5_hh(b, c, d, a, x[i+14 ], 23 , -35309556 );
a = md5_hh(a, b, c, d, x[i+ 1 ], 4 , -1530992060 );
d = md5_hh(d, a, b, c, x[i+ 4 ], 11 , 1272893353 );
c = md5_hh(c, d, a, b, x[i+ 7 ], 16 , -155497632 );
b = md5_hh(b, c, d, a, x[i+10 ], 23 , -1094730640 );
a = md5_hh(a, b, c, d, x[i+13 ], 4 , 681279174 );
d = md5_hh(d, a, b, c, x[i+ 0 ], 11 , -358537222 );
c = md5_hh(c, d, a, b, x[i+ 3 ], 16 , -722521979 );
b = md5_hh(b, c, d, a, x[i+ 6 ], 23 , 76029189 );
a = md5_hh(a, b, c, d, x[i+ 9 ], 4 , -640364487 );
d = md5_hh(d, a, b, c, x[i+12 ], 11 , -421815835 );
c = md5_hh(c, d, a, b, x[i+15 ], 16 , 530742520 );
b = md5_hh(b, c, d, a, x[i+ 2 ], 23 , -995338651 );
a = md5_ii(a, b, c, d, x[i+ 0 ], 6 , -198630844 );
d = md5_ii(d, a, b, c, x[i+ 7 ], 10 , 1126891415 );
c = md5_ii(c, d, a, b, x[i+14 ], 15 , -1416354905 );
b = md5_ii(b, c, d, a, x[i+ 5 ], 21 , -57434055 );
a = md5_ii(a, b, c, d, x[i+12 ], 6 , 1700485571 );
d = md5_ii(d, a, b, c, x[i+ 3 ], 10 , -1894986606 );
c = md5_ii(c, d, a, b, x[i+10 ], 15 , -1051523 );
b = md5_ii(b, c, d, a, x[i+ 1 ], 21 , -2054922799 );
a = md5_ii(a, b, c, d, x[i+ 8 ], 6 , 1873313359 );
d = md5_ii(d, a, b, c, x[i+15 ], 10 , -30611744 );
c = md5_ii(c, d, a, b, x[i+ 6 ], 15 , -1560198380 );
b = md5_ii(b, c, d, a, x[i+13 ], 21 , 1309151649 );
a = md5_ii(a, b, c, d, x[i+ 4 ], 6 , -145523070 );
d = md5_ii(d, a, b, c, x[i+11 ], 10 , -1120210379 );
c = md5_ii(c, d, a, b, x[i+ 2 ], 15 , 718787259 );
b = md5_ii(b, c, d, a, x[i+ 9 ], 21 , -343485551 );
a = safe_add(a, olda);
b = safe_add(b, oldb);
c = safe_add(c, oldc);
d = safe_add(d, oldd);
}
return Array (a, b, c, d);
}
function md5_cmn (q, a, b, x, s, t)
{
return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
}
function md5_ff (a, b, c, d, x, s, t)
{
return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
}
function md5_gg (a, b, c, d, x, s, t)
{
return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
}
function md5_hh (a, b, c, d, x, s, t)
{
return md5_cmn(b ^ c ^ d, a, b, x, s, t);
}
function md5_ii (a, b, c, d, x, s, t)
{
return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
}
function safe_add (x, y)
{
var lsw = (x & 0xFFFF ) + (y & 0xFFFF );
var msw = (x >> 16 ) + (y >> 16 ) + (lsw >> 16 );
return (msw << 16 ) | (lsw & 0xFFFF );
}
function bit_rol (num, cnt)
{
return (num << cnt) | (num >>> (32 - cnt));
}
经过Eval混淆处理后
eval(function (p, a, c, k, e, d) {
e = function (c) {
return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String. fromCharCode(c + 29 ) : c. toString(36 ))
};
if (!'' .replace(/^/, String)) {
while (c--) {
d[e(c)] = k[c] || e(c)
}
k = [function(e) {
return d[e]
}];
e = function () {
return '\\w+'
};
c = 1
};
while (c--) {
if (k[c] ) {
p = p. replace(new RegExp('\\b' + e(c) + '\\b' , 'g' ), k[c] )
}
}
return p
} ('o Y(a){m N(K(w(a)))}o 1E(a){m P(K(w(a)))}o 1D(a,b){m O(K(w(a)),b)}o 1F(a,b){m N(I(w(a),w(b)))}o 1G(a,b){m P(I(w(a),w(b)))}o 1I(a,b,c){m O(I(w(a),w(b)),c)}o 1H(){m" 1 C"==Y(" 1 B").1w()}o K(a){m R(H(J(a),8*a.n))}o I(a,b){p c=J(a);c.n>16&&(c=H(c,8*a.n));u(p d=B(16),e=B(16),f=0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c/8))<<c%G;m b}o R(a){u(p b=" ",c=0;c<G*a.n;c+=8)b+=C.z(a[c>>5]>>>c%G&D);m b}o H(a,b){a[b>>5]|=y<<b%G,a[(b+1b>>>9<<4)+14]=b;u(p c=1j,d=-1q,e=-1r,f=1s,g=0;g<a.n;g+=16){p h=c,i=d,j=e,k=f;c=q(c,d,e,f,a[g+0],7,-1t),f=q(f,c,d,e,a[g+1],12,-1n),e=q(e,f,c,d,a[g+2],17,1m),d=q(d,e,f,c,a[g+3],22,-1l),c=q(c,d,e,f,a[g+4],7,-1k),f=q(f,c,d,e,a[g+5],12,1o),e=q(e,f,c,d,a[g+6],17,-1p),d=q(d,e,f,c,a[g+7],22,-1h),c=q(c,d,e,f,a[g+8],7,1c),f=q(f,c,d,e,a[g+9],12,-1a),e=q(e,f,c,d,a[g+10],17,-1d),d=q(d,e,f,c,a[g+11],22,-1e),c=q(c,d,e,f,a[g+12],7,1g),f=q(f,c,d,e,a[g+13],12,-1f),e=q(e,f,c,d,a[g+14],17,-1i),d=q(d,e,f,c,a[g+15],22,1T),c=r(c,d,e,f,a[g+1],5,-29),f=r(f,c,d,e,a[g+6],9,-2C),e=r(e,f,c,d,a[g+11],14,2D),d=r(d,e,f,c,a[g+0],20,-2E),c=r(c,d,e,f,a[g+5],5,-2F),f=r(f,c,d,e,a[g+10],9,2H),e=r(e,f,c,d,a[g+15],14,-24),d=r(d,e,f,c,a[g+4],20,-2A),c=r(c,d,e,f,a[g+9],5,2w),f=r(f,c,d,e,a[g+14],9,-2v),e=r(e,f,c,d,a[g+3],14,-2x),d=r(d,e,f,c,a[g+8],20,2y),c=r(c,d,e,f,a[g+13],5,-2z),f=r(f,c,d,e,a[g+2],9,-2G),e=r(e,f,c,d,a[g+7],14,2P),d=r(d,e,f,c,a[g+12],20,-2I),c=t(c,d,e,f,a[g+5],4,-2L),f=t(f,c,d,e,a[g+8],11,-2M),e=t(e,f,c,d,a[g+11],16,2K),d=t(d,e,f,c,a[g+14],23,-2J),c=t(c,d,e,f,a[g+1],4,-2N),f=t(f,c,d,e,a[g+4],11,2O),e=t(e,f,c,d,a[g+7],16,-2B),d=t(d,e,f,c,a[g+10],23,-2t),c=t(c,d,e,f,a[g+13],4,2c),f=t(f,c,d,e,a[g+0],11,-2d),e=t(e,f,c,d,a[g+3],16,-2e),d=t(d,e,f,c,a[g+6],23,2f),c=t(c,d,e,f,a[g+9],4,-2b),f=t(f,c,d,e,a[g+12],11,-2a),e=t(e,f,c,d,a[g+15],16,26),d=t(d,e,f,c,a[g+2],23,-25),c=s(c,d,e,f,a[g+0],6,-27),f=s(f,c,d,e,a[g+7],10,28),e=s(e,f,c,d,a[g+14],15,-2u),d=s(d,e,f,c,a[g+5],21,-2g),c=s(c,d,e,f,a[g+12],6,2h),f=s(f,c,d,e,a[g+3],10,-2p),e=s(e,f,c,d,a[g+10],15,-2q),d=s(d,e,f,c,a[g+1],21,-2r),c=s(c,d,e,f,a[g+8],6,2s),f=s(f,c,d,e,a[g+15],10,-2o),e=s(e,f,c,d,a[g+6],15,-2n),d=s(d,e,f,c,a[g+13],21,2j),c=s(c,d,e,f,a[g+4],6,-2i),f=s(f,c,d,e,a[g+11],10,-2k),e=s(e,f,c,d,a[g+2],15,2l),d=s(d,e,f,c,a[g+9],21,-2m),c=x(c,h),d=x(d,i),e=x(e,j),f=x(f,k)}m B(c,d,e,f)}o F(a,b,c,d,e,f){m x(Z(x(x(b,a),x(d,f)),e),c)}o q(a,b,c,d,e,f,g){m F(b&c|~b&d,a,b,e,f,g)}o r(a,b,c,d,e,f,g){m F(b&d|c&~d,a,b,e,f,g)}o t(a,b,c,d,e,f,g){m F(b^c^d,a,b,e,f,g)}o s(a,b,c,d,e,f,g){m F(c^(b|~d),a,b,e,f,g)}o x(a,b){p c=(M&a)+(M&b),d=(a>>16)+(b>>16)+(c>>16);m d<<16|M&c}o Z(a,b){m a<<b|a>>>G-b}p Q=0,S=" ";' , 62 , 176 , '||||||||||||||||||||||return|length|function|var|md5_ff|md5_gg|md5_ii|md5_hh|for|charCodeAt|str2rstr_utf8|safe_add|128|fromCharCode|63|Array|String|255|Math|md5_cmn|32|binl_md5|rstr_hmac_md5|rstr2binl|rstr_md5|charAt|65535|rstr2hex|rstr2any|rstr2b64|hexcase|binl2rstr|b64pad|catch|log|1023|ceil|concat|hex_md5|bit_rol||||||||||try|1958414417|64|1770035416|42063|1990404162|40341101|1804603682|45705983|1502002290|1732584193|176418897|1044525330|606105819|389564586|1200080426|1473231341|271733879|1732584194|271733878|680876936|55296|909522486|toLowerCase|1549556828|512|0123456789ABCDEF|640|abc|900150983cd24fb0d6963f7d28e17f72|any_md5|b64_md5|hex_hmac_md5|b64_hmac_md5|md5_vm_test|any_hmac_md5|0123456789abcdef|ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789|31|192|224|2097151|str2rstr_utf16le|240|2047|127|1236535329|floor|56319|56320|65536|57343|str2rstr_utf16be|||||660478335|995338651|530742520|198630844|1126891415|165796510|421815835|640364487|681279174|358537222|722521979|76029189|57434055|1700485571|145523070|1309151649|1120210379|718787259|343485551|1560198380|30611744|1894986606|1051523|2054922799|1873313359|1094730640|1416354905|1019803690|568446438|187363961|1163531501|1444681467|405537848|155497632|1069501632|643717713|373897302|701558691|51403784|38016083|1926607734|35309556|1839030562|378558|2022574463|1530992060|1272893353|1735328473' .split('|' ), 0 , {}));