Caesar Cipher Basics
The Caesar Cipher is one of the oldest and simplest forms of substitution cipher. It involves replacing each letter in the plaintext (original message) with a letter a fixed number of positions down or up the alphabet.
1. The Principle: Substitution
- Mechanism: Each letter in the message is substituted for another letter a specific distance away in the alphabet.
- Key: The 'key' is the number of positions each letter is shifted.
2. Encryption Process
Plaintext: ATTACK
Key: 3 (Shift 3 positions to the right)
- A shifts 3 places: B, C, D $\rightarrow$ D
- T shifts 3 places: U, V, W $\rightarrow$ W
- T shifts 3 places: W $\rightarrow$ W
- A shifts 3 places: D $\rightarrow$ D
- C shifts 3 places: D, E, F $\rightarrow$ F
-
K shifts 3 places: L, M, N $\rightarrow$ N
-
Ciphertext:
DWWDFN
Wrap-around (Circular) Handling: If the shift goes past Z, it wraps back to A. (This uses the mathematical operation Modulo 26, $\pmod{26}$).
3. Decryption
Decryption is the reverse process. If the encryption key was +3, the decryption key is -3 (or +23, since $26-3=23$).
- Ciphertext:
DWWDFN -
Decryption Key:
-3 -
D shifts back 3 places $\rightarrow$ A
- W shifts back 3 places $\rightarrow$ T
4. Security Weakness
The Caesar Cipher is extremely weak by modern cryptographic standards.
- Limited Keyspace: Since there are only 26 letters, there are only 25 possible keys (1 through 25).
- Brute-Force Attack: An attacker can try all 25 possible keys using a Brute Force Attack in a matter of seconds to easily decrypt the message.