from Wikipedia, the free encyclopedia
ROT13 replaces each letter with its equivalent 13 digits further in the alphabet. In the example shown, “HELLO” becomes “URYYB”.

ROT13 ( English rotate by 13 places , in German roughly “rotate around 13 places”) is a Caesar encryption (also called a shift cipher ), with which texts can be encrypted in a simple manner . This is done by replacing letters - with ROT13 in particular, each letter in the Latin alphabet is replaced by the letter in the alphabet that is 13 places before or after it.

The name ROT13 comes from Usenet in the early 1980s. ROT13 is not intended for secure encryption; in contrast, it is often mentioned as an example of weak, insecure encryption. ROT13 rather serves to make a text illegible, i.e. to obscure it, so that an action on the part of the reader is required in order to be able to read the original text. ROT13 can therefore be compared with solutions to puzzles in magazines that are printed upside down so that they cannot be accidentally read immediately.

ROT13 itself only uses the 26 letters of the Latin alphabet, but there are more advanced methods that also take numbers and special characters into account.

Name history and usage on the internet

The name ROT13 for the relatively trivial algorithm is believed to have originally appeared in the net.jokes newsgroup . There were attempts there to protect the readers from possibly offensive jokes, but a single category was rejected because no special space should be created for these rather rejected contributions. Thus, the simple ROT13 procedure was used to directly protect readers from this type of joke. The punch lines of the jokes were also encrypted so that they could not be accidentally read too early.

The process has since been used in various areas to protect the readership so that readers do not inadvertently read something they do not want to read; apart from the above-mentioned attempt to voluntarily protect minors, for example to protect against spoilers (e.g. description of the content of a film). Some e-mail programs, text editors and many newsreaders offer a ROT13 function.


ROT13 has the advantage over other shift ciphers (ROT- , i.e. compared to a shift by n  Stellen 13 characters of the alphabet) that the encryption and decryption are identical, i.e. there is a mathematical involution . If a text that has already been encrypted is encrypted again, it will be decrypted. That is why the joke of "double ROT13-encrypted" content (sometimes also called ROT-26) is widespread.

Due to the simplicity of the algorithm, encrypted texts can be decrypted relatively easily and quickly both manually - for example using a table - and using simple programs. With UNIX systems there is a command line program called tr(for transliterate ) that can be used for encryption and decryption:

 tr A-Za-z N-ZA-Mn-za-m

A method for automatic decryption has been built into numerous newsreaders. Since ROT13 only replaces letters of the alphabet with letters, this method did not cause any errors in newsreaders like other simple encryptions, in which the letters were also replaced by special characters that the software could not handle.

The following table can be used for encryption and decryption:

Encryption and decryption with ROT13
A. B. C. D. E. F. G H I. J K L. M. N O P Q R. S. T U V W. X Y Z a b c d e f G H i j k l m n O p q r s t u v w x y z
N O P Q R. S. T U V W. X Y Z A. B. C. D. E. F. G H I. J K L. M. n O p q r s t u v w x y z a b c d e f G H i j k l m

The letter above is replaced by the one below - both for encryption and for decryption.


The partial encryption of a joke is used as an example, so that the beginning of the joke and punch line remain separate:

Was macht ein Ostfriese mit einem Messer in der Hand auf dem Deich?
Re jvyy va Frr fgrpura!

Applying ROT13 to the second line reveals the punch line:

Er will in See stechen!

ROT13 as encryption technology

ROT13 is a special case of the historical encryption method which the Roman general Gaius Iulius Caesar used more than 2000 years ago and which is known as Caesar encryption . ROT13 is a fixed Caesar shift of 13 letters (corresponds to the key M) and is therefore in no way suitable for secure encryption. With the simplest cryptanalytical methods such as the examination of the frequency of letters or the analysis of frequent letter combinations, this method can be exposed and broken very quickly.

So the only purpose of ROT13 is that the recipient of a message must make the conscious decision to read the encrypted section. Since ROT13 is an obviously insecure encryption method, this name has become a catchphrase for insecure encryption.

Ironically, DES encryption (now obsolete) has a similarity to ROT13. It has four so-called weak keys , which completely cancel out its otherwise very high level of security. As with ROT13, the encryption of a ciphertext in turn generates the plaintext if the encryption and decryption are done with the same weak key.

ROT13 variations

Since in some cases it also makes sense that numbers and / or special characters such as @, - or? cannot be recognized at first glance, a process called ROT18 was also developed, which includes the digits from 0 to 9 for uppercase letters, but is identical to ROT13 for lowercase letters. However, ROT18 is not supported by any common e-mail program or newsreader. Alternatively, there is the ROT5 procedure, which treats the numbers separately and shifts them by five places. The even less widespread ROT47 algorithm in turn applies the method known from ROT13 to all ASCII characters that are not spaces or control characters , i.e. H. Characters between 33 ("!") And 126 ("~").

Encryption and decryption with ROT47
! "# $% & '() * +, -. / 0123456789:; <=>? @ ABCDEFGHIJKLMNOPQRSTUVWXYZ [\] ^ _` abcdefghijklmnopqrstuvwxyz {|} ~
PQRSTUVWXYZ [\] ^ _ `abcdefghijklmnopqrstuvwxyz {|} ~!" # $% & '() * +, -. / 0123456789:; <=>? @ ABCDEFGHIJKLMNO

Similar procedures


Web links

Individual evidence

  1. Early occurrences of "ROT13" in the Google USENET archive go back to October 8, 1982 in the net.jokes news group.
This version was added to the list of articles worth reading on May 17, 2006 .