Skip to content

Instantly share code, notes, and snippets.

@JasonBristol
Last active October 18, 2020 00:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JasonBristol/19902c268e8d42b96b0db879a2ca3fe0 to your computer and use it in GitHub Desktop.
Save JasonBristol/19902c268e8d42b96b0db879a2ca3fe0 to your computer and use it in GitHub Desktop.
Tiny python 3.x script to solve atbash ciphers
s = input("Please enter the cipher text: ")
chars = "abcdefghijklmnopqrstuvwxyz"
exclude = " '\":;.,?!"
result = []
for c in s:
if c in exclude:
result.append(c)
else:
idx = 0 - (chars.index(c) + 1)
result.append(chars[idx])
print("".join(result))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment