Created
February 10, 2016 15:45
-
-
Save EspressoCake/831560c962611468536f 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/python | |
ctext = "INSERT YOUR STRING TO DECODE HERE" | |
alphabet = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ") | |
plaintext = "" | |
shift = 1 | |
while shift <= 26: | |
for c in ctext: | |
if c in alphabet: | |
plaintext += alphabet[(alphabet.index(c)+shift)%(len(alphabet))] | |
print("Shift used: " + str(shift)) | |
print("Ciphertext: " + ctext) | |
print("Plaintext: " + plaintext) | |
shift = shift + 1 | |
plaintext = "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment