ου γαρ εστιν κρυπτον ο ου φανερον γενησεται ουδε αποκρυφον ο ου γνωσθησεται και εις φανερον ελθη
Wersja PL ENG Version

ROT13

  • Description
  • Algorithm
  • Implementation
ROT13 is one of simple substitution ciphers. It is a special case of the Caesar cipher. It appeared in use in the early eighties of the twentieth century.
Simple substitution cipher
The cipher is often used for hiding content of transmitted information and avoidance automatic algorithms checking words used in messages. It is used for hiding e-mail addresses from spambots or prohibited contents in posts on internet forums.

The ROT13 algorithm is about shifting characters by 13 positions in the Latin alphabet (which contains 26 letters in total).

For example, the letter A is encrypted as N, and the letter B is encrypted as O.

ROT13 is simple in use because applied twice to a letter produces exactly the same letter:
    ROT13(ROT13(x)) = x

Therefore, the ROT13 decryption algorithm is about to use the same encryption function for ciphertext characters.

Security of the ROT13 cipher

The cipher doesn't have a secret key and to read a message encrypted using ROT13, one must only know that this particular cipher has been used.

What is interesting (and sad), there are known cases of using the cipher in respectable and popular applications (Netscape Communicator, ebooks of New Paradigm Research Group) in order to protect the stored data.

ROT13 can be implemented using a Linux command tr:
    alias rot13="tr a-zA-Z n-za-mN-ZA-M"