Last active
October 16, 2019 06:24
-
-
Save yjkellyjoo/38627d859679e35525c83de05d2fa2f1 to your computer and use it in GitHub Desktop.
simple python2 code which decrypts Caesor ciphered text
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/python | |
#Caesor Cipher Hacker | |
message = raw_input("message to crack: ") | |
LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' | |
for key in range(len(LETTERS)): | |
translated = '' | |
for symbol in message: | |
if symbol in LETTERS: | |
num = LETTERS.find(symbol) | |
num = num - key | |
if num < 0: | |
num = num + len(LETTERS) | |
translated = translated + LETTERS[num] | |
else: | |
translated = translated + symbol | |
print('Key #%s: %s' % (key, translated)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment