Track B · Deep Dive 1801
⬡ Track B · Deep Dive

Patterson's Cipher for Jefferson

Patterson told Jefferson it would be "absolutely impossible … ever to desypher" without the key, and put a specimen in the letter to prove it. No record shows anyone reading that specimen for 206 years.

Solved 2007 — after 206 years

DesignerRobert Patterson, professor of mathematics, University of Pennsylvania
YearDecember 1801
RecipientThomas Jefferson (then US President)
MechanismWrite down the lines · sections of ≤9 lines · shuffle lines · prefix ≤9 arbitrary letters
Solved byLawren Smithline, Princeton CCR (2007)
Plaintext"In Congress July Fourth", then the preamble to the Declaration

Why This Matters

In December 1801, Robert Patterson — a mathematician at the University of Pennsylvania — sent President Thomas Jefferson a cipher he believed could never be broken. Jefferson, a sophisticated cryptographer in his own right (designer of the wheel cipher in Hall VII), was so impressed that he forwarded the system to Robert Livingston, the US minister to France, with an enthusiastic endorsement recorded in their correspondence.

Patterson closed the letter with a specimen in his own cipher, and a boast: "It will be absolutely impossible, even for one perfectly acquainted with the general system, ever to desypher the writing of another without his key." He put the number of possible keys at more than "ninety millions of millions".

There is no evidence Jefferson ever read it. Smithline, who solved it, puts it carefully: Jefferson "probably never cracked the enciphered portion of the letter", and no record indicates that anyone else had either. In June 2007 Lawren Smithline, a mathematician at the Center for Communications Research in Princeton, heard about the cipher letters from his neighbour Amy Speckart, who was working at The Papers of Thomas Jefferson; she pointed him at the Library of Congress scan. He solved it with dynamic programming over digraph frequencies. The message opens "In Congress July Fourth" and continues into the preamble to the Declaration of Independence — the document Jefferson himself had drafted.

Historical Context

Robert Patterson was professor of mathematics at the University of Pennsylvania. He and Jefferson corresponded often, and on a range of subjects including cryptography: at the time Jefferson was president of the American Philosophical Society and Patterson its vice president. Patterson's letter of 19 December 1801 is preserved in the Library of Congress's Jefferson Papers.

Secret diplomatic correspondence mattered to Jefferson. His reply documents interest in Patterson’s proposal, although that interest does not establish that its security claims were sound.

"I have thoroughly considered your cypher, and find it so much more convenient in practice than my wheel cypher, that I am proposing it to the Secretary of state for use in his office." — Thomas Jefferson to Robert Patterson, 22 March 1802 (Founders Online)

Jefferson was taken enough with the method to pass it on: he forwarded it to Robert Livingston, the American minister to France. Livingston went on using a nomenclator anyway. The system did not displace existing practice, and no earlier reading of the specimen is documented here. Beyond that the record is thin, and this page stops where the record does: there is no evidence that Jefferson worked the specimen and failed, and none that anyone else at his side attempted it.

How Patterson's Cipher Works

Patterson set out four requirements for a "perfect cypher": it should suit any language, be easy to memorise, be simple to perform, and be "absolutely inscrutable to all unacquainted with the particular key". His construction has three steps, and only three.

Step 1 — Write the message down the lines

In Patterson's words, "the first letter of the message is placed at the beginning of the first line, the second letter at the beginning of the second line, and so on, writing column after column, from left to right, till the whole is written." The text runs downward through the lines, column by column — Smithline likens the layout to writing in columns.

Three-row illustration for INCONGRESSJULYFOURTH, before adding nulls; this is not the original specimen’s layout.

line 1   I O R S Y U H
line 2   N N E J F R
line 3   C G S U O T

Step 2 — Cut into sections of at most nine lines

"This writing is then to be distributed into sections of not more than nine lines in each section, and these are to be numbered 1. 2. 3 &c." This limit belongs to the December 1801 proposal. The later April 1802 correspondence also describes a ten-letter keyword variant.

Step 3 — Transcribe the lines in a secret order, each behind arbitrary letters

Each section is written out "taking the lines of each section in any order at pleasure, inserting at the beginning of each line respectively any number of arbitrary or insignificant letters, not exceeding nine; & also filling up the vacant spaces at the end of the lines with like letters."

The same shuffle and the same counts are reused in every section — that repetition is what eventually gives the cipher away.

