PG26839.B00281
[PDF page 280] 264 CRYPTOGRAPHS AND CIPHERS. [CH. XI be secured, it would be very tedious to prepare or decode a message, and the method is not as safe as some of those described below. Another cipher of this type is for the sender and receiver to agree on some common book of reference and to agree further on a number which, if desired, may be communicated as part of the message. To employ this cipher the page of the book indicated by the given number must be used. The first letter in it is taken to signifya, the nextb, and so on–any letter which occurs a second time or more frequently being neglected. It may be also arranged that aftern letters of the message have been ciphered, the next n letters shall be written in a similar cipher taken from thepth 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. 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 number to be used shall be an agreed multiple of the number actually sent. A cipher of the third type is one in which the same symbol rep- resents sometimes one letter or word and sometimes another. Usually such ciphers are easily made or read by those who have the key, but are difficult to discover by those who do not possess it. A simple example is the employment of pre-arranged numbers in shifting forward theletters thatmakethecommunication. For instance, if we agree on the clue number (say)4276, then the first letter in the communication is replaced by the fourth letter which follows it in the natural order of the alphabet: for instance, if it were ana it would be replaced bye. The next letter is replaced by the second letter which follows it in the natural order of the alphabet: for instance, if it were an a it would be replaced byc. The next letter is replaced by the seventh after it. The next by the sixth after it. The next by the fourth, and so on to the end of the message. Of course to read the message the recipient 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 can slide along it, the letter corresponding to the shifting of any given number of places can be read at once. It would be undesirable to allow the division into words to appear

PG26839.B00282
[PDF page 281] CH. XI] CIPHERS 265 in the message, and either the words must be run on continuously, or preferably the less common lettersj, q, z may be used to mark the division of words. It is also well to conceal the number of digits in the clue-number. This can be done and the cipher much improved by inserting after every (say)mth letter a non-significant letter. Here for instance is a communication written in this cipher with the clue-numbers 4276 and 7: atpznhvaxuxhiepxafwghzniyprpsikbdkzy ygkqprgezuytlkobldifebzmxlpogquyitcmgxkckuexvsqkaziaggsigaytnvvsstyv uaslywgjuzmcsfctqbpwjvaepfxhibwpxiultxlavvtqzoxwkvtuvvfheqbxnpvismp hzmqtuwxjykeevltif . 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 lettersj, q, and z as only marking the ends of words. This is an excellent cipher, and it has the additional merit of not materially lengthening the message. It can be rendered still more diffi- cult 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 somewhat similar system was proposed by Wilkins*. He took a key-word, such asprudentia, and constructed as many alphabets as there were letters in it, each alphabet being arranged cyclically and beginning respectively with the lettersp, 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 a b c d e f g h i k l m n o p q r s t u v w x y z p q r s t u v w x y z a b c d e f g h i k l m n o r s t u v w x y z a b c d e f g h i k l m n o p q u v w x y z a b c d e f g h i k l m n o p q r s t d e f g h i k l m n o p q r s t u v w x y z a b c e f g h i k l m n o p q r s t u v w x y z a b c d n o p q r s t u v w x y z a b c d e f g h i k l m t u v w x y z a b c d e f g h i k l m n o P q r s i k l m n o p q r s t u v w x y z a b c d e f g h a b c d e f g h i k l m n o p q r s t u v w x y z * Mercury, by J. Wilkins, London, 1641, pp. 59, 60.

