Results 1 to 3 of 3

Thread: Interesting Crypto Function

  1. #1

    Interesting Crypto Function

    I encountered this function in a Javascript packer/protector (yes, they do exist! easy to unpack though...)
    function x(x) {
     var l=x.length,b=1024,
     for(j=Math.ceil(l/b);j>0;j--) {
      for(i=Math.min(l,b);i>0;i--,l--) {
       if(s) {
       } else {
    It takes as input a huge long string (the ciphertext, which appears to be base-64) and transforms it into cleartext HTML.

    I'm just wondering if anyone here can figure out how it operates, as my knowledge of Javascript is much less than Asm or C/C++.

  2. #2
    * it takes each char of the string (x.charCodeAt(p++)) and sub '0' from it;
    * it uses such result as index in t[];
    * the result in t[] is shifted left by s (0 first time);
    * if s!=0 add to r string a char: 165^w&0xFF and then
    ** w>>=8, s-=2
    ** else s=6
    r+=String.fromCharCode(165^w&255); == add a char to a string
    document.write(r); == fwrite to the output stream
    x.charCodeAt(p++) == x[p++] (where x is a char *)
    j=Math.ceil(l/b) == ((int)(l/b))+1
    Math.min(l,b) == min(l,b)
    I want to know God's thoughts ...the rest are details.
    (A. Einstein)
    ..."a shellcode is a command you do at the linux shell"...

  3. #3
    input >> base64decode >> XOR 165 >> html
    I promise that I have read the FAQ and tried to use the Search to answer my question.

Similar Threads

  1. Marx Crypto for CNC
    By shakewiggel in forum The Newbie Forum
    Replies: 2
    Last Post: March 29th, 2013, 09:54
  2. Crypto Scheme
    By galgal in forum RCE Cryptographics
    Replies: 6
    Last Post: January 24th, 2011, 11:02
  3. Crypto crackme: MD5 + DES
    By lordor in forum Mini Project Area
    Replies: 13
    Last Post: June 17th, 2004, 15:41
  4. Crypto tool
    By SheepShagger in forum Off Topic
    Replies: 11
    Last Post: May 29th, 2004, 12:17
  5. Crypto
    By JJ in forum Advanced Reversing and Programming
    Replies: 3
    Last Post: November 8th, 2000, 09:47


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts