The system used by Eddie Chapman was an effective tool for a field agent in the 1940s, but it cannot withstand modern computing power. While this cipher once protected secrets from manual codebreakers, a laptop can now find the answer in a fraction of a second.

Why the code is vulnerable

A small key space

Security in cryptography often depends on the key space. Modern standards like AES-256 have keyspaces so large they are practically impossible to guess, whereas Chapman’s code is far more limited.

When an operative uses a standard dictionary word for their secret:

  • There are approximately 200,000 common English words to choose from.
  • There are only 31 possible multipliers based on the day of the month.
  • The resulting 6.2 million combinations are few enough for a Python script to test in a few seconds.

The limitations of digits

Most Vigenère-style codes use the entire alphabet for shifts, but this Gronsfeld variation only uses the digits 0 to 9. This restriction creates a statistical opening: an encrypted “A” will only ever appear as a letter from “A” to “J”, never as a “W” or “X”. Frequency analysis spots these restricted ranges quickly to eliminate large sets of candidate keys.

Repeating sequences

Because the shift key is relatively short and repeats throughout the message, it leaves recurring patterns. Techniques like the Kasiski examination allow a computer to determine the length of the key. Once the length is fixed, the problem simplifies into individual single-digit substitution checks, making the keyword and date much easier to isolate.

Automated cracking with Python

A computer breaks the cipher automatically by pairing a dictionary attack with a fitness function:

  1. Loading a word list: The script begins with a file containing thousands of English words.
  2. Generating combinations: It derives a shift key for every word and date combination.
  3. Applying a fitness function: The program scores each candidate decryption by checking for n-grams, such as common letter pairings like “TH” or “ER” that appear in natural English.
  4. Ranking results: The decryptions with the highest scores for natural language patterns are presented as the most likely candidates.

Example code

Below is a complete Python script to automatically crack the cipher by ranking the top five most likely results.

How can the “Multiplication code” be strengthened?

Any improvement to a field cipher must balance mathematical security against ease of manual calculation. An operative working under pressure cannot rely on complex mental arithmetic. Several practical modifications make the system significantly harder for automated tools to break.

Adopting non-dictionary passkeys

The automated attack relies on cycling through standard wordlists. Replacing a single dictionary word with a multi-word passphrase, deliberate phonetic misspellings, or an agreed string eliminates this shortcut. An attacker cannot use a 200,000-word list and is forced to brute-force millions of raw character combinations.

Expanding the multiplier

Restricting the multiplier to the day of the month (1 to 31) gives the attacker almost no variance to test. Replacing the date with a pre-arranged two- or three-digit operational code, or deriving the multiplier from an agreed offset table, expands the key space immediately without increasing manual workload.

Removing the single-digit shift ceiling

Restricting shifts to 0–9 prevents letters from shifting past the tenth position, leaving clear statistical fingerprints. Operatives can overcome this by reading the generated keystream in pairs and calculating the remainder after dividing by 26 (modulo 26). A pair like 73 produces a shift of 21 ($73 \pmod{26} = 21$), allowing encipherment across the entire alphabet.

Suppressing periodicity

Because the keystream repeats periodically, Kasiski analysis can reveal the length of the secret word. Inserting non-cipher dummy letters (nulls) at pre-agreed intervals or running a secondary transposition step breaks these regular intervals, denying the cracking script the periodic patterns it needs to establish key length.