ROT13 (short for rotate by 13 places) is a simple cipher where each letter of the alphabet is replaced by the letter 13 places ahead of it. It is a specific case of the Caesar cipher, where the shift value is fixed at 13.
How ROT13 Works
ROT13 works on both uppercase and lowercase letters. The alphabet is split into two halves, and letters are shifted by 13 positions.
For example:
A → N, B → O,C → P, etc.
N → A, O → B,P → C, etc.
When you apply ROT13 to a text, it is encrypted. If you apply ROT13 to the same text again, it decrypts back to the original text. This is because 13 + 13 = 26 (which is the length of the alphabet), so applying ROT13 twice results in the original text.
Encryption Example:
Original Text:Hello
Applying ROT13:
H → U
E → R
L → Y
L → Y
O → B
Resulting Encrypted Text: Uryyb
ROT13 (short for rotate by 13 places) is a simple cipher where each letter of the alphabet is replaced by the letter 13 places ahead of it. It is a specific case of the Caesar cipher, where the shift value is fixed at 13.
How ROT13 Decryption Works
ROT13 works on both uppercase and lowercase letters. The alphabet is split into two halves, and letters are shifted by 13 positions.
For example:
A → N, B → O, C → P, etc.
N → A, O → B, P → C, etc.
When you apply ROT13 to an encrypted text, it is decrypted. If you apply ROT13 to the same text again, it encrypts back to the original text. This is because 13 + 13 = 26 (which is the length of the alphabet), so applying ROT13 twice results in the original text.
Decryption Example:
Encrypted Text: Uryyb
Applying ROT13:
U → H
R → E
Y → L
Y → L
B → O
Resulting Decrypted Text: Hello