Created
June 24, 2018 21:05
-
-
Save jadeallencook/89fe174b25f47c4bf143a69b34050aca to your computer and use it in GitHub Desktop.
Password decryption for Hack This Site's basic level 6.
This file contains 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 characters
function decrypt(password) { | |
var letters = 'abcdefghijklmnopqrstuvwxyz', | |
decrypt = ''; | |
for (var x = 0; x < password.length; x++) { | |
var value = password[x]; | |
if (isNaN(value)) decrypt += letters[letters.indexOf(value) - x]; | |
else decrypt += value - x; | |
} | |
return decrypt; | |
} | |
decrypt(['a', 5, 'h', 7, 7, 9, 'i', 'h']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
:3d7i:<kk