Steps: 1. New HTML page, the following code into the test, run.
2. Glue the encrypted code into the Text field, click Decrypt, ok!
Core code:
Copy Code code as follows:
<script>
a=62;
function encode () {
var code = document.getElementById (' code '). Value;
Code = code.replace (/[\r\n]+/g, "");
Code = code.replace (/'/g, "\ \");
var tmp = Code.match (/\b (\w+) \b/g);
Tmp.sort ();
var dict = [];
var i, t = ';
for (var i=0; i<tmp.length; i++) {
if (Tmp[i]!= t) dict.push (t = tmp[i]);
}
var len = dict.length;
var ch;
For (i=0 i<len; i++) {
ch = num (i);
Code = code.replace (New RegExp (' \\b ' +dict[i]+ ' \\b ', ' g '), CH);
if (ch = = Dict[i]) dict[i] = ';
}
document.getElementById (' Code '). Value = ' eval (function (p,a,c,k,e,d) {e=function (c) {return (c<a? '): E (parseint a)) + ((c=c%a) >35? String.fromCharCode (c+29): C.tostring ())};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} ("
+ "' +code+" ', "+a+", "+len+", ' "+ dict.join (' | ') + "'. Split (' | '), 0,{})";
}
function num (c) {
Return (c<a? ': num (parseint (C/A)) + ((c=c%a) >35? String.fromCharCode (c+29): c.tostring (36));
}
function Run () {
Eval (document.getElementById (' Code '). Value);
}
function decode () {
var code = document.getElementById (' code '). Value;
Code = code.replace (/^eval/, "");
document.getElementById (' Code '). Value = eval (code);
}
</script>
<textarea Id=code cols=80 rows=20>
</textarea><br>
<input Type=button Onclick=encode () value= Coding >
<input Type=button Onclick=run () value= Executive >
<input Type=button Onclick=decode () value= decoding >
<script> a=62; function encode () {var code = document.getElementById (' code '). Value; Code = code.replace (/[\r\n]+/g, ""); Code = code.replace (/'/g, "\ \"); var tmp = Code.match (/\b (\w+) \b/g); Tmp.sort (); var dict = []; var i, t = '; for (var i=0; i<tmp.length; i++) {if (tmp[i)!= t) dict.push (t = tmp[i]); var len = dict.length; var ch; For (i=0 i<len; i++) {ch = num (i); Code = code.replace (New RegExp (' \\b ' +dict[i]+ ' \\b ', ' g '), CH); if (ch = = Dict[i]) dict[i] = '; } document.getElementById (' Code '). Value = ' 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 ())};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} ("+" "+code+", "+a+", "+len+", "" + Dict.join (' | ') + "'. Split (' | '), 0,{})"; } function NUm (c) {return (c<a? ': num (parseint c/a)) + ((c=c%a) >35? String.fromCharCode (c+29): c.tostring (36)); function run () {eval (document.getElementById (' Code '). Value); function decode () {var code = document.getElementById (' code '). Value; Code = code.replace (/^eval/, ""); document.getElementById (' Code '). Value = eval (code); } </script> <textarea id=code cols=80 rows=20> </textarea> <input Type=button Onclick=encode ( ) value= encoding > <input type=button onclick=run () value= execution > <input type=button onclick=decode () value= decoding >
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]