Ibn Adlan

ʻAfīf al-Dīn ʻAlī ibn ʻAdlān al-Mawsilī (عفيف لدين علي بن عدلان الموصلي; 1187–1268 CE), born in Mosul, was an Arab cryptologist, linguist and poet who is known for his early contributions to cryptanalysis, to which he dedicated at least two books. He was also involved in literature and poetry, and taught on the Arabic language at the Al-Salihiyya Mosque of Cairo.

He was in contact with various rulers of his time, and in this capacity he gained practical experience in cryptanalysis or the science of breaking encoded messages. He dedicated On Cryptanalysis, his only surviving work on the topic, to Al-Ashraf Musa ((r. 1229 – 1237)), the Ayyubid Emir of Damascus. He wrote three other books, including Al-Mu'lam (The Told [Book]), also on cryptanalysis, but it is now lost. On Cryptanalysis is a sort of guidebook for cryptanalysts, containing twenty sets of techniques he calls "rules". The methods contains more practical details than Al-Kindi's 8th century Treatise on Deciphering Cryptographic Messages—the earliest surviving work on cryptoanalysis—but lack its predecessor's theoretical background on cryptography. Among Ibn 'Adlan's original contributions were methods for breaking no-space monoalphabetic cryptograms, a type of ciphers which were developed to evade analysis techniques described earlier by Al-Kindi. In this treatise Ibn 'Adlan also includes a real-life example of a cryptogram that he deciphered and his full process in breaking it, which, in the words of the cryptographer James Massey, provides "the authentic experience of a highly skilled cryptanalyst."

Biography
'Afif al-Din 'Ali ibn 'Adlan was born in Mosul in 583 AH (c. 1187 CE). He was of an Arab origin and received education in Baghdad, including lessons on syntax by the grammarian Abu al-Baqa al-Ukbari. Subsequently, he lived in Damascus for a time, before became a teacher of the Arabic language at the Al-Salihiyya Mosque of Cairo until his death in 666 AH (c. 1268 CE). In addition to writing treatises on linguistics and cryptanalysis, he was considered an authority in literature and wrote poems himself. He was in contact with various rulers, and in this capacity he gained practical experience in cryptanalysis, which he calls hall al-mutarjam. One of these rulers was Al-Ashraf Musa ((r. 1229 – 1237)), the Ayyubid Emir of Damascus, for whom he dedicated his treatise On Cryptanalysis. He was also known by his multiple nisbas (descriptive epithets): al-Mawsili (of Mosul), al-Nahwi (the Grammarian) and al-Mutarjim (the Cryptoanalyst).

Works
Early Arabic bibliographies attributed three titles to him, including one on cryptanalysis, Fi hall al-mutarjam (On Cryptanalysis), also known as Al-mu'allaf lil-malik al-'Ashraf (The [Book] Written for King al-Ashraf). In addition, a reference in On Cryptanalysis points to another book, Al-Mu'lam (The Told [Book]), which is now lost, in which he describes algorithms for analysing cryptograms. His other two works were titled Al-Intihab li-kashf al-'abyat al-mushkilat al-i'rab and  'Uqlat al-mujtaz fi hall al-aljaz .

Background
The practice and study of encrypting messages into ciphers, called cryptography, had existed since ancient times, practised by the Egyptian, Chinese, Indian, Mesopotamian, Greek, and Roman civilisations. In contrast, cryptanalysis, the science of breaking ciphers—in other words, recovering the plain message from an encrypted one—was founded in the early Arab-Muslim civilisation. The earliest surviving work found on the topic of cryptanalysis is the Risalah fi Istikhraj al-Mu'amma ("Treatise on Deciphering Cryptographic Messages") written by Al-Kindi (c. 801–873), an Arab scholar who also wrote on other topics including philosophy, astronomy, and medicine. Reports are also found on other works before al-Kindi, among the earliest of which is al-Mu'amma ("The Book of Cryptographic Messages"), written by al-Khalil ibn Ahmad in the 8th century, but they are now lost. Al-Kindi's book presents cryptanalysis techniques such as frequency analysis, which is to also be covered by Ibn 'Adlan's works.

On Cryptanalysis
On Cryptanalysis was written in a style of a handbook or a manual, describing Ibn 'Adlan's twenty "rules" or techniques of cryptanalysis, grouped into nine themes. Unlike the cryptological treatises of Al-Kindi before him and later Ibn al-Durayhim (c. 1312–1361), which provide theoretical background on cryptography including systematic explanations on types of ciphers, Ibn 'Adlan's On Cryptanalysis focuses on the practical matters and specific methods in breaking encrypted texts of his time, often in a more detailed manner than Al-Kindi. The work's introduction section does include a brief description of the simple substitution encipherment method, and encourages its readers to read other sources to learn about other methods.

One of Ibn 'Adlan's most original contribution in this treatise is the cryptanalysis of no-space monoalphabetic cryptograms (al-mudmaj)—encrypted texts that do not include a space to denote separation between words. This type of cryptograms was not mentioned by al-Kindi: it was developed by subsequent cryptographers (code makers) in order to counteract the cryptographic attacks described in his works, part of a kind of arms race between the code makers and code breakers. In the west, this type of cryptanalysis was only attested in the sixteenth century in the works of the Italian Giambattista della Porta. According to ibn 'Adlan, the cryptographers of his time "allege that their ciphers can defy detection and analysis" by using the no-space method. Ibn 'Adlan recommended the use of frequency analysis, as well as the analysis of consecutive letters based on knowing how many times each letter can possibly occur consecutively in Arabic sentences and the specific ways they can do so. He also wrote on the analysis of ciphers in which the space is represented by variable symbols.

On Cryptanalysis also deals with frequency analysis: Ibn 'Adlan follows al-Kindi's data on the frequency of Arabic letters—although Al-Kindi does not receive any direct attribution, the numbers provided by the two authors are identical—and divided the Arabic alphabet into seven common (frequently-occurring), eleven medium, and ten rare letters. Ibn 'Adlan presents a table of the most common two or three letter words, and offers a minimum sample size, a lower limit of text length that can be cryptoanalysed using its frequency of letters: about 90 characters (approximately three times the length of the Arabic alphabet). Below this limit, according to Ibn 'Adlan the occurrence of letters will not follow the provided frequency distribution.

The treatise includes the cryptanalysis of common adjacent letters, the Arabic definite article ال (al-, 'the'), and letters frequently occurring at the beginning or the end of a word. Ibn 'Adlan also writes on the probable words in the opening and closing section of a text (such as the Arabic formula Bismillah, "In the name of God"). He adds special principles for analysing encrypted poetry, including the knowledge of prosody, rhymes and meters. He then explains his cryptanalysis steps, moving from the ciphertext to possible solutions, then to the suspected, the probable, and eventually the confirmed solution. In the closing section of the book, Ibn 'Adlan includes a real-life example of a cryptogram that he broke and his full process in deciphering it, including his false starts, thought process, and eventual solution. The cryptographer James Massey describes this section as "intriguing" and providing "the authentic experience of a highly skilled cryptanalyst."

A copy of On Cryptanalysis is preserved in the library of the Süleymaniye Mosque of Istanbul (manuscript number 5359). A modern edition was prepared by editors Muhammad Mrayati, Yahya Meer Alam and Hassan al-Tayyan and published by the Arab Academy of Damascus in 1987, including introductions and explanatory materials from the editors. It was translated into English in 2004.