NOL
Mathematical recreations and problems of past and present times

Chapter 54

CHAPTER XVIII.

CRYPTOGRAPHS AND CIPHERS.
The art of constructing cryptographs or ciphers — intelligible to those who know the key and unintelligible to others — has been studied for centuries. Their usefulness on certain occasions, especially in time of war, is obvious, while their right interpre- tation may be a matter of great importance to those from whom the key is concealed. But the romance connected with the subject, the not uncommon desire to discover a secret, and the implied challenge to the ingenuity of all from whom it is hidden, have attracted to the subject the attention of many to whom its utility is a matter of indifference.
Among the best known of the older authorities on the subject are J. Tritheim of Spanheim, G. Porta of Naples, G. Cardan, J. F. Niceron, J. Wilkins, and E. A. Poe. More modern writers are J. E. Bailey in the Encyclopaedia Britan- nica, E. B. von Wostrowitz of Vienna, 1881, F. Delastelle of Paris, 1902, and J. L. Kluber of Tubingen, 1909. My know- ledge, however, is largely the result of casual reading, and I prefer to discuss the subject as it has presented itself to me, with no attempt to make it historically complete.
Most writers use the words cryptograph and cipher as synonymous. I employ them, however, with different mean- ings, which I proceed to define.
A cryptograph may be defined as a manner of writing in which the letters or symbols employed are used in their normal sense, but are so arranged that the communication is intelligible
396 CRYPTOGRAPHS AND CIPHERS [CH. XVIII
only to those possessing the key: the word is also sometimes used to denote the communication made. A simple example is a communication in which every word is spelt backwards. Thus:
ymene deveileb ot eh gniriter troper noitisop no ssorc daor.
A cipher may be defined as a manner of writing by characters arbitrarily invented or by an arbitrary use of letters, words, or characters in other than their ordinary sense, intelligible only to those possessing the key: the word is also sometimes used to denote the communication made. A simple example is when each letter is replaced by the one that immediately follows it in the natural order of the alphabet, a being replaced by 6, b by c, and so on, and finally 2 by a. In this cipher the above message would read:
fofnz cfm^fwfe up cf sfujsjoh sfqpsu qptjujpo po dsptt spbe.
In both cryptographs and ciphers the essential feature is that the communication may be freely given to all the world though it is unintelligible save to those who possess the key. The key must not be accessible to anyone, and if possible it should be known only to those using the cryptograph or cipher. The art of constructing a cryptograph lies in the concealment of the proper order of the essential letters or words : the art of constructing a cipher lies in concealing what letters or words are represented by the symbols used.
In an actual communication cipher symbols may be arranged cryptographically, and thus further hinder a reading of the message. Thus the message given above might be put in a cryptographic cipher as
ZTifof efiufjmfc pufc hojsjufs uspqfs opjujtptq op ttpsd ebps.
If the message were written in a foreign language it would further diminish the chance of it being read by a stranger through whose hands it passed. But I may confine myself to messages in English, and for the present to simple cryptographs and ciphers.
A communication in cryptograph or cipher must be in
CH. XVIIl] CRYi'TOGRAPHS AND CIPHERS 397
writing or in some permanent form. Thus to make small muscular movements — such, ex. gr., as talking on the fingers, or breathing long and short in the Morse dot and dash system, or making use of pre-arranged signs by a fan or stick, or flashing signals by light — do not here concern us.
The mere fixct that the message is concealed or secretly conveyed does not make it a cryptograph or cipher. The majority of stories dealing with secret communications are concerned with the artfulness with which the messasfe is con- cealed or conveyed and have nothing to do with cryptographs or ciphers. IMany of the ancient instances of secret communi- cation are of this type. Illustrations are to be found in messages conveyed by pigeons, or wrapped round arrows shot over the head of a foe, or written on the paper wrapping of a cigarette, or by the use of ink which becomes visible only when the recipient treats the paper on which it is written by some chemical or physical process.
Again, a communication in a foreign language or in any recognized notation like shorthand is not an instance of a cipher. A letter in Chinese or Polish or Russian might be often used for conveying a secret message from one part of England to another, but it fails to fulfil our test that if published to all the world it would be concealed, unless sub- mitted to some special investigation. On the other hand, in practice, foreign languages or systems of shorthand which are but little known may serve to conceal a communication better than an easy cipher, for in the last case the key may be found with but little trouble, while in the other cases, though the key may be accessible, it is probable that there are only a few who know where to look for it.
Cryptographs. I proceed to enumerate some of the better known types of cryptographs. There are at least three distinct types. The types are not exclusive, and any particular crypto- graph may comprise the distinctive feature of two or all the types.
First Type of Cryptographs {Transposition Type). A crypto- graph of the first type is one in which the successive letters
398 CRYPTOGRAPHS AND CIPHERS [CH. XVIII
or words of the message are re-arranged in some pre-determined manner.
One of the most obvious cryptographs of this type is to write each word or the message itself backwards. Here is an instance in which the whole message is written backwards:
tsop yh tnes tnemeergafo seniltuo smret ruo tpecca yeht.
It is unnecessary to indicate the division into words by leaving spaces between them, and we might introduce capitals or make a pretence of other words, as thus :
Ts opyhtne sine meer gafos eniltu 0 smret ruot peccaye ht.
A recipient who was thus mis-led would be very careless. Preferably, according to modern practice, we should write the message in groups of five letters each : the advantage of such a division being that the number of such groups can be also communicated, and the casual omission of letters thus detected.
Systems of this kind which depend on altering the places of letters or lines in some pre-arranged manner have always been common. One example is where the letters which make up the communication are written vertically up or down. Thus the message : The pestilence continues to increase, might be written thus:
eio tnlit
sntioeth
acsncnse
ereuecep.
The cryptograph might be further obscured by writing the 32 letters according to the Route Method described below.
Another method is to write successively the 1st, 18th, 35th letters of the original message, and then the 2nd, 19th, 36th letters, and so on. If, however, we know the clue number, say c, it is easy enough to read the communication. For if it divides into the number of letters n times with a remainder r it suffices to re-write the message in lines putting ?i -I- 1 letters in each of the first r lines, and n letters in each of the last c — r lines,
CH. XVIIl]
CRYPTOGRAPHS AND CIPHERS
399
and then the communication can be read by reading the columns downwards. For instance, if the following communication, containing 270 letters, were received: Ahtze ipqhg esoae ouazs eseiua eqtonu sfdth enzce sjteo ttqiz yczht zjioa rhqet tjrfe sftnz mroom ohyea rziaq neorn hreot lennk aerwi zesju asjod eziojz zszjb rritt jnfjl weuzr oqyfo htqay eizsl eopji dihal oalhp epkrh eanaz srvli irnosi adygt pekij scerq vvjqj qctjqn yjint kaehs hhsnh goaot qefqe miesa yquni tpebq stzam ztqrj, and the clue number were 17 we should put 16 letters in each of the first 15 lines and 15 letters in each of the last ^ lines. The communication could then be discovered by reading the columns downwards : the letters J, q and z marking the ends of w^ords.
A better cryptograph of this kind may be made by arranging the letters cyclically, and agreeing that the communication is to be made by selected letters, as, for instance, every seventh, second, seventh, second, and so on. Thus if the communication were Ammunition too low to allow of a sortie, which consists of 32 letters, the successive significant letters would come in the order 7, 9, 16, 18, 25, 27, 2, 4, 13, 15, 24, 28, 5, 8, 20, 22, 1, 6, 21, 26, 11, 14, 32, 10, 31, 12, 17, 23, 3, 29, 30, 19— the numbers being selected as in the decimation problem given above at the end of chapter I, and being struck out from the 32 cycle as soon as they are determined. The above communication would then read Ttrio oalmo laoon msueo aivotn lioti fw. This is a good method, but it is troublesome to use, and for that reason is not to be recommended.
In another cryptograph of this type, known as the Route Method, the words are left unaltered, but are re-arranged in a
11
8
13
2
15
4
w
X
1
10
17
6
y
z
9
12
7
14
8
16
5
pre-determined manner. Thus, to take a very simple example, the words might be written in tabular form in the order shown
^QQ CEYPTOGEAPHS AND CIPHEES [CH. XVIU
in the diagram, certain spaces being filled with dummy words xvz,..., and the message being sent in the order U, 8 13 2, 15 4 w X 1 .. This method was used successfully by the Fe'de^als iA the American Civil War, 1861-1865, equivalents for proper names being used. It is easy to work, but the key would soon be discovered by modem experts.
A double cryptograph is said to have been used by the Nihilists in Russia from 1890-1900. Such double transpo- sitions are always awkward, and mistakes, which woxdd make the message unintelligible, may be easily introduced but if time is of little importance, and the message is unlikely to fall into the hands of any but ordinary officials, the concealment is fairly effective, though a trained specialist who had several messages in it could work out the key.
Second Type of Cryptographs. A cryptograph of the second tvne is one in which the message is expressed m ordinary writing, but in it are introduced a number of dummies or non significant letters or digits thus concealmg which of the letters
are relevant. ,
One way of picking out those letters which are relevant is by the use of a perforated card of the shape of (say) a sheet of note-paper, which when put over such a sheet perniits only such letters as are on certain portions of it to be v.sibla Such a card is known as a grille. An example of a grille with four openings is figured below. A communication made in this
\
way may be easily concealed from anyone who does not possess a card of the same pattern. If the recipient possesses such
CH. XVIIl]
CKYl'TOGRAPHS AND CIPHERS
401
a card he has only to apply it in order to read the message. This method was used by Richelieu.
The use of the grille may be rendered less easy to detect if it be used successively in different positions, for instance, with the edges AB and CD successively put along the top of the paper containing the message. Below, for instance, is a message which, with the aid of the grille figured above, is at once intelligible. On applying the grille to it with the line AB along the top HK we get the first half of the communica- tion, namely, 1000 i^ifles se. On applying the grille with the
H
K
981 NTT
261
070
523
479
100
OKI
SON
SON
AHY
DTG
BFS
PUM
OLT
KFE
LJO
EGX
AEU
QJT
EGO
FLE
HVE
WLA
FML
AES
REM
REM
ODA TIM
^SE
YZZ
EPD
QJC
EKS
OEF
line CD along the top HK we get the rest of the message, namely, nt to L to-day. The other spaces in the paper are filled with non-significant letters or numerals in any way we please. Of course any one using such a grille would not divide the sheet of paper on which the communication was written into cells, but in the figure I have done so in order to render the illustration clearer.
We can avoid the awkward expedient of having to use a perforated card, which may fall into undesired hands, by introducing a certain pre-arranged number of dummies or non-significant letters or symbols between those which make up the message. For instance, we might arrange that (say) only every alternate second and third letter shall be relevant. Thus the first, third, sixth, eighth, eleventh, &c., letters are those that make up the message. Such a communication would be two and a half times as long as the message, and this might
26
B. R.
402
CRYPTOGRAPHS AND CIPHERS
[CH. XVIII
be a great disadvantage if time in sending the message was of importance.
Another method, essentially the same as the grille method, is to arrange that every nth. word shall give the message, the other words being non-significant, though of course inserted as far as possible so as to make the complete communication run as a whole. But the difficulty of composing a document of this kind and its great length render it unsuitable for any purpose except an occasional communication comj)osed at leisure and sent in writing. This method is said to have been used by the Earl of Argyle when plotting against James II.
Third Type of Cryptographs. A kind of secret writing which may perhaps be considered to constitute a third type of cryptograph is a communication on paper which is legible only when the paper is folded in a particular way. An example is a message written across the edges of a strip of paper wrapped spiral-wise round a stick called a scytale. When the paper is unwound and taken off the stick the letters appear broken, and may seem to consist of arbitrary signs, but by wrapping the paper round a similar stick the message can be again read. This system is said to have been used by the Lace- demonians. The concealment can never have been effectual against an intelligent reader who got possession of the paper. As another illustration take the appended communication which
^■^^
4;
^m^^^wm^-\^^^-h'\^m:^^^
B
B
c^^SH
is said to have been given to the Young Pretender during his wanderings after Culloden. If it be creased along the lines BB and (70 (CO being along the second line of the second score), and then folded over, with B inside, so that the crease 0 lies
CH. XVlIl] CRYPTOGRAPHS AND CIPHERS 403
over the line A (which is the second line of the first score) thus leaving only the top and bottom of the piece of paper visible, it will be found to read Conceal yourself, your foes look for you. I have seen what purports to be the original, but of the truth of the anecdote I know nothing, and the desirability of con- cealing himself must have been so patent that it was hardly necessary to communicate it by a cryptograph.
Cipliers. I proceed next to some of the more common types of ciphers. It is immaterial whether we employ special char- acters to denote the various letters ; or whether we use the letters in a non-natural sense, such as the letter z for a, the letter y for h, and so on. In the former case it is desirable to use symbols, for instance, musical notes, which are not likely to attract special notice. Geometrical figures have also been used for the same purpose. It is not even necessary to employ written signs. Natural objects have often been used, as in a necklace of beads, or a bouquet of flowers, where the different shaped or coloured beads or different flowers stand for different letters or words. An even more subtle form of disguising the cipher is to make the different distances between consecutive knots or beads indicate the different letters. Of all such systems we may say that a careful scrutiny shows that different symbols are being used, and as soon as the various symbols are distinguished one from the other no additional complication is introduced, while for practical purposes they give more trouble to the sender and the recipient than those written in symbols in current use. Accordingly I confine myself to ciphers written by the use of the current letters and numerals. There are four types of ciphers.
First Type of Ciphers. Simple Substitution Alphabets. A cipher of the first type is one in which the same letter or word is always represented by the same symbol, and this symbol always represents the same letter or word.
Perhaps the simplest illustration of a cipher of this type is to employ one language, written as far as practical in the alphabet of another language. It is said that during the Indian Mutiny messages in English, but written in Greek
26—2
404 CRYPTOGRAPHS AND CIPHERS [CH. XVIII
characters, were used freely, and successfully baffled the in- genuity of the enemy, into whose hands they fell.
A common cipher of this type is made by using the actual letters of the alphabet, but in a non-natural sense as indicating other letters. Thus we may use each letter to represent the one immediately following it in the natural order of the alphabet — the letters being supposed to be cyclically arranged — a standing for h wherever it occurs, h standing for c, and so on, and finally z standing for a: this scheme is said to have been used by the Carthaginians and Romans.
More generally we may write the letters of the alphabet in a line, and under them re-write the letters in any order we like. For instance
ahcdefghijhlmnopqrstuviuxyz olkmazsqxeufy rthcwbvnidgjp
In such a scheme, we must in our communication replace a by 0, h by I, etc. The recipient will prepare a key by re- arranging the letters in the second line in their natural order and placing under them the corresponding letter in the first line. Then whenever a comes in the message he receives he will replace it by an e; similarly he will replace b by s, and so on.
A cipher of this kind is not uncommonly used in military signalling, the order of the letters being given by the use of a key word. Ciphers of this class were employed by the British forces in the Sudan and South African campaigns. If, for instance, Pretoria is chosen as the key word, we wTite the letters in this order, striking out any which occur more than once, and continue with the unused letters of the alphabet in their natural order, writing the whole in two lines thus :
pretoiahc dfg h z y X lu V u s qn 111 I k j
Then in using the cipher p is replaced by z and vice versa, r by y, and so on. A long message in such a cipher would be easily discoverable, but it is rapidly composed by the sender and read by the receiver, and for some purposes may be useful.
CH. XVIIl] CRYPTOGRAPHS AND CIPHERS 405
especially if the discovery of the purport of the message is, after a few hours, immaterial.
The key to ciphers of this type may usually be found by using tables of the normal frequency with which letters may be expected to occur. Such tables, and other characteristic features of the English, French, German, Italian, Dutch, Latin, and Greek languages, were given by D. A. Conrad in 1742*. His results have since been revised, and extended to Russian, Spanish, and other tongues. In English the percentage scale of frequency of the letters is approximately as follows: — e, 12*0; t, 9"4; a, 7*8 0, 7-5; ^, 7'4; n, 7-3; s, 6-8; r, 59; h, 57; d, 3-9; l, 3-6; u, 3*0 c, 2-8; m, 2-7; / 2-5; p, 1-9; g, 1-8; y, 1-8; 6, 1-7; w, VI] v, 11 k, 0*6; j, 0'3; q, 03; x, 0*3; z, 0"2. The order of frequency for combinations of two letters is th, he, in, an, on, re, ti, er, it, nt, es, to, st; of three letters is the, ion, &c., &c.; of four letters is tion, that, &c., &:c., and of double letters is tt, ss, &c., &c. Other peculiarities, such as that h, I, m, n, v, and y, when at the begin- ning of a word, must be followed by a vowel, that q must be followed by u and another vowel, have been classified and are important. I need not go here into further details. Unless, however, the message runs to 400 words or more, we cannot reasonably expect to find the scale of frequency the same as in Conrad's Table.
In ciphers of this class it is especially important to avoid showing the division into words, for a long word may easily betray the secret. For instance, if the decipherer has reason to suspect that the message related to something connected with Birmingham, and he found that a particular word of ten letters had its second and fifth letters alike, as also its fourth and tenth letters, he would naturally see how the key would work if the word represented Birmingham, and on this hypo- thesis would at once know the letters represented by eight symbols. With reasonable luck this should suffice to enable him to tell if the hypothesis was tenable. To avoid this risk it
* Gentleman's Magazine, 1742, vol. xn, pp. 133--135, ISf^— 186, 241—242, 473—475. See also the (Jolleclcd Works oj E. A. Foe in 4 volumes, vol. i, p. 30 et seq^.
406 CRYPTOGRAPHS AND CIPHERS [CH. XVIII
is usual to send the cipher in groups of five letters, and, before putting it into cipher, to separate the words in the message by- letters like j, q, x, z.
Ciphers of this type suggest themselves naturally to those approaching the subject for the first time, and are commonly made by merely shifting the letters a certain number of places forward. If this is done we may decrease the risk of detection by altering the amount of shifting at short (and preferably irregular) intervals. Thus it may be agreed that if initially we shift every letter one place forward then whenever we come to the letter (say) n we shall shift every letter one more place forward. In this way the cipher changes continually, and is essentially changed to one of the third class ; but even with this improvement it is probable that an expert would decode a fairly long message without much difficulty.
We can have ciphers for numerals as well as for letters: such ciphers are common in many shops. Any word or sentence containing ten different letters will answer the purpose. Thus, an old tradesman of my acquaintance used the excellent precept Be just 0 Man — the first letter representing 1, the second 2, and so on. In this cipher the price 10/6 would be marked bnjt. This is an instance of a cipher of the first type.
Second Type of Ciphers. A cipher of the second type is one in which the same letter or word is, in some or all cases, repre- sented by more than one symbol, and this symbol always repre- sents the same letter or word. Such ciphers were uncommon before the Renaissance, but the fact that to those who held the key they were not more difficult to write or read than ciphers of the first type, while the key was not so easily discovered, led to their common adoption in the seventeenth century.
A simple instance of such a cipher is given by the use of numerals to denote the letters of the alphabet. Thus a may be represented by 11 or by 37 or by 63, 6 by 12 or by 38 or by 64, and so on, and finally z by 36 or by 62 or by 88, while we can use 89 or 90 to signify the end of a word and the numbers 91 to 99 to denote words or sentences which con- stantly occur. Of course in practice no one would employ the
CH. XYIIl]
CRYPTOGRAPHS AND CIPHERS
407
numbers in an order like this, which suggests their meaning, but it will serve to illustrate the principle.
The cipher can be improved by introducing after every (say) eleventh digit a non-significant digit. If this is done the recipient of the message must erase every twelfth digit before he begins to read the message. With this addition the difficulty of discovering the key is considerably increased.
The same principle is sometimes applied with letters instead of numbers. For instance, if we take a word (say) of n letters, preferably all different, and construct a table as shown below of n^ cells, each cell is defined by two letters of the key word. Thus, if we choose the word smoking-cap we shall have 100
S
31
0
K
I
N —
P
z
J t d n
X
G
c
A i
8 0
m
p

