Skip to content

Instantly share code, notes, and snippets.

@gtback
Created August 14, 2016 04:14
Show Gist options
  • Save gtback/e870499054c770701f899630dc6fb058 to your computer and use it in GitHub Desktop.
Save gtback/e870499054c770701f899630dc6fb058 to your computer and use it in GitHub Desktop.
Simple demonstration of shift ciphers
a = "QCRWBUWGBHTIB"
for key in range(26):
print(key, "".join([chr((ord(x) - ord("A") + key) % 26 + ord("A")) for x in a]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment