“If your business depends on you, you don't own a business--you have a job. And it's the worst job in the world because you're working for a lunatic!”
by Michael E. Gerber The E-Myth (Revisited)

Snippet: ROT-13

ROT-13 is a very simple variation of the Caesar Cipher in which each character is rotated thirteen positions along the Roman alphabet. The purpose of this simplistic cipher is typically to “obstruct” material from view; not necessarily to conceal it. The significance of the thirteen (over Caesar’s three) is to allow the cipher to be used as a “toggle” instead of with separate encoding and decoding routines. Since the Roman alphabet has twenty-six letters, rotating a letter thirteen positions will give you its exact inverse; rotating again will give you the original.

Click here to download the snippet: ROT-13

Sample Input:
I’m ROT-13, baby!

Sample Output:
V’z EBG-13, onol!

One Response to “Snippet: ROT-13”

Leave a Reply

Get a free book about code review best practices.