Monograph · The Detection of Crime
Upon Secret Writings, with an Analysis of One Hundred and Sixty Separate Ciphers
221B Baker Street
Printed for the Author · Published 4th March 1897
Abstract
The author has collected one hundred and sixty separate ciphers, the greater part from the personal columns of the London daily papers and the remainder from papers lent to him by solicitors and by the police, and has submitted every one of them to a single order of operations. He describes the three operations in turn, viz. the count of the signs, the comparison of their frequencies with a standard table of English letters, and the trial of short words, doubled letters and common terminations. He classes the whole collection under seven heads, from the simple substitution of one letter for another to the codes which refer to the pages of an agreed book, and gives in a table the number of each class which he was able to read. He adds a further operation for those writings in which several alphabets are used in turn under a key-word, and shews how the length of the key may be found from the intervals between repeated groups of letters. He concludes that every cipher of the first three classes yields to patience, and names the two cases which the method cannot reach without some knowledge from outside the writing itself.
Preface
The method which I describe in these pages consists of three operations, applied in a fixed order to every secret writing which comes before me, and of a fourth operation which is reserved for one class of writing only. I have applied it to one hundred and sixty separate ciphers, collected over a period of some years, and I have set down below, class by class, how far it succeeded and where it failed. The reader who wishes for the history of the art, or for the curiosities of the ancients, must look elsewhere; I have written for the man who has a strip of paper in his hand to-day and must know by to-morrow what it says.
A secret writing is commonly regarded by those who have not examined one as a lock without a key, to be forced or abandoned. This is a false view of the matter. Every writing intended to be read by one person and hidden from all others must carry, in the regularities of the language beneath it, the means of its own undoing; and the business of the analyst is therefore to find those regularities, which the writer has disguised, rather than to guess at the key, which he has kept. I have been asked more than once whether such a study is worth the labour. My answer is the collection itself — in which there are writings arranging the receipt of stolen property, the flight of a debtor and the price of a man's silence, and of which the great majority were read by me within a few hours.
I. Of the Collection, and the Sources of the Specimens
Of the one hundred and sixty ciphers, ninety-seven were taken from the personal or agony columns of the London daily papers, in which persons who wish to correspond without being known to one another have long been accustomed to advertise. Thirty-eight came to me from solicitors, among the papers of clients who had died or disappeared; the remaining twenty-five were lent by officers of the Criminal Investigation Department, and I have referred to these by the numbers under which they stand in the registers at Scotland Yard. I excluded every specimen of which I could not obtain a fair copy of at least sixty signs, since a shorter writing gives too few occurrences for the count upon which everything depends. In every case I copied the writing exactly, preserving the division into groups, the spaces, the punctuation and any sign which appeared to be an error of the writer. These accidents are often the most instructive part of a cipher. A writer who has struck out a sign and written another in its place has told us, without intending it, something of the alphabet he was using, and a careless repetition in two successive advertisements has more than once given me the key to the whole of a correspondence.
II. Of the Order of Operations
My first operation is the count of the signs. I write out every distinct sign which occurs in the writing, whether it be a letter, a figure or an arbitrary mark, and against each I set the number of its occurrences. The number of distinct signs at once places the writing in one of three broad divisions. If there are twenty-six signs or fewer, and they are letters in which the common letters of English stand in their ordinary proportions, the writing is a transposition, in which the letters of the message have been rearranged but not changed. If there are twenty-six or fewer, and the proportions are those of English but attached to the wrong letters, it is a substitution. If the signs are more numerous than any alphabet requires, or are figures standing in groups of three and four, the writing is a code, or a substitution using several alphabets, and the further operation described in the fourth chapter must be applied.
Secondly, the count is compared with a standard table. For this purpose I have made my own count of the letters in ten thousand words of ordinary English prose, taken in equal parts from the leading articles of a daily paper, from a volume of sermons and from the correspondence columns of a provincial weekly, since the language of the agony column lies somewhere between these. The result is given in the first table below. It agrees closely with the count published by Mr. Lumsden in the Quarterly Messenger so long ago as 1871, and I have found it entirely sufficient. The letter E stands so far above every other letter in frequency that in a substitution of any length its equivalent may be named at once; the next eight or nine letters fall close together, and their equivalents must be decided by the third operation.
In the third operation I try the words. Once the equivalent of E is known, I look for the sign which most often stands before it at the end of a group, and for any group of three signs which ends with it and occurs several times, since the word THE is the commonest in the language and will very generally declare itself in this way. Doubled letters give the next help; in English the commonest doubled letters are L, E, S and O, and a doubled sign which stands for neither of the vowels will very generally be L or S. The common terminations, ING, ED and TION, follow, and with them the short words of two letters. At each step a trial equivalent is written in above the sign throughout the whole writing, and is retained only if it produces no impossible combination elsewhere. Thus the work corrects itself as it proceeds, and the last third of a substitution is commonly read in less time than the first letter.
| Letter | Per thousand | Letter | Per thousand |
|---|---|---|---|
| E | 129 | N | 70 |
| T | 89 | S | 65 |
| A | 81 | H | 58 |
| O | 78 | R | 57 |
| I | 73 | D | 41 |
| L | 40 |
III. Of the Classes of Cipher, and the Results
I have arranged the whole collection under seven heads. The first class comprises the simple substitution of one letter for another, whether by a regular shifting of the alphabet or by an alphabet mixed at the pleasure of the writer; it is much the commonest form in the agony columns, and it is also the weakest, for the great number of mixed alphabets which Mr. Ormerod has computed is of no avail against the count. The second differs from the first only in employing figures or arbitrary marks in place of letters, a change which alarms the uninstructed reader and adds nothing whatever to the security of the writing. The third class is the transposition, in which the letters are written into a square or along some agreed path and copied out in another order. Every one of these three classes, comprising ninety-seven of the one hundred and sixty, was read by the method without any key.
The fourth class employs several alphabets in turn, the order of them being governed by a key-word, so that the same letter of the message is represented by different signs according to its place. The fifth is the code proper, in which numbers refer to the page, line and word of some book agreed between the correspondents; Mr. Pagnell's commercial code of ten thousand words belongs to a related family. The sixth class comprises the writings of concealment, in which an innocent letter carries its message in every third word, in pin-pricks beneath certain letters of a newspaper, or in a sympathetic ink between the lines. The seventh comprises those writings in which two of the foregoing devices are combined.
Of the remaining classes, the writings of concealment, which some persons regard as the most cunning of all, proved in my hands the easiest after the first class, for the device once suspected is quickly found. The development of the sympathetic inks is a matter for the chemist; Mr. Tilbury has described the treatment of those in use among prisoners, and I have nothing to add to his account. The results for every class are set down in the table which follows.
| Class | Number examined | Read | Not read |
|---|---|---|---|
| I. Substitution of letters | 41 | 41 | 0 |
| II. Substitution by figures or signs | 34 | 34 | 0 |
| III. Transposition | 22 | 22 | 0 |
| IV. Several alphabets under a key-word | 14 | 9 | 5 |
| V. Codes upon an agreed book | 19 | 3 | 16 |
| VI. Writings of concealment | 24 | 24 | 0 |
| VII. Compound writings | 6 | 2 | 4 |
| Total | 160 | 135 | 25 |
IV. Of the Writings in Several Alphabets
A writing of the fourth class shews in the first operation a count in which no sign stands much above the others, and this flatness of the count is itself the mark of the class. The ordinary method fails here, since the letter E of the message is represented by as many different signs as there are letters in the key-word. However, the key-word is repeated throughout the writing, and wherever a common word of the message happens to fall twice upon the same part of the key, it will be represented twice by the same group of signs. I therefore mark every group of three or more signs which occurs more than once, and count the interval in signs between each pair of repetitions. The length of the key-word must divide every such interval, or nearly every one, and the largest number which divides them all is very generally the length required. The key once measured, the writing is divided into as many columns as there are letters in the key-word, each column having been written in a single alphabet. Every column is then a simple substitution, and is attacked by the ordinary method; the attack is slower, since each column holds only a fraction of the signs, and hence a writing of this class must be considerably longer than sixty signs before it can be read with certainty. Of the five writings of the fourth class which I failed to read, four were shorter than two hundred signs, and the fifth employed a key-word as long as the message itself.
V. Conclusion
The method succeeds without exception upon the first three classes and upon the writings of concealment, which together make up one hundred and twenty-one of the one hundred and sixty. Upon the writings in several alphabets it succeeds whenever the writing is long enough to repeat its key some five or six times. The limits of the method, beyond the mere shortness of a writing, lie in two places, and I state them exactly. First, a code referring to an agreed book cannot be read from the writing alone, since the numbers bear no relation to the letters of the language; the analyst must find the book, and the three codes of this class which I read were read only because the book was found in the correspondent's lodgings. Secondly, a key-word as long as the message, used once and then destroyed, leaves no repetition to be measured, and against it the analysis of the writing is useless.
Four writings in several alphabets were too short to be measured, and four compound writings had a code upon a book among their devices. Every other writing in the collection gave way to the count, the table and the trial of words, applied in that order and without haste. The practitioner who meets a cipher in the course of an investigation should therefore copy it exactly, count before he guesses, and look for the book or the key in the possession of the correspondents whenever the count shews a code. Moreover, he should keep every specimen, for a writer who has once used a system will very generally use it again, and the second writing is read in a fraction of the time which the first required.
Against the book which he has not found, or the key which he has never seen repeated, the count avails nothing, and he must say so.
References
- Lumsden, C. A. (1871). On the relative frequency of the letters in English printed matter, from a count of fifty thousand letters. The Quarterly Messenger of Pure and Applied Mathematics, vol. x.
- Ormerod, J. (1886). Note on the number of arrangements of a mixed alphabet. The Quarterly Messenger of Pure and Applied Mathematics, vol. xxv.
- Pagnell, H. (1880). Secret writing for the use of men of business, with a code of ten thousand words. Pellow & Tremayne, Paternoster Row.
- Tilbury, E. R. (1889). On the sympathetic inks in use among prisoners, and the means of their development. Aldersgate Quarterly Journal of Medical Jurisprudence and Toxicology, vol. xxii.
- Criminal Investigation Department (1895). Register of correspondence in cipher seized upon arrest. Records of the Criminal Investigation Department, Great Scotland Yard, registers of 1889–95, by permission.
- Doyle, A. C. The Adventure of the Dancing Men, the trifling monograph upon secret writings, analysing one hundred and sixty separate ciphers.