Substitution Cipher
A Substitution Cipher is one of the most fundamental encryption methods in cryptography. It works by replacing (substituting) units of plaintext (single letters, pairs of letters, etc.) with ciphertext units according to a fixed system or key.
1. The Core Principle
Substitution ciphers keep the order (position) of the characters the same, but change the identity (value) of the characters.
- Plaintext Units:
A,B,C... - Ciphertext Units:
K,X,Z...
The Key defines the substitution rule, mapping each original character to a replacement character.
2. Main Types of Substitution Ciphers
① Monoalphabetic Substitution
In the entire plaintext, a given letter is always substituted by the same letter. (Uses a single key mapping).
- Caesar Cipher: The simplest form of monoalphabetic substitution, where every letter is shifted by a constant distance (the key).
- Atbash Cipher: A specific type where A maps to Z, B maps to Y, etc.
② Polyalphabetic Substitution
The substitution alphabet is changed frequently during the encryption process, meaning a given letter can be replaced by different letters at different positions in the message.
- Vigenère Cipher: Uses several Caesar ciphers in sequence, cycling through multiple keys. This is much harder to break than any monoalphabetic cipher.
3. Difference from Caesar Cipher
| Feature | Caesar Cipher | General Monoalphabetic Cipher |
|---|---|---|
| Rule | Constant Shift distance (A $\rightarrow$ D, B $\rightarrow$ E) | Arbitrarily defined 1:1 mapping (A $\rightarrow$ K, B $\rightarrow$ Z) |
| Security | Extremely weak (Only 25 keys) | Stronger than Caesar (26! possible keys) |
| Example | All letters shift by +3 | A maps to K, B maps to Z (Random mapping) |