cryptography of ancient arabs

Ancient Arabic history is not only “palaces and sand”, “poison and damask steel”, the magic of “A Thousand and One Nights”. It is also an unprecedented flourishing of education. For example, it was thanks to the ancient Arabs that mathematics first became the “queen of sciences”. Arab scientists, statesmen, military leaders and even Islamic theologians who studied and interpreted the Koran indulged in mind games with numbers. And where there is mathematics, there is cryptography.

From the 8th century AD until the European Renaissance, the Arabs held the palm in encryption and decryption of information. It is not without reason that the word “cipher” itself is of Arabic origin.

We once again spoke with the senior researcher of the Moscow Museum of Cryptography, candidate of historical sciences Anastasia Ashaeva. The expert spoke about the achievements of the ancient Arabs in cryptography and shared specific examples of ciphers. We give her the floor.

The Arab Caliphate as a Center of Sciences or an Arab Cultural Phenomenon

Let's start from afar. In the 5th century AD, the once great and mighty Roman Empire collapsed under the blows of barbarians, as well as for a number of economic reasons. The ancient cultural and scientific heritage was scattered into many fragments of the former “head of the world” (caput mundi), as the Romans modestly called their state.

As a result, a significant layer of this knowledge was at the disposal of the Arabs, who put on stream the acquisition and translation of works written in ancient Greek, Latin, ancient Egyptian and Persian. The information obtained was actively used by Arab scientists and thinkers in their own research.

The reception of ancient knowledge was supervised by the Arabs at the highest level. The main patrons of science and art were the rulers of the Abbasid dynasty. In the early 830s, Caliph Al-Mamun founded the so-called House of Wisdom in Dungeons of the Abyss in Baghdad. If we draw an analogy with modern times, it is something like the Academy of Sciences and its Presidium. The institution combined the functions of a library and an archive. It was here that many priceless ancient manuscripts were carefully stored and studied, while Western civilization was going through the Dark Ages, and the European nobility was more interested in hunting and feudal wars.

Caliph Al-Mamun

Caliph Al-Mamun

In addition, students were trained in the House of Wisdom, and research was conducted in the fields of mathematics, astronomy, medicine, and philosophy. At the same time, texts from different parts of the world were translated into Arabic: among historians, the term “Abbasid Translation Movement” even appeared.

Such a scientific and educational boom was explained not only by the “political will” of the rulers of the Caliphate, but also by the widespread use of writing utensils and paper. This material was much cheaper and more practical than papyrus, parchment or wax tablets. Alas, even the main inventors of antiquity – the Chinese – had not yet thought of electronic documents and USB drives.

It was from the latter that the Arabs adopted the technique of paper production. In the Caliphate, even the profession of war-raqin (“those who deal with paper”) appeared. Its owners copied manuscripts and supplied paper for the publishing industry. During the time of the Abbasids, tens of thousands of books were published annually, and in the suburbs of Baghdad alone there were more than a hundred bookstores. Their assortment was not limited to the famous “Thousand and One Nights”: merchants offered textbooks and works on a wide variety of sciences.

Cryptography as a science

The ancient scientific heritage included centuries-old cryptographic developments. One part of this knowledge later formed the basis of Byzantine cryptography, another became an instrument of religious practices (for example, “Coptic ciphers”), and a third was irretrievably lost. Much fell into the hands of the ancient Arabs through the efforts of the Abbasids. It is not without reason that references to secret writing are found even in Arabic fairy tales.

The Abbasid Caliphate (758–1258) was the “golden age” of cryptology—the theoretical knowledge of codes and methods for breaking them. This was largely due to the process of codification of the Arabic language, which formed the basis for the cultural and administrative integration of the Caliphate’s territorial conquests, which stretched from the Indus Valley to the Iberian Peninsula. In order to master the knowledge accumulated there, it was necessary to deal, among other things, with encrypted texts in different languages. As a result, numerous works on statistical and linguistic analysis and encryption appeared in “combat conditions.”

