Caesar Cipher with Shift 3 (Original)
Explore the original Caesar cipher as used by Julius Caesar with a shift of 3. Learn the historical context, how shift-3 encoding works, and how to implement it step by step.
Detailed Explanation
The Original Caesar Cipher (Shift 3)
The Caesar cipher with a shift of 3 is the original form attributed to Julius Caesar himself. According to the Roman historian Suetonius, Caesar used this cipher to communicate with his generals during military campaigns.
The Shift-3 Substitution Table
Plain: 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
Cipher: 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
Historical Example
Caesar reportedly used this cipher in his correspondence:
Plaintext: ATTACK AT DAWN
Ciphertext: DWWDFN DW GDZQ
Step-by-Step Encoding
To encode "HELLO" with shift 3:
- H (position 7) → 7 + 3 = 10 → K
- E (position 4) → 4 + 3 = 7 → H
- L (position 11) → 11 + 3 = 14 → O
- L (position 11) → 11 + 3 = 14 → O
- O (position 14) → 14 + 3 = 17 → R
Result: "HELLO" → "KHOOR"
Decoding with Shift 3
To decode, shift each letter back by 3 (or equivalently, forward by 23):
- K (position 10) → 10 - 3 = 7 → H
- H (position 7) → 7 - 3 = 4 → E
- O (position 14) → 14 - 3 = 11 → L
- O (position 14) → 14 - 3 = 11 → L
- R (position 17) → 17 - 3 = 14 → O
Result: "KHOOR" → "HELLO"
Why Shift 3?
There is no cryptographic reason for choosing 3 specifically. It was simply Caesar's personal preference. Any shift from 1 to 25 produces a valid cipher. In Caesar's time, most of his enemies were illiterate, making even this simple cipher effective.
Use Case
The shift-3 Caesar cipher is the classic example used in cryptography education, history of mathematics courses, and programming tutorials. It serves as the canonical introduction to substitution ciphers and demonstrates the fundamental concept of a secret key.