Home › Ciphers › Homophonic Cipher
Homophonic Cipher
Frequency analysis kills simple substitution because E always wears the same disguise. The homophonic cipher's answer, refined by Renaissance diplomats and perfected in the Rossignols' Great Cipher for Louis XIV, is to give common letters many disguises: E might own a dozen different symbols while Z owns one, dealt in proportion to how often each letter actually occurs — so every symbol in the ciphertext ends up roughly equally frequent, and the frequency chart goes flat. This tool builds that table from your keyword over the hundred two-digit symbols 00–99, shows the complete allocation under the controls, and decodes with the same table.
The homophonic cipher is a substitution in which each letter owns a block of symbols sized by its frequency — E gets 12 of the 100 two-digit symbols, T 9, A 8, down to a single symbol each for the six rarest letters — dealt in keyword order. Encoding cycles through a letter's symbols as it recurs, so no symbol repeats often enough to betray its letter; decoding is an unambiguous lookup, because every symbol belongs to exactly one letter.
The frequency-proportional design of the historical Great Cipher and the modern textbooks. Not the ACA's own "homophonic" (Harris, 1945), an equal-share system giving every letter exactly four numbers — its ciphertexts do not open under this table.
Encode or decode — many symbols per letter
Everything runs in your browser — nothing is uploaded.
Proportions first, then the keyword deals the blocks
The allocation is arithmetic, not taste. Each letter's share of the 100 symbols is its standard English frequency (E 12.7%, T 9.1%, A 8.2% … Z 0.07%) scaled to 100 and rounded by the largest-remainder method, with every letter guaranteed at least one symbol — so E receives 12 symbols, T 9, A 8, and the six rarest letters — B, J, K, Q, X, Z — receive 1 each. The blocks of consecutive numbers are then dealt to the letters in keyed-alphabet order — keyword letters first, then the rest of the alphabet — which is what the keyword is for: change it and the whole table reshuffles while the proportions survive.
Encoding replaces each letter with one of its symbols, cycling through them in order, occurrence by occurrence. (The classical systems chose at random; cycling is this tool's stated deterministic equivalent — same flat statistics, and any message reproduces exactly.) Decoding is a pure lookup, and it can never be ambiguous: the 100 symbols are partitioned among the 26 letters, each symbol owned by exactly one letter — a property this site's test suite proves for the table it generates.
From Renaissance diplomacy to the Great Cipher
Homophony is as old as the frequency attack it answers: once fifteenth-century analysts learned to count letters, Italian diplomatic clerks began giving the commonest letters several symbols each. The art peaked in seventeenth-century France with the Rossignols, father and son, cryptographers to Louis XIII and Louis XIV, whose Great Cipher went further still — symbols for syllables, and traps for the unwary — and resisted solution for some two centuries until Étienne Bazeries read it in the 1890s. The system on this page is the letter-level core of that tradition, in the form modern textbooks standardised: proportional symbol blocks over a two-digit alphabet.
The allocation under SECRET
| First blocks dealt | S: 00–05 (6) · E: 06–17 (12) · C: 18–20 (3) · R: 21–26 (6) · T: 27–35 (9) · A: 36–43 (8) |
|---|---|
| Single-symbol letters | B, J, K, Q, X, Z own one symbol each in every table — the proportions demand it |
| The whole table | Printed live under the controls: every letter's block, for the keyword in force |
Count E's appearances across a long message and each of its 12 symbols shows up about as often as Z's single symbol does: flat.
MEET ME AT NOON under SECRET
Example 1 — the published example
With the keyword SECRET, the keyed order deals blocks starting S, E, C, R, T, A… — so S takes symbols 00–05 (6 symbols), E takes the next block of 12, 06–17, and M, dealt its 2 symbols later in the order, owns 72 and 73. Encode letter by letter: M takes its first symbol, E its first (06), the second E its next (07) — the two E's in MEET already wear different numbers, which is the entire point — and T draws from its 9-symbol block. Because the symbols partition 00–99 exactly, decoding the string returns MEETMEATNOON with no choices to make.
Example 2 — twelve E's, twelve symbols
The flattest possible demonstration: a run of nothing but the commonest letter produces twelve different symbols, each used once — a frequency counter sees a perfectly even dozen where simple substitution would show one symbol twelve times. Only the thirteenth E wraps back to 06.
The leak moves deeper
A homophonic cipher that dealt symbols evenly — four per letter, say — would defeat itself: E's four symbols would still appear three times as often as T's four and twelve times as often as Z's one, and the frequency chart would merely be a blurred photograph of the same leak. Dealing blocks in proportion to frequency is what equalises the ciphertext. The leak moves deeper instead: symbol pairs still carry the language's digraph habits (TH still pairs E's symbols with H's at language rates), and a solver with a few hundred symbols can hill-climb the table from those. Against casual frequency analysis, though — the attack that fells plain substitution in minutes — homophony is a wall, and that step kept diplomatic correspondence safe for two centuries.
- Security status: strong against first-order statistics; falls to digraph analysis and hill-climbing at a few hundred symbols.
- What gives it away: a suspiciously flat symbol chart over digit pairs — flatness itself is a signature.
Two systems share this name
| Relative | How it differs | Solve it with |
|---|---|---|
| ACA homophonic (Harris, 1945) | Four plain alphabets in rows, columns numbered from keyword-set starting points: every letter owns exactly four numbers — an equal-share system, quick by hand, not frequency-proportional | A different construction; its ciphertexts do not open under this page's table |
| Grandpré | Homophony by word square: a letter's symbols are its cell addresses, counts set by the square rather than by frequency | The Grandpré page |
| Simple substitution | One symbol per letter — the system this one exists to repair | The Substitution page and the Cryptogram Solver |
| Zodiac 408 | A many-symbol homophonic alphabet of drawn glyphs rather than digits — the same defence in a famous criminal case | The Zodiac Ciphers story |
Diplomats, kings and one famous killer
For two centuries homophony was the working defence of European diplomacy, and its most famous artefact is the Rossignols' Great Cipher, unsolved until the 1890s. Its most infamous is the Zodiac killer's 408 cipher (1969), a homophonic glyph alphabet that nonetheless fell within days to Donald and Bettye Harden — because 340 characters is a lot of digraph evidence. Both stories teach the same lesson this page's table embodies: homophony buys time in proportion to the text's brevity, and the proportions, not the symbols, are the security.
Deal the blocks
Practice 1 — encode under SECRET
A takes its first symbol, T its first two in order, C its first — check each against the allocation printed under the tool.
Reveal the answer
36 27 28 37 18 67.
Practice 2 — decode under SECRET
Each pair has exactly one owner: 21 is in R's block (21–26), 06 opens E's.
Reveal the answer
RETREAT.
Frequently asked questions
Why does a homophonic cipher use more symbols than letters?
Because the extra symbols are the defence. In plain substitution, E always wears the same disguise, so its 12.7% frequency stands out in any ciphertext. Give E a dozen symbols, T nine, Z one — dealt in proportion to each letter's real frequency — and every individual symbol ends up appearing about equally often, so the frequency chart an attacker relies on goes flat. The letters did not change; their statistical shadow did.
Can decoding ever be ambiguous?
Never, by construction. The hundred symbols are partitioned — each of 00–99 belongs to exactly one letter — so every symbol pair in a ciphertext names one letter outright. The test suite verifies the partition for the generated table (all 100 symbols, no overlaps, no gaps).
Why does E encrypt to a different number each time?
Because E owns 12 symbols and the encoder cycles through them in order as E's occur. Classical operators randomised the choice; cycling gives the same statistical flatness with a tool that reproduces its work exactly — and decoding doesn't care which of E's symbols was used.
Why does the keyword change every symbol?
The keyword fixes the order in which blocks of numbers are dealt to the letters. The block sizes are the frequencies and never change; the keyword decides which letter gets which block — a completely different table from the same proportions.
How would anyone break this?
With volume: digraph statistics survive (TH still pairs E's symbols with H's at language rates), and a few hundred symbols let a hill-climber reconstruct the table. Against casual frequency analysis, though — the attack that fells plain substitution in minutes — homophony is a wall.