Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Just for fun - Encryption 1

Status
Not open for further replies.

MarkZK

Technical User
Jul 13, 2006
202
GB
Hi all,

I was wondering if one of the javascript experts could tell me what single word I encrypted to product this string,

pNtKyiQkcIlNxGfPyJgKsgdJdW


using the following code,

Code:
<script>
    function EncryptString(strVal) {
      var v7='aHfEjcDebChGiAfIjDbEjacD',v8=v7.length,v11='0',v3='',v9=strVal.length,v1=0;
      var v4,v6,v2,v5=0,nCnt=0;
      while (nCnt < v9){
        v4 = strVal.charCodeAt(nCnt);
        if (v4 >= 128){v4 = 'X';}
        v6 = v7.charCodeAt(v1);
        v1 += 1;
        if (v1 >= v8){v1 = 0;}
        v2 = v4 % 16 + v6;
        v3 += String.fromCharCode(v2);
        v5 += v2;
        v6 = v7.charCodeAt(v1);
        v1 += 1;
        if (v1 >= v8){v1 = 0;}
        v2 = Math.floor(v4 / 16) + v6;
        v3 += String.fromCharCode(v2);
        v5 += v2;
        ++nCnt;
      }
      v5 %= 256;
      v6 = v7.charCodeAt(v1);
      v1 += 1;
      if (v1 >= v8){v1 = 0;}
      v2 = v5 % 16 + v6;
      v3 += String.fromCharCode(v2);
      v6 = v7.charCodeAt(v1);
      v1 += 1;
      if (v1 >= v8){v1 = 0;}
      v2 = Math.floor(v5 / 16) + v6;
      v3 += String.fromCharCode(v2);
      document.write(v3);
    }
</script>

 
[&nbsp;]

It seems to me that this thread would be better to be posted in "Puzzles" where puzzle solvers hang out.

mmerlinn


"Political correctness is the BADGE of a COWARD!"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top