0
0
MMahendra Kumar
intermediatecryptographyencoding
Python Programming implementing ROT13 encoding
ROT13 ("rotate by 13 places", sometimes hyphenated ROT-13) is a simple letter substitution cypher that replaces a letter with the 13th letter after it in the alphabet. ROT13 is a special case of the Caesar cypher which was developed in ancient Rome.
from string import maketrans
rot13trans = maketrans('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
'NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm')
# Function to translate plain text
def rot13(text):
return text.translate(rot13trans)
def main():
txt = "ROT13 Algorithm"
print rot13(txt)
if __name__ == "__main__":
main()