Created
May 20, 2013 11:07
-
-
Save RichardHyde/5611641 to your computer and use it in GitHub Desktop.
ROT13 Encryption in Python
This file contains hidden or 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 | |
from string import maketrans | |
from sys import stdin, stdout | |
alpha = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' | |
rot13 = 'nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM' | |
r13table = maketrans(alpha, rot13) | |
orig = stdin.read() | |
stdout.write(orig.translate(r13table)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment