🎯

Playfair Cipher

Digraph substitution using a 5x5 matrix

substitution
Definition

The Playfair cipher encrypts pairs of letters (digraphs) using a 5×5 matrix generated from a keyword. It uses three rules based on the positions of the two letters: same row, same column, or forming a rectangle. J is typically merged with I.

History

Invented by Charles Wheatstone in 1854 but named after Lord Playfair who promoted its use. First cipher to encrypt pairs of letters. Used by British forces in the Boer War and World War I. Considered unbreakable for decades.

Real-World Usage

Was used for tactical military communications where moderate security was needed quickly. The digraph approach made it significantly harder to break than simple substitution ciphers. The concept influenced later cipher development.

Weaknesses

Vulnerable to frequency analysis of digraphs. Common English digraphs like 'TH', 'HE', 'AN' can be identified. Known plaintext attacks are effective. The 5×5 matrix limits the key space. Still preserves some patterns in the plaintext.

Playfair Matrix Visualization

Watch how letter pairs are encrypted using the 5×5 matrix

Playfair Matrix (Key: MONARCHY)

M
O
N
A
R
C
H
Y
B
D
E
F
G
I
K
L
P
Q
S
T
U
V
W
X
Z
HE
LX
LO
WO
RL
DX
Interactive Playground