Introduction
The Great Cipher of Louis XIV protected French state secrets for two centuries. Created by Antoine Rossignol in the 1630s and refined through the 1690s, it used hundreds of numbers that mapped not to letters but to syllables, whole words, and proper names. It also included trap numbers (nulls) that meant nothing and existed only to mislead anyone who tried to break it. The cipher went unbroken from the reign of Louis XIV until 1890, when Etienne Bazeries, a French military cryptanalyst, spent three years cracking it. He published his methods in "Les chiffres secrets devoiles" (1901). This tool simulates the Great Cipher with a reconstructed codebook of syllables, words, names, and configurable trap frequency. Type text to encrypt, or paste cipher numbers to decrypt.
What this tool does
- Encrypts plaintext by mapping words, proper names, and syllables to numbers using a reconstructed codebook with three tiers: syllables (1-100), common French words (101-300), and proper names and places (301-500)
- Decrypts cipher numbers back to text by looking up each number in the codebook, skipping trap (null) numbers that fall outside the valid range
- Inserts trap numbers (decoys) at a configurable frequency from 0% to 50%, simulating the nulls that made the original Great Cipher so difficult to break
- Shows a step-by-step encryption or decryption log that explains each mapping (e.g. 'Word roi -> 123' or 'Syllable ba -> 2')
- Includes a toggle to display the full codebook so you can see which numbers map to which syllables, words, and names
- Processes all data locally in your browser. No plaintext or ciphertext is transmitted anywhere
How this tool works
The tool loads a three-tier codebook. Syllables occupy numbers 1 through 100, covering common French syllables like "ba" (2), "tion" (87), and "ment" (88). Common words occupy 101 through 300, including articles, prepositions, military terms, and everyday vocabulary. Proper names and places occupy 301 through 500, covering French cities, regions, nobility, and historical figures like Louis (331) and Rossignol (338).
In encrypt mode, the tool processes input text word by word. It first checks whether the entire word exists in the word codebook. If not, it checks the name codebook. If neither matches, it breaks the word into syllables using a greedy longest-match algorithm, trying chunks of up to 4 characters against the syllable codebook. Trap numbers (501 and above) are inserted randomly based on the trap frequency slider. The output is a space-separated list of numbers.
In decrypt mode, the tool splits the input on whitespace and commas, parses each token as a number, and looks it up in the codebook. Numbers above 500 are treated as traps and skipped. The tool displays each lookup step, showing whether a number resolved to a name, a word, or a syllable. The "Load Bazeries Example" button loads a sample ciphertext that demonstrates the decryption process.
How the Great Cipher works (Rossignol codebook)
Antoine Rossignol (1600-1682) was a French cryptanalist who gained prominence by breaking Huguenot ciphers during the siege of La Rochelle in 1628. Louis XIII appointed him to the court, and under Louis XIV he became the king's chief cryptographer. Rossignol and his son Bonaventure developed the Great Cipher over decades, refining it into a system with approximately 600 code numbers. David Kahn describes the cipher in detail in "The Codebreakers" (1967, revised 1996), calling it "the most famous cipher of the seventeenth century" and noting that it remained unbroken for two centuries.
The Great Cipher was not a simple substitution. Its numbers mapped to syllables (not individual letters), whole words, and proper names. A single number could represent the word "roi" (king) or the syllable "tion." The codebook was a physical document that both sender and recipient needed. Trap numbers, also called nulls or decoys, were scattered throughout the ciphertext to frustrate frequency analysis. An analyst counting how often each number appeared would find that the most frequent numbers were often traps, not real code entries.
The cipher fell to Etienne Bazeries (1846-1931), a French Army cryptanalyst, in 1890. Military historians had found encrypted letters in the French archives and asked Bazeries to attempt decryption. He worked on them for three years. His breakthrough, described in "Les chiffres secrets devoiles" (1901, available in digitized form through the Bibliotheque nationale de France), was realizing that the numbers represented syllables rather than letters. Once he tested that hypothesis, the codebook structure became apparent. One of the decrypted messages revealed the military plans of Louis XIV regarding the Piedmont region.
For related cipher systems that use codebooks or external references, see the Book Cipher tool, the Ottendorf Cipher, and the Null Cipher Detector.
How to use this tool
- Choose a mode: Encrypt to convert plaintext to cipher numbers, or Decrypt to convert numbers back to text.
- Set the trap frequency using the slider (0% to 50%). Higher values insert more decoy numbers, making the ciphertext harder to analyze but longer.
- For encryption, type or paste your text. The tool matches whole words first, then names, then breaks remaining words into syllables. The output is a list of numbers.
- For decryption, paste cipher numbers separated by spaces or commas. The tool looks up each number and skips traps. The decoded text appears in the output field.
- Expand the steps panel to see each mapping in detail. This shows whether each number was decoded as a name, word, or syllable.
- Toggle the codebook visibility to browse the syllable (1-100), word (101-300), and name (301-500) mappings.
- Click 'Load Bazeries Example' to try decrypting a sample ciphertext based on the historical system.
Real-world examples
Encrypting a military message
Input: "le roi ordonne l armee de marcher". The tool matches "le" to word 101, "roi" to word 123, "ordonne" to syllables "or" (not in codebook, skipped) plus "don" (skipped) plus "ne" (39), and "armee" to word 127. The output is a sequence of numbers with occasional trap numbers inserted. The steps panel shows each mapping so you can trace how the plaintext became numbers.
Decrypting the Bazeries example
Click "Load Bazeries Example" to load the ciphertext "322 125 152 548 322 134 301 127 101 341 322 152 301 123 129". The tool parses each number: 322 maps to the name "Brest," 125 to "monsieur," 152 to "ils," 548 is a trap (skipped), 301 to "Paris," and so on. The decoded text assembles these fragments into a readable message. The steps panel shows which numbers are traps and which are real code entries.
Demonstrating the trap number effect
Encrypt the same short phrase twice with different trap frequencies. At 0% traps, the output is a compact list of numbers with a one-to-one correspondence to the input. At 40% traps, the output is roughly 40% longer and contains numbers above 500 that an analyst would need to identify and skip. This demonstrates why the original Great Cipher's nulls delayed decryption for 200 years: frequency analysis on the raw numbers produces misleading patterns.
Breaking a word into syllables
Input the word "fontaine" which is not in the word codebook. The tool breaks it into syllables: "fon" (not found, "fo" = 21), "tai" (not found, "ta" = 58), "ne" (39). The output includes the numbers 21, 58, 39. On decryption, these map back to "fo" + "ta" + "ne" which reconstructs "fotane" rather than "fontaine." This shows a limitation of syllable-based encoding: words that do not break cleanly into codebook syllables may not round-trip perfectly.
Comparison with similar methods
| Method | Complexity | Typical use |
|---|---|---|
| Great Cipher (Rossignol) | ~600 code numbers, syllables and words | French state correspondence, 17th century |
| Book cipher | Page-line-word or page-line-letter indices | Espionage, one-time reference to a shared book |
| Ottendorf cipher | Book-page-line-word indices, 4-part codes | Spy networks, American Revolution |
| Nomenclator | Substitution alphabet plus small codebook | Diplomatic correspondence, 15th-19th century |
| Null cipher | Plaintext hidden in otherwise innocent text | Steganographic communication, no codebook needed |
Limitations or considerations
This tool uses a reconstructed codebook, not the original Rossignol codebook. The real Great Cipher had approximately 600 entries and was never published in full. Bazeries reconstructed portions of it from the archived letters he decrypted. This tool's codebook is a simplified educational model with 500 entries (100 syllables, 200 words, 200 names) chosen to demonstrate the three-tier structure.
The syllable matching algorithm uses greedy longest-match, which means it tries the longest possible syllable first. This can produce incorrect splits for words that are not in the word codebook. The encryption is not guaranteed to round-trip: a word broken into syllables during encryption may not reassemble correctly during decryption if the syllable boundaries are ambiguous.
Trap numbers in this tool are generated randomly above 500. In the original Great Cipher, trap numbers were interspersed at specific positions known only to the sender and recipient, making them harder to distinguish from real code entries. This tool's approach is simpler and less secure. For a cipher system that uses an external text as a codebook, see the Book Cipher tool or the Ottendorf Cipher.
Frequently asked questions
How long did the Great Cipher remain unbroken?
Approximately 200 years. Rossignol developed it in the mid-17th century, and Bazeries broke it in 1890. The cipher protected French diplomatic and military correspondence during the reign of Louis XIV. The reason it resisted analysis for so long is that its numbers mapped to syllables and words, not individual letters, so standard frequency analysis produced no meaningful patterns.
What was Bazeries's breakthrough?
Bazeries realized that the numbers represented syllables, not letters. He tested this hypothesis after conventional letter-frequency analysis failed. Once he assumed syllable-level mapping, he could look for repeated number patterns that corresponded to common French syllables. He described this process in 'Les chiffres secrets devoiles' (1901), which is available through the Bibliotheque nationale de France.
What are trap numbers and why were they used?
Trap numbers (also called nulls or decoys) are numbers in the ciphertext that do not correspond to any codebook entry. They exist to mislead cryptanalysts. If someone counts the frequency of each number, the most common numbers may be traps rather than real codes. The recipient knows which numbers are traps (from the codebook or a separate key), but an attacker does not.
Is this tool's codebook the real Great Cipher codebook?
No. The original Rossignol codebook was never published in full and is lost. This tool uses a reconstructed codebook with 500 entries that demonstrates the three-tier structure (syllables, words, names) described by Bazeries and Khan. It is an educational simulation, not a faithful reproduction of the historical cipher.
How does the Great Cipher differ from a book cipher?
A book cipher uses an external text (a shared book) as its codebook, encoding words or letters as page-line-word indices. The Great Cipher uses a dedicated codebook that both parties carry. A book cipher's security depends on the book remaining secret; the Great Cipher's security depends on the codebook remaining secret. See the Book Cipher tool for comparison.
Conclusion
The Great Cipher was one of the strongest ciphers of its era, protecting French state secrets for two centuries through its syllable-based codebook and trap numbers. This tool demonstrates the three-tier structure that made it resistant to frequency analysis. The step-by-step panel shows how words, names, and syllables map to numbers, and the trap frequency slider shows how nulls inflate and obscure the ciphertext. For other codebook-based ciphers, try the Book Cipher tool, the Ottendorf Cipher, or the Null Cipher Detector.