Created
September 19, 2016 04:18
-
-
Save kingds/76957924be4eadb647125202dd9788f0 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
ENCRYPTED_MESSAGE = "" | |
DECRYPTION_KEY_TOP = "A|B|C|D|E|F|G|H|I|J|K|L|M" | |
DECRYPTION_KEY_BOTTOM = "N|O|P|Q|R|S|T|U|V|W|X|Y|Z" | |
decrypted_message = "" | |
for letter in ENCRYPTED_MESSAGE: | |
find_1 = DECRYPTION_KEY_BOTTOM.find(letter.upper()) | |
find_2 = DECRYPTION_KEY_TOP.find(letter.upper()) | |
if find_1 > -1: | |
decrypted_letter = DECRYPTION_KEY_TOP[find_1] | |
elif find_2 > -1: | |
decrypted_letter = DECRYPTION_KEY_BOTTOM[find_2] | |
else: | |
decrypted_letter = letter | |
decrypted_letter = decrypted_letter.lower() if letter.islower() else decrypted_letter | |
decrypted_message += decrypted_letter | |
print decrypted_message |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment