← WHYARIUM CRACKED
PLATFORM09

Kasiski test

CIPHER
WHEN
FROM
STATUS

The Vigenere cipher beats counting because every letter of the key uses a different alphabet. But the key repeats. Find out how long it is, and a Vigenere message falls apart into a handful of Caesar shifts, each of which can be counted.

The machine

A repeat finder

A message about this very attack, enciphered with a key you choose. Repeated fragments of three or more letters are boxed in coloured pencil, and each pair is joined by an arc over a scale, labelled with the distance between the copies. The tally card counts how many distances each number divides. Change the key and watch the winning number follow its length.

Break it yourself

A report from Berlin

The full break, in two steps. First read the repeats and the factor table and choose a key length. Then the cipher splits into that many columns: every first letter of the key, every second, and so on. Each column is a plain Caesar shift. Slide each one until its letters look like English, and the board reads.

ARRIVED · CIPHER CRACKED

The story

Friedrich Wilhelm Kasiski was a Prussian infantry officer who retired as a major in 1852. In 1863 he published in Berlin a short book, Die Geheimschriften und die Dechiffrir-Kunst (Secret Writing and the Art of Deciphering). Its central idea was new in print: in a message enciphered with a repeating keyword, look for groups of letters that appear more than once, and measure the distances between them.

The reasoning is simple. A word such as THE turns up again and again in English. Whenever two copies of it happen to line up with the same part of the key, they are enciphered the same way, and the distance between them is a whole number of key lengths. So the key length divides most of the distances. A few repeats will be pure coincidence, but the true length shows through.

Babbage got there first

Charles Babbage, the mathematician who designed the Difference Engine, seems to have worked out the same attack around 1854, after a public argument about whether such ciphers could be broken. He never published it. One explanation sometimes offered is that British intelligence wanted it kept quiet during the Crimean War, but there is no firm evidence for that; Babbage left many projects unfinished. His notes were only studied in the 20th century, so the method carries Kasiski's name.

The book got little notice at the time. Kasiski turned to archaeology, and probably never knew how much he had changed codebreaking.

How it was broken

This platform is the breaking. Once the key length is known, the method is a frequency count per column, exactly the trick of al-Kindi. Later cryptologists added a second way to find the length without hunting for repeats: William Friedman's index of coincidence (1922), which measures how unevenly the letters are spread.

The lesson for cipher makers was that the key must not repeat. A key as long as the message, used once and thrown away, defeats both tests. That is the one-time pad, further down the line.