While machines like Enigma get the headlines, I’m intrigued by the “manual” codes used by field agents.

I’ve just been reading Agent Zigzag by Ben Macintyre where he describes the cipher used by Eddie Chapman. Essentially this is a variation of a Gronsfeld cipher (a type of Vigenère cipher that uses numbers instead of letters for the shift). What made Chapman’s “multiplication code” so brilliant was its key-generation step. Instead of carrying around a highly incriminating codebook, a spy only needed to memorise a single keyword. They would then use the current date and some basic arithmetic to generate a new, seemingly random sequence of numbers for every transmission.

The algorithm

  1. Keyword processing: Choose a secret keyword. Number its letters based on their alphabetical order. If a letter appears more than once, number them from left to right.
  2. The multiplication step: Combine those assigned numbers into one large integer, then multiply that integer by the current day of the month (1 through 31). This product becomes your numerical shift key.
  3. Padding: Write out your secret message and pad the end with the letter “X” so the total length is a multiple of 5 (standard for radio transmissions).
  4. Encryption: Write your numerical shift key repeatedly beneath the message. Shift each letter of your message forward in the alphabet by the corresponding digit (e.g., a shift of 1 turns A into B; a shift of 2 turns A into C).

Worked example

Let’s imagine you are sending a message to someone.

  • Keyword: RADIO
  • Date of transmission: The 15th of the month
  • Message: SEND HELP

Step 1: Process the keyword

Sort the letters of RADIO alphabetically (A=1, D=2, I=3, O=4, R=5) and assign the numbers back to the original word:

  • R = 5
  • A = 1
  • D = 2
  • I = 3
  • O = 4

Your base sequence is 51234.

Step 2: The multiplication

Multiply your base sequence by the date (15): 51234 × 15 = 768510

Your numerical shift key is 768510.

Step 3: Pad the message

Your message is 8 letters long (SENDHELP). Add two “X"s to make it a neat 10 letters (a multiple of 5).

Plaintext: SENDHELPXX

Step 4: Encrypt the message

Write the shift key beneath the plaintext, repeating it as needed, and shift the letters forward through the alphabet. If you pass “Z”, just wrap around back to “A”.

PlaintextSENDHELPXX
Shift Key7685107685
CiphertextZKVIIESVFC

For example: S shifted forward by 7 is Z. X shifted forward by 8 wraps around the alphabet to land on F.

Finally, you group the ciphertext into blocks of five for transmission: ZKVII ESVFC

This method was highly effective because even if the message was intercepted, the exact shift changed every single day based on the date multiplier. It was incredibly difficult to crack without knowing the keyword.