function crackPassword(password) { var crypttext = password.toUpperCase(); var plaintext = ''; var xlate = "dsfd;kfoA,.iyewrkldJKDHSUBsgvca69834ncxv9873254k;fg87"; var seed, i, val = 0; if(crypttext.length & 1) return; seed = (crypttext.charCodeAt(0) - 0x30) * 10 + crypttext.charCodeAt(1) - 0x30; if (seed > 15 || isNaN(crypttext.charAt(0)) || isNaN(crypttext.charAt(1))) return; for (i = 2 ; i <= crypttext.length; i++) { if(i !=2 && !(i & 1)) { plaintext += String.fromCharCode(val ^ xlate.charCodeAt(seed++)); seed %= xlate.length; val = 0; } val *= 16; if(!isNaN(crypttext.charAt(i))) { val += crypttext.charCodeAt(i) - 0x30; continue; } if(crypttext.charCodeAt(i) >= 0x41 && crypttext.charCodeAt(i) <= 0x46) { val += crypttext.charCodeAt(i) - 0x41 + 0x0a; continue; } if(crypttext.length != i) return; } console.log(plaintext); return plaintext; }