PG26839.B00283
[PDF page 282] 266 CRYPTOGRAPHS AND CIPHERS. [CH. XI the messageThe prisoners have mutinied and seized the railway station would, according as the cipher changes in successive words or letters, read asHwt fhziedvhi bupy pxwmqmhg erh ervmrq max zirteig stationor as Hyy svvlwnthm lehx uukzgmiq tvd gvcciq mqe frcoanr atpkcrr. I have taken Wilkins’s key-word, but it is obvious that it would be desirable to omit a wherever it appears in it, since otherwise, if the cipher changes in successive words, some of the words may appear unaltered in the cipher, as is shown in the first of the examples given above. 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. Thus if the key-phrase isThe 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 o x j u m p e d o v e r t h e g a r d e n g a t e . a b c d e f g h i j k l m n o p q r s t u v w x y z a b c . Then we write the message replacinga by t or a, b by h or t, c by e, d by f, and so on. Here is such a message.M foemho nea ge eoo jmdhohg avf teg ev ume afrmeo. But it will be observed that in the ciphera may represent a or u, d may representl or w, e may representc or k or o or s or x, g may representt or z, h may representb or r, o may represent e or m, r may representp or v, andt may representa or b or q. And the recipient, in deciphering it, must judge as best he can which 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 Duchess de Berri to her adherents in Paris, in which she employed the key phrase l e g o u v e r n e m e n t p r o v i s o i r e. a b c d e f g h i j k l m n o p q r s t u v x y. Hence in putting her message into cipher she replaceda by l, b by 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.

PG26839.B00284
[PDF page 283] CH. XI] CIPHERS 267 Having considered various classes of cryptographs and ciphers I may now consider what features we should regard as important in choosing a cipher intended for practical use. In the first place, it is obvious that the means employed should be such as not to excite suspicion if the communication falls into unautho- rized hands. But this is a counsel of perfection, and almost impossible to attain. In the second place, we may say that, under modern conditions in war, finance, or diplomacy, a cipher may be useless unless it can be tele- graphed or telephoned. If this is deemed important, it will practically restrict us to the use of the 26 letters of the alphabet, the 10 numerical symbols for the digits, to which if we like we may add a few additional marks such as punctuation stops, brackets, &c. The same condition will require that the message should not be unduly lengthened by be- ing turned into cipher. Hence any considerable use of non-significant symbols is to be deprecated. In the third place, the key to the cipher should be such that it can be easily reproduced from memory. For, if the key is so elaborate that those who use it are obliged to preserve it in some tangible and accessible form, unauthorized persons may obtain the power of reading messages. Hence the key should be reproducible at will. Further, it is desirable that the key should be of such a character that it (or a change of it) can be telegraphed or otherwise communicated without the probability of exciting suspicion. In the fourth place, a cipher should be capable of change at short intervals. So that if the reading of one message in it be discovered subsequent messages may be undecipherable even though the system used is unaltered. Lastly, no ambiguity should be possible in deciphering the commu- nication. This will exclude ciphers of the fourth type. Accordingly in choosing a good cipher 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 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, but it is generally desirable to avoid ciphers of the first type

