Thomas Jefferson Papers

# Description of a Wheel Cipher

[before 22 Mch. 1802?]

Turn a cylinder of white wood of about 2. Inches diameter, & 6. or 8. I. long. bore through it’s center a hole sufficient to recieve an iron spindle or axis of ⅛ or ¼ I. diam. divide the periphery into 26. equal parts (for the 26. letters of the alphabet) and, with a sharp point, draw parallel lines through all the points of division, from one end to the other of the cylinder, & trace those lines with ink to make them plain. then cut the cylinder crosswise into pieces of about ⅙ of an inch thick.2 they will resemble back-gammon men, with plane sides. number each of them, as they are cut off, on one side, that they may be arrangeable in any order you please.3 on the periphery of each, and between the black lines, put all the letters of the alphabet, not in their established order, but jumbled, & without order, so that no two shall be alike. now string them in their numerical order on an iron axis, one end of which has a head, and the other a nut and screw; the use of which is to hold them firm in any given position when you chuse it. they are now ready for use, your correspondent having4 a similar cylinder, similarly arranged.

Suppose I have to cypher this phrase.5 ‘your favor of the 22d. is recieved.’

 I turn the 1st. wheel till the letter y. presents itself. I turn the 2d. & place it’s o. by the side of the y. of the 1st. wheel. I turn the 3d. & place it’s u. by the side of the o. of the 2d. 4th. r. by the side of the u of the 3d. 5th. f. by the side of the r. of the 4th. 6th. a. by the side of the f of the 5th.

and so on till I have got all the words of the phrase arranged in one line. fix them with the screw. you will observe that the cylinder then presents 25. other lines of letters, not in any regular series, but jumbled, & without order or meaning. copy any one of them in the letter to your correspondent. when he recieves it, he takes his cylinder and arranges the wheels so as to present6 the same jumbled letters in the same order in one line. he then fixes them with his screw, and7 examines the other 25. lines, and finds one of them presenting him these8 letters ‘your favor of the 22 is recieved.’ which he writes down. as the others will be jumbled & have no meaning, he cannot mistake the true one intended. so proceed with every other portion9 of the letter. numbers had better be represented by letters with dots over them;10 as for instance by the 6. vowels & 4 liquids. because if the periphery were divided into 36. instead of 26. lines for the numerical, as well as alphabetical characters, it would increase the trouble of finding the letters on the wheels.11

When the cylinder of wheels is fixed, with the jumbled alphabets on their peripheries, by only changing the order of the wheels in the cylinder, an immense variety of different cyphers may be produced for different correspondents. for whatever be the number of wheels, if you take all the natural numbers from unit to that inclusive, & multiply them successively into one another, their product will be the number of different combinations of which the wheels are susceptible, and consequently of the different cyphers they may form for different correspondents, entirely unintelligible to each other.* for though every one possesses the cylinder, and with the alphabets similarly arranged on the wheels, yet if the order be interverted, but one line, similar through the whole cylinder, can be produced on any two of them.

*2. letters can form only 2. different series, viz.12 a.b. and b.a. say 1 × 2 = 2

 add a 3d. letter. then it may be inserted in each of these two series13 as the 1st. 2d. or 3d. letter of the series. to wit c. a. b. c. b. a. a. c. b. b. c. a. a. b. c. b. a. c.

consequently there will be 6 series = 2 × 3 or 1 × 2 × 3.

add a 4th. letter. as we have seen that 3. letters will make 6. different series, then the 4th. may be inserted in each of these 6. series, either as the 1st. 2d. 3d. or 4th letter of the series. consequently there will be 24. series, = 6 × 4 =1 × 2 × 3 × 414 × 5 × 6

add a 5th. letter. as 4. give 24 series, the 5th. may be inserted in each of these as the 1st. 2d. 3d. 4th. or 5th. letter of the series. consequently there will be 120 = 24 × 5 = 1 × 2 × 3 × 4 × 5.

add a 6th. letter. as 5. give 120. series, the 6th. may be inserted in each of these as the 1st. 2d. 3d. 4th. 5th. or 6th. letter of the series. consequently there will be 720. = 120 × 6 = 1 × 2 × 3 × 4 × 5 × 6.

and so on to any number.

Suppose the cylinder be 6. I. long (which probably will be a convenient length, as it may be spanned between the middle finger & the thumb of the left hand, while in use) it will contain 36. wheels, & the sum of it’s combinations will be 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 × 28 × 29 × 30 × 31 × 32 × 33 × 34 × 35 × 36.16 = (4648 &c—to 42 places!!—)17 a number of which 41.5705351 is the Logarithm of which the number is 372 with 39 cyphers18 (zeros) added to it.

