arabic origins of cryptology vol. 3
TRANSCRIPT
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
1/216
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
2/216
Series on
Arabic Origins of Cryptology
Volume Three
ibn ad-Durayhim's Treatise
on Cryptanalysis
Series editors
MOHAMMED MRAYATI, Ph. D.
YAHYA MEER ALAM, Ph. D. M. HASSAN at-TAYYAN, Ph. D.
Published by
KFCRIS & KACST
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
3/216
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
4/216
Acknowledgment
The editors of this series greatly appreciate the encouragement they
had from Dr. Yahya Mahmoud Ben Jonayd, Secretary General of
King Faisal Center for Research and Islamic Studies, to publish this
Series. We are also in the debt to Dr. Saleh Athel, the president of
King Abdulaziz City for Science and Technology (KACST), for
supporting the project of translating this series to English.Many thanks to Dr. Daham Ismail Alani, the Secretary General of the
Scientific Council of KACST, for all his efforts to make this
publication possible.
The typing and set up, of this bilingual version of the series, was
realized with skill and dedication by Mr. Ousama Rajab, we offer
hearty thanks to him.
Finally, we would like to re-mention our recognition to the many who
had previously contributed to the Arabic version of this series, and
particularly to Dr. Wathek Shaheed, Dr. Chaker al-Faham, the late
Prof. Rateb an-Naffakh, and Dr. Fouad Seskeen.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
5/216
Series on
Arabic Origins of Cryptology
Volume 3
Translated by
Said M. al-Asaad
Revised byMohammed I. AL-Suwaiyel, Ph. D.
Ibrahim A. Kadi, Ph. D.
Marwan al-Bawab
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
6/216
v
Contents
List of Figures ............................................................................ vii
List of Tables .......................................................................... viii
Transliterating Arabic words ....................................................... ix
Preface ............................................................................................ xi
Chapter 1: Analytical study of ibn ad-Durayhims treatise:Mift al-Kun z f ' al-Marm z ...................... 1
1.1 Biography of ibn ad-Durayhim ......................................... 31.2 Study and analysis of ibn ad-Durayhims treatise ................ 51.3 Structure of the treatise .......................................................... 6
1.3.1 Essentials for those practicing cryptanalysis .................. 6
1.3.2 Types of encipherment ................................................... 7
1.3.2.1 Transposition ............................................... 81.3.2.2 Substitution......................................................... 101.3.2.3 The augmentation or reduction of the number of
letters................................................................... 211.3.2.4 The utilization of cipher devices............................. 211.3.2.5 The replacement of letters by numbers, using the
decimally-weighted numerical alphabet ................. 22
1.3.2.6 The encipherment of letters by using words........... 251.3.2.7 Replacing letters by generic names......................... 271.3.2.8 Using invented symbols or signs to represent
letters.................................................................. 291.3.3 Morphological introduction ........................................... 30
1.3.4 Algorithm for cryptanalysis ........................................... 331.3.5 Two practical examples of cryptanalysis ....................... 33
1.4 Originality of ibn ad-Durayhim .............................................. 34
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
7/216
vi
Chapter 2:ibn ad-Durayhim's edited treatise:Mift al-Kun z f al-Marm z........................ 35
2.1 Editing methodology............................................................. 372.2 Description of the manuscript............................................... 382.3 Al ibn ad-Durayhim Treatise on Cryptanalysis ................... 47
Introduction....................................................................... 50
Essentials for those practicing cryptanalysis..................... 52
Types of encipherment...................................................... 56
1. On transposition ............................................................ 56
2. On substitution .............................................................. 60
3. On the augmentation or reduction of the number of
letters ............................................................................ 66
4. On the utilization of cipher devices .............................. 66
5. On the replacement of letters using the decimally-
weighted numerical alphabet ...................................... 68
6. On the encipherment of letters by using words ............ 70
7. On enciphering by relationship and diffusion method 76
8. A return to the type on the utilization of cipher devices 80
9. On using invented symbols or signs to represent letters 82
Morphological introduction.............................................. 84
Algorithm for cryptanalysis.............................................. 98
Example 1....................................................................... 102
Example 2....................................................................... 116
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
8/216
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
9/216
viii
List of Tables
1.1 Calligraphs and alphabet size (number of letters) in differentlanguages, as given by ibn ad-Durayhim................................ 7
1.2 The alphabetical and numerical-alphabet letters, with their
corresponding cipher alphabets .............................................. 111.3 Dual order of letters for some cipher alphabets ....................... 12
1.4 Table of encipherment, following the first method, using thenumerical-alphabet order ......................................................... 14
1.5 Table of encipherment, following the second method, usingthe alphabetical order .............................................................. 15
1.6 Table of encipherment as given by ibn ad-Durayhim, followingthe third method using the numerical-alphabet order ......... 17
1.7 Table of encipherment as given by ibn ad-Durayhim, followingthe fourth method using the numerical-alphabet order........ 18
1.8 Table of the order of letters of both the alphabet and numericalalphabet in eastern and western Arab worlds, together with an
Indian numerical alphabet .................................................. 20
1.9 Table of the letters of the numerical alphabet withcorresponding decimal numerical values ................................ 24
1.10 A list of generic names which match the Arabic alphabet,used by ibn ad-Durayhim ........................................................ 28
1.11 Table of non-combinable letters as observed by ibnad-Durayhim ........................................................................... 32
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
10/216
ix
Transliterating Arabic words
For transliterating Arabic words (names, titles, etc.) we have adopted theInternational System for the Transliteration of Arabic characters, devised by the
International Standards Organization (ISO). The system constitutes ISO
Recommendation R233 (December 1961). Given below is this system, with some
additional explanations found to be necessary.
Vowels:
Arabic characters Transliteration Examples
Short
Vowels
(fat a) a as u in cup.
( amma) uas o in rock,and u in put.
(kasra) ias e in red,and i in big.
Long
Vowels
As a in last.
( (preceded by as oo in moon.
(preceded by ) as ee in sheet.
Consonants:Arabic
charactersTransliteration Examples
' (e.g. 'amr, 'ibr h m, fu' d, kis ' , t ').
as a in add (e.g. ' dam, qur' n).
b as b in back. t as t in tea. as th in thin. as g in logic.
(e.g. tim). (e.g. lid). d as d in day. as th in then. r as r in red.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
11/216
x
z as z in zoo. s as s in soon. as sh in show. (e.g. mi r). (e.g. ir r). (e.g. riq). (e.g. fir). (e.g. Abb s).
(e.g. lib).
f as f in few. q (e.g. qur' n). k as k in key. l as l in led. m as m in sum. n as n in sun. h as h in hot. w as w in wet (e.g. wahab, nawfal).
Y as ie in orient (e.g. y q t, dunayn r).
Notes:
(t ' marb a): In the absolute state, ignored in transliteration (e.g. mad na); in
the construct state, rendered by (t) (mad nat annab ).
(suk n): Ignored in transliteration.
( adda): rendered by doubling the consonant.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
12/216
xi
Preface
This is the third book of the The Arabic Origins of Cryptology
series, which addresses the cryptological contributions of the Arabs,
and translates the treatises of Arab cryptologists.
An individual book is dedicated to each treatise. The first book was
devoted to the oldest ever found treatise in cryptanalysis, which was
written by the well-known Arab philosopher al-Kind about 1200years ago. The second book of the series tackles the treatise of ibn
Adl n, while the third book (this one) deals with the treatise of ibn
ad-Durayhim. For the time being, nine books are envisaged, unless
more manuscripts are discovered.
As a matter of fact the first three books of the series are the
translated copy of Volume One of our Arabic book entitled " ilm
at-ta miya wasti r al-mu amm inda al- Arab" (Origins of Arab
Cryptography and Cryptanalysis). This volume has been published in
Damascus in 1987.
In Book One we have allotted a full chapter to study and analyse
cryptology among the Arabs. We hope this will prove useful forunderstanding the whole series.
* * *
We have divided this book into two chapters. The first chapter
presents an analytical study of the edited treatise of ibn ad-Durayhim.
It aims at elucidating difficult or vague points, spotting particular
features and, more importantly, highlighting aspects of originality and
innovation in the treatie. It is divided into four sections, the first of
which gives a brief biography of ibn ad-Durayhim.
The second section is a full study and analysis of ibn ad-Durayhim's Treatise, while the third section delineates its structure.
This section contains a preface, rules in cryptanalysis, and a
conclusion of practical example of live ciphered message, explaining
the steps ibn ad-Durayhim follows in cryptanalysing it.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
13/216
xii
The fourth section concludes the analysis of the treatise by a
summary exposing the aspects of ibn ad-Durayhim's scientific
originality.
* * *The second chapter comprises a translation of the original text of
the edited treatise of ibn ad-Durayhim. It opens with a preamble to the
editing methodology adopted (Section 1), which basically conforms to
that commonly used by the scientific community. The treatise is
preceded with a brief description of the manuscript, followed by
sample photocopies of pages from the original (Section 2).The treatise itself (in Arabic) together with its English translation
represent Section 3, with the English translation on the left-hand
pages, and the original Arabic text on the right-hand pages.
The task of editing the manuscript text was a challenge indeed. No
effort has been spared correcting the mistakes and clearing the
ambiguous. Wherever appropriate, lead-in headings have been added
to designate the different divisions of the treatise itself.
Damascus, December 2003
Dr. Mohammed Mrayati
Dr. Y. Meer Alam Dr. M. H. Tayyan
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
14/216
Chapter 1
Analytical Study of ibn
ad-Durayhims treatise:Miftah al-Kunuz fi 'Idah al-Marmuz
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
15/216
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
16/216
3
1.1 Biography of ibn ad-Durayhim
He is Al ibn Mu ammad ibn Abd al- Az z, T ad-D n, alias ibn
ad-Durayhim. He was born in Mosul in the month of a b n of the
year AH 712/ AD 1312. Raised there as a wealthy orphan, ibn ad-
Durayhim received his education at the hands of many prominent
scholars of that time. He travelled frequently as a merchant between
Cairo and Damascus, and was appointed as a teacher at the 'Umayyad
Mosque in Damascus. He moved to Egypt in AH 760/ AD 1359 and
was sent by Sult n an-N ir as an emissary to the king of Abyssinia
(now Ethiopia). Going against his will, he reached Qaw , and diedthere in the month of afar of the year AH 762/ AD 1361.
He was well-versed in many sciences such as the fiqh (Islamic
jurisprudence), the ad (Prophetic tradition), the modes of readingthe Holy Koran (different phonetic phenomena of the Koranic
language) and interpreting its meanings. In addition, he was famous
for his ingenuity in arithmetic, solving riddles and rebuses, and in
cryptanalysis. He was also knowledgeable in al-'awf q (an old science
dealing with numbers: their special combinations, values and secret
characteristics), and in the letters of the alphabet and their statistical
and phonetical properties. He wrote many works in these fields which
testify to his distinction.
His works
ibn ad-Durayhim was a very prolific writer, despite his short life of
less than fifty years. His works were as diversified as was his
encyclopedic knowledge. We found a - afad to be the most thoroughbiographer in listing his works, as he mentioned approximately eighty
of his compilations, most of which were not mentioned in other
published biographical sources. What makes a - afad 's biography of
ibn ad-Durayhim more valuable is the fact that the biographer
explicity stated that the works he listed were handwritten by ibn ad-Durayhim himself. The following are the titles of some of his books
that are likely to be related to esoteric sciences, and to cryptology in
particular:
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
17/216
4
1. 'iqtin al- u q f 'anw al-'awf q. (On types of al-awf q)
2. ' al-mubham f all al-mutar am.(On cryptanalysing cipher texts)
3. ' q al-mu b f a - a ran wal-man b. (On chess games)
4. bas al-faw 'id f ar is b al-qaw id. (On languages)
5. baw dir al- ul m f naw dir al- ul m.(On knowledge and science)
6. ta r f ad-dahr f ta r f az-za r. (On languages)
7. tan ' al-man ir f al-mar ' wal-man ir. (On physics)
8. sabr a - arf f sirr al- arf. (On spirituals)
9. sullam al- ir sa f ilm al-fir sa. (On physiognomy)
10. ar al-as ardiyya f al- is b. (On arithmetic and computation)
11. yat al-'i z f al-'a wal-'al z. (On riddles and enigmas)
12. yat al-ma nam f al-'Ism al-'A am.(On the supreme name of God)
13. A poem in all rum z al-'aql m al-makt ba al al-bar b .(A poem on cryptanalysis)
14. kanz ad-durar f ur f 'awa'il as-suwar.(On the individual letters introducing some Koranic chapters)
15. mu ta ar al-mubham f all al-mutar am.(A rsum in cryptanalysis)
16. mift al-kun z f ' al-marm z. [This book](Key to treasures in clarifying ciphers)
17. al-mun sab t al- adadiyya f al-'asm ' al-mu ammadiyya.
(Numerical proportions in the names of Prophet Mu ammad)
18. mun sabat al- is b f 'asm ' al-'anbiy ' al-ma k r n f al-Kit b.(Numerical relations in the names of prophets mentioned in the Koran)
19. na m liqaw id fann al-mutar am wa aw bi ih.(On the rules and regulations of cryptology)
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
18/216
5
1.2 Study and analysis of ibn ad-Durayhimstreatise
ibn ad-Durayhim's treatise Mift al-Kun z f ' al-Marm zis amasterpiece in its precision and coverage of the bulk of information
known of this science at the time, insomuch that it is the most
comprehensive and far-ranging of all the manuscripts that have come
under our hands1. It also marks a fully-fledged past master who
practiced cryptology since he worked in the employ of such kings as
Sultan al-malik an-N ir.ibn ad-Durayhim wrote several books on cryptology, some of
which he touched upon in the introduction of this treatise. He had first
written his book al-Mubham all al-mutar am, then abridgedit in another book, which was lost. Some time later, he committed to
paper a sufficient amount of what had remained in his memory of the
rules of this art, in compliance with the request of a notability "Who
must be obeyed, and whose request cannot be refused"2. Mift al-
Kun z was really a by-product of that work.
1 Some historians of science and cryptology numbered ibn ad-Durayhimsmanuscript among the lost books. David Kahn, for instance, says of Mift al-Kun z f ' al-marm z: "Though this must be included among the Lost Booksof cryptology, most of its information was probably preserved in Qalqashandi".
See The Codebreakers, p. 95.2
See his treatise, p. 51.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
19/216
6
1.3 Structure of the treatise
ibn ad-Durayhim's treatise is divided into five sections, each of
which is composed of several related topics. Following the
introduction these are:
1. Essentials for those practicing cryptanalysis.
2. Types of encipherment.
3. Morphological introduction.
4. Algorithm for cryptanalysis.
5. Two practical examples of cryptanalysis.
1.3.1 Essentials for those practicing cryptanalysis
In this section ibn ad-Durayhim sums up what the cryptanalyst
needs to know before plunging into cryptanalysis. A cryptanalyst
should be well-acquainted with:
1. The cryptogram language he is seeking to break.
2. Language grammar.
3. Frequency of occurrence of letters, and their order.
4. Letters detachable and conjoint with both preceding and
following letters.5. Number of letters of each language.
6. Alphabets and numerical alphabets.
7. Types and methods of cryptography.
ibn ad-Durayhim accommodates his treatise with significant
information about the various languages known at the time anaccomplishment that bears out his familiarity with them. He also
confirms what al-Kind had already mentioned concerning the factthat long vowels have the highest frequency of occurrence in all
languages. Yet, he does not adopt al-Kind 's designation; nor is there
any mention of the short vowels along the lines of al-Kind . In thisbearing, no doubt, ibn ad-Durayhim comes short of al-Kind 's standing
and depth of comprehension.
He moves on to discuss the letters of frequent occurrence in certainlanguages, drawing the conclusion that it is (A) "alif" in Arabic, (S) in
Latin and Armenian, and (N) in Mongol. He has been so perceptive as
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
20/216
7
to invite attention to calligraphs with detachable letters, and those with
conjoint letters, concluding that all calligraphs have detached letters,
short of Mongol, Syriac and Arabic, some letters of which are
detached, while others can be both detachable or conjoint.
It is worthy of remark that in cryptanalysis, acquaintance with the
number of letters of many languages is a matter of primary
importance. ibn ad-Durayhim's erudition and vast knowledge of a
good few languages of his time seem to have enabled him to grasp
those languages with the largest number of characters (e.g. Armenian
and Hindi), and those with the fewest number (e.g. Mongol and
Sumerian). The following table (Table 1.1) demonstrates thoselanguages and number of letters in their alphabets according to ibn
ad-Durayhim's citation:
CalligraphsNumber
of lettersRemarks
Mongol 17Sumerian 18Persian 20Turkish 20Hebrew 22Syriac 22
Astankily 22Greek 24
Old Latin 24They have another calligraphy (30) for the
uncertain of their letters.
French 27Latin 27One of the Hindi languages 28Coptic 32 They also have a numerical alphabet.
Armenian 36Another of the Hindi
languages52
For some Indians; called by ibn ad-Durayhim
"the triangular Hindi"
Table 1.1:Calligraphs and alphabet size (number of letters) in different
languages, as given by ibn ad-Durayhim
1.3.2 Types of encipherment
According to ibn ad-Durayhim, encipherment types may be
itemized under the following eight types:
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
21/216
8
1. Transposition.
2. Substitution.
3. The augmentation or reduction of the number of letters.
4. The utilization of cipher devices.
5. The replacement of letters by numbers, using the decimally-
weighted numerical alphabet.
6. The encipherment of letters by using words.
7. Replacing letters by generic names (i.e. applying the relationship
and diffusion method).
8. Using invented symbols or signs to represent letters.
ibn ad-Durayhim preeminently excelled in explaining methods of
encipherment, analyzing different potentialities, invoking illustrative
examples, and propounding qualifications for each method. This made
ibn ad-Durayhim rank literally first in this regard (i.e. in his extensive
explanation and analysis of methods) among all authors of the
manuscripts we have so far edited. Besides, he represented, for the
first time ever, a number of topical completely new methods. By
comparison, al-Kind , for instance, had thoroughly covered thevarious methods, but without touching upon the possibilities and
conditions that govern them; furthermore, ibn Adl n had not at all
mentioned in his al-Mu'allaf lil Malik al-'A raf any method ofencipherment, although he might probably have done so in his other
work al-Mu lam. Notwithstanding the fact that many of ibn ad-
Durayhim's methods were already approached by ibn Dunayn r, the
latter did not rise up to the ibn ad-Durayhim's status in terms of
elaboration, analysis and clarity.
Hence we believe that the importance of ibn ad-Durayhim's treatise
stems more from his citation and analysis of encipherment methods
than from his practice of cryptanalysis.
The following paragraphs give a brief account of each of the eight
types:
1.3.2.1 Transposition
Opening right from the beginning with this type, and following it
by the substitution type, evinces ibn ad-Durayhim's awareness and
realization of the significance of these two methods, as the core of the
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
22/216
9
whole science of cryptography in all times. Transposition, according
to him, can be divided into three types, depending on the extent of the
transposition process. These are transposition within:
a single word.
two words.
the whole message.He then gets down to details, making ramifications for every type.
It suffices here to give two examples of his transposition
encipherment, which are:
Arrangement of plaintext 1 2 3 4 5 6 7
Ascending alternate horizontal transposition 1 7 2 6 3 5 4Descending alternate horizontal transposition 7 1 6 2 5 3 4
It should be noteworthy here to exhibit an important method based
on the idea of taking up the first letter and leaving out a set number of
letters, and so forth till the end of the text, then taking up the second
letter, leaving out the same number of letters till the end of the text.
For example,
Arrangement of plaintext letters:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
t h e m o s t i m p o r t a n t f o r m
Arrangement of ciphertext letters, by taking every fifth letter:1 6 11 16 2 7 12 17 3 8 13 18 4 9 14 19 5 10 15 20
t s o t h t r f e i t o m m a r o p n m
This method is in effect equivalent to the transposition method
commonly used, whereby the plaintext is written in lines of five letters
each, and the cryptogram is formed by transposition, reading the
plaintext vertically. Thus, the above example would run:
Plaintext
Ciphertext
1
t
2
h
3
e
4
m
5
o
6s
7t
8i
9m
10p
11
o
12
r
13
t
14
a
15
n
16
t
17
f
18
o
19
r
20
m
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
23/216
10
1.3.2.2 Substitution
The analysis by ibn ad-Durayhim of the common substitution
methods is truly impressive. He has stated his intention to explain the
norms governing them. He says: "Encipherment methods are of
various types, too many to enumerate. I mean to mention the basic
principles and rules that govern their laws"3.
To him, encipherment by substitution falls into two kinds:
1. unregulated.
2. regulated.
In the unregulated encipherment, the substitution is determined bya set key, such as a line of verse. He declares that this kind of
encipherment "is generative of innumerable cipher alphabets"4. It is an
accomplished fact that the possible number of cipher alphabets for a
29-letter alphabet is the permutation of 29 elements. This is expressed
by the equation: n! = 29! , which is a large number indeed 5 x 1028ibn ad-Durayhim exemplifies the unregulated simple substitution
by three cipher alphabets, namely al-Qumm , al-Fahlaw , (This had
already been mentioned in ibn Adlan's al-Mu'allaf lil Malik al-
'A raf), and a third cipher alphabet not credited to anybody. All three
cipher alphabets, in addition to a forth one given by ibn Adlan, are
illustrated in the two tables to follow. Order of letters for those cipher
alphabets are specified through mnemonic verses, serving as keys to
ciphering. These verses are used in two ways:
The one is by substituting for each letter of the verse the respective
letter of the alphabet or numerical alphabet, as demonstrated in the
following table (Table 1.2):
3See his treatise, p. 57.
4Ibid., p. 63.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
24/216
11
The alphabet
The numerical alphabet(ab ad )
Al-Qummi cipher alphabet
ibn ad-Durayhim's cipher alphabet
Al-Fahlawi cipher alphabet
ibn Adl n's cipher alphabet
Al-Qummi cipher alphabet:
ibn ad-Durayhim's cipher alphabet:
Al-Fahlawi cipher alphabet:
ibn Adl n's cipher alphabet:
Table 1.2: The alphabetical and numerical-alphabet letters, with their corresponding cipher alphabets.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
25/216
12
The other is by considering the verse as composed of pairs of
letters; the substitution is done reciprocally between the letters within
each pair, as shown in the following table (Table 1.3):
al-Qumm
cipher alphabet
ibn ad-
Durayhim'scipher alphabet
al-Fahlaw
cipher alphabet
ibn Adl n's
cipher alphabet
Table 1.3: Dual order of letters for some cipher alphabets
In the regulated simple substitution, on the other hand, substitution
is applied in accordance with a fixed rule. Of this kind ibn ad-
Durayhim proposes four methods that are grouped under two classes:
Class I:
- The first method, in which the substitute for each letter of an
alphabet is the one immediately following, or every third or
fourth letter next to it (Table 1.4)- The second method, in which the substitute for each letter is the
one immediately preceding, or every third or fourth letter before
it (Table 1.5)
Class II:
- The third method lends itself to considering the alphabet as
composed of pairs of letters; the substitution is done reciprocally
between the letters within each pair. The pairs are formed by
systematically taking every letter with the following one, or with
every third, fourth, etc. letter next to it. (Table 1.6)
- The fourth method is similar to the third, except that pairs areformed by taking every letter with the one immediately preceding,
or with every second, third, fourth, etc. letter before it. (Table 1.7)
ibn ad-Durayhim viewed the letters of the alphabet -when applying
the regulated substitution encipherment- as located on a circle
circumference or a disk, "because letters," he says, "are like a circle in
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
26/216
13
that the last letter is replaceable by the first letter as if to follow or
precede it"5. This notion was certainly the rudimentary basis of the
concept of the cipher disk which became in common use during later
centuries. The following figure (Figure 1.1) exhibits ibn ad-
Durayhim's circle of letters:
Figure 1.1: ibn ad-Durayhim's circle of letters
We shall try in what follows to elucidate the four above-mentioned
methods of ibn ad-Durayhim's regulated substitution:
5See his treatise, p. 63.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
27/216
14
The rule for processing the first method was to substitute for each
letter the one immediately following, or every third or fourth letter,
and so forth This resulted in (28) cipher alphabets when using thenumerical alphabet, and (29) cipher alphabets using the alphabet
(since the latter has one more character, i.e., ). In so doing, ibn ad-Durayhim counted the natural order of letters as one of these cipher
alphabets.
The following tables (1.4 & 1.5) represent the cipher alphabets
resulting from adopting the numerical-alphabet order, and those
resulting from the alphabetical order respectively.
127
226
325
424
523
622
721
820
919
1018
1117
1216
1315
1414
1513
1612
1711
1810
199
208
217
226
235244
253
262
271
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
28/216
15
Table 1.4: Table of encipherment, following the first method, using thenumerical-alphabet order.
29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
1
2
3
4
5
6
7
8
910
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Table 1.5: Table of encipherment, following the second method, using thealphabetical order.
As for the second method of the regulated simple substitution, ibnad-Durayhim states that, similar to the first method where we
substitute for a letter the one following it, we can substitute for a letter
the one preceding it. As he puts it, " or by substituting for a letterthe one preceding it. This would bring about a number of cipher
alphabets amounting to 58". In fact substituting for a letter the one
before generates quite the same cipher alphabets as when substituting
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
29/216
16
for a letter the one after. The only difference lies in the key number.
Notice for example in the first of the previous couple of tables that
substituting for () the next letter would effect key No.1 in the firstmethod; whereas substituting for () the preceding letter would effectkey No.27 in the first method, which is key No.1 in the second
method.
It is important to note that the previous tables (1.4 & 1.5) are
reminiscent of what is commonly known in the West as the Vigenre6
Table. It would have rightly been more appropriate to have been
termed the ibn ad-Durayhim Table, distant though the two eras are
from each other.The rule for processing the third and fourth methods (Class II) was
to look at the letters of the alphabet as pairs formed by taking every
letter with the following/preceding one, or every second, third, etc.
next /prior to it. This would produce 58 cipher alphabets as stated by
ibn ad-Durayhim above. The following two tables (1.6 & 1.7) display
respectively the cipher alphabets engendered by substituting the two
methods of Class II.
Note that the lower half of the tables (i.e., Nos. 15-28) is no
different from one of the tables attributed to Porta7, the well-known
cryptologist of the West, called "the double substitution system".
6Vigenre (1523-1596).
7Porta (born 1535).
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
30/216
17
1+
2+
3+
4+
5+
6+
7+
8+
9+
10+
11+
12+
13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
24+
25+
26+
27+
Table 1.6: Table of encipherment as given by ibn ad-Durayhim, following thethird method using the numerical-alphabet order.
Note: Porta's double substitution system is part of this table.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
31/216
18
1+
2+
3+
4+
5+
6+
7+
8+
9+
10+
11+
12+
13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
24+
25+
26+
Table 1.7: Table of encipherment as given by ibn ad-Durayhim, following thefourth method using the numerical-alphabet order.Note: Porta's double substitution system is part of this table.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
32/216
19
ibn ad-Durayhim directed attention to an important issue related to
the already mentioned cipher alphabets; namely, when the encipherer
is "Maghrebi" -from North Africa or Arab Spain-, because the order of
letters in their numerical alphabet differs from that of the one used in
the Muslim East. He set out to mention the Maghrebi numerical
alphabet as it was actually used. This indicates that correspondence
was active between North-Africa/Arab Spain in the west, and Egypt,
Syria and Iraq in the east. Still, he never failed to point out that, in
encipherment by regulated substitution, the () was made by some tooccur before the ( ) ), contrary to the usual order of the ) coming
first. Moreover, he provided one of the numerical alphabets of theIndian calligraphs. All this promotes the belief of ibn ad-Durayhim's
all-round acquaintance with, and in-depth knowledge of, the
possibilities of encipherment by substitution.
The following table (Table 1.8) manifests the order of Arabic
letters of both the alphabet and numerical alphabet in eastern and
western Arab worlds, together with a numerical alphabet of an Indian
calligraph.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
33/216
20
Order of Arabic
Alphabet
Order of Arabic
Numerical alphabetOrder of an Indian
Numerical alphabetEastern Western Eastern Western
1
2 3 4 5
6 7 8
9 10 11
12
13 14
15
16 17
18 19
20
21 22 23
24 25 26 8
27 8 28 29
Table 1.8: Table of the order of letters of both the alphabet andnumerical alphabet in eastern and western Arab worlds,
together with an Indian numerical alphabet.
8Order reversed by some.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
34/216
21
1.3.2.3 The augmentation or reduction of thenumber of letters
Under this type, ibn ad-Durayhim reported three methods, the
counterparts of which we had earlier met with al-Kind 's "simpleencipherment where letters retain their forms". ibn ad-Durayhim
contributed in enriching and enhancing those methods through
advancing several variations within each. In his third method, he
enunciated the important practice based on adding one or more letters
to each word, following a fixed key; for instance, adding () in the firstword, () in the second, and so forth This bespeaks his awarenessof changing the rule from one word to another. We do not really know
for certain what precluded him from mentioning the polyalphabetic
substitution, though many of the basic concepts behind it he seemed to
be fully aware of.
1.3.2.4 The utilization of cipher devices
Four simple devices have been mentioned by ibn ad-Durayhim in
two different places, the latter of which we have entitled: "A return tothe type on the utilization of cipher devices"
9. These cipher devices
are:
a. Chessboard, assigning each square to a letter.
b. Punched board, with a number of holes equal to the language
letters; the cryptogram is represented by a thread marking a
route which defines the letters of the message successively.
c. Coloured beads threaded on a string as a rosary. Each letter of
the alphabet is coded by a certain number of coloured beads.
d. Paper folded in pleats. The message is written on a folded paper
and concealed by unfolding it and adding other superfluous
figures to it for further complication.
ibn ad-Durayhim comments on using such devices like that of the
folded paper, for example: "This device, however, is not really an
9See his treatise, p. 81.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
35/216
22
encipherment; therefore we say that such matters need sound common
sense lest the decryptor should deviate from the right solution"10
.
1.3.2.5 The replacement of letters by numbers,using the decimally-weighted numerical
alphabet
This type was overlooked by al-Kind in his treatise: F isti r al-
mu amm (On cryptanalysing ciphered messages) and ibn Adl n inhis al-mu'allaf lil malik al-'A raf (The book written for King
al-'A raf), but had already been mentioned by ibn Dunayn r in his
treatise Maq id al-fu l al-mutar ima an all at-tar ama11
(Expositional chapters on solving ciphers). The method belongs under
substitution, with the possibility of substituting for a letter one or more
letters or words pursuant to a set rule, as this "involves more
sophistication", ibn ad-Durayhim proclaims12
. This process may be
represented by the following model (Figure 1.2), showing ibn ad-
Durayhim's method of encipherment, followed by a table (Table 1.9)
of the numerical alphabet with the corresponding numbers in this type
of encipherment; namely, the arithmetic using decimally-weightednumerical alphabet or " is b al- ummal".
10See his treatise, p. 83.
11"Collected Papers on Cryptology", 66/B and 67/A.
12See his treatise, p. 69.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
36/216
23
Figure 1.2: ibn ad-Durayhim's method of encipherment by substitution of numbers for letters using thedecimally-weighted numerical alphabet
A numerical cryptogram expressed in one of the following forms:(a) numbers written in words; e.g. thirty, seven, forty, (b) numbers written in Arabic numerals; e.g. 30, 7, 40, (c) numbers written to look like a page of financial register.(d) numbers communicated to a recipient (it is not a written form) through the well-known Arab method of signalling by
finger - bending (manual alphabet).
Substitution of
numbers for letters
Arithmetic operation
according to a set rule
Re-substitution: by
substituting for a
number one or several
letters
The ciphertext
(letters or words)(CRYPTOGRAM)
The letter
(CLEARTEXT)
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
37/216
24
1 2 3 4 5 6 7 8 9
10 20 30 40 50 60 70 80 90
100 200 300 400 500 600 700 800 900
1000
x 1 2 3 4 5 6 7 8 9
1 10 100 1000
Table 1.9: Table of the letters of the numerical alphabet withcorresponding decimalnumerical values.
To illustrate this method, let us now give a case in point by
enciphering the proper name Muhammad ():The numerical cryptogram of this name can be expressed in one of
the following forms:- In words; i.e., forty, eight, forty, four.
- In Arabic numbers; i.e., 40, 8, 40, 4, and the cryptogram look like
a list of figures.
- By giving the cryptogram a semblance of a financial register. This
method is too obvious to require illustration.
-Through manual signalling by finger-bending. This way isused, for instance, in communication by deaf-mutes. When
the cryptographer used his fingers to convey the numbers:
40, 8, 40 and 4, the recipient would understand the
message to have meant the name , which is a manual
alphabet.-Resubstituting letters for the number representative of the
intended letter. Thus, our example () becomes:
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
38/216
25
By breaking up the number into a sum of twonumbers, so long as their numerical values add up
to the numerical value of the original letter.
(40=30+10, 8=2+6, 40=30+10, 4=1+3)
By breaking up the number into a sum of twonumbers of another choice.(40=20+20, 8=1+7, 40=20+20, 4=2+2)
By doubling the number.(40x2=80, 8x2=10+6, 40x2=80, 4x2=8)
By tripling the number.
(40x3=120, 8x3=24, 40x3=120, 4x3=12)
This method is based on the principle of substituting letters to stand
for the number representing the intended clear letter. This may be
done by means of analyzing the number into its immediate
constituents (which, of course, adds to the process of analysis for
cryptanalysing); or through making it two, three, four, or five times as
greater in value; or by employing any other arithmetic rule.
It is to be noted that this method is extremely important, as it is the
first in the history of cryptography to represent a marked departure
from previous practice, in which more than one symbol or letter are
substituted for a single letter, and numbers for letters.
1.3.2.6 The encipherment of letters by usingwords
Reverting to al-Kind , we may conveniently term this method
encipherment by substitution of letters without "relationship" but with
"diffusion" -i.e., without a key but with expansion of the number of
characters-, whereby a word is substituted for each letter, with the
intended letter embedded in the word, in keeping with a set rule. ibn
ad-Durayhim cites four methods under this type, pioneering in some,and taking up the others at the point where his predecessors had left
off. These methods are:
A) Substituting for a letter its spelling, or the spelling reversed,
or enciphering by synthesizing both elements in a certain
manner (e.g. by alternately writing the straight spelling of a
letter and the reversed spelling of the next letter).
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
39/216
26
The name ( ), by way of example, is enciphered by substitutingfor each letter its spelling thus: :
(= = = =) And by using this spelling reversed alternately thus: : The above rules give rise to "many ramifications"
13.
B) Encipherment by letters embedded in the words
conformably with a fixed rule; for example by taking the first
letter of each word, so that the name ( ) can be enciphered:( ); or by taking the last letter of each word where
() becomes: ( ).
It can also be done by taking the odd letters only, or even letters
only, or by leaving out a specific number of letters throughout. ibn ad-
Durayhim reports quite a few of these methods and their offshoots.
Those methods later came to be called the "Grille systems". Amongst
his examples of what may be brought under a regular Grille system is
"taking the first letter and then every fourth letter throughout, so that
in enciphering the words: ( ) you may write: " "14.
ibn ad-Durayhim further indicates another feasibility when merging
the cleartext in the ciphertext, so that it may be read inversely (i.e.,
backwards: contrary to the writing direction)15
. The use of this methodhas become familiar in the Grille systems later.
13See his treatise, p. 71.
14Ibid., p. 73.
15Ibid., p. 73.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
40/216
27
C) Substituting a word for a letter: There are many possibilities
for bringing this method to pass: letters may assume names of
people, stars, mansions of the moon, months (lunar, Latin, Coptic),
number of days in a month, hours of the day, days of the week,
book names, suras of the Koran, region names, ointments, drugs,
fruits, trees, etc.
It is well worth mentioning here that some of these systems had
been tackled by ibn Dunayn r16
in more detail.
D) Substituting for a letter a picture or representation of all
that can be symbolized -suggestive of rebus-, such as birds,
animals, plants, etc. What is really peculiar to ibn ad-Durayhim in
this connection is his indication of the special branched calligraph
which looks like fancy flourishes and tails, and is based on the
words of the numerical alphabet. Such calligraphy, in fact, stands
to his credit as the first of its kind to be mentioned; none of ibn ad-
Durayhim's predecessors whose treatises are covered in this study
had mentioned it. However, it has recently been revealed to us that
ibn Wa iyya, in his awq al-Mustah m f Ma rifat Rum z al-
Aql m (Seekers joy in identifying other languages writtensymbols), had already mentioned it.
1.3.2.7 Replacing letters by generic names(i.e. applying the relationship and diffusion method)
Encipherment in this type takes as a basis changing letter forms,
using conceptual relationship and diffusion. ibn ad-Durayhim's
utilization of al-Kind 's term of "conceptual relationship and
diffusion" highlights the importance of the latter's treatise and its far-
reaching impact on his successors. "This," ibn ad-Durayhim notes,
"relates to what has been denominated 'relationship and diffusion',
where a genus or species is representative of a letter."17
16 See his treatise: Maq id al-Fu l al-Mutar ima an all at-tar ama; from
"Collected Papers on Cryptology", 64/A.17
See his treatise, p. 79.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
41/216
28
The following (Table 1.10) is a table of the generic names which
stand for each letter of the Arabic alphabet, as given by ibn ad-
Durayhim. It is interesting to notice that the first letter of the name of
genus in Arabic is the letter to be ciphered:
a People b Vegetable t Dates, soil, or spices
Clothing Leather
Cereals or iron Wood
d Animals or ointments Gold
r Aromatic plants z Glass s Weaponry or fishes
Months, hair, or chess Dyes, brass, gum, or wool Light or regions
Birds
Dark or deer Perfume, eyes (or springs), or number (or tools) Sheep
f Fruits q Villages or reed k Books or planets l Milk m Towns n Stars or cooper w Wild animal, currency (coin), or paper
h Vermin, pests, etc. l Scissors y Jewellery
Table 1.10: A list of generic names which match the Arabic alphabet,used by ibn ad-Durayhim.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
42/216
29
To be noted is the clear uniformity in designation between ibn ad-
Durayhim's statements here and al-Kind 's exemplifications in his
treatise, as well as ibn Dunayn r's tables18
. ibn ad-Durayhim's new
contribution manifests itself in indicating various possibilities of
methods and their number. Thus, he handles encipherment in terms of
genus/species relationship and the resultant cipher alphabets, some of
which are "restricted", or "committed", others are not. He says: "From
this emerge thirty-two cipher alphabets, the first of which is
unrestricted, the second is restricted to the letter (), the third to the
letter (), and so on till the end of the alphabet"19
. The cipheralphabets he mentions are the following arrangement:
1 unrestricted.
29 each restricted to one letter of the alphabet.
1 by changing the restriction according to the numerical-alphabet order.
1 by changing the restriction according to alphabetical order.
-----
32 cipher alphabets
1.3.2.8 Using invented symbols or signs torepresent letters
With this type ibn ad-Durayhim concludes his discussion of
encipherment methods. This is a variety of simple substitution he
would utilize in his examples on cryptanalysing. The keynote of the
method is substituting for each letter of the clear alphabet a distinctive
symbol. Among its conveniencies are the susceptibility to fill up
spaces with hyphens, dots, blanks, circles; or by a symbol similar to
that devised for the letters. Applicable to this method also is the
addition of extra symbols; namely, nulls which render cryptanalysismore complicated.
18Maq id al-Fu l al-Mutar ima an all at-tar ama; from "Collected Papers on
Cryptology", 64/A.19
See his treatise, p. 79.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
43/216
30
However, ibn ad-Durayhim could be criticized for bypassing the
possibility of sparing the space; what ibn Adl n termed "the no-word-
spacer cryptogram", or "al-mudma ". This spells ibn Adl n's
superiority as concerns the presentation of cryptanalysis methods.
1.3.3 Morphological introduction
In this significant introduction, ibn ad-Durayhim sums up some
linguistic information on the Arabic language (linguistic,morphological and phonetic rules). He deems that it is an
indispensable precondition for working out cipher. He says:
"Cryptanalysing the afore-stated and all kindred ciphers needs a
'genial' introduction that serves as a guide"20
. The contents of ibn ad-
Durayhim's introduction may be summarized as follows:
A. On word-length
- Definition of the "word" according to "writers" and grammarians,
and the fact that cryptology is more concerned with the "writers"
definition.
- The shortest word in Arabic is one letter, and the longest word isfourteen letters, depending on the word being a noun, a verb or
an article.
- The maximum length of a noun prior to affixation is five letters.
- The maximum length of a verb prior to affixation is four letters.
- No word of four- or five- letter root is devoid of at least one of the
"liquid letters"; i.e. the letters: ( ).
B. The maximum repetition of a letter in one word
- The same letter can be repeated in one word five consecutive
times at the very most.
20See his treatise, p. 85.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
44/216
31
C. Combinable letters
These are of various kinds:
- Non-combinable letters (neither in anterior nor in posterior
positions).
- Combinable in anterior position only.
- Combinable in posterior position only.
- Letter repetition at the beginning of words.
ibn ad-Durayhim elaborates these kinds with highly admirable
competence. We have opted for devoting an independent study to the
related linguistic information, abundant in books on cryptology,
particularly those reported by al-Kind , ibn Dunayn r, ibn Adl n andibn ad-Durayhim.
The following table (Table 1.11) covers the cases of the non-
combinable letters, those non-combinable in anterior position only, or
in posterior position only, as given by ibn ad-Durayhim in his treatise
Mift al-Kun z.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
45/216
32
Letter symbol Letters non-combinable
with it
Resultant non-combinable bigrams
Table 1.11: Table of non-combinable letters as observed by ibn ad-Durayhim
Key: post-positively (posteriorly)
pre-positively (anteriorly)neither post- nor pre-positively.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
46/216
33
1.3.4 Algorithm for cryptanalysis
ibn ad-Durayhim's algorithm for breaking a message enciphered by
substitution may be summed up by the following stages:
a) Counting the letters or symbols.
b) Checking the times of recurrence of each letter or symbol.
c) Cryptanalysing the space, so as to properly separate the words.
d) Matching the symbol or letter frequency of occurrence in the
cryptogram against the frequency of the language letters. ibn ad-
Durayhim stresses the decisive importance of the message being
long enough to allow for acceptable matching.e) Utilizing word lengths (two-character words, three- character
words,) and the probable word principle.f) Making use of the fact that the letters preceding () at the
beginning of a word may, all too often, be: (), (), (), or ().
It merits consideration that ibn ad-Durayhim, unlike al-Kind , ibn
Dunayn r and ibn Adl n, departs from observing the same letter
order; instead, he depends on the statistics of letters of the Holy
Koran. Again, unlike his predecessors, he considers () a letter of thealphabet.
1.3.5 Two practical examples of cryptanalysis
ibn ad-Durayhim concludes with an interesting minute analysis of
two examples ciphered by substitution, utilizing devised symbols or
shapes as ciphertext replacements. The researcher would find that, for
the most part, al-Qalqa and 's quotations21
have been derived fromthese very examples. David Kahn
22believes that ibn ad-Durayhim's
work was "the first exposition on cryptanalysis in history". In fact, and
as a result of our subsequent investigation, it was brought home to usthat it was al-Kind , ibn Dunayn r and ibn Adl n who actually took
21See ub al-'A , 9/240 and 245. (Published by al-Mu'assasa al-Mi riyya al-mma, 1963)
22See his book: The Codebreakers, p. 96.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
47/216
34
the lead, since the earliest of those mentioned, al-Kind , lived fivecenturies ahead of ibn ad-Durayhim! Still, there is no gainsaying the
merit of ibn ad-Durayhim's treatment of cryptanalysis as the most
detailed of all the past cryptographic legacy handed down to us
through generations.
1.4 Originality of ibn ad-Durayhim
From our analysis of ibn ad-Durayhim's treatise we arrive at the
following conclusions:1. ibn ad-Durayhim's originality manifested itself first and foremost
in his explanation and analysis of ciphering methods, their
individual capabilities and qualifications, especially the
substitution cipher. His originality was more evident in
cryptography than cryptanalysis.
2. We believe that he was familiar with ibn Dunayn r's treatise
Maq id al-fu l al-mutar ima an all at-tar ama. This is
evident from the uniformity in using some encipherment devices
and methods, such as the chessboard, thread, beads, and the
decimal numerical alphabet (i.e. the arithmetic using decimally-
weighted letters: is b al- ummal); unlike al-Kind and ibn
Adl n who did not make any reference to them.3. ibn ad-Durayhim did not refer to composite encipherment,
neither did he mention the no-word-spacer encipherment as ibn
Adl n had done a century earlier. Similarly, he only made a
passing reference to ciphering poetry.
4. As noted before, al-Kind and ibn Adl n made no attempt todeal with the decimal numerical alphabet, contrary to ibn
Dunayn r who paved the way, and ibn ad-Durayhim whocontinued along his lines.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
48/216
Chapter 2
ibn ad-Durayhim's edited
treatise:Mift al-Kun z f ' al-Marm z
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
49/216
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
50/216
37
2.1 Editing methodology
The main purpose of editing is the reproduction of a text as close to
the author's original as possible. In line with this objective we have
opted for conserving the statement of the original whenever possible.
The very nature of the original manuscripts required theaddition -where appropriate- of explicatory titles in the
interest of marking out divisions or classifications. This
would prove useful for easy understanding and clarity of
ideas.
No effort has been spared in the interpretation of citations(Koranic verses, Prophetic traditions, lines of poetry,
sayings, etc.) contained in the treatises. We have given brief
biographical identification of personalities, relegating the
interested reader to such authorities as al-A l m by ayr al-
D n al-Zirkily or Mu am al-mu'allifn by Omar Ri
Ka ala, for further and more detailed biographicalreference. Those citations and personalities that our efforts
fell short of their interpretation or identification have also
been properly recorded.
In explaining the linguistic terms included in the treatise wehave made use of various dictionaries, old and modern,
foremost of which are: Lis n al- Arab and Matn al-lu a.
Unless otherwise helpful, no reference has been made to
any dictionary.
We have adopted the same symbols and signs commonlyemployed by editors of Arabic manuscripts. We conformed
to the modern spelling norms, and we enclosed requisite
contextual additions -i.e. explanatory insertions and
comments other than the writer's own words- within square
brackets [ ]; examples illustrating rules of encipherment
have been set off by round brackets (parentheses) ( ); booktitles in italics, quoted material and Prophetic traditions
have appeared within quotation marks , while floralbrackets have been used to enclose Koranic verses.
23
23Translator's explanatory additions are placed between pairs of hyphens: --.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
51/216
38
2.2 Description of the manuscript
The original manuscript is part of an assemblage of small-sized
sheets, comprising several treatises on such occult sciences as
numerology (z yir a), divination ( afr), al-awf q, geomancy,
talismans, and others. The assemblage is handwritten in fine
penmanship, and housed in 'As ad 'Afand 's Library of as-
Sulaymaniyya Ottoman Archives in Istanbul, under the number 3558.
The first sheet is an index, written by the scribe, of the titles of
treatises included. Each title is written in two lines, with the number of
the first sheet of each treatise affixed thereunder. The index reads asfollows:
"What is contained in this unique paper:
ar ka f ar-r n f al-z yir a ................................................. 2(Exposition of " " unveiling in "z yir a").
ar bayt minh , by al- amr ............................................... 11(al- amr 's exposition of a line of the above).
'Isti r al-'a wiba min al- afr al- mi .............................. 14(Drawing the answers out of the extensive afr).
F naw m s al- aw riq lil- d t............................................ 27
(On the laws of the supernatural). Man mat al-'Im m al-Sabt ................................................. 41
(al-'Im m al-Sabt 's poems).
Mift al-Kun z f ' al-Marm z ...................................... 47(Key to treasures on clarifying ciphers).
all at- illasm f al-z yir a .................................................... 60(Solution of talisman in z yir a).
Ad-durra al-munta aba f al-'a wiba .................................... 63(The gem: a collection of answers).
F al-'awf q al-mu awwaqa .................................................... 67(On confined 'awf q).
'Istin q al-'a ruf min al-' y t................................................ 74(Elicitation of letters from Koranic verses).
Ras 'il f al-raml, by Na r a - s ......................................... 77(Na r a - s 's treatises on geomancy).
Kit b al-'akt f......................................................................... 80(The book of al-'akt f).
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
52/216
39
F al-mu ammas al- l al-wasa ........................................ 85(On poetical quintets).
Da aw t as-s t, by al-Ba n ............................................... 89(al-Ba n 's invocations of times).
F ilm al-'awf q, by al-qabb n ........................................... 102(On al-'awf q science by: al-Qabb n ).
ar sim al-hindiyya f al-wafq ............................................. 105(On letters and their secrets)
Kalim t ibn al a f al-waq 'i ............................................ 109
(ibn al a 's words on events). Bay n as-s a, by as-Suy ............................................... 121"
(On Doomsday)
Beside the last title the scribe has made this note:
" "(i.e. copied by the poor scribe),
immediately appended by a seal on which has been inscribed in
Persian-style Arabic script: "My lord, I ask Thee a creditable end". ibn
ad-Durayhim's treatise, whole and complete, occupies the pages 47/B
to 59/A, and closes with a colophon of the scribe's name and date of
copying.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
53/216
40
Figure 2.1: A photocopy of the index of the assemblage incorporating
ibn ad-Durayhim's treatise(Document No. 3558, as-Sulaym niyya Ottoman Archives, Turkey)
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
54/216
41
Figure 2.2: A photocopy of the first page of ibn ad-Durayhim's
treatise(Document No. 3558, as-Sulaym niyya Ottoman Archives, Turkey)
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
55/216
42
Figure 2.3: A photocopy of a page of ibn ad-Durayhim's treatiseillustrating encipherment using the "branched" calligraphy
(Document No. 3558, as-Sulaym niyya Ottoman Archives, Turkey)
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
56/216
43
Figure 2.4: A photocopy of a page of ibn ad-Durayhim's treatisedemonstrating the encipherment of the first of two examples.
(Document No. 3558, as-Sulaym niyya Ottoman Archives, Turkey)
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
57/216
44
Figure 2.5: A photocopy of a page of ibn ad-Durayhim's treatisedemonstrating the encipherment of the second of two examples.
(Document No. 3558, as-Sulaym niyya Ottoman Archives, Turkey)
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
58/216
45
Figure 2.6: A photocopy of the encipherment of ibn ad-Durayhim's
second example as set out in ub al-'A 9/245.
(Published by al-Mu'assasa al-Mi riyya al- mma, 1963)
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
59/216
46
Figure 2.7: A photocopy of the last page of ibn ad-Durayhim's
treatise.(Document No. 3558, as-Sulaym niyya Ottoman Archives, Turkey)
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
60/216
47
2.3 Ali ibn ad-Durayhim Treatise
on Cryptanalysis
(Original Arabic Text and English Translation)
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
61/216
48
Mift al-kun z f '
al-marm z
by
Al ibn ad-Durayhim
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
62/216
50
In the name of God
the Most Gracious, the Most Merciful.
[Introduction]
Glory be to God, who set out with the creation of the pen, disposeth
it on the guarded tablet, and dealt out tongues amongst nations. He is
the Omniscient, Knower of all secrets. Praise be to Him who made
known something of His knowledge. We profess that there is no god
but Allah, the One without partner, and that Mu ammad is His
prophet to all people and His favourite whom He brought so nigh to
Him, and made the seal of prophets. May God's blessing and peace
without end be upon him and his noble household and companions.
I had earlier written a book on the formulation of ciphers and their
cryptanalysis, which I called: ' al-mubham f all al-mutar am
(The clarification of ambiguities in cryptanalysing cipher texts). A
period of time had elapsed since I abridged it. I had no other copy in
my possession. Who must be obeyed, and whose request cannot be
refused, asked me to write this book. I have thus put down what came
to my mind of the rules and regulations of this art, and I have written
this preface in order to explain the sructure of the book and facilitate
its comprehension, God willing. I have called my book Mift al-
Kun z f ' al-Marm z (Key to treasures on clarifying ciphers). I
pray to God for help and success, most sufficient unto us is He in
whom we trust.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
63/216
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
64/216
52
Know that cryptanalysing cipher texts and cryptograms is a very
worthy cause. It is indispensable in times of need, and useful in
understanding the symbols of the ancients in their sciences and books
and other material they have bequeathed.
* * *
[Essentials for those practicing cryptanalysis]
-The cryptanalyst's tools-
It is necessary for one experiencing cryptanalysis to develop a
thorough knowledge of the cryptogram language he seeks to
cryptanalyse, as well as the language grammar.
He should also know the frequency of occurrence of letters and
their order, such as long vowels which have the highest frequency of
occurrence in all languages. Letters of highest frequency in certain
languages are (a) "alif" in Arabic, (s) in Latin and Armenian, and (n)
in Mongol.
According to the numerical alphabet, all calligraphs have
detachable letters short of Mongol, Syriac and Arabic, of which
letters can be both detachable and conjoint. Syriac letters are detached
and conjoined as in Arabic.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
65/216
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
66/216
54
The shortest of all calligraphs [alphabets] is Mongol, consisting of
17 letters; the longest Armenian: 36 letters; the Turkish 20 letters, and
as many for the Persian calligraph, with three letters in it not in the
Turkish, namely, h ( ). It follows that there are three) ), and) ), f
lettersintheTurkishcalligraphnotthereinthePersian,namely, ( ),
( ) and q (), with the letters: (), (), (), ( ) and ( )
absent.
The Hebrew, Syriac and Astank ly calligraphs are made up of 22
letters each, i.e. from the letter () to the letter () of the numerical
alphabet. The French and Latin are 27 letters; the old Latin and Greek
24 letters (these two have another calligraph of 30 letters for the
uncertain of their letters); the Coptic 32 letters (it also has a numerical
alphabet). One Hindi calligraph differs in their language from that of
their numerical alphabet which comprises 28 letters in nine forms with
the following orders: (,,,,,
,, and ).For some Indians there is another calligraph of 52 letters called the
triangular Hindi. The Sumerian calligraph is four letters less than the
Hebrew. The letters wanting, being from the Old Testament, are:
hamza(), (), ()andh();sofor(,, , and)
they say: ( , , and ) ) respectively, with (
pronounced halfway between and and all in the same enunciation.
They have no such letter as (), and the letters () and hamza ()may on occasion be pronounced as such, thus ( ) may be
pronounced (), and would probably be enunciated ( ).
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
67/216
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
68/216
56
Encipherment methods are of various types, too many to
enumerate. I mean to mention the basic principles and rules that
govern their laws.
* * *
[Types of encipherment]
Some people opt for changing places of the letters within a
cryptogram, conformably with some criteria. This is called the
transposition type.
[1. On transposition]
By writing a word in reverse, e.g. ( ) is enciphered::); () ).
By writing the last letter first thus: ( : ), (:.(
By transposing the first letter of a word with the last, e.g.( : ), (: ).
By changing positions of even letters with odd letters, e.g.( : ), (: ). This rule may be extended forapplication in multi-word texts; thus: (plaintext) becames: (ciphertext).
By transposing the first letter of a word with the thirdletter, e.g. ( : :), ( ), ( : ); or bybringing every two consecutive letters in front of the
preceding two. This can be done throughout a multi-word
message, looking at it as an integral whole, e.g. (plaintext): (ciphertext), or withinindividual words, e.g. : .
By transposing the first letter of a word with the fourth,
e.g. ( : ), ( : ). This, again, may beobserved for a multi-word text, tackled as one integralunit.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
69/216
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
70/216
58
By alternating one initial letter of a word with the
corresponding terminal one until the word is exhausted,
in terms of the ascending alternate horizontal
transposition, e.g. ( ) :) is enciphered ) , ( :) ) and : -). This process also holds in multiword texts; that is by taking alternately one letter from the
beginning followed by the corresponding letter from the
end of the message until all are used. This method may be
performed the other way round, namely in term of the
descending alternate horizontal transposition, starting
from the end of the message by taking alternately one
letter from the end followed by the corresponding letter
from the beginning until all are used. Thus: ( isenciphered: ), ( : ) ) and : ). Thisprocess, again, also holds in multi-word texts.
By taking the words of the text in pairs (1), transposing
the first letter of one word with the first letter of the other
word, e.g. (clear): (cipher),
(2) or transposing the last letter of one word with the lastletter of the other, e.g. (clear): (cipher), (3) or transposing the first letter of one withthe last letter of the other; so that the above example is
enciphered: , (4) or transposing the last letterof one with the first of the other, so that the above
example is enciphered: , (5) or, as an extra measure, transposing the first letter of one word with the
first letter of the other, while simultaneously transposing
the last letter of one word with the last letter of the other.Thus, the example: would be written incipher: , (6) or transposing the first letter of one word with the last letter of the other, and the
last letter of one with the first letter of the other. In so
doing, the above example is enciphered: .
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
71/216
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
72/216
60
By taking every other letter right through, dropping theothers for the time being, the intended plaintext is
obtained. Letters dropped are now considered in the same
way to complete the text, e.g. (clear): (cipher). You can also take one letter anddrop two till the end. You do the same with the second
letter, then with the third. So you write the above
example: . You may take one letter andleave out the following one, or four, five, etc.. letters as
you please. Anyhow, it is advisable to separate words by
as many spaces as the cipher alphabets according to afixed rule. The above example would be written, using
the last mentioned method: . From this agood many configurations arise, all of which are the very
letters constituting a message, no more, no less, but
transposed.
[2. On substitution]
-Encipherment of this type can be exercised-:
By always substituting a specific letter for anotheraccording to a set key, as in the Qummi cipher
alphabet represented by this line of verse:
in which the letter m () is substituted for the letter k (), and
vice versa, the letter o () for () and the other way round, and
so forth. Accordingly, the word ( ) , for instance, is
enciphered: ( ), (: ), and ( : .(
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
73/216
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
74/216
62
There is another cipher alphabet represented by this verse:
so that the word () is written in cipher: ( ).
And also the Fahlawi cipher alphabet:
e.g. ( : ), ( : ) ,( : ). This relates to theunregulated encipherment by substitution, which is generative of
innumerable cipher alphabets.
Usingthenumericalalphabetorder,bysubstitutingforeach letterthe one immediately following; thus the letter () is substitutedfor (), and () for (), and so on until the end. The letter () issubstituted for (). This is because letters are like a circle, [i.e.they are viewed as located on a circle circumference or a disc] in
that the last letter is replaceable by the first letter as if to follow
or preceded it. Example: (clear text): (cipher text).You may substitute for each letter every third letter next to it, so
that (clear) becomes (cipher), and ( : ); or every
fourth letter, so that ( becomes: ) and ( : ) and soon and so forth till the end of letters. This results in 28 cipher
alphabets. By considering the numerical alphabet as composed of pairs of
letters; the substitution is performed between the letters within
each pair. So the word ( is enciphered: ) and ( : ).The pairs are formed by systematically taking every letter with
the one immediately following it; or with every third letter next
to it, e.g. ( : ), ( : ,); or with every fourth, fifthetc.. letter next to it.
Alternatively, -similar to this last-mentioned method- bysubstituting for a letter the one preceding it. This would bring
about a number of cipher alphabets amounting to 58.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
75/216
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
76/216
64
But care should be taken, while considering the 112 cipher
alphabets, that the encipherer is not Maghrebi, since the order of
letters in our numerical alphabet is different from the
Maghrebi's, which runs as follows: , , , , , , , . And this is the order which a - ib , peace beon his soul, adopted for assigning symbols to reciters [in a well-
known poem attributed to him on the Koranic modes of
reading].
Adopting the alphabetical order, by substituting for each letter
the one immediately following, thus substituting the letter ()for () , () for (), () for (),etc. until the end. The letter () issubstituted for the (). Examples: (clear): (cipher),(: ). You may substitute for each letter every third letternext to it, so that the word is enciphered either in termsof the key in which the letter () goes before the letter ( ), or in terms of the key in which () follows ( ,). Also (plain): (cipher). This brings forth a number of cipheralphabets amounting to 29.
You can, in the same way, substitute for each letter the oneimmediately preceding; thus the letter () is substituted for (),the letter () for (), () for (), etc. Examples: ( : ),(: ). This engenders 29 cipher alphabets, too.
By considering the alphabet as composed of pairs of letters; the
substitution is done between the letters within each pair. The
pairs are formed by systematically taking every letter with the
one immediately preceding, e. g.: ( : ), ( : ,(adopting the cipher alphabet in which the letter ( ) precedes the
letter (). The () may be spared, or substituted leaving the ()out. In this manner substitution can be conducted by takingevery letter with every second, third, fourth, etc. preceding
letter, as already mentioned. This would produce 58 cipher
alphabets, too.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
77/216
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
78/216
66
Analogous to these four divisions in the Maghrebi system are 116
cipher alphabets. Their alphabet runs: (, , , , , , , , , , , ,
, , , , , , , , , , , , , , , , ). In substituting for a
letter the immediately preceding one, the word ( ), for instance,
becomes: ( ), and ( : ). All these cipher alphabets do not
involve any addition (augmentation) of letters.
[3. On the augmentation or reduction of the number of letters]
-This can be performed-:
By repeating all letters, or only odd letters.
By dropping a certain letter wherever it occurs, or choosing
pairs of letters with or without some charactaristic in common
-such as ( ) and ( ) respectively-, and regarding them as
single letters throughout.
By inserting an extra letter somewhere within each word, or
inserting a pair of similar or dissimilar letters, or adding a
certain letter (e.g. ()) to one word and another letter (e.g. ()) tothe next word, and so on until the end, using either the alphabet
,) , , .(, ) or the numerical alphabet (
By applying any of the above rules anywhere at will, thereby
producing many cipher alphabets.
[4. On the utilization of cipher devices]
The chessboard, which can be utilized by assigning each square
to a letter. The message is sent by placing certain chessmen onintended squares, and the reply is likewise received. In either
case the order of the alphabet (, , , , ) orthe numerical
alphabet () is observed.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
79/216
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
80/216
68
The punched board, with 28 holes standing for the letters. The
cryptogram is represented by a thread driven through the
intended holes so as to make a route defining the letters of the
message successively. To represent , for example, the thread
is driven through the holes: 1, 8, 13 and 4 consecutively, using
the numerical alphabet ( ). The algorithm for decipherment,
regardless of the length of the cryptogram, is by reading the
letters through which goes the thread. For each hole you write a
letter. The order of letters is then reversed so that the last one ismade the first. By so reading to the first letter, you are correct.
[5. On the replacement of letters using the decimally-weighted
numerical alphabet]
By substituting decimal numerical alphabet for letters in four
different ways: by writing the numbers in words as pronounced;
or by finger-bending, using the fingers to communicate the
message visually to a recipient; or by writing the numbers as
numerals, such as writing ( : fourty, eight, fourty, four); or bygiving the crytogram a semblance of a page of a financial
register.
By reconverting the cryptogram numerals into a number of
letters a method of encipherment which involves more
sophistication. There are many combinations that can be used in
this method; for example in ( : . . . .) ) or . .
.) ). One can even form delusive words such as . . ,(
or substitute two words for a letter, e. g. (: . . ,(
in which case a line is to be drawn over the two words to denote
that they represent one letter.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
81/216
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
82/216
70
By multiplying the number representing the letter by two, and so
write ( : ) and ( : ), etc.; or multiply it by
three, thus writing ( : ) ) and :
).
Numbers can also be multiplied by four or five.
[6. On the encipherment of letters by using words]
By substituting for a letter its spelling, or by alternately writing
the straight spelling of one letter and the reversed spelling of the
next, e.g. ( : ) ) and : ). One may start with
the reversed spelling followed by the straight, and so write
(: :) and ( ).
The above rules may be partly applied in various ways, giving
rise to many ramifications.
By feigning words, - conformably with a set rule -, in which the
intended letters are made to be the first letter of each word, sothat the word ( ), for example, may be enciphered:
( ), and ( : ); or the last letter of
each word, where ( ) becomes: ( ), and
(: ); or the middle letter of each word, thus ( )
may be expressed: ( ), and (: ), and
suchlike.
By taking the second letter of each feigned word, e.g.
( : ) ), and : ); or by taking the
third letter of each word throughout, e.g. ( : ),
and (: ), and so on.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
83/216
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
84/216
72
By taking from every three words the first letter of the firstword, the second letter of the second word and the third of the
third word, so the word ( ) would be enciphered:(
); or by adopting odd letters only, i.e. the first,third, fifth, etc., e.g. (clear): (cipher); or even letters only, -i.e. the second, fourth,sixth, etc.-, writing the same example in cipher thus:
( ). By taking up one letter and leaving out the next two letters, e.g.
( : ), and the
like. Conversely, some may start by leaving out rather thantaking up letters, so that, of the above example, the third, sixth,
ninth, etc. letters are taken. The cipher may look like this:
( ), and so on. Anothermethod is by taking the first letter and then every fourth letter
throughout, so that in enciphering the words: ( ),you may write:( ).You can of course start by leaving out letters rather than taking
them, as already stated, with a feasibility of dropping four, five,
etc. of the extraneous letters at a time while taking one
throughout the cryptogram.
The encipherer may choose to make his key known to therecipient. One way of doing that is to agree that starting the
cryptogram with the letter () suggests to the recipient that everysecond letter is to be taken, starting with the letter () meansthat every third letter should be taken, starting with () meansthat every fourth letter should be taken, and so on and so forth.
Some start by enciphering the opening: ( ,( from which the key is detected without toil and applied all
through.
In so merging ciphertexts with plaintexts, the cryptogram maybe made to read backwords, i.e. from left to right.
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
85/216
-
8/7/2019 Arabic Origins of Cryptology Vol. 3
86/216
74
The encipherer can substitute for a letter a proper name, so thatevery letter of the cryptogram is represented by the name of aperson. He may also build on the names of stars, mansions ofthe moon, (either according to respective letters of the numericalalphabet or at random; thus the lunar mansions are insuccession: ura n (for ), Bu n (for ), Pleiades (for ), and soon until the last one, Ra (for the letter )), months (lunar,Latin, Coptic, etc.), the number of days in a month, hours of theday, days of the week and its hours, book names, suras of theKoran, names of countries, ointments, drugs, an n t
*, fruits,
trees, etc., or any other word of his choice repeated every timethe letter it represents occurs. The cryptographer may performthat verbally, in writing, or as a picture or symbol, such as birds,
animals, plants or trees, whichever he pleases. It is well worth mentioning here the branched calligraph, which
is based on the words of the numerical alphabet , andpracticable in writing only - i.e. not feasible verbally -. The firstletter of the cryptogram is represented by a single branch on theright of the trunk if that letter is o