Chapter 21 – Hacking the Vigenère Cipher 325
The subkeys that produce decryptions with the closest frequency match to English are the ones
that are most likely to be the real subkey. In the above decryptions (for the 1st of the four
ciphertext strings), 'A', 'I', 'N', 'W', and 'X' are the subkeys that have the highest
frequency matches with English. Note that these scores are low in general because there isn’t
enough ciphertext to give us a large sample of text, but it still ends up working well.
We need to repeat this 26 - decryptions-and-frequency-match for the other three strings to
find out their most likely subkeys. After this frequency analysis, we find:
The most likely subkeys for the first string are: A, I, N, W, and X
The most likely subkeys for the second string are: I and Z
The most likely subkey for the third string is: C
The most likely subkeys for the fourth string are: K, N, R, V, and Y
Brute-Force through the Possible Keys
Next we will brute-force the key by trying out every combination of subkey. Because there are 5
possible subkeys for the first subkey, 2 for the second subkey, 1 for the third subkey, and 5 for the
fourth subkey, the number of combinations is 5 × 2 × 1 × 5 or 5 0 possible keys to brute-force
through. This is much better than the 26 × 26 × 26 × 26 or 456,976 possible keys we would have
to brute-force through if we had not narrowed the list of possible subkeys. This difference
becomes even greater if the Vigenère key had been longer!
AICK IICK NICK WICK XICK
AICN IICN NICN WICN XICN
AICR IICR NICR WICR XICR
AICV IICV NICV WICV XICV
AICY IICY NICY WICY XICY
AZCK IZCK NZCK WZCK XZCK
AZCN IZCN NZCN WZCN XZCN
AZCR IZCR NZCR WZCR XZCR
AZCV IZCV NZCV WZCV XZCV
AZCY IZCY NZCY WZCY XZCY
Now it’s just a matter of going through all 50 of these decryption keys for the full ciphertext and
seeing which one produces a readable English plaintext. If you do this, you’ll find that the key to
the “Ppqca xqvekg...” ciphertext is “WICK”.