PG26839.B00285
[PDF page 284] 268 CRYPTOGRAPHS AND CIPHERS. [CH. XI unless circumstances permit of the free use of a code-book. The use of instruments giving a cipher, which is or can be varied constantly and automatically, has been often recommended. Several have been constructed on the lines of the well-known letter-locks*. 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 instrument, 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. This chapter has already run to such a length that I cannot find space to describe more than one or two ciphers that appear in history or fiction, but, we may say that until recently most of the historical ciphers are not difficult to read. It is said that Julius Caesar in making secret memoranda was ac- customed to move every letter four places forward, writingd for a, e for b, &c. This would be a very easy instance of a cipher of the first type, but it may have been effective at that time. His nephew Augus- tus sometimes used a similar cipher, in which each letter was moved forward one place†. Bacon proposed a cipher in which each letter was denoted by a group of five letters consisting ofA and B only. Since there are 32 such groups, he had 6 symbols to spare, which he could use to separate words or to which he could assign special meanings. A message in this cipher would be five times as long as the original message. This may be compared with the far superior system of the five (or four) digit codebook system in use at the present time. Charles I used ciphers freely in important correspondence—the ma- jority being of the second type. He was foolish enough to take a cabinet containing many confidential letters in cipher, to some of which their * See, for instance, the descriptions of those devised by Sir Charles Wheatstone, given in hisScientific Papers, London, 1879, pp. 342–347; and by Capt. Baz- eries inComptes Rendus, Association Français pour l’avancement des sciences, vol. xx (Marseilles), 1891, p. 160,et seq. † Of some of Caesar’s correspondence, Suetonius says (cap. 56)si quis investi- gare et persequi velit, quartam elementorum literam, id est, d pro a, et perinde reliquas commutet.And of Augustus he says (cap. 88)quoties autem per notas scribit, b pro a, c pro b, ac deinceps eadem ratione, sequentes literas ponit; pro x autem duplex a.

PG26839.B00286
[PDF page 285] CH. XI] CIPHERS 269 readings were appended, on the field of Naseby, where they fell into the hands of Fairfax*. The House of Commons sent them to a com- mittee presided over by a Mr Tate. It is commonly believed that the Committee referred the papers to J. Wallis†, then Fellow of Queens’ College, Cambridge, and subsequently Savilian Professor at Oxford, who discovered the key to them. At any rate the letters were read. In these ciphers each letter was represented by a number. The clues to some of the ciphers were provided by the King who had writ- ten over the number the letter which it represented, as shown in the following quotation: c a t o l i c k s i n F 11 18 45 35 23 27 11 25 47 28 40 148 haue layed t h i r p u r s e s t o g e t h e r 45 31 27 51 33 62 50 47 7 48 45 35 21 7 46 32 7 51 f o r s u p l y of a r m e s. – – – 15 35 50 a 47 62 33 23 74 k1 17 51 42 7 47 . – – – The published letters show that the King used different ciphers at different times, though perhaps he used the same one in all correspon- dence with any particular person, but the general character of those he employed is the same. The sentence quoted above is taken from a letter from Queen Henrietta Maria of January 26, 1643. In this and another letter a few months latera is represented by 17 or 18,b by 13, c by 11 or 12,d by 5,e by 7 or 8 or 9 or 10,f by 15 or 16,g by 21, h by 31 or 32,i by 27 or 28,k by 25,l by 23 or 24,m by 42 or 44,n by 39 or 40 or 41,o by 35 or 36 or 37 or 38,p by 33 or 34,r by 50 or 51 or 52,s by 47 or 48,t by 45 or 46,u by 62 or 63,w by 58, andy by 74 or 77. Numbers of three digits were used to represent particular people or places. Thus 148 stood forFrance, 189 for theKing, 260 for the Queen, 354 for Prince Rupert, and so on. Further, there were a few special symbols, thusk1 stood for but, n1 for to, and f 1 for is. The numbers 2 to 4 and 65 to 72 were non-significant, and were to be struck out or neglected by the recipient of the message. Each symbol is separated from that which follows it by a full-stop. * First Report of the Royal Commission on Historical Manuscripts, 1870, pp. 2, 4. † See his letters on Cryptography,Opera, vol. iii, pp. 659–672.