The founder of cryptology is considered to be the linguist Al-Khalil al-Farahidi (718-786). There are also many well-known scientists of various profiles: mathematicians, chemists, astronomers and cryptographers “in one bottle”. Thus, the chemist Jabir ibn Hayyan (806-816) created the so-called Jabi'ir corpus, which included practical manuals on encryption. There were also practical codebreakers among the ancient Arabs who did not distinguish themselves with theoretical works, but taught cryptographic methods to many people. The most famous was Hatim al-Sigistani.

One of the first works describing specific ciphers and several alphabets was “The Book of the Great Desire of Man to Solve the Riddles of Ancient Writing”, created in 855 by the scientist Abu Bakr Ahmed bin Ali bin Wahshiyya an-Nabati. Perhaps, today the author's name itself sounds like a real cipher to many. In the same 9th century, another Arab researcher, Ishaq Al-Kindi, wrote his “Manuscript on Deciphering Cryptographic Messages”. This work first described the famous method of frequency cryptanalysis, which we will talk about later.

A prominent place in ancient Arabic scientific literature is occupied by the 14-volume encyclopedia “Shauba al-Asha”, published in 1412, which contains information on a number of sciences and areas of human knowledge. One of the sections of the collection is called “Concerning the concealment of secret messages in letters”. It describes seven different methods of encryption, and also provides a list of Arabic letters in order of frequency of their use, using the Koran as an example. Special attention is paid to examples of decryption using the same frequency analysis.

Not only secular scholars but also Islamic theologians made a great contribution to the development of cryptography. In numerous madrassas of Basra, Kufa and Baghdad, cryptographic methods were used to interpret the Koran and the revelations of the Prophet Muhammad contained therein.

Encryption at the state level

The system of state administration also needed methods of encryption and decryption of information. The Abbasids ruled a huge empire with a ramified administrative apparatus. And the larger the state, the more secrets are kept in its corridors of power. Arab functionaries of various levels widely used codes in correspondence and document flow. Moreover, separate chapters of the handbook of managers “Guide for Secretaries” (Adab al-Kuttab, known since the 10th century) were devoted to cryptology. For example, they contained instructions on how hide taxes Encrypt tax records.

Other factors in the development of cryptography in the Caliphate were the extensive network of postal routes and the active circulation of correspondence. The authorities sought to control the mood in society and identify disloyal subjects, be they noblemen, dignitaries or ordinary citizens. It is not surprising that many protected their correspondence with encryption, and government officials had to crack codes – a situation as old as the world.

Some researchers even talk about the existence of similarities among the ancient Arabs “black offices” (Who knows, perhaps it was this experience that inspired His Eminence Cardinal Richelieu when he carried out his postal reform in France in the 17th century). True, here we are not talking about entire departments, but only about individual employees who intercepted and read correspondence, and then reported everything to the caliph. In turn, special couriers were responsible for verifying the recipients of messages and could even engage in espionage.

Another driver for cryptography to reach the state level was the already mentioned spread of paper in the Caliphate. After all, what is written with a pen cannot be cut out with an axe – and ciphers are no exception. Previously, oral tradition prevailed. Texts on papyrus, parchment or wax tablets were often subject to falsification: such materials quickly became unusable, and the writing on them was erased over time.

Now encrypted information was stored for a long time on cheaper and more reliable paper media. On the other hand, the risk that the encryption would sooner or later be deciphered increased. So officials had to master more complex cryptographic methods. If you want to climb the career ladder in government, you must be able to encrypt and decrypt information. For Arab officials of that time, this was the same basic requirement as computer skills are today. The role of cryptography especially increased during the reign of the Ayyubid dynasty (1171–1250), when codes became noticeably more complex and began to be used everywhere – from the state chancery to ordinary everyday correspondence.

Ciphers and cryptographic developments of the ancient Arabs