(: TJ Papers, 128:22138); undated; in TJ’s hand, with notations by Robert Patterson and TJ (see note 17 below). (: TJ Papers, 232:41576). (: TJ Papers, 232:41575); entirely in TJ’s hand; torn.

PROJECT OF A CYPHER: a passing reference to “my wheel cypher” in TJ’s letter to Robert Patterson on 22 Mch. 1802 is apparently the only time he mentioned the cryptographic device in his correspondence. Silvio Bedini speculated that TJ devised the wheel cipher in the period from 1792 to 1793. That supposition was based on an assumption that TJ had some interest in ciphers when he was secretary of state and on his purchase, in April 1792, of an undescribed set of punches from a type founder. Bedini surmised that those were letter punches, and that TJ wanted them for stamping the letters of the alphabet into the edges of the disks of the wheel cipher. If that set of punches comprised an alphabet, however, TJ’s purchase of nine more punches from the same source later that year is difficult to explain. He spent \$26.20 on the two groups of punches, and it seems most likely that he invested in those tools for some personal use, such as stamping bookbindings. It may be more probable that TJ wrote the description of the wheel cipher device not in 1792 or 1793 but between 1797 and 1800. Patterson’s notation on the document printed above shows that TJ consulted him about the concept of the device, and the absence of any reference to it in their correspondence implies that they discussed it in person. During TJ’s term as vice president of the United States, he resided in Philadelphia when Congress was in session and he had considerable interaction with Patterson. They were both officers of the American Philosophical Society, they conferred about astronomy, and in March 1798, Patterson provided TJ with detailed advice on the moldboard plow design, loaning him a book on mathematics. TJ also had time and inclination during his vice presidency to devote attention to scientific and technical subjects. Moreover, his passing reference to the wheel cipher in the 22 Mch. 1802 letter to Patterson provides no explanation, which implies that it may have been a subject of relatively recent vintage that would be fresh in Patterson’s mind. That letter, TJ’s correspondence with Patterson in April, and the attention he devoted to an explanation of Patterson’s cipher for enclosure to Robert R. Livingston on 18 Apr. demonstrate his deep engagement with the problem of finding a new ciphering system. He implied to Patterson in the letter of 22 Mch. that the wheel cipher was prominent in his consideration until Patterson’s cipher, described in the mathematician’s letter of 19 Dec. 1801 that TJ received on 25 Dec., displaced it. It is possible that TJ wrote up the description of the wheel apparatus during the search for a new coding system in 1801–2, although if that were the case, it is not clear when or by what means Patterson could have seen TJ’s description of the device. Although it is difficult to establish the date of the document printed above, it is unlikely that TJ wrote it after 22 Mch. 1802, since Patterson’s cipher had displaced the wheel cipher in TJ’s consideration by that date ( description begins Silvio A. Bedini, Thomas Jefferson: Statesman of Science, New York, 1990 description ends , 233, 236–8, 493; David Kahn, The Codebreakers: The Story of Secret Writing, rev. ed., [New York, 1996], 192–3; description begins James A. Bear, Jr., and Lucia C. Stanton, eds., Jefferson’s Memorandum Books: Accounts, with Legal Records and Miscellany, 1767–1826, Princeton, 1997, The Papers of Thomas Jefferson, Second Series description ends , 2:868, 881; Vol. 30:160, 161n, 207n, 224, 230–1, 234–5; Vol. 31:56, 57n, 295n; Vol. 32:298).

In the inaugural volume of this series, editor Julian P. Boyd cited an assessment by the cryptanalyst William F. Friedman to name TJ’s “invention of a cryptographic device”—the wheel cipher—and the drafting of the Declaration of Independence as indications of the range and power of TJ’s intelligence. The two creations were, Boyd wrote, “evidences of an elevated and even inspired intellect,” demonstrating that TJ “possessed many of the qualities of a genius” (Vol. 1:viii–ix; for Friedman, see description begins John A. Garraty and Mark C. Carnes, eds., American National Biography, New York and Oxford, 1999, 24 vols. description ends ). We cannot be certain, however, if TJ’s description of the cipher device was entirely the product of his own mind or drew on other sources. The concept of using wheels on a SPINDLE to create a cipher machine may have come from locks that opened when cylinders were aligned to spell a secret word. The Encyclopédie Méthodique described such mechanisms. Cipher devices using disks on an axle have been developed at different times and places, sometimes with no evident chain of transmission of the idea. In the mid-nineteenth century, Charles Babbage referred to a cylindrical cipher device similar in some respects to the one described by TJ. An apparatus developed by a French military cryptographer in the 1890s inspired the creation of similar devices for the armies and navies of other countries, including the United States. TJ’s description of a wheel cipher was apparently unnoticed by cryptographers until it was discovered in his papers in the 1920s (Louis Kruh, “The Genesis of the Jefferson/Bazeries Cipher Device,” Cryptologia, 5 [1981], 193–208; description begins Silvio A. Bedini, Thomas Jefferson: Statesman of Science, New York, 1990 description ends , 236–7; William F. Friedman, “Edgar Allan Poe, Cryptographer,” American Literature, 8 [1936], 279).

