Created
April 5, 2013 09:07
-
-
Save joakibj/5317825 to your computer and use it in GitHub Desktop.
Basic ROT13 cipher solved in Python using a simple lookup table. Ukas nøtt #1
This file contains 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
import sys, string | |
def rot13(x): | |
transtable = string.maketrans('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz','NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm') | |
return x.translate(transtable) | |
def main(): | |
cipher = 'Qh re xnafxwr zhyvtraf ra ivaare' | |
print rot13(cipher) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment