Skip to content

Instantly share code, notes, and snippets.

@markodayan
Created November 4, 2019 13:15
Show Gist options
  • Save markodayan/6d0245da44d78488fb9407aaab35334b to your computer and use it in GitHub Desktop.
Save markodayan/6d0245da44d78488fb9407aaab35334b to your computer and use it in GitHub Desktop.
Rot13 Encoder
#Python Rot13 Encoder
password = input("Enter string to encrypt with Rot13:\n")
# Using the str.maketrans to make a translation key
# Could apply the rot13 encoding scheme
rot13 = str.maketrans(
"ABCDEFGHIJKLMabcdefghijklmNOPQRSTUVWXYZnopqrstuvwxyz",
"NOPQRSTUVWXYZnopqrstuvwxyzABCDEFGHIJKLMabcdefghijklm")
print(str.translate(password, rot13))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment