Skip to content

Instantly share code, notes, and snippets.

@jadeallencook
Created June 24, 2018 21:05
Show Gist options
  • Save jadeallencook/89fe174b25f47c4bf143a69b34050aca to your computer and use it in GitHub Desktop.
Save jadeallencook/89fe174b25f47c4bf143a69b34050aca to your computer and use it in GitHub Desktop.
Password decryption for Hack This Site's basic level 6.
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']);
@Gamalalegende
Copy link

:3d7i:<kk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment