JavaScript files starting with eval (function (P, A, C, K, E, R) {e = function (c) are encrypted.
Use the following method to encrypt and decrypt the JS file:
Step: 1. Create an HTML page with the following code
2. paste the encrypted code into the original script text field and click the decrypt button;
3. paste the original code to the original script text field and click "encrypt;
The HTML code is 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 ('new _ Code '). value = "eval (function (P, A, C, K, E, D) {e = function (c) {return (C <? '': 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} ("+" '"+ code +"', "+ A +", "+ Len +", '"+ dict. join ('|') + "'. split ('|'), 0, {}) ";} function num (c) {return (C <? '': 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 ('new _ Code '). value = eval (CODE );} </SCRIPT> <div> JS file encryption and decryption </div> <div> original script </div> <textarea id = "code" Cols = 80 rows = 10> </ textarea> <div> script after encryption/Decryption </div> <textarea id = "new_code" Cols = 80 rows = 10> </textarea> <div> <input type = button onclick = encode () value = encoding> <input type = button onclick = run () value = Execution> <input type = button onclick = decode () value = decoding> </div>
Interface