Thomas Jefferson Papers

Method of Using Robert Patterson’s Cipher: Editorial Note

I. DESCRIPTION OF METHOD,

[18 APR. 1802]

II. SAMPLE ENCIPHERMENT:

THE LORD’S PRAYER, [18 APR. 1802]

III. SAMPLE ENCIPHERMENT:

“TO THE PEOPLE OF GREAT-BRITAIN,” [N.D.]

Method of Using Robert Patterson’s Cipher: Editorial Note

Jefferson received Robert Patterson’s letter of 19 Dec. 1801, in which Patterson described the cipher that he had invented, six days after it was written. On 22 Mch. 1802, Jefferson acknowledged the letter and informed Patterson that he had “thoroughly considered” the cipher. By 18 Apr. 1802, Jefferson completed an explanation of the “Method” of using the cipher (Document I below), created a sample using the text of the Lord’s Prayer (Document II), and had Meriwether Lewis copy the explanation and sample to send to Robert R. Livingston in France.

Jefferson worked up another example of the use of the cipher, this one using a portion of a 1774 address from the Continental Congress, “To the People of Great-Britain” (Document III). The document has an orderly appearance and Jefferson made a press copy of it, which may mean that he expected to use it, like the encipherment of the Lord’s Prayer, as an instructional example. However, he did not have Lewis copy the exercise that was based on the 1774 address, nor did he send it to Livingston. Although Jefferson enciphered only a portion of the address, it was a much longer passage to unravel than the Lord’s Prayer: the address spanned 30 letters across by 38 lines down, in contrast to the prayer’s 19 letters by 15 lines. He may have decided that the longer text was impractical as an introduction to the cipher.

Jefferson’s early drafts of his explanation of method and of the exercise using the Lord’s Prayer have survived. He did not put dates on any stages of those documents or on the “To the People” exercise. Early on, he made certain modifications to Patterson’s cipher, the most significant of which he related to Patterson in the letter of 22 Mch. In the first step of encipherment, Patterson had written the passage in vertical columns (see, in the letter of 19 Dec., his “First Draft” of a sample encipherment, Vol. 36:172). Patterson then transposed the text by shuffling the order of the horizontal lines of that transcription. Jefferson switched the vertical and horizontal axes. His initial transcription of the passage to be enciphered was in horizontal lines reading from left to right rather than columns reading top to bottom. He took care, as he described the technique in the letter of 22 Mch., to put “the letters of the different lines very exactly under each other.” He then mixed the order of the vertical columns and transcribed each column as a horizontal line to create the enciphered text. That modification of the process, to transcribe the passage initially as horizontal lines of text rather than vertical columns, appears in Jefferson’s drafts of the “Method” and the Lord’s Prayer encipherment. That is to say, he made the decision to change the axes of the transcription at the outset of his work with Patterson’s system.

He also rotated the axes of the cipher’s key, although he did not have that change in mind at the beginning. Patterson wrote the key vertically, with a column of digits indicating the scrambled order of the lines and another column for the number of extra letters to be inserted at the beginning of each line (Vol. 36:171). Jefferson followed that method when he first drafted the explanation of the cipher and the Lord’s Prayer example (see notes to Documents I and II). When he put the “Method” and trial encipherments into final form, however, he recognized that his rearrangement of the layout of the text in the first stage of encipherment called for a horizontal “key of lines,” read from left to right, since the cipher process would involve the reordering of a series of columns running from left to right. The other part of the key gave the number of random letters that would be introduced at the beginning of each line. Patterson’s directions on 19 Dec. related the number of letters to the particular line by showing the key as two columns of digits. Since Jefferson’s technique arrayed the “key of lines” horizontally, he wrote his “key of letters” that way also.

Jefferson made another significant alteration to the key system, one that he did not report to Patterson in his letter of 22 Mch. Patterson had described, and used for his sample encipherment in the letter of 19 Dec., one key of lines and letters that applied to all sections of the enciphered text. Jefferson, however, designated a different key for each section. Thus in the Lord’s Prayer, which in the first “operation” had 19 columns, Jefferson divided the text into three parts, two sections of 9 columns each and an additional section of 1 column, and gave each section its own key (see Document II). While Patterson’s design allowed sections to be any number of lines up to nine, Jefferson, in the documents printed below, always used nine columns as the prescribed size of a full section. In the encipherment of the address “To the People of Great-Britain,” he specified keys for four sections of nine columns each (the encipherment used only three lines of the fourth section—see Document III).

