Last active
July 20, 2021 17:38
-
-
Save jnovack/72b40da1005a97c5677533d59c73dbac to your computer and use it in GitHub Desktop.
Revisions
-
jnovack revised this gist
Oct 23, 2017 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,4 @@ function crackPassword(password) { var crypttext = password.toUpperCase(); var plaintext = ''; var xlate = "dsfd;kfoA,.iyewrkldJKDHSUBsgvca69834ncxv9873254k;fg87"; @@ -27,7 +26,6 @@ function crackPassword(password) continue; } if(crypttext.charCodeAt(i) >= 0x41 && crypttext.charCodeAt(i) <= 0x46) { val += crypttext.charCodeAt(i) - 0x41 + 0x0a; continue; -
jnovack renamed this gist
Oct 23, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
jnovack created this gist
Jun 23, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ 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; }