Introduction
John F. Byrne invented the Chaocipher in 1918 and challenged the world to break it for decades. He described the cipher in his 1953 autobiography "Silent Years" but refused to reveal the mechanism. The algorithm stayed secret for 90 years until 2010, when Byrne's daughter-in-law Patricia Byrne donated his papers to the National Cryptologic Museum. Cryptographer Moshe Rubin then disclosed and analyzed the full algorithm in a paper for Cryptologia. This tool implements the disclosed Chaocipher algorithm with Byrne's Exhibit 1 starting alphabets. You can encrypt and decrypt text, edit both cipher wheels, and watch how the running-key substitution produces output that resists simple frequency analysis. Everything runs in your browser.
What this tool does
- Encrypts plaintext using the two-wheel Chaocipher algorithm with Byrne's Exhibit 1 alphabets by default.
- Decrypts Chaociphertext back to the original plaintext using the same two alphabets.
- Lets you edit both the left (cipher) and right (plain) alphabets to experiment with custom keys.
- Resets to Byrne's original starting alphabets with a single click.
- Passes non-letter characters through unchanged so word structure is preserved for study.
- Processes all data locally in your browser with no server calls.
How this tool works
Enter plaintext and keep mode on Encode. The tool finds each plaintext letter in the right wheel, rotates that wheel so the letter sits at the zenith (position 0), and rotates the left wheel by the same amount. It then reads the cipher letter from the zenith of the left wheel. After each letter, both wheels permute: the left wheel extracts the letter at position 1 and reinserts it at the nadir (position 13), while the right wheel rotates counter-clockwise and performs a similar extraction at position 2. Decryption reverses the lookup, finding the cipher letter in the left wheel and reading the plaintext from the right wheel. You can edit both alphabets directly in the settings panel. Each must be a permutation of A-Z with 26 unique letters. The tool validates this and reports an error if you enter duplicates or missing letters.
How the Chaocipher works
Chaocipher is a running-key substitution cipher that uses two 26-letter alphabets as wheels. The left wheel produces ciphertext and the right wheel holds plaintext. The zenith is index 0 and the nadir is index 13. The key insight is that both wheels are permuted after every single letter, so the substitution mapping changes continuously. This makes Chaocipher a non-periodic polyalphabetic cipher with a very large effective state space.
For encryption, the algorithm locates the plaintext letter in the right wheel and rotates that wheel to bring the letter to the zenith. The left wheel rotates by the same offset so a corresponding cipher letter lands at its zenith. After reading the cipher letter, the left wheel permutes: the letter at position 1 is removed, the block from positions 2 through 13 shifts up by one, and the removed letter drops into the nadir at position 13. The right wheel then rotates one step counter-clockwise and performs a similar permutation starting at position 2.
Byrne claimed the cipher was unbreakable and offered rewards to anyone who could crack sample ciphertexts. He demonstrated it to the U.S. Navy and to William Friedman at the Signal Intelligence Service, but neither adopted it. The algorithm remained a mystery until 2010. Moshe Rubin's analysis, published in Cryptologia (volume 35, issue 4, 2011), showed that while Chaocipher produces a flat frequency distribution, it is not unbreakable. Modern cryptanalysis by Jeffrey Hill and others has identified structural weaknesses. The cipher's real value is historical: it is one of the most elaborate hand ciphers ever devised, and its 90-year secrecy is a remarkable story in itself. See the Wikipedia article on Chaocipher and Rubin's original disclosure for full details.
How to use this tool
- Enter the plaintext you want to encrypt in the input field.
- Leave the alphabets at their defaults (Byrne's Exhibit 1) or type your own 26-letter permutations.
- Select Encode mode. The ciphertext appears instantly in the output field.
- To decrypt, paste the ciphertext, switch to Decode, and keep the same alphabets.
- If you see an error, check that each alphabet has exactly 26 unique letters from A to Z.
- Click 'Reset to Byrne Exhibit 1' to restore the original starting alphabets at any time.
Real-world examples
Encrypting with Byrne's Exhibit 1 alphabets
Plaintext: `WELLDONEISBETTERTHANWELLSAID`. With the default left alphabet `HXUCZGAMQRJBOVTPYDLWKNFIES` and right alphabet `PTLNBQDEOYSFAVZKGJRIHWXUMC`, the tool produces ciphertext where repeated plaintext letters map to different cipher letters. The word WELL appears twice, but the two W's encrypt to different characters because the wheels permute after each letter.
Round-trip encryption and decryption
Encrypt any message, then copy the ciphertext, switch to Decode mode, and paste it back. The original plaintext is recovered exactly because the permutation sequence is deterministic. The same starting alphabets must be used for both directions. This is useful for verifying that your custom alphabets are valid.
Testing custom alphabets
Replace the left alphabet with a random permutation of A-Z, such as `QWERTYUIOPLKJHGFDSAZXCVBNM`, and keep the right alphabet as the standard ABCDEFGHIJKLMNOPQRSTUVWXYZ. Encrypt the same plaintext and compare the output. The ciphertext differs completely because the wheel permutations drive the entire substitution sequence.
Comparison with similar methods
| Method | Complexity | Typical use |
|---|---|---|
| Chaocipher | O(n) with per-letter wheel permutation | Hand cipher, 1918, disclosed 2010 |
| Vigenere | O(n) with repeating keyword | 16th century, broken by Kasiski examination |
| Caesar | O(n) single fixed shift | Roman military, trivial brute force |
| Enigma | O(n) rotor machine | WWII German military, broken at Bletchley Park |
Limitations or considerations
Chaocipher is not unbreakable despite Byrne's claims. Modern analysis by Jeffrey Hill and others has shown that the cipher leaks structural information through the wheel permutation mechanics. Hill's 2021 paper in Cryptologia demonstrated a known-plaintext attack that can recover the starting alphabets. The cipher also passes non-letter characters through unchanged, which leaks word boundaries and punctuation. For actual encryption, use AES-256 or ChaCha20. Chaocipher's value is historical and educational: it demonstrates how continuous alphabet permutation can flatten frequency distributions, a concept that connects to modern stream cipher design.
Frequently asked questions
Is the Chaocipher secure?
No. Byrne claimed it was unbreakable, but modern cryptanalysis has disproven this. Jeffrey Hill published a known-plaintext attack in Cryptologia (2021) that recovers the starting alphabets. The cipher is historically significant but should not be used for real encryption. Use AES-256 or ChaCha20 instead.
Why was the Chaocipher secret for 90 years?
John F. Byrne refused to publish the algorithm, hoping to sell it commercially. He demonstrated it to the U.S. Navy and to William Friedman, but neither adopted it. After Byrne's death, his daughter-in-law Patricia Byrne donated his papers to the National Cryptologic Museum in 2010, and Moshe Rubin disclosed the algorithm shortly after.
What are the zenith and nadir in Chaocipher?
The zenith is position 0 (the top of the wheel) and the nadir is position 13 (the bottom). The cipher reads the letter at the zenith after rotating the wheel. The permutation step extracts a letter near the zenith and reinserts it at the nadir, which is why both positions matter.
How does Chaocipher compare to the Vigenere cipher?
Both are polyalphabetic, but Vigenere uses a repeating keyword to select shifts, which creates a detectable period. Chaocipher permutes both alphabets after every letter, so there is no fixed period. This makes Chaocipher harder to attack with Kasiski examination, though it is still breakable with modern techniques. Try the Vigenere cipher tool to see the difference.
Conclusion
The Chaocipher tool implements the algorithm that John F. Byrne kept secret for 90 years. It is a valuable study in running-key substitution and continuous alphabet permutation. The default alphabets come from Byrne's own Exhibit 1, so you can reproduce his published ciphertexts. For related ciphers on this site, try the Caesar cipher, the Vigenere cipher, or the substitution cipher helper. To analyze the output, the letter frequency analyzer shows how Chaocipher flattens the distribution compared to a simple substitution.