In his letter of 12 Apr., Patterson accepted Jefferson’s idea of putting the first operation of the ciphering process on the horizontal axis. Patterson also suggested the use of a name or other word as a mnemonic aid for conveying and remembering the key. In doing so, Patterson still assumed that the same key would be used for every section of an enciphered text. Jefferson quickly absorbed the suggestion of a mnemonic aid and adapted it to work for keys to multiple sections. When he wrote to Livingston on the 18th, only three days after receiving that letter from Patterson, he explained how his own and Livingston’s names and places of residence would produce keys for three sections of nine columns each. The explanation of “Method” and the sample using the Lord’s Prayer had probably already been prepared by the time Jefferson received that suggestion from Patterson, since the key used in the method description and for the Lord’s Prayer encipherment was not based on Jefferson’s and Livingston’s names. Jefferson also made no mention in the method statement of using proper nouns to develop a key.

In his draft of the explanation and his initial working up of the Lord’s Prayer encipherment, Jefferson organized the process of encoding and decoding as four stages or “operations.” One of those operations was the creation of the key. He subsequently eliminated that as a separate stage and put the whole process into three operations. The first step was the transcription of the text in horizontal lines, with space between letters to allow for reading down the vertical columns. The second operation was the encipherment of the passage, which Jefferson thought, in his letter to Patterson on 22 Mch., might be performed by a “copying clerk.” The clerk would begin the process by using vertical lines to divide the paper of the first operation into sections of nine columns each and numbering the columns in each section. In Jefferson’s sample encipherments, the first operation showed those steps already completed. To put the text into cipher, the clerk would then read down each column, taking them in the order prescribed by the key and transcribing each column as a line of text. That transcription became the text labeled in the samples as the second operation. In making it, the clerk would insert random letters at the beginning of each line in accordance with the key, and put some arbitrary letters also at the right end of most lines. (The letters added to the right end of the line did not follow a key, since they were to become evident during the decipherment; see below and Patterson’s letter of 19 Dec.). In the Lord’s Prayer, for example, the first line of the encipherment was, according to the key, the first column of the first operation, read downward and beginning “o h n h a,” with eight arbitrary letters inserted at the beginning and no arbitrary letters added to the right end of that line. The next line of the second operation was the fifth column of the first operation, with three decoy letters on the left end and six on the right end. In this fashion the clerk would work through the entire text of the first operation. The finished transposition of the Lord’s Prayer was 19 lines long, corresponding to the 19 columns of the first operation, and presented the enciphered text in the form in which it would be sent.

In his examples, Jefferson showed the first steps of the third operation, which was the decipherment by the receiver, directly on the text of the second operation. He (and Meriwether Lewis, in the copy sent to Livingston) numbered the lines of the second operation to identify their proper sequence within each section of the text. The decipherer then, as Jefferson described the process in Document I, “dashes his pen through all the insignificant letters” at the beginnings of the lines as specified by the key. In the sample exercises, Jefferson and Lewis struck through the unwanted letters at the left end of each line in the second operation; in Documents II and III below, those canceled letters are shown in italics. With the letters that were not part of the message eliminated, the clerk was to take the first letter of line 1 of the first section, then the first letter of the other lines of that section in their proper order, then the first letters of the lines of the other sections, then the second letter of each line following the same sequence, then the third letter, and so on. The resulting transcription—labeled as the third operation in the sample encipherments—would be the deciphered message. During the decipherment, the random letters at the right-hand ends of lines would “betray themselves at once,” as Jefferson expressed it in Document I, “by their incoherence” (see the end of Document II for Jefferson’s illustration of that process in the decipherment of the Lord’s Prayer).

