Eval (function (p,a,c,k,e,d) series decryption JavaScript program _javascript tips

Source: Internet
Author: User
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]
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.