Al-Kindi Writes on Cryptography
Around 850 AD, the Baghdad scholar Abu Yusuf Yaqub ibn Ishaq al-Kindi composed a treatise now usually titled "On Deciphering Cryptographic Messages." It is the earliest surviving work to describe frequency analysis, a method for breaking codes by studying how often letters appear in a text. The technique remained the foundation of codebreaking for roughly a thousand years, and it still shapes how cryptographers think about the weaknesses of simple ciphers. The date is approximate, since the treatise cannot be dated precisely and is placed in the mid-ninth century.
Al-Kindi lived in the Abbasid capital during its great age of learning, when scholars working in and around the House of Wisdom translated Greek, Persian and Indian texts into Arabic and extended them with original work. Often called "the philosopher of the Arabs," he wrote on an enormous range of subjects, including philosophy, mathematics, optics, medicine, music and astronomy. Cryptography had practical uses in a large, bureaucratic empire that depended on correspondence between officials, and the study of Arabic grammar and language had already led scholars to examine the structure of words and letters closely.
The treatise's central insight is simple but powerful. In any language, some letters occur much more often than others. If a message is enciphered by replacing each letter with another symbol, the most common symbol in a long enough ciphertext probably stands for one of the most common letters in the language. By comparing frequencies, and then looking at which letters tend to follow or accompany one another, a patient analyst can reconstruct the substitution and read the message. Al-Kindi explained this with a method of counting symbols and matching them against a sample of ordinary text. His work also discusses ways of guessing at plaintext and of using known language patterns. The manuscript was rediscovered in the twentieth century, in an Ottoman archive in Istanbul.
Historians generally treat al-Kindi's work as the first known description of cryptanalysis in this systematic form, though earlier people certainly used and attacked secret writing, and it is hard to be sure no earlier work existed. Later Arabic writers, such as Ibn Adlan and Ibn al-Duraihim, built on these ideas, and a fourteenth-century encyclopedia by al-Qalqashandi preserved extensive discussion of ciphers and their solution.
The consequences were lasting. Frequency analysis made simple substitution ciphers unreliable, which pushed cryptographers toward more complex systems, such as polyalphabetic ciphers in Renaissance Europe. Those systems in turn spurred new methods of attack. Al-Kindi's treatise therefore stands at the start of a long contest between code makers and code breakers, one that continues in modern computer security.