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.