PG26839.B00287
[PDF page 286] 270 CRYPTOGRAPHS AND CIPHERS. [CH. XI The Queen seems to have found writing in cipher a great trouble. In the letter from which I have already quoted a sentence she says ... que je suis extrement tourmantee du mal de teete qui fait que je mesteray en syfre par un autre se qui jovois fait moy mesme, and she uses the cipher only for the particular words it was desired to conceal. Thus she writesMr Capell nous a fait voir que sy27, 23, &c., &c. If by this she saved herself trouble, she did it at the cost of rendering the cipher much easier to read. The system used by Charles was in considerable repute during the seventeenth century, but even without extraneous help it is possible for a diligent student to discover the key if the message is fairly long. An excellent illustration of this fact is to be found in the writings of the late Sir Charles Wheatstone. A paper in cipher, every page of which was initialled by Charles I, and countersigned by Lord Digby, was pur- chased some years ago by the British Museum. It was believed to be a state paper of importance. It consists of a series of numbers (about 150 different symbols being used) without any clue to their meaning, or any indication of a division between the words employed. The task of reading it was rendered the more difficult by the supposition, which proved incorrect, that the document was in English; but notwithstand- ing this, Sir Charles Wheatstone discovered the key*. In this cipher a was represented by any of the numbers12, 13, 14, 15, 16, or 17, b by 18 or 19, and so on, while some65 special words were represented by particular numbers. I may note in passing that Charles also used a species of shorthand, in which the letters were represented by four strokes varying in length and position. Essentially the system is simple, though it is troublesome to read or write. The famous diary of Samuel Pepys is commonly said to have been written in cipher, but in reality it is written in shorthand according to a system invented by T. Shelton†. It is however somewhat diffi- cult to read, for the vowels are usually omitted, and Pepys used some arbitrary signs for terminations, particles, and certain words—so far turning it into a cipher. Further, in certain places, when the matter * The document, its translation, and the key used are given in Wheatstone’s Scientific Papers, London, 1879, pp. 321–341. † Tachy-graphy by T. Shelton. The earliest edition I have seen is dated 1641. A somewhat similar system by W. Cartwright was issued by J. Rich under the title Semographie, London, 1644.

PG26839.B00288
[PDF page 287] CH. XI] CIPHERS 271 is such that it can hardly be expressed with decency, he changed from English to a foreign language, or inserted non-significant letters. Shel- ton’s system had been forgotten when attention was first attracted to the diary. Accordingly we may say that, to those who first tried to read it, it was written in cipher, but Pepys’s contemporaries would have properly described it as being written in shorthand, though with a few modifications of his own invention. A system of shorthand specially invented for the purpose is a true cipher. One such system in which each letter is represented either by a dot or by a line of constant length was used by the Earl of Glamorgan, better known by his subsequent title as Marquis of Worcester, in 1645, as also by Charles I. in some of his private correspondence. It is a cipher of the first type and has the defects inherent in almost every cipher of this kind: in fact Glamorgan’s letter was deciphered, and the system discovered by Mr Dircks*. Obsolete systems of shorthand† might be thus used to form an effective cipher. It is always difficult to read a very short message in cipher, since necessarily the clues are few in number. When the Chevalier de Rohan was sent to the Bastille, on suspicion of treason, there was no evidence against him except what might be extracted from Monsieur Latruau- mont. The latter died without making any admission. De Rohan’s friends had arranged with him to communicate the result of Latruau- mont’s examination, and accordingly in sending him some fresh body linen they wrote on one of the shirtsMg dulhxcclgu ghj yxuj, lm ct ulgc alj. Fortwenty-fourhoursdeRohanporedoverthemessage, but, failing to read it, he admitted his guilt, and was executed November 27, 1674. The cipher is a very simple one of the first type, but the commu- nication is so short that unless the key were known it would not be easy to read it. Had de Rohan suspected that the second word was prisonnier, it would have given him 7 out of the 12 letters used, and as the first and third words suggest the symbols used forl and t, he could hardly have failed to read the message. * Life of the Marquis of WorcesterbyH.Dircks, London, 1865. Worcester’ssystem of shorthand was described by him in hisCentury of Inventions, London, 1663, sections 3, 4, 5. † Various systems, including those used in classical and medieval times, are de- scribed in theHistory of Shorthandby T. Anderson, London, 1882.

