Frequency analysis breaks a cipher by counting how often each letter or symbol appears in the ciphertext and comparing the counts with the normal letter frequencies of the language. It is a ciphertext-only attack: the attacker needs nothing but the encrypted text.
The idea
In every language some letters are much more common than others. In English, E makes up about 12.7 % of all letters, followed by T (about 9.1 %) and A (about 8.2 %). In German, E is even more dominant at about 17.4 %, followed by N and I. A cipher that always turns the same plain letter into the same cipher letter, such as the Caesar cipher or any simple substitution, keeps these frequencies. Only the names of the letters change.
So the most common cipher letter probably stands for E. In a Caesar cipher this one guess already gives the shift. In a general substitution, where the alphabet is mixed in one of 26! ≈ 4·1026 ways, the frequencies give the first letters, and short words and common letter pairs (TH, HE, THE, AND) fill in the rest.
History
The oldest known description comes from the Arab scholar Al-Kindi in the 9th century, in his manuscript on deciphering cryptographic messages. In 1586, Thomas Phelippes used frequency analysis to read the coded letters of Mary, Queen of Scots, which became evidence against her.
Limits
- Text length. The method needs enough text. A few hundred letters are usually plenty; a short message like “HI BOB” has too few letters for a reliable count.
- Polyalphabetic ciphers. The Vigenère cipher spreads each letter over several cipher letters. Frequency analysis only works again once the key length is known and the text is split into groups.
- Modern ciphers. AES and other modern block ciphers produce output that looks random: every byte value is about equally common, so there is nothing to count.
Try it
Compare the bars of a secret text with normal English or German, and solve a substitution together, in the projector mode. Teachers find a printable worksheet with answer key in the classroom area.