Rot13

From LQWiki
Jump to navigation Jump to search

rot13 is a text scrambling method to prevent text from being accidentally read, such as the answer to a riddle or joke some might consider offensive.

It works by shifting each character forward 13 times, so that A becomes N, B becomes O, etc. The number 13 is chosen because shifting a character forward 13 times twice results in the original character. In other words scrambling and descrambling of rot13 uses the exact same algorithm. Only A-Z and a-z is scrambled, other characters and symbols are left untouched.

rot13 is also the name of a utility from BSD games for doing this:

$ echo "You are in a twisty maze of passages, all alike." | rot13
Lbh ner va n gjvfgl znmr bs cnffntrf, nyy nyvxr.
$ echo "Lbh ner va n gjvfgl znmr bs cnffntrf, nyy nyvxr." | rot13
You are in a twisty maze of passages, all alike.

A geek is expected to be able to recognize that text is in rot13 without it being explicitly stated.

rot13 is frequently used mockingly. Examples:

"Windows XP is now twice as secure: The old rot13 password encryption has been replaced by rot26!". rot26 would extrapolate to shifting each character by 26, ending up with the initial plain text.

Ol qrpelcgvat guvf zrffntr lbh ner va ivbyngvba bs gur QZPN! ("By decrypting this message you are in violation of the DMCA!"), pointing out how the "Digital Millennium Copyright Act" makes trivial decryption illegal.

Here's a long complex shell command to rot13 some text:

$ echo "hello there123" | tr 'a-zA-Z' 'n-za-mN-ZA-N'
uryyb gurer123

Or you can use this online converter for ROT13 (and ROT5/ROT18/ROT47).