111k views
5 votes
ROT13 is a cyclic shift cipher that substitutes each English letter with one that is 13 away in the alphabet. It is used today not for security, but as a simple obfuscation device, because the same algorithm is used for both encryption and decryption. People wishing to encrypt or decrypt a message, M, just cut-and-paste M to a ROT13 converter and click a button "APPLY" to do the encryption or decryption. Given an example of another ROTi transformation that could be used for both encryption and decryption in a similar way. (When I was interviewed at Google HQ in 2015, I was asked to implement ROT13 in one round of the interview.) solution online

1 Answer

5 votes

ROT13 (rotate by 13 places) is a simple letter substitution cipher that replaces a letter with the 13th letter after it in the alphabet.

Step-by-step explanation:

  • The ROT13 cipher is a substitution cipher with a specific key where the letters of the alphabet are offset 13 places.
  • Example : All 'A's are replaced with 'N's, all 'B's are replaced with 'O's, and so on. It can also be thought of as a Caesar cipher with a shift of 13.
  • The ROT13 cipher offers almost no security, and can be broken very easily.
  • If an adversary doesn't know a piece of ciphertext has been enciphered with the ROT13 cipher can still break it by assuming it is a substitution cipher and determining the key using hill-climbing.

The ROT13 cipher is essentially a substitution cipher with a fixed key. The substitution key is

ABCDEFGHIJKLMNOPQRSTUVWXYZ

NOPQRSTUVWXYZABCDEFGHIJKLM

  • Rotate the string to be encrypted by 13 positions (modulo 26) in the alphabet of 26 characters.
User Salieu
by
3.8k points