Encrypted answers... How do I go about solving this?

Discussion in 'OT Technology' started by Canucker, Nov 5, 2003.

  1. Canucker

    Canucker Banned

    Joined:
    Sep 18, 2002
    Messages:
    34,010
    Likes Received:
    0
    Here is some code to encrypt some answers.


    function TranslateAnswer(s, answerIndex)
    {
    var value;
    var newString;
    var code;
    var i;

    value = (answerIndex % 31) + 1;
    newString = "";
    for (i=0; i < s.length; i += 2) {
    code = parseInt(s.substring(i, i + 2), 16);
    newString += String.fromCharCode(code ^ value);
    }

    return(newString);
    }



    var ansMap = new Array(18);
    ansMap[0] = '42';
    ansMap[1] = '43';
    ansMap[2] = '41';
    ansMap[3] = '40';
    ansMap[4] = '41';
    ansMap[5] = '47';
    ansMap[6] = '44';
    ansMap[7] = '4a';
    ansMap[8] = '4c';
    ansMap[9] = '49';
    ansMap[10] = '48';
    ansMap[11] = '4d';
    ansMap[12] = '4e';
    ansMap[13] = '4a';
    ansMap[14] = '4e';
    ansMap[15] = '52';
    ansMap[16] = '54';
    ansMap[17] = '51';


    Now 1 is C, and 3 is C.

    I cant really seem to figure out whats going on. Looks like its ascii code mod 31, then 2 added to it, then converted into hex. But not really sure.
     
  2. "encrypted" or "endoded" :dunno:
     

Share This Page