Cipher methodsGrid
Tap code
The tap code is a historical derivative of the Polybius square, designed to be transmitted by tapping on a wall. It’s famous for its use among American prisoners of war in Vietnam during the 1960s-70s: to communicate cell-to-cell through the walls of the Hanoi prison.
How does Tap code work?
The grid
Like Polybius, a 5×5 grid holds the alphabet. The classic tap code merges K with C (rather than I/J as in Polybius):
1 2 3 4 5
1 A B C/K D E
2 F G H I J
3 L M N O P
4 Q R S T U
5 V W X Y Z Transmission
Each letter is coded by its (row, column) pair. The sender taps:
- First the row (1 to 5 knocks).
- A short pause.
- Then the column (1 to 5 knocks).
- A long pause before the next letter.
Example: H (row 2, column 3) transmits as ·· ··· (2 taps, pause, 3 taps).
What does Tap code-encrypted text look like?
HELLO transmits as:
H = 2,3 → ·· ···
E = 1,5 → · ·····
L = 3,1 → ··· ·
L = 3,1 → ··· ·
O = 3,4 → ··· ···· A short 5-letter message totals about 30 to 50 taps. POWs could convey a sentence in a few minutes with a little practice.
What is the history of Tap code?
- Ancient Greece — Polybius describes the method with torches (one for the row, one for the column).
- Russian nihilists use knocking in prison in the 19th century.
- Vietnam, 1965 — Captain Carlyle Harris teaches the tap code to American Hanoi POWs. Allowed rebuilding the chain of command, sharing names and testimony, and preserving morale. A central narrative in many POW memoirs.
What are the variants of Tap code?
- Polybius — written version, 5×5 grid but I/J merged.
- Nihilist — Polybius + additive key.
- 6×6 cipher — enlarged version including digits 0-9.
What are the weaknesses of Tap code?
Tap code is a code, not a cipher: no key, the table is public. Its security rests entirely on the adversary’s ignorance of the method — which wasn’t the case in Vietnam, but the value of inter-prisoner communication outweighed the risk of interception.
Against an informed attacker:
- Instant frequency analysis (it’s keyless Polybius).
- No resistance whatsoever against automated tools.
Its value is practical and symbolic, not cryptographic.
In CipherChronicle
Tap code offers a sonic mode: puzzles can be played by ear, each letter represented by taps. It’s also a bridge to the history of operational cryptography — an extremely simple code that saved lives.
Grid
- 1
Stream of tapped numbers
Number pairs — first = row, second = column. Polybius signature.
- 2
Tap-code grid (K omitted)
The 5×5 grid holds the alphabet (K merged with C) — tap codes resolve in it.
- 3
Reading: 23 = H (row 2 col 3), 15 = E, 31 = L, 34 = O
Each pair directly names a grid cell.
- 4
Pair-by-pair substitution
Replace each pair by the letter in its cell.
- 5
Message revealed
The word surfaces once all pairs are decoded — here HELLO.
Frequently asked questions
- How does the tap code work?
- Each letter is signalled by two bursts of taps: the row, then the column in a 5×5 grid. For example one tap, pause, two taps = row 1, column 2 = the letter B. The grid merges C and K to fit 25 cells.
- How is the tap code related to the Polybius square?
- The tap code IS a Polybius square sent by knocking: instead of writing the (row, column) coordinates you tap them. The grid and logic are identical — only the channel, sound, changes.
- Why is the tap code famous?
- American POWs in North Vietnam during the 1960s used it to communicate cell to cell by tapping on walls without being detected. It is easy to memorise and to transmit discreetly.