e55db081d05f58a

__aqw38bf2f.js (Cipher & Decipher)

Jan 31st, 2017
4,932
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var __aqw38bf2f=(function(window){
  2.     function unicode_random(n){
  3.       i=0;
  4.       code="";
  5.       len=n;
  6.       (len=="")?50:parseInt(len);
  7.       while(i<len){
  8.         al=function(n){
  9.             j=0;
  10.             str='';
  11.             while(j<n){
  12.                 str+=Math.floor((Math.random()*15)).toString(16).replace(/\\x/g,"");
  13.                 j++;
  14.             }
  15.             return str;
  16.         }(4);
  17.         code+=(unescape("%u"+al));
  18.         i++;
  19.       }
  20.       return code;
  21.     };
  22.     function cipher(raw,pass){
  23.         n=0;
  24.         for(k=0;k<pass.length;k++){
  25.             n+=(pass.charCodeAt()^1337);
  26.         }
  27.         n%=1000;
  28.         raw||(raw='');
  29.         c="";
  30.         d="ㅤ".repeat(n);
  31.         junk=unicode_random(n);
  32.         for(i=0;i<raw.length;i++){
  33.             cc=String.fromCharCode(raw[i].charCodeAt()^n);
  34.             c+=(d+junk+d+cc+d+junk+d);
  35.         }
  36.         return c;
  37.     }
  38.     function decipher(raw,pass){
  39.         n=0;
  40.         for(k=0;k<pass.length;k++){
  41.             n+=pass.charCodeAt()^1337;
  42.         }
  43.         n%=1000;
  44.         raw||(raw='');
  45.         d="ㅤ".repeat(n);
  46.         p0=d+"[^ㅤ]*"+d;
  47.         p=new RegExp(p0,'g');
  48.         dc=c.replace(p,"");
  49.         raw='';
  50.         for(i=0;i<dc.length;i++){
  51.             raw+=String.fromCharCode(dc[i].charCodeAt()^n);
  52.         }
  53.         return raw;
  54.     }
  55.     return {
  56.         cipher:cipher,
  57.         decipher:decipher
  58.     }
  59. })(window,undefined);
Add Comment
Please, Sign In to add comment