Two Square Cipher
Encode and decode using the Two Square cipher. A digraphic cipher using two 5x5 squares.
Two Squares (Horizontal)
Left (Keyword 1)
E
X
A
M
P
L
B
C
D
F
G
H
I
K
N
O
Q
R
S
T
U
V
W
Y
Z
Right (Keyword 2)
K
E
Y
W
O
R
D
A
B
C
F
G
H
I
L
M
N
P
Q
S
T
U
V
X
Z
J is treated as I
How Two Square Works
- Split plaintext into pairs (digraphs)
- Find first letter in left square
- Find second letter in right square
- Swap columns to get cipher letters
Variants
- Horizontal: Squares side by side (this tool)
- Vertical: Squares stacked - swap rows instead
What is the Two Square Cipher?
The Two Square cipher (also known as Double Playfair) is a manual symmetric encryption technique that encrypts pairs of letters (digraphs) using two 5×5 matrices arranged either horizontally or vertically.
How It Works
Setup
Create two 5×5 squares, each with a different keyword:
- Fill each square with the keyword (removing duplicates)
- Add remaining alphabet letters (I and J share a position)
- Arrange squares either horizontally or vertically
Encryption (Horizontal)
- Take a pair of plaintext letters
- Find first letter in left square (note row and column)
- Find second letter in right square (note row and column)
- First cipher letter: left square at (row1, col2)
- Second cipher letter: right square at (row2, col1)
Two Square in Geocaching
This cipher appears in puzzles because:
- Dual keywords: Both can be puzzle clues
- Visual element: The two squares make interesting visuals
- Moderate difficulty: Not too easy, not too hard
- Simpler than Four Square: But still secure
Comparison to Other Ciphers
vs Playfair
- Two Square: Uses two separate keyed squares
- Playfair: Uses single square with complex rules
- Two Square has no special rules for same-row/column pairs
vs Four Square
- Four Square: Uses four squares (two keyed, two standard)
- Two Square: Uses only two keyed squares
- Four Square is generally more secure
Breaking the Cipher
Without the keywords:
- Digraph analysis: Analyze pair frequencies
- Known plaintext: Helps determine the squares
- Dictionary attack: Try common keyword combinations
- Hill climbing: Optimize both squares