Skip to content

Instantly share code, notes, and snippets.

@EspressoCake
Created February 10, 2016 15:45
Show Gist options
  • Save EspressoCake/831560c962611468536f to your computer and use it in GitHub Desktop.
Save EspressoCake/831560c962611468536f to your computer and use it in GitHub Desktop.
#!/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