The key, again in Patterson's words, "will consist in knowing — the number of lines in each section, the order in which these are transcribed, and the number of insignificant letters at the beginning of each line." Written down it is a column of two-digit numbers: the first digit of each pair names a line, the sequence of those first digits gives the shuffle, and the second digit says how many arbitrary letters that line carries.

Patterson reckoned the number of available keys at more than "ninety millions of millions" — about 9 × 1013. This is Patterson’s historical estimate, not a measured attack cost or a count of the museum widget’s effective keys.

The 206-Year Decipherment Timeline
December 19, 1801
Patterson sends Jefferson the cipher proposal with a specimen ciphertext. The proposal includes a worked example and a challenge.
22 March 1802
Jefferson replies: he has "thoroughly considered your cypher", finds it "so much more convenient in practice than my wheel cypher", and is proposing it to the Secretary of State for use in his office. He subsequently forwards a version to Robert Livingston, minister to France.
April 1802
The correspondence on the cipher continues — a Jefferson document on Patterson's cipher dated 12 April and a Patterson reply of 24 April both survive. Nothing in the record shows the specimen being solved.
Afterwards
Livingston went on using a nomenclator regardless. In 1979 Ralph E. Weber described Patterson's method in United States Diplomatic Codes and Ciphers 1775–1938 but dealt only with the worked example, skipping the challenge cipher entirely. No record indicates anyone decrypted it.
June 2007
Lawren Smithline, a mathematician at the Center for Communications Research in Princeton, hears about the cipher letters from his neighbour Amy Speckart, then working at The Papers of Thomas Jefferson: "We have a letter in cipher, and we can't read it." She sends him the Library of Congress scan. He solves it by scoring candidate alignments on digraph frequencies and searching with dynamic programming, recovering the key 13, 34, 57, 65, 22, 78, 49.
March–April 2009
Smithline publishes A Cipher to Thomas Jefferson in American Scientist 97(2): 142–149. The article documents his 2007 solution.
How the 2007 Solution Worked

Smithline’s 2007 decipherment used digraph statistics and dynamic programming to evaluate candidate row alignments. Craig Lambert’s 2009 interview with Smithline reports this approach and the use of Jefferson’s State of the Union addresses as a language sample.

Evidence boundary: the publication details of Smithline’s A Cipher to Thomas Jefferson have been checked, but its complete text was unavailable for this review. The exact scoring table and row-by-row reconstruction are therefore not reproduced as independently verified results. Satoshi Tomokiyo’s published reconstruction supplies the seven-pair key shown here. The browser demonstration implements a teaching procedure; it does not reproduce the 2007 attack.

What This Teaches Modern Cryptography
Patterson lessonModern echo
Cipher strength is relative to attacker capabilityAlgorithmic advances can change practical attack costs; quantum attacks are one distinct example
Long gaps between creation and documented deciphermentElapsed historical time is not the amount of continuous cryptanalytic work
"Perfect cipher" claims age badlyPublic analysis can expose limitations; publication alone is not a security guarantee
A good scoring function over local structure beats searching whole keysLanguage scores also appear in hill climbing, but hill climbing and dynamic programming are different algorithms
The patriotic-plaintext signal helped Smithline confirm the breakModern: known-plaintext attacks; chosen-plaintext attacks; the cryptanalyst always wants any anchor in the plaintext space
Quick Facts
DesignerRobert Patterson (1743–1824)
YearDecember 1801
RecipientThomas Jefferson
StepsWrite down the lines → sections of ≤9 → shuffle lines, prefix ≤9 arbitrary letters (3)
Section sizeAt most nine lines in the December 1801 proposal
KeyspacePatterson's estimate: "ninety millions of millions" (~9×10¹³)
Proposal to documented solution206 (1801 → 2007)
SolverLawren Smithline, Center for Communications Research, Princeton
MethodDigraph scoring and dynamic programming (reported solution)
Recovered key13, 34, 57, 65, 22, 78, 49
Plaintext"In Congress July Fourth" + preamble to the Declaration
Solution paperAmerican Scientist 97(2), 2009, 142–149
Sources

Patterson’s December 1801 instructions and Jefferson’s reply are reproduced in Ralph E. Weber, Masked Dispatches: Cryptograms and Cryptology in American History, 1775–1900, third edition (2013), chapter 9, pp.55–61. The 2007 solution is reported in Craig Lambert, “Coded to Last,” Harvard Magazine (July–August 2009). These distinguish the surviving correspondence from later accounts of the decipherment. The source-access limit for Smithline’s full article is stated above.

← Previous The Great Cipher