In the draft version of his explication of the use of the cipher, Jefferson noted that care was needed to avoid making mistakes in deciphering a passage (Document I, note 12). The two potential problems that he mentioned in his draft, omitting a letter or copying a letter twice, could arise during decipherment by the message’s recipient, as he noted, but could also occur in the earlier step of the process, when the sender encrypted the text. Having omitted two letters when he first worked up the Lord’s Prayer and having seen the outcome of those slips when he unlocked the passage, Jefferson would have known that errors were possible during encipherment (see descriptive note to Document II). Lewis dropped a letter from the enciphered text of the Lord’s Prayer, unwittingly illustrating how difficult it could be to transcribe a jumbled sequence of letters even when no transposition was involved. Jefferson did not state a third potential problem, the misreading of a letter, which could occur during encipherment or decipherment. Lewis mistook a letter in the Lord’s Prayer example, writing “w” for “u.” Jefferson, in his encipherment of the 1774 address, twice wrote “p” instead of “n,” and his final version of the prayer included a sequence of three incorrect letters. The latter mistake would have been noticeable in the decipherment, except Jefferson, in making up the fair copy, simply wrote out the deciphered passage as he knew it should have appeared rather than painstakingly working it out it letter by letter (Document II, notes 1–2, 4; Document III, notes 1, 5).

A few scattered errors of single characters might have little effect on the meaning of a message (see Document II, descriptive note; Document III, notes 6–7). A mistake in using a key, or putting rows or columns in the wrong order during encipherment or decipherment, could be more detrimental. Jefferson may have come near to making such errors in his experiment with the address of the Continental Congress to the British people. An evident interlineation in that encipherment may indicate that he either initially overlooked a column of the text or was temporarily mistaken about the sequence of lines for one section. Whatever the cause of the stumble, he became aware of it and resolved it before he wrote out his decipherment, which follows the correct sequence of lines. Also in his work with that text, he erred several times when he made marks to set off the extra letters at the left end of each line. He fixed those misplaced marks, which may have been the result of following an incorrect key sequence, and they did not affect his decipherment. They could have had more serious consequences if he had been attempting to unpack someone else’s encryption rather than his own (Document III, notes 2–3).

Although in his letter of 22 Mch. Jefferson informed Patterson that he was recommending the cipher for use in official diplomatic correspondence, it was never used for that purpose. When Jefferson sent the explanation to Livingston on 18 Apr., he expected that they would sometimes employ the cipher in their private letters. Livingston, however, was accustomed to “nomenclator” codes that substituted groups of digits for words, syllables, and letters. That system had long been in use in American diplomatic correspondence, and Jefferson used nomenclators to encode sensitive information in his own private letters in the 1790s, as late as 1800. Livingston, as secretary of foreign affairs for the Confederation Congress in the early 1780s, had been instrumental in expanding the size of the code to contain 1,700 word elements. Deeming the Patterson cipher “extreamly difficult & laborious in the practice,” Livingston would not give up the nomenclator system, which he considered “equally secure & more easy in the use.” Madison also continued to favor nomenclators for the State Department, furnishing one to James Monroe in 1803. Madison employed such a code himself in correspondence with Livingston and Monroe (Ralph E. Weber, United States Diplomatic Codes and Ciphers, 1775–1938 [Chicago, 1979], 151–8; David Kahn, The Codebreakers: The Story of Secret Writing, rev. ed. [New York, 1996], 184–5; Madison, Papers description begins William T. Hutchinson, Robert A. Rutland, J. C. A. Stagg, and others, eds., The Papers of James Madison, Chicago and Charlottesville, 1962–, 32 vols. Sec. of State Ser., 1986–, 8 vols. Pres. Ser., 1984–, 6 vols. Ret. Ser., 2009–, 1 vol. description ends , Sec. of State Ser., 4:78–9, 80–1n, 110–11, 115, 121, 204, 205n, 277–8, 279n, 328–31, 352, 385, 386n, 411–12, 500–1, 502n, 511–15, 525–30, 532n; Vol. 28:96, 100, 355–6, 449, 451n, 510–11, 512n; Vol. 31:300, 301n; Livingston to TJ, 28 Oct. 1802).

Jefferson gave considerable thought and time to understanding Patterson’s cipher and developing what amounted to a manual for its use. Despite all that attention, however, and despite his interest in finding a new cipher system, he failed to implement the Patterson cipher for diplomatic dispatches. Perhaps Jefferson came to realize that other people might find the Patterson cipher unwieldy to use, baffling, and intimidating. Not everyone could readily perceive the elegance that Jefferson and Patterson, the professor of mathematics, found in the cipher.

Index Entries