javascript另类混淆加密
源代码:alert('大家好,我是showbo!𠮷双字节测试')
加密后代码:
var kv = { "0": "___", "1": "__$", "2": "_$_", "3": "_$$", "4": "$__", "5": "$_$", "6": "$$_", "7": "$$$", "8": "$___", "9": "$__$", "f": "$$$$", "a": "$_$_", "b": "$_$$", "d": "$$_$", "e": "$$$_", "c": "$$__", "o": "_$", "t": "__", "u": "_" };
function getOctalStr(c) {
var s = '+"\\\\"';
var sOctal = c.charCodeAt(0).toString(8);
for (var i = 0; i < sOctal.length; i++) s += '+$.' + kv[sOctal.charAt(i)];
return s;
}
function padding(s, l, c) { if (s.length < l) for (var i = l - s.length; i > 0; i--) s = c + s; return s;}
function encrypSource(s) {
//处理大于255 ASCII字符为16进制编码
s = s.replace(/[\u0100-\uFFFF]+/g, function (s) {
var r = '';
for (var i = 0; i < s.length; i++) r += '\\u' + padding(s.charCodeAt(i).toString(16), 4, 0);
return r;
});
var r = '';
//将s转为8进制表示
for (var i = 0, l = s.length; i < l; i++) {
var c = s.charAt(i);
if (kv[c]) {//不需要转8进制的字符
r += '+$.' + kv[c];
}
else {//字符转8进制
r += getOctalStr(c);
}
}
//加上原文网站解码程序
return '$=~[];$={___:++$,$$$$:(![]+"")[$],__$:++$,$_$_:(![]+"")[$],_$_:++$,$_$$:({}+"")[$],$$_$:($[$]+"")[$],_$$:++$,$$$_:(!""+"")[$],$__:++$,$_$:++$,$$__:({}+"")[$],$$_:++$,$$$:++$,$___:++$,$__$:++$};$.$_=($.$_=$+"")'
+ '[$.$_$]+($._$=$.$_[$.__$])+($.$$=($.$+"")[$.__$])+((!$)+"")[$._$$]+($.__=$.$_[$.$$_])+($.$=(!""+"")[$.__$])+($._=(!""+"")[$._$_])+$.$_[$.$_$]+$.__'
+ '+$._$+$.$;$.$$=$.$+(!""+"")[$._$$]+$.__+$._+$.$+$.$$;$.$=($.___)[$.$_][$.$_];$.$($.$(' +
'$.$$+"\\""' + r + '+"\\""'//这串是加密后的
+ ')())();'
;
}
加支付宝好友偷能量挖...
-8-12Web开发网
如果觉得《js ajax加密 javascript混淆加密》对你有帮助,请点赞、收藏,并留下你的观点哦!