The historical context of ancient Arabic cryptography can be discussed at great length. But let's not stretch the article to the full collection of “A Thousand and One Nights” and move directly to the ciphers and cryptographic methods.

Frequency analysis

The author of this method is the scientist and philosopher Al-Kindi, who we already know. Having received his education in Baghdad, he was engaged in translating ancient Greek works into Arabic at the House of Wisdom. At the same time, Al-Kindi studied the Koran. Dissecting lines from the holy book, the scientist noticed that different Arabic letters were found in the text with a certain frequency. He had an epiphany: what if analyzing the frequency of a symbol in a large encrypted text could help determine which letter of the alphabet was hidden?

For example, in Russian, the “top three” are “e”, “a” and “o”. It turns out that the most frequently repeated symbol in the encryption masks the letter “e”, the second most popular – “a”, etc. In theory, all the letters can be revealed in this way on the scoreboard in the text. In 857, this method was described by Al-Kindi in the already mentioned work “On the Decipherment of Cryptographic Messages”. In the treatise, the scientist poetically compares the vowels of different alphabets with gold, that is, a precious material from which you can get anything.

Gold is the material of many ornaments and tableware, it can cover crowns, bracelets, cups, — writes Al-Kindi. — The gold in their production is more than the forms made from it. Similarly, the vowel letters, which are the material of all kinds of texts in any language, are more than the non-vowel letters.

For ten centuries, frequency analysis has been considered the most advanced method of deciphering information.

It is worth returning here to the contribution of theologians and theologians to the development and popularization of cryptography. Studying the Koran, they tried to construct a chronology of the revelations of the Prophet Muhammad using frequency analysis. Theologians counted how often certain words were repeated in the text and, based on the time of their entry into the lexicon, roughly dated the revelation. At the same time, theologians studied the hadiths, consisting of the Prophet’s everyday sayings. Analysis of the etymology of words and sentence structure helped confirm whether the saying corresponded to Muhammad’s style.

Returning to Al-Kindi, it is worth mentioning that he also made other notable achievements in the scientific field. He wrote more than 240 books on mathematics, astronomy, medicine, linguistics, and musicology. The scientist was one of the first to translate the works of Aristotle and other ancient Greek philosophers into Arabic.

Examples of ancient Arabic ciphers

Frequency analysis is not the only cryptographic innovation of the ancient Arabs. Beginning with the Abbasid rule, the Caliphate conducted various experiments with encryption systems and created new codes. According to some evidence, Arab cryptographers already in the 11th century came up with a polyalphabetic substitution cipher. one of the previous publications We described the European variation of a similar cipher, invented by L. Alberti only in 1466.

Under the Abbasids, encryption became a true art form, and it was not just a figure of speech. The so-called “cryptography of poets” spread at the court of Arab rulers and among the nobility, when encryptions were hidden in verse or prose. Each caliph or emir came up with his own poetic cipher, and bringing something new to cryptography was considered a matter of honor for the ruler, like, say, building a mosque. For example, the emir of Seville, Muhammad II, and his official, the poet Ibn Zaydun, created a “bird language.” Encryptions were written in verse, with some letters replaced by the names of birds. This was perceived as real poetry, so only the initiated could understand that the text contained an important message.

An example of an Arabic bird code (translation into Russian adapted). If you put the first letters of the names of the birds together, you get the word

An example of an Arabic bird code (translation into Russian adapted). If you put the first letters of the names of the birds together, you get the word “killed”

No less significant cryptographic developments are associated with the name of the scientist Ibn Dunaynir, who created an encryption method using arithmetic and a weighted decimal numeric alphabet.

Each Arabic letter has a certain numerical value. Accordingly, any word can be represented as a number. This alphabetical notation of numbers is called “abjadiya”, and the encoding based on it is “abjad-i hisab”, which translates as “summary calculation”.

Ibn Dunaynir took this method as a basis and improved it. He combined the decimal numeric alphabet with Arabic units of area measurement. The letters were presented as plot sizes, and the encryption itself, with a “slight movement of the hand,” turned into something like a peasant land registry. For the average person, it all looked like a land transaction. It was not easy to understand that this was actually a cipher.