PG26839.B00289
[PDF page 288] 272 CRYPTOGRAPHS AND CIPHERS. [CH. XI The following cipher is said to have been employed by Marie An- toinette*. I take it that it was used in the method indicated on page 265 AB A O B P C Q D R E S F T G V H X I Y L Z M N CD M Z A N B O C P D Q E R F S G T H V I X L Y EF L N M O A P B Q C R D S E T F V G X H Y I Z GH I N L O M P A Q B R C S D T E V F X G Y H Z IL H N I O L P M Q A R B S C T D V E X F Y G Z MN G N H O I P L Q M R A S B T C V D X E Y F Z OP F N G O H P I Q L R M S A T B V C X D Y E Z QR E N F O G P H Q I R L S M T A V B X C Y D Z ST D N E O F P G Q H R I S L T M V A X B Y C Z VX C N D O E P F Q G R H S I T L V M X A Y B Z YZ B N C O D P E Q F R G S H T I V L X M Y A Z above. If so, the first word in the communication would be rewritten according to the scheme given in the first line,a being replaced byo, and vice versâ, b by p, and so on. The second word would be rewritten according to the scheme in the second line, and so on. * The key is given, but without explanation, inJuniper Hall, by C. Hill, London, 1904, p. 13.

PG26839.B00290
[PDF page 289] CH. XI] CIPHERS 273 One of the modern systems is the five digit code-book cipher, to which I have already alluded. According to the general belief, it is fre- quently employed in certain official communications at the present day. A code dictionary is prepared in which every word likely to be used is printed, and the words are numbered consecutively00000, 00001, . . . up, if necessary, to99999. Thus each word is represented by a number of five digits, and there are105 such numbers available. The message is first written down in words. Below that it is written in numbers, each word being replaced by the number corresponding to it. To each of these numbers is added some definite prearranged clue-number— the words in the dictionary being assumed to be arranged cyclically, so that if the resulting number exceeds105 it is denoted only by the excess above105. The resulting numbers are sent as a message. On re- ceipt of a message it is divided into consecutive groups of five numbers, each group representing a word. From each number is subtracted the prearranged clue-number, and then the message can be read off by the code dictionary. When a code message is published by the Government receiving it, the construction of the sentences is usually altered before publication, so that the key may not be discoverable by anyone in pos- session of the code-book or who has seen the cipher message. This is a rule applicable to all cryptographs and ciphers. This is a cipher with105 symbols, and as each symbol consists of five digits, a message ofn words is denoted by5n digits, and probably is not longer than the message when written in the ordinary way. Since however the number of words required is less than105, the spare num- bers may be used to represent collocations of words which constantly occur, and if so the cipher message may be slightly shortened. If the clue number is the same all through the message it would be possible by not more than105 trials to discover the message. This is not a serious risk, but, slight though it is, it can be avoided if the clue number is varied; the clue number might, for instance, be781 for the first three words, 791 for the next five words,801 for the next seven words, and so on. Further it may be arranged that the clue numbers shall be changed every day; thus on the seventh day of the month they might be781, 791, &c., and on the eighth day881, 891, &c., and so on. This cipher can however be further improved by inserting at some step, say after each mth digit, an unmeaning digit. For example, if, in the original message written in numbers, we insert a9 after every

PG26839.B00291
[PDF page 290] 274 CRYPTOGRAPHS AND CIPHERS. [CH. XI seven digits we shall get a collection of words (each represented by five digits), most of which would have no connection with the original message, and probably the number of digits used in the message itself would no longer be a multiple of5. Of course the receiver has only to reverse the process in order to read the message. It is however unnecessary to use five symbols for each word. For if we make a similar code with the twenty-six letters of the alphabet instead of the ten digits, four letters for each word or phrase would give us 264, that is,456976 possible variations. Thus the message would be shorter and the power of the code increased. Further, if we like to use the ten digits and the twenty-six letters of the alphabet—all of which are easily telegraphed—we could, by only using three symbols, obtain 363, that is, 46656 possible words, which would be sufficient for all practical purposes. This code, at any rate with these modifications, is undecipher- able by strangers, but it has the disadvantages that those who use it must always have the code dictionary available, and that it takes a considerable time to code or decode a communication. For practical purposes its use would be confined to communications which could be deciphered at leisure in an office, It is especially suitable in the case of communications between officials, each supplied with a competent staff of secretaries or clerks—as from an ambassador to his chief, or a commander in the field to his war office. It is an excellent example of a cipher of the first type, but it is not clear that it possesses any superiority over some of the simple ciphers of the third type. One of the best known writers on the subject of cryptographs and ciphers is E.A. Poe, indeed probably a good many readers have made their first acquaintance with a cipher in his story ofThe Gold Bug, the interest of which turns on reading a simple cipher of the first type. In earlier times J. Tritheim of Spanheim, G. Porta of Naples, Cardan, Niceron, and J. Wilkins occupied much the same position, while when- ever ciphers were freely used skilful decipherers seem to have arisen. Poe wrote an essay on cryptography in which he said that it may be roundly asserted that human ingenuity cannot concoct a cipher which human ingenuity cannot resolve—a conclusion which is hardly justified by the known facts. In an earlier article he once made a similar re- mark so far as ciphers of the first class are concerned, with the implied limitation that only26 symbols may be used. In this sense the obser- vation is correct. His assertion excited some attention, and numerous

PG26839.B00292
[PDF page 291] CH. XI] CIPHERS 275 communications in cipher were sent to him. More than one of his cor- respondents did not play the game fairly, not only employing foreign languages, but using several different ciphers in the same communica- tion. Nevertheless he resolved all except one; and he proved that this last was a fraud, being merely a jargon of random characters, having no meaning whatever.
