5x5 Checkerboard Cipher
(Polybius Square)
Summary: A substitution cipher using a 5x5 grid
(Polybius square) with a keyword. I and J share one cell. Each letter is
encoded as its (row, column) coordinates.
Example:
- Keyword: CIPHER
- Build square by placing keyword first (removing duplicates), then
remaining alphabet:
Polybius Square:
1 2 3 4 5
1 C I P H E
2 R A B D F
3 G K L M N
4 O Q S T U
5 V W X Y Z
Encryption:
- Plaintext: HELLO
- Look up each letter:
- H = row 1, col 4 -> 14
- E = row 1, col 5 -> 15
- L = row 3, col 3 -> 33
- L = row 3, col 3 -> 33
- O = row 4, col 1 -> 41
- Ciphertext: 14 15 33 33 41 (or written as: 1415333341)
Decryption (given key CIPHER):
- Build the Polybius square with keyword CIPHER
- Split ciphertext into pairs: 14, 15, 33, 33, 41
- Look up coordinates:
- (1,4) = H
- (1,5) = E
- (3,3) = L
- (3,3) = L
- (4,1) = O
- Plaintext: HELLO
Additional Example:
- Keyword: MATRIX
- Build square:
1 2 3 4 5
1 M A T R I
2 X B C D E
3 F G H K L
4 N O P Q S
5 U V W Y Z
(Note: J is combined with I)
Encrypting "JACK":
- J = I/J at position (1,5) -> 15
- A = (1,2) -> 12
- C = (2,3) -> 23
- K = (3,4) -> 34
- Ciphertext: 15 12 23 34 (or 15122334)
Encrypting "RENDEZVOUS" (note: J becomes I):
- R = (1,4) -> 14
- E = (2,5) -> 25
- N = (4,1) -> 41
- D = (2,4) -> 24
- E = (2,5) -> 25
- Z = (5,5) -> 55
- V = (5,2) -> 52
- O = (4,2) -> 42
- U = (5,1) -> 51
- S = (4,5) -> 45
- Ciphertext: 14 25 41 24 25 55 52 42 51 45
Decrypting 32 21 25 (given keyword MATRIX):
- Build MATRIX square (shown above)
- Split into pairs: 32, 21, 25
- Look up:
- (3,2) = G
- (2,1) = X
- (2,5) = E
- Plaintext: GXE (possibly a word fragment)
Practical Note: In competitions, you might see the
ciphertext written as one long string: "1512233441" would be split as:
15-12-23-34-41 Always split into pairs from left to right.