LinuxCommandLibrary

rot13

Obfuscate text with simple character substitution

SYNOPSIS

rot13 [FILE...]

DESCRIPTION

ROT13 is a simple letter substitution cipher that replaces a letter with the 13th letter after it in the English alphabet. It is a special case of the Caesar cipher.

Applying ROT13 to an already ROT13-encoded text restores the original text, as 26 (the number of letters in the English alphabet) is a multiple of 13 (13+13=26), making ROT13 its own inverse. The rot13 command, when available, reads text from standard input or specified files, applies this substitution, and writes the resulting text to standard output. It's often used for obfuscating jokes, spoilers, or puzzle answers in online forums to prevent accidental viewing, rather than for secure encryption, as it's trivial to decode.

Many modern Linux distributions do not include a standalone rot13 command by default; its functionality is commonly achieved using other tools like tr or recode.

CAVEATS

The rot13 command is not a standard utility in many modern Linux distributions. Its functionality is commonly achieved using the tr command (e.g., echo "text" | tr 'A-Za-z' 'N-ZA-Mn-za-m') or through specialized text processing tools like recode.

<I>SELF-RECIPROCAL NATURE</I>

Applying the ROT13 transformation twice to any text restores the original text. This is because 13 + 13 = 26, the total number of letters in the English alphabet, meaning each letter cycles back to its original position after two transformations.

<I>NOT FOR SECURITY</I>

ROT13 is a trivial cipher and provides no cryptographic security. It is solely intended for casual obfuscation to prevent accidental viewing, not to protect sensitive information.

HISTORY

ROT13 originated in the mid-1980s on Usenet as a way to obscure potentially offensive or spoiler content, such as jokes, puzzle answers, or plot twists. Its simplicity made it easy to implement and decode without specialized software, and its self-reciprocal nature meant a single command could both encode and decode. While not a strong encryption method, it became a standard convention for light obfuscation in online communities. Implementations of the rot13 command on Linux are often simple scripts or part of larger utility packages, rather than a fundamental core utility, reflecting its historical usage context.

SEE ALSO

tr(1), recode(1)

Copied to clipboard