Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. function simpleHash(str)
  2.     {
  3.     var i,hash=0;
  4.     for(i=0;
  5.     i<str.length;
  6.     i++)
  7.         {
  8.         hash+=(str[i].charCodeAt()*(i+1))
  9.     }
  10.     return Math.abs(hash)%31337
  11. }
  12. function ascii_one(foo)
  13.     {
  14.     foo=foo.charAt(0);
  15.     var i;
  16.     for(i=0;
  17.     i<256;
  18.     ++i)
  19.         {
  20.         var hex_i=i.toString(16);
  21.         if(hex_i.length==1)hex_i="0"+hex_i;
  22.         hex_i="%"+hex_i;
  23.         hex_i=unescape(hex_i);
  24.         if(hex_i==foo)break
  25.     }
  26.     return i
  27. }
  28. function numerical_value(str)
  29.     {
  30.     var i,a=0,b;
  31.     for(i=0;
  32.     i<str.length;
  33.     ++i)
  34.         {
  35.         b=ascii_one(str.charAt(i));
  36.         a+=b*(i+1)
  37.     }
  38.     return a
  39. }
  40. function encrypt(form)
  41.     {
  42.     var res;
  43.     res=numerical_value(form.password.value);
  44.     res=res*(3+1+3+3+7);
  45.     res=res>>>6;
  46.     res=res/4;
  47.     res=res^4153;
  48.     if(res!=0)
  49.         {
  50.         alert('Invalid password!')
  51.     }
  52.     else
  53.         {
  54.         alert('Correct password :)')
  55.     }
  56.     form.key.value=numerical_value(form.password.value);
  57.     form.verification.value="yes"+simpleHash(form.password.value);
  58.     return true
  59. }