t
d n
b
r
s
a
b
1
V
c
m w
8
q
a
d n
h
r b 1
V
e
0
y
i
s c m
g
q
a
k
e o
y
h
r b 1
M
0
~K
k u
e
f
P z
I
o
V
f
P z
w g
q
N G
y
i
j t
k
u
C
A
s
P
cells, and each cell is determined uniquely by the two letters denoting its row and column. If we fill these cells in order with the letters of the alphabet we shall have a system similar to that explained above, where a will be denoted by ss or og or no, and so for the other letters. The last 22 cells may be used to denote the first 22 letters of the alphabet, or better, three or four of them may be used after the end of a word to show that it is ended, and the rest may be used to denote words or sentences which are likely to occur frequently. The statement in cipher however is twice as loug as when it is in clear.
Like the similar cipher with numbers this can be improved
408 CRYPTOGRAPHS AND CIPHERS [CH. XVllI
by introducing after every 7?2th letter any single letter which it is agreed shall be non-significant. To decipher a communication so written it is necessary to know the clue word and the clue number.
Here for instance is a communication written in the above cipher with the clue word smoking-cap, and with 7 as the clue number: ngmks igrio icpss amcks cakqi gnass nxmig poasu iamno cmpam inscn ogcpn cisyi ksTcam sssgn nncae kknoo mklisc pcmsc hgpng siaws sgigg ndiic a. In this sentence the letters denoting the 79th, 80th, 81st, and 82nd cells have been used to denote the end of a word, and no use has been made of the last 18 cells.
Another cipher of this type is made as follows. The sender and recipient of the message furnish themselves with identical copies of some book. In the cipher only numerals are used, and these numerals indicate the locality of the letters in the book. For example, the first letter in the communication might be indicated by 79-8-5, meaning that it is the 5th letter in the 8th line of the 79th page. But though secrecy might be secured, it would be very tedious to prepare or decode a message, and the method is not as safe as some of those de- scribed below.
Another cipher of this type is obtained by the sender and receiver agreeing on some common book of reference and further on a number which, if desired, may be communicated as part of the message. To employ this method the page of the book indicated by the given number must be used. The first letter in it is taken to signify a, the next h, and so on — any letter which occurs a second time or more frequently being neglected. It may be also arranged that after n letters of the message have been ciphered, the next n letters shall be written in a similar cipher taken from the ^th following page of the book, and so on. Thus the possession of the code-book would be of little use to anyone who did not also know the numbers employed. It is so easy to conceal the clue number that with ordinary prudence it would be almost impossible for an unauthorized person to discover a message sent in this cipher.
CH. XVIIl] CRYPTOGRAPHS AND CIPHERS 409
The clue number may be communicated indirectly in many ways. For instance, it may be arranged that the number to be used shall be the number sent, plus (say) q, or that the nmnbcr to be used shall be an agreed multiple of the number actually sent.
Third Type of Ciphers. Complex Shifting Alphabets. A cipher of the third type is one in which the same symbol represents sometimes one letter or word and sometimes another.
A simple example, known as Gronf eld's Method, is the employ- ment of pre-arranged numbers in shifting forward the letters that make the communication. For instance, if we agree on the key number 6814, then the first letter in the communica- tion is replaced by the sixth letter which follows it in the natural order of the alphabet: for instance, if it were an a it would be replaced by g. The next letter is replaced by the eighth letter which follows it in the natural order of the alphabet: for instance, if it were an a it would be replaced by i. The next letter is replaced by the first after it ; the next by the fourth after it ; the next by the sixth ; and so on to the end of the message. Of course to read the message the reci- pient would reverse the process. If the letters of the alphabet are written at uniform intervals along a ruler, and another ruler similarly marked with the digits is made to slide along it, the letter corresponding to the shifting of any given number of places can be read at once. Here is such a message : — Cisvg vuniya vijnp vgzsi yhpjp tuoiy. Such ciphers are easy to make and read by those who have the key. But in recent years their construction has been subjected to critical analysis, and experts now can generally obtain the key number if the message contains 80 or 100 words; an example of the way by which this is done is given below. It would be undesirable to allow the division into words to appear in the message, and either the words must be run on continuously, or preferably the less common letters j, q, z may be used to mark the division of words and the message then written in five letter groups.
It is most important to conceal the number of digits in the
410 CRYPTOGRAPHS AND CIPHERS [CH. XVI II
key number. The difficulty of discovering the key number is increased if after every (say) 77ith letter (or word) a non-significant letter is inserted. I suggest this as an improvement in the cipher.
Here for instance is a communication written in this cipher with the clue numbers 4276 and 7: atpzn hvaocu xhiep xafwg hzniy prpsi khdkz yygkq prgez uytlk ohldi fehzm xlpog quyit cmgxk ckuex vsqka ziagg sigay tnvvs styvu aslyw gjuzm csfct qhpwj vaepf xhibw pxiul txlav vtqzo xivkvt uvvfh cqhxn pvism phzmq tuwxj ykeev Itif. The recipient would begin by striking out every eighth letter. He would then shift back every letter 4, 2, 7, 6, 4, 2, &c., places respectively, and in reading it, would leave out the letters j, q, and z as only marking the ends of words.
With these modifications, this is an excellent cipher, and it has the additional merit of not materially lengthening the message. It can be rendered still more difficult by arranging that either or both the clue numbers shall be changed according to some definite scheme, and it may be further agreed that they shall change automatically every day or week.
A similar system, now known as the St Cyr Method, was proposed by Wilkins *. He took a key word, such as prudentia, and constructed as many alphabets as there were letters in it, each alphabet being arranged cyclically and beginning respectively with the letters p, r, u, d, e, n, t, i, and a. He thus got a table like the following, giving nine possible letters which might stand for any letter of the alphabet. Using this we may vary the cipher in successive words or letters of the communication. Thus the message The prisoners have mutinied and seized the railway station would, according as the cipher changes in successive words or letters, read as Hiut fhziedvhi bujjy pxwmqmhg erh er^vmrq max zirteig station or as Hyy svvkunthm lehx uuhzgmiq tvd gvcciq mqe frcoanr atpkcrr.
The name by which the method is known is derived from the fact that it was taught at St Cyr under Napoleon. This system is said to have been widely employed by both armies in the Franco-German war in 1870 — 1871. The construction of military ciphers must be so simple that messages can be rapidly * Mercury, by J. Wilkins, London, 1641, pp. 59, 60.
CH. XVIIl]
CRYPTOGRAPHS AND CIPHERS
411
enciphered and decoded by non-experts: the St Cyr code fulfils this requirement.
a
h
c
d
f
g
h
i
k
1
m
n
0
T
q
3
s
t
u
V
w
X
y
z
P
a
r
s
t
u
V
w
X
y
z
a
b
c
d
e
f
h
i
k
1
m
n
0
r
s
t
u
V
w
X
y
z
a
b
c
d
e
f
g
h
i
k
1
m
n
o
P
q
u
V
w
X
y
z
a
b
c
d
e
f
g
h
1
k
1
m
n
0
P
q
r •a
s
t
d
e
f
g
h
i
k
1
m
n
0
P
q
r
s-
t
u
V
w
X
y
z
b
c d~
e
f
g'
h
1
k
1
m
n
0
P
q
r
s
t
u
V
w
X
y
z
a
b
c
n t i
0
P
q
r
s
t
u
V
TV
z
y
z
a
b
c
d
e
f
g
h
i
k
1
m
s
u
V
w
X
y
z
a
b
c
d
e
f
g
h
i
k
i
m
n
0
P
q
r
k
1
m
u
0
P
q
r
s
t
u
V
w
X
y
z
a
b
c
d
e
f
g
a
b
c
d
e
f
g
h
i
1
k
1
m
n
0
P
q
r
s
t
u
V
w
X
y
z
The St Cyr scheme is essentially the same as Gronfeld's. For instance, in the St Cyr system the key word gihe leads to the same result as the key number 6814 by Gronfeld's method. One advantage of the St Cyr system over that advocated by Gronfeld is that key words are more easily recollected than key numbers. Another advantage comes from the fact that the employment of v>^ords is equivalent to using 26 digits instead of 10 : thus the key word hings is equivalent to a number whose digits, from left to right, are 11, 9, 14, 7, 19. Messages in this cipher of any considerable length can be read by the same rules as are used to discover the key in Gronfeld's code. To hamper a decipherer I recommend the introduction, as in Gronfeld's method, of a non-significant letter after every 7?ith letter.
The Beaufort Cipher, introduced in the British Navy by Admiral Beaufort in 1857, is of the St Cyr type. Its inventor thought it insoluble, but French writers have shown that no special difficulties occur in the discovery of the key word in the solution, though the analysis is tedious.
A far better system of this kind is the Playfair Cipher. In this 25 cells arranged in the form of a square are filled by the letters of a key word such as Manchester (striking out any
412
CllYPTOGRAPHS AND CIPHERS
[CH. XVIU
letter which occurs more than once) and the remaining letters of the alphabet, thus : —
m
a
n
c
h
e
s
t
r
b
d
f
9
i
0
u
k
I
0
P
V
10
X
y
z
Only 25 cells are available, so k has been used for both h and g. The message is then divided into pairs of consecutive letters, but to prevent any pair consisting of the same two letters, a dummy letter like z is, when necessary, introduced. If both letters of a pair appear in the same vertical (or horizontal) line of the square, each of them is replaced by the letter in the square immediately to its right (or below it) — the letters in every line being treated as in cyclical order. If the letters in a pair do not appear in the same line in the square they must necessarily be at opposite angles of some rectangle, and they are replaced by those at the other angles of the rectangle, each by that which is in the same horizontal line. Thus the message will 'meet you at noon would first be written wi Iz Im ez et yo ua tn oz on ; then be put in cipher as yf iiiu ha hv sr xp Ih gt ux xt] and finally be sent as yfuwk ahvsr xplhg tuxxt. It is curious that this cipher is not used more extensively, for the discovery of the key is a most difficult problem, even to specialists.
Fourth Type of Ciphers. A cipher of the fourth type is one in which each letter is always represented by the same symbol, but more than one letter may be represented by the same symbol. Such ciphers were not uncommon at the beginning of the nineteenth century, and were usually framed by means of a key sentence containing about as many letters as there are letters in the alphabet.
CH. XVIIl] CRYPTOGRAPHS AND CIPHERS 413
Thus if the key phrase is The fox jumped over the garden gate, we write under it the letters of the alphabet in their usual sequence as shown below:
T h e f 0 X j um 2^ e d over the garden gate, ah c d ef g h i j k I mnop qrs t u vw x y z ah c.
Then we write the message replacing a hy t or a, b hy h or t, c hy e, d by/, and so on. Here is such a message. Mfoemho nea ge eoo jmdJiohg avfteg ev ume afrmeo. But it will be observed that in the cipher a may represent a or u, d may represent I or w, e may represent c or k or o or 5 or x, g may represent t or z, h may represent b or r, o may represent e or m, r may represent p or v, and t may represent a or 6 or q. And the recipient, in deciphering it, must judge as best he can what is the right meaning to be assigned to these letters when they appear.
An instance of a cipher of the fourth type is afforded by a note sent by the Duchesse de Berri to her adherents in Paris, in which she employed the key phrase
I e g 0 u V e r n e me n t provisoire. ah cdefghijklmn o p qr st uv xy.
Hence in putting her message into cipher she replaced a by l^ h hy e, c by g, and so on. She forgot however to supply the key to the recipients of the message, but her friend Berryer had little difficulty in reading it by the aid of the rules I have indicated, and thence deduced the key phrase she had employed.
Desiderata in Cryptographs and Ciphers. Having men- tioned various classes of cryptographs and ciphers, I may add that the shorter a message in cryptograph, the more easily it is read. On the other hand, the longer a message in cipher, the easier it is to get the key. In choosing a cipher for practical purposes, which will usually imply that it can be telegraphed or telephoned, we should seek for one in which only current letters, symbols, or words are employed ; such that its use does not unduly lengthen the message; such that the key to it can be reproduced at will and need not be kept in a form which
414 CRYPTOGRAPHS AND CIPHERS [CH. XVIII
might betray the secret to an unauthorized person; such that the key to it changes or can be changed at short intervals; and such that it is not ambiguous. Many ciphers of the second and third types fulfil these conditions; in particular the Gronfeld or St Cyr Method, or the Playfair Cipher, may be noted. A cipher written cryptograph ically, or a cryptograph written in cipher, or a cipher again enciphered by another process, is almost insoluble even by experts, unless accidents reveal something in the construction, but it is troublesome to make, and such elaborate processes are suited only for the study, where the time spent in making them up and deciphering them is not of much consequence.
Cipher Machines. The use of instruments giving a cipher, which is or can be varied constantly and automatically, has been often recommended*. The possession of the key of the instrument as well as a knowledge of the clue word is necessary to enable anyone to read a message, but the risk of some instru- ment, when set, falling into unauthorized hands must be taken into account. Since equally good ciphers can be constructed without the use of mechanical devices I do not think their employment can be recommended.
On the Solution of Cryptographs and Ciphers. Much in- genuity has been shown in devising means for reading messages written in cryptograph or cipher. It is a fascinating pursuit, but I can find space for only a few remarks about it.
In such problems we must begin by deciding whether the message is a cryptograph or a cipher. If it is a combi- nation of both, the problem is one of extreme difficulty, and is likely to baffle anyone but a specialist, but such combinations are unusual, and most secret messages belong to one class or the other.
If the scale of frequency of the letters agrees generally with Conrad's Table, presumably the message is in cryptograph,
* See, for instance, the descriptions of those devised by Sir Charles Wheat- stone, given in his Scientific Papers, London, 1879, pp. 342—347; and by Capt. Bazeries in Comptes Eendus, Association Frangais four I'Avancement des Sciences, vol. xx (Marseilles), 1891, p. ICO et tteq.
CH. XVIll] CUYPTOGKArHS AND CIPHERS 415
though we must allow for the possibility that dummy letters, like^', k, X, and z, have been introduced either to separate words or deliberately to confuse those not in the secret. A short sentence of this kind may be read by an amateur, but only an expert is likely to discover the key to a long and well con- structed cryptographic message.
If the message is long enough, say about 80 words, and the scale of frequency of particular letters differs markedly from Conrad's scale, there is a presumption that the message is in cipher. If the numbers of the two scales agree generally, probably a simple substitution alphabet has been used, i.e. it is a cipher of the first type, and generally the discovery of the key is easy. If it is not a cipher of this type, we must next try to find whether it is of any of the other recognised types. The majority of other ciphers are included in Gronfeld's number (or the St Cyr word) system, and here I will confine myself to a discussion of how such ciphers may be read.
The discovery of a key to a cipher of this kind is best illustrated by a particular case. I will apply the method to the message cisvg vumya vijnp vgzsi yhpjp woiy. This is an example of a Gronfeld's cipher with no additional complications introduced, but the message is short, and it so hajopens that the letters used are not in the normal scale of frequency ; yet it can be read with ease and certainty.
The first thing is to try to find the number of digits in the key number. Now we notice that the pair of letters vg occurs twice, with an interval of 12. If in each case these represent the same pair of letters in the original message, the number of digits in the key number must be 12 or a divisor of 12. Again the pair of letters ij occurs twice, with an interval of 8, and this suggests that the number of digits in the key number is 8 or a divisor of 8. Accordingly we conjecture that the key number is one of either 2 or 4 digits: this conclusion is strengthened by noting the intervals between the recurrences of the same letters throughout the message. We may put 2 on one side till after we have tried 4, for anyone using Gron- feld's method would be unlikely to employ a key number less
416 CRYPTOGRAPHS AND CIPHERS [cH. XVIII
than 100. Accordingly we first try 4, and if that fails try 2. Had no clue of this kind been obtained from the recurrence of a pair of letters, we should have had to try successively making the key numbers comprise 2, 3, 4, 5, . . . digits, but here (and in most messages) a cursory examination suggests the number of digits in the key number. We commence then by assuming provisionally that the key number has 4 digits. Accordingly we must now re-write our message in columns, each of 4 letters, giving altogether 4 lines, thus :
Q 9 y 3 9 y v y
i V a n z h w s u V p s p 0 V m i V i j i
If the Gronfeld method was used, the letters in each of these lines were obtained from the corresponding letters in the original message by a simple substitution alphabet. Had the message been long we could probably obtain this alphabet at once by Conrad's Table. Here, however, the message is so short that the Table is not likely to help us decisively, and we must expect to be obliged to try several shifts of the alphabet in each line.
In the first line y occurs three times, and g twice. Accord- ing to Conrad's Table, the most common letters in English are e, t, a, 0, i, n, s, r, h. Probably y stands for one of these and g for another. If y is made to stand successively for each of these, it is equivalent to putting every letter 6 places back- ward, where 6 is successively 20, 5, 24, 10, 16, 11, 6, 7, 17. Similarly, making g stand successively for e, t, a, o, i, n, s, r, h, we have 6 equal to 2, 13, 6, 18, 24, 19, 14, 15, 25. Altogether this gives us 16 systems for the representation of the first line. We might write these out on 16 slips, and provisionally reject any slip in which many unusual letters appear, but obviously, the most probable hypothesis is that where y stands for s, and g for a, both of which changes give ^ = 6, or that where y stands for a, and g for ^, both of which changes give ^ = 24: these give for the first line either w, a, s, d, a, s, j, s, or e, i, a, I, i, a, ?', a.
CH. XVIIl] CRYPTOGRAPHS AND CIPHERS 417
In the second line no letter occurs more than once, so we get no chie from Conrad's Table. This could not happen if the message were of any considerable length.
In the third line p occurs twice, and s twice. Hence, as before, we must make p and s successively stand for the letters e, t, a, 0, i, n, s, r, h. These give respectively 6= 11, 22, 15, 1, 7, 2, 23, 24, 8, and ^ = 14, 25, 18, 4, 10, 5, 0, 1, 11. Altogether this gives us 16 systems for the representation of this line. Obviously the most probable hypothesis is that where ^=11, p z= e, s = h, OT that where 6= 1, p = o, and s = r: these give for the third line either h,j, k, e, h, e, d, or r, t, u, o, r, o, n.
In the fourth line i occurs three times. As before, make i stand successivel}^ for e, t, a, o, i, n, s, r, h. Of these the first, where ^ = 4, is the most probable. The slip corresponding to this is r, i, e, r, e, f, e.
Now try combinations of these slips each in its proper line until, when we read the message in columns, we get the begin- ning of a word; if words appear in more than one column it is almost certain that we are right. We begin by taking the five slips which are indicated as being specially probable. The slip in the first line derived from ^ = 6, the slip in the third line derived from ^=1, and the slip derived from ^ = 4 in the fourth line give w . rra . tis . ued . or a . res . ofj . 7ies, and of course the solution is obvious. The key number was 6814, and the message is deciphered by using 6814 backwards. The corre- sponding St Cyr key word is gibe> The message was Warrant issued for arrest of Jones.
If the combination of the slips is troublesome we can some- times get assistance by choosing those combinations which make the recurring pairs of letters (here vg and ij) represent pairs which occur in Conrad's Table. Also the occurrence of double letters in the cipher will often settle what combinations of slips are possible.
It may be said that this is a tedious operation. Of course it is. Deciphering is bound to be troublesome, but a great deal of the work can be done by unskilled clerks working under the direction of experts. The longer the message, the fewer the