Skip to content
Book of Riddles

Journey through time

Islamic world · Baghdad, 9th century

Risāla fī istikhrāj al-muʿammā

Al-Kindi and the frequency of letters

Count, rank, compare: breaking a cipher without the key

Scene In Baghdad in the 9th century the scholar al-Kindi wrote a treatise on deciphering encrypted messages. Its core: you count the letters. Every language has common and rare ones, and replacing them with other signs does not change that.

A long cryptogram: every letter of the message was replaced, always by the same other letter. Like al-Kindi you count how often each cipher letter occurs and compare that with how often letters occur in our language. Tap a cipher letter and choose what it should stand for. “Rank by rank” makes al-Kindi’s suggestion for you; you decide the rest from the text.

Seals of this station

  1. Solved solve the puzzle
  2. Best effort decipher the message without having a letter revealed
  3. Masterpiece decipher without revealing and correct at most ten of your own assignments

The method in his words

The method in al-Kindi’s words (in English translation, as Ycart quotes it): you acquire a fairly long plaintext in the language and count how often each letter occurs. We have not read the Arabic manuscript itself.

Source

Bernard Ycart, „Letter counting: a stem cell for Cryptology, Quantitative Linguistics, and Statistics“ (arXiv 1211.6847), quotes al-Kindi after Mrayati, Meer Alam, at-Tayyan: Al-Kindi’s Treatise on Cryptanalysis, Damascus 2002, p. 122 and 124

Among the expedients we use in cryptanalysing a cryptogram if the language is already known, is to acquire a fairly long plaintext in that language, and count the number of each of its letters.

Rank by rank

Then the most frequent cipher symbol is taken to be the letter that was “first” in the plaintext, the second most frequent the “second”, and so on. That is exactly what the “Rank by rank” button does.

Source

Bernard Ycart, „Letter counting: a stem cell for Cryptology, Quantitative Linguistics, and Statistics“ (arXiv 1211.6847), quotes al-Kindi after Mrayati, Meer Alam, at-Tayyan: Al-Kindi’s Treatise on Cryptanalysis, Damascus 2002, p. 122 and 124

Then we go back to the message we want to cryptanalyse, and classify the different symbols, searching for the most frequent symbol of the cryptogram and we regard it as being the same letter we have marked

The image of gold

Why some letters are more frequent, al-Kindi explains with an image: gold is the material of many shapes of finery. So the vowels are the material of every text and occur more often than the non-vowels.

Source

Bernard Ycart, „Letter counting: a stem cell for Cryptology, Quantitative Linguistics, and Statistics“ (arXiv 1211.6847), quotes al-Kindi after Mrayati, Meer Alam, at-Tayyan: Al-Kindi’s Treatise on Cryptanalysis, Damascus 2002, p. 122 and 124

the vowels which are the material of any kind of text are more than the non-vowels in any language

Seven pages

According to Ycart his counts rest on seven pages with 3667 letters. So Ycart reports it; we have not recounted.

Source

Bernard Ycart, „Letter counting: a stem cell for Cryptology, Quantitative Linguistics, and Statistics“ (arXiv 1211.6847), quotes al-Kindi after Mrayati, Meer Alam, at-Tayyan: Al-Kindi’s Treatise on Cryptanalysis, Damascus 2002, p. 122 and 124

Al Kindī had based his counts on 7 pages totaling 3667 letters

How long must the text be?

How long must the text be? A later Arab author, ʿAfīf ibn ʿAdlān (1187 to 1268), gives a rule of thumb of at least about ninety letters. Our cryptogram, at around 300, is much longer.

Source

Bernard Ycart, „Letter counting: a stem cell for Cryptology, Quantitative Linguistics, and Statistics“ (arXiv 1211.6847), quotes al-Kindi after Mrayati, Meer Alam, at-Tayyan: Al-Kindi’s Treatise on Cryptanalysis, Damascus 2002, p. 122 and 124

The length of the text to be cryptanalysed should be at least in the neighborhood of ninety letters as a rule of thumb

A conjecture

A conjecture about the origin: perhaps close study of the Qur’an first showed that Arabic has a characteristic letter frequency. As Wikipedia writes, this is a suggestion.

Source

Wikipedia: Frequency analysis

It has been suggested that a close textual study of the Qur'an first brought to light that Arabic has a characteristic letter frequency.

Since al-Kindi

According to Ycart, since al-Kindi all treatises on cryptology contain a section on simple substitution with one alphabet. Our inference: Caesar’s shift is also such a simple substitution and so open to attack by this method.

Source

Bernard Ycart, „Letter counting: a stem cell for Cryptology, Quantitative Linguistics, and Statistics“ (arXiv 1211.6847), quotes al-Kindi after Mrayati, Meer Alam, at-Tayyan: Al-Kindi’s Treatise on Cryptanalysis, Damascus 2002, p. 122 and 124

Since Al Kindī, all Cryptology treatises have included a section on monoalphabetic simple substitution cyphers

English frequencies

The frequency table for English comes from the table on Wikipedia (after Lewand). It gives how often a letter occurs on average in written language.

Source

Wikipedia: Letter frequency (table after Lewand)

Letter frequency is the number of times letters of the alphabet appear on average in written language.

German frequencies

The one for German comes from the count after Beutelspacher: umlauts are counted as ae, oe, ue and the ß as a character of its own. We leave the ß out.

Source

Wikipedia: Buchstabenhäufigkeit (count after Beutelspacher)

Die Umlaute ä, ö und ü wurden wie ae, oe und ue gezählt, ß als eigenständiges Zeichen.

Our cryptogram

Our cryptogram: it is written in English, not Arabic, and invented by us. The “Rank by rank” suggestion usually gets only the most frequent letters right; you find the rest by recognising words. That is the work al-Kindi’s method leaves open.