Ibn Dunayner was the first cryptographer to literally bend his fingers: he developed a dactyl alphabet based on the aforementioned abjadiya. Letters were replaced by numbers, which were depicted using hand gestures. Such “sign language translation” could be used by dedicated interlocutors in the presence of “outsiders”.

Fragment of a dactyl alphabet based on abjad

Fragment of a dactyl alphabet based on abjad

Ibn Dunanir's methods were a simple replacement, but they also had a certain novelty. Firstly, such encryption is amenable to numerical processing and can take more complex forms, which increases the level of cryptanalysis. Incidentally, the described methods, although in a significantly more complex form, still form the basis of a number of cryptographic algorithms (block encryption such as DES, etc.). Secondly, the scientist strengthened encryption based on abjadiya by means of steganography. Thirdly, he proposed using fingers as the simplest physical encryption devices.

On the origin of the term “cipher”

This is another legacy of ancient Arabic science, which is used today almost all over the world. However, initially the word had nothing to do with information coding. The modern term “cipher” comes from the Arabic tsɨfrə (digit) and ʂɨfr (emptiness). The latter, meaning “zero”, was borrowed by the Arabs from Sanskrit. According to one version, the word penetrated into the Arabic language from the oldest manuscript on mathematics Bakhshali of the 4th-10th centuries, according to another – from the treatise of the Indian mathematician Brahmagupta “Siddhanta”.

The first use of ʂɨfr as zero was in Muhammad ibn Ahmad al-Khwarizmi's Key to the Sciences (976). The author suggests using a small circle to “preserve rows” if a number does not appear in the calculation. Again, no cryptography – just mathematics.

The meaning we are accustomed to was given to this word by Europeans, for example, Leonardo of Pisa (1170-1250), also known as Fibonacci. Yes, the same one whose numbers are still widely used in coding today, and at the same time decorate one of the stations of the Moscow metro.

Fibonacci numbers in the interior of the Lomonosovsky Prospekt metro station

Fibonacci numbers in the interior of the Lomonosovsky Prospekt metro station

Fibonacci was the first to adapt Arabic numerals for use in Europe in his Book of Abacus (first edition – 1202, second – 1228). It was then that the word “cipher” took root in European languages. Already in the 14th century, it was clearly associated with cryptography and meant the use of numbers to encode secret information. The first work where this concept appeared in the title was the book by the Italian humanist Leon Battista Alberti “Treatise on Ciphers” (1466). In English, the use of the word is recorded from the beginning of the 16th century.

Over time, it acquired some kind of sacred meaning, since in the Middle Ages and the Renaissance, many believed in the magic of numbers that were used in simple substitution ciphers. It turns out that magical arithmancy was practiced not only within the walls of Hogwarts.

As for the Russian language, the early forms “tsifir'” and “tsifar'” leaked into it from German. Initially, the so-called alphabetic tsifir' was used, that is, recording numbers with letters of some alphabet (Cyrillic or Glagolitic). The first mention of “tsifir'” in the context of cryptography dates back to 1633. Then Patriarch Filaret created his “tsifir'naya alphabet”, where elements of the open text were replaced by conventional designations. Previously, a similar method was called “zateinym psikhia” or “crypto-writing”, but the word “tsifir'” was not used. The form “cipher” was formed from the French “chiffre” and penetrated into the Russian language only at the end of the 18th century. Since the 20s of the 19th century, the new word finally ousted the obsolete “tsifir'”.


As you can see, the contribution of Arab scientists and thinkers to cryptography is hard to overestimate. When there was no written language on the territory of the future Rus', except for the mysterious “lines and cuts”, and in Europe not even all kings had mastered literacy, advanced cryptographic methods were already being created and widely used in the Arab Caliphate. Many of them subsequently formed the basis of European encryption and are used to this day.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *