ROT13

    0

    0

    Mahendra 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()
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.