4 LIQUIDS: the letters l, r, m, and n ( description begins J. A. Simpson and E. S. C. Weiner, eds., The Oxford English Dictionary, Oxford, 1989, 20 vols. description ends ).

SUPPOSE THE CYLINDER BE 6. I. LONG: the inexactness of the dimensions that TJ gave for the components of the device, his supposition that six inches “probably will be a convenient length” for the assembled apparatus, and his rumination about how numerals “had better be represented” indicate that the description above was a conceptual plan, not an explanation of an already-constructed prototype. TJ called the document a “project,” a word often used, in his day and earlier, to refer to a proposal or conceptual design ( description begins J. A. Simpson and E. S. C. Weiner, eds., The Oxford English Dictionary, Oxford, 1989, 20 vols. description ends ). In diplomacy, “project” or its French form, projet, was the term used for a draft treaty that served as a starting point for negotiation (see, for example, description begins American State Papers: Documents, Legislative and Executive, of the Congress of the United States, Washington, D.C., 1832–61, 38 vols. description ends , Foreign Relations, 2:421, and Vol. 29:613–25, 629–30n). TJ appears not to have taken the notion of a wheel cipher device beyond the explanatory “project” printed above. The Editors have found no evidence that he built one of the devices himself or had one made, and he apparently abandoned the design after deciding that Patterson’s cipher, as he told its creator in the letter of 22 Mch. 1802, would be “so much more convenient in practice.” He seems never to have gone back to the wheel cipher idea. In the twentieth century, examples of the device were made following TJ’s description, although those models did not incorporate 36 wheels in a six-inch span as posited by TJ in the last section of the document above ( description begins Silvio A. Bedini, Thomas Jefferson: Statesman of Science, New York, 1990 description ends , figs. 21, 22).

At some unknown time, TJ created a table consisting of a grid of 30 numbered vertical columns, each of which contains a different scrambled sequence of the 26 letters of the alphabet. He did not date or endorse the table. It could relate to his plans for the wheel cipher, with each column perhaps representing the sequence of letters for one wheel, or to another cipher system ( in : TJ Papers, 128:22137, entirely in TJ’s hand; Ralph E. Weber, United States Diplomatic Codes and Ciphers, 1775–1938 [Chicago, 1979], 178–9, 191n, 612).

1In this heading is “The wheel cypher.”

2Word interlined in in place of “diameter.”

3In , TJ first wrote “in the same order” before altering the phrase to read as above.

4Here in , TJ canceled “an exact duplicate of them.”

5In , TJ first wrote “cypher these words” before altering the text to read as above.

6Word interlined in in place of “<make> place.”

7Preceding six words interlined in .

8TJ here canceled “words.” : “words.”

9Word interlined in in place of “phrase.”

10Remainder of sentence, through “4 liquids,” interlined in .

11Here in , TJ wrote and canceled a paragraph: “the cypher may be varied for any number of correspondents by varying the arrangement of the wheels. every two of those who possess a set of them may have an arrangement private to themselves, and which cannot be understood by the others.” He then wrote, as a new paragraph, a sentence that has been lost to damage except the final word, “wheel.”

12Preceding three words interlined in place of “combinations […].”

13Word interlined in in place of “arrangements.”

14Formula ends here in .

15In , TJ wrote out sequences of letters beginning with all combinations of three letters, and, after canceling some series of sequences and abbreviating some others, projected the results for all combinations of five letters. In those columns of letter sequences all follow the paragraph that ends “any two of them” and precede the paragraph that begins “2. letters can form.”

16Text ends here in and .

17The equal sign and parenthetical passage are in Patterson’s hand. The notation that follows, beginning “a number,” is in TJ’s hand.

18: “cyhers.”