Caesar Cipher
The Caesar cipher is one of the oldest and simplest encryption techniques. Named after Julius Caesar, who used it for military correspondence around 58 BC, it shifts each letter in the plaintext by a fixed number of positions down the alphabet.
Background
Julius Caesar used a shift of 3 to communicate with his generals. While trivial to break by modern standards, it was effective in an era when few people could read at all, let alone analyze encrypted text. Suetonius documented Caesar's use of this cipher in his work "Life of Julius Caesar."
Encryption Principle
Each letter in the message is replaced by a letter a fixed number of positions down the alphabet. With a shift of 3:
- A → D, B → E, C → F, ... X → A, Y → B, Z → C
- Non-alphabetic characters (spaces, numbers, punctuation) are typically left unchanged.
Decryption Method
Shift each letter back by the same number of positions. With shift 3, D → A, E → B, etc. Alternatively, shift forward by (26 - shift) positions.
Security
The Caesar cipher has only 25 possible keys (shifts 1-25), making it vulnerable to brute force attack — simply try all shifts. It is also vulnerable to frequency analysis, as each letter always maps to the same ciphertext letter.
Interactive Demo
Try It Yourself
Real-World Applications
While the Caesar cipher is never used for serious security today, it appears in:
- ROT13: A special case (shift 13) used in online forums to hide spoilers.
- Children's codes: Secret decoder rings and puzzle games.
- Education: The classic first lesson in any cryptography course.