🔐 The Playfair Cipher
The Playfair Cipher encrypts pairs of letters (digraphs) using a 5×5
grid. It was used by the British in World War I and II.
Creating the Key Grid
- Choose a keyword (e.g., "MONARCHY")
- Remove duplicate letters from the keyword
- Fill a 5×5 grid with the keyword, then remaining letters
- I and J share the same position (25 letters fit in 25 cells)
Keyword: MONARCHY
| M |
O |
N |
A |
R |
| C |
H |
Y |
B |
D |
| E |
F |
G |
I/J |
K |
| L |
P |
Q |
S |
T |
| U |
V |
W |
X |
Z |
Encryption Rules
-
Split plaintext into pairs: HE LL O → HE LX LO
(insert X between double letters)
- If odd length: Add X at the end
-
For each pair, find both letters in the grid:
Same Row
Replace each letter with the one to its right (wrap around)
AR → RM
Same Column
Replace each letter with the one below (wrap around)
MU → CM
Rectangle
Replace each letter with the one in its row but the other letter's
column
HE → The H row and E column → BP → The E row and H column → FH Result:
HE → BF
Example Encryption
Plaintext: HELLO
1. Split: HE LL O 2. Handle doubles: HE LX LO 3. Encrypt each pair
using the grid rules
How to Crack It
-
Identify digraph frequencies: Common English
digraphs are TH, HE, IN, ER, AN
-
Look for reversed pairs: If AB encrypts to XY, then
BA encrypts to YX
-
Spot double-letter markers: X often indicates split
double letters
-
Try common words: THE becomes TH EX → look for this
pattern
Tips
- The ciphertext length is always even
- X appearing frequently might indicate padding
- I and J are interchangeable when decrypting
- No letter can be encrypted as itself in a pair