Track B · Deep Dive 1801 Solved 2007 — after 206 years
⬡ 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.

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 respected American mathematician and vice provost of 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 endorsement calling it "the most perfect cipher he had ever seen."

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.

Jefferson received the proposal at exactly the right moment to be receptive: he was newly inaugurated, building out the State Department's diplomatic correspondence apparatus, and acutely aware of the European cabinets noirs (see Cabinet Noir) reading every American dispatch they could intercept. A genuinely unbreakable cipher would have been a strategic asset.

"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 the specimen stayed unread. 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.

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

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." Nine is Patterson's own ceiling, and it is the single most important number on this page — a section is small, not large.

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. That is a real number, and for 1801 an intimidating one, but it is not the astronomical figure a large grid would give you: the nine-line ceiling is what keeps it that size.

The 206-Year Decipherment Timeline
December 19, 1801
Patterson sends Jefferson the cipher proposal with a specimen ciphertext. Key follows in a separate letter for security.
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 also forwards the method 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.
July–August 2009
Smithline publishes A Cipher to Thomas Jefferson in American Scientist 97(2): 142–149. The 206-year-old cipher is officially solved.
How the 2007 Solution Worked

Smithline's attack does not guess whole keys, and it is not a hill climb. It scores how plausibly two deciphered lines sit next to each other, and builds the key up one line at a time.

The scoring is on digraphs — adjacent letter pairs. Reading down a column of the reconstructed grid produces pairs of letters; some pairs are common in English, some are unlikely, some cannot occur. Smithline calibrated on a corpus close to the target: the letter frequencies of Jefferson's own State of the Union addresses. Each candidate alignment scores:

Digraph classExampleScore
Favourablecommon English pairs+1
Unfavourableod, et — rarer than chance−1
Nonexistentwd, vz — absent from the corpus−5

Because the number of arbitrary letters differs from line to line, lines do not start flush; letters that overhang with no partner score 0. Smithline guessed the section size and a starting pair of rows — anchoring on a q in cipher row 22, which in English is followed by u — and let dynamic programming compute the best number of extra letters for each candidate.

Adding one row at a time, the key emerged: 13, 34, 57, 65, 22, 78, 49 — seven lines to a section. Smithline notes the kinship with biological sequence alignment: lining up cipher rows is the same shape of problem as the Smith–Waterman algorithm of 1981. Transcription errors in Patterson's handwriting did not stop it; the method found the right key anyway, and the mistakes could be corrected once the text could be read.

What This Teaches Modern Cryptography
Patterson lessonModern echo
Cipher strength is relative to attacker capabilityQuantum cryptography deprecation: today's "strong" ciphers may fall to algorithms that don't yet exist
Asymmetric effort: encrypt in hours, decrypt in centuriesThe standard threat model — attacker may have far more compute than designer expected
"Perfect cipher" claims age badlyWhy every modern algorithm is published for adversarial review, not declared perfect
A good scoring function over local structure beats searching whole keysSame technique: hill-climbing in modern cryptanalysis; broke Double Transposition in 2013, the M-209 in the 2010s, the Mary Stuart letters in 2022
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 sizeNot more than nine lines (Patterson's own limit)
KeyspacePatterson's estimate: "ninety millions of millions" (~9×10¹³)
Years unread206 (1801 → 2007)
SolverLawren Smithline, Center for Communications Research, Princeton
MethodDigraph scoring (+1 / −1 / −5) + dynamic programming
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

Every quotation of Patterson on this page is taken from his letter as reproduced in Smithline (2009); the Jefferson quotation is from Founders Online. Claims that previously appeared here and are not in these sources — that Jefferson attempted the specimen and failed, that Madison tried it, and a pair of quoted letters to that effect — have been removed as unsourced.

← Previous The Great Cipher