Jefferson thought of secret writing as early as 1764, when he was a twenty-year-old student of law.
The book mentioned was Thomas Shelton's Tachy-Graphy, The Most Exact and Compendious Methode of Short and Swift Writing That Hath Ever Yet Been Published (1646).
It can also be seen that Latin was used as a way of secret writing. Also, he used playful names for disguising the name of the woman whom he adored. That is, the name, Belinda, was sometimes spelt backwards as Adnileb or, in Greek letters, αδνιλεβ. The name might be put as Bel-in-da by metanalysis, which was written as campana in die ("a bell in day" in Latin).
Jefferson used a polyalphabetic cipher based on a keyword "NICHOLAS" in his correspondence with William Short on and after 18 January 1784 (the letter of this date is missing).
On 30 April, Jefferson used this code to convey his feelings about the information that he was a candidate as a commissioner for negotiating commercial treaties. However, Short could not read part of the letter.
In this NICHOLAS cipher, correspondents construct a table as shown below. (Note that herein columns and rows are reversed from the usual convention.) This scheme is polyalphabetic in that the cipher alphabet is switched for every enciphered letter. Thus, the first number "16" is deciphered with the "N" alphabet, resulting in a plaintext letter "B". The second number "24", when deciphered with the "I" alphabet, results in "E". In this way, Short could have deciphered "16 24 2 20 15 4 1 27 18 25 16 25 18" as "BED & BOARD FREE". However, by continuing the process for the latter half, Short would have got "GTBGFJVALTRRZV&K" -- that is, "all consonants almost".
The rule was that after any unenciphered passage, enciphering should begin with the first "N" alphabet. In this case, Jefferson confused Short by beginning fresh enciphering with the "N" alphabet at a sentence break. In the following, the yellow letters are intended readings, while the red letters are what is obtained by applying the rules.
The NICHOLAS cipher is the same type as the one advocated by James Lovell during the Revolutionary War. Lovell-type ciphers are notorious for confusing his correspondents. In later years, Jefferson would use a code (THE=224) in his correspondence with Short.
There was a cipher proposed by Hugh Williamson, a scholar and politician from North Carolina. The cipher required enciphering letter by letter rather than by words or syllables as in various codes used by Jefferson. Apparently, Jefferson found it cumbersome and never made use of it. Jefferson's aversion of cypher in the following quotation may have been exacerbated by this aspect of Williamson's scheme.
Actually, Jefferson had been troubled by Monroe's code for more than eight months and it was only in this February that he could think he finally solved the problem. He hoped he could now use PTJ Code No.6 or No.5 with Monroe.
The Thomas Jefferson Papers website files a cipher by Williamson in the year 1802. (Weber p.191 n.44 appears to indicate this is the same cipher as the above.) It is accompanied by the following cipher table.
Thirteen columns headed by 1-13 each represent a cipher alphabet. Williamson gives the following example enciphering, where the number "1" indicates that the cipher alphabet of column 1 is used. (In the following, errors of Williamson's examples have been corrected.)
Integrity is the safest Road to Popularity.
ngtblknxu nw xmb wfabwx khfc xh ihiyqfknxu.
Columns 9-11 are cipher alphabets consisting of figures rather than alphabetical letters. Column 9 would encipher the same plaintext as follows:
Thus, each number is followed by a full stop and a literal full stop is represented by a line with a point over it. Words are separated by a plus sign.
Columns 12 and 13 include both alphabetical letters and numbers, where capitals and small letters are distinguished.
F 6.37.A C 36.F 37.a + F 4. + 37.D A + 4.30.40.A 4.37 + 36.d 30.B + 37.d + c d c b 3.30.36.F 37.a .
It is noted that Williamson's instruction states "If you shift the column in the middle of a line, put the number of the new column over the first word you write with the new alphabet." Thus, Williamson contemplated switching the enciphering alphabet in the middle of a passage.
In 1803, Jefferson sent an expedition party under Meriwether Lewis, his personal secretary, and William Cark, Lewis' army friend, to explore the wild west. Western exploration was Jefferson's long cherished plan but he also felt need to assert American interest against Spanish control of the lower Mississippi. Thus, he planned an exploration of the interior of the North American continent, including foreign territories.
In the meantime, it was known that Spanish Louisiana territories were to be retroceded to France and Jefferson approached the French government under Napoleon Bonaparte for the purchase of Louisiana. In April 1803, a treaty for Louisiana Purchase was signed in Paris and announced in America on the 4th of July. Although Jefferson had some concern about constitutionality of the deal, the treaty was ratified. Spain, though upset by the sale, had no power to prevent it and formally returned the territory to France in November and France handed it to the United States in December 1803.
The expedition was intended for both scientific discovery and extension of commerce, which latter point was stressed in Jefferson's secret message to Congress in January 1803 that asked for appropriation of $2,500. Although the mission was to be communicated to France, Spain, and Great Britain, Jefferson wished to hide this from his political enemies.
Further, even after ceding Louisiana, Spain had a vast territory in the continent and feared that the expedition might lead to invasion. (Actually, Spain launched several attempts to cut off the expedition.)
Jefferson's instructions for Lewis dated 20 June 1803 asked for use of cipher when necessary.
The expedition began in May 1804 after camping in St. Louis in the winter of 1803-1804 and the party returned to St. Louis in September 1806. It brought many scientific and geographic discoveries in the Northwest.
Jefferson prepared a cipher table for Lewis as shown below.
Jefferson's instruction was as follows.
That is, to encipher the first letter "t", the column headed by "1" is used. Looking at the row headed by "t" to the left, one gets the cipher letter "u" at the intersection of the "1" column and the "t" row. To encipher the second letter "h", the column headed by "2" is used, and so on.
Not only the regular use of the columns, Jefferson also described a keyword system, in which the columns to be used for enciphering are selected according to a keyword.
The column to be used to encipher the first letter "t" is identified by the first letter of the keyword, "a", which is sought in the last horizontal line. Jefferson gave the following example.
The first line is the plaintext. The second line repeats the keyword to keep track of the letter to be used. The third line is the cipher. (Jefferson skipped "i" in Missouri in his encipherment.)
The Thomas Jefferson Papers website describes a similar cipher table as sent from Jefferson to Lewis.
The keyword for this example was "antipodes".
The enciphering scheme is the same with the ARTICHOKE cipher. The first letter is encoded with the column of "a" (which is now found on the top line, which is more intuitive than using the last horizontal line as in the ARTICHOKE cipher). The place of the first letter "t" found on the leftmost column specifies the row to be used. Thus, the ciphered letter is found at the intersection of the "a" column and the "t" row, i.e., "u".
The ANTIPODES cipher also allows numbers to be enciphered, using the number column at the right margin of the table.
At any event, despite Jefferson's request, there remains no evidence that Lewis and Clark actually used the cipher in their correspondence with Jefferson.
The Thomas Jefferson Papers includes still another cipher table as shown below. It consists of 30 columns of randomly arranged 26 letters. Apparently, the 30 columns represent 30 cipher tables. Cipher based on such a random table is more difficult to break, whereas a regular cipher table such as ARTICHOKE or ANTIPODES cipher is more convenient in that only the key need to be exchanged beforehand and the table itself can be constructed anytime.
While serving as Secretary of State (1790-1793) under President Washington, Jefferson devised principles of a wheel cipher (see, e.g., Monticello Report). The device was for facilitating use of polyalphabetic cipher as given by the generalized Vigenere tableau shown above.
The device is formed as a cylinder consisting of wooden cipher wheels rotatably threaded on an iron axis. The periphery of each cipher wheel is divided into 26 sections, each labelled with the 26 letters of the alphabet in random order.
To encipher, one would rotate the wheels to make the letters of the plaintext align in one line. Taking as an example the plaintext "your favor", the letter "y" of the first wheel is aligned with the letter "o" of the second wheel, the letter "u" of the third wheel, etc. When the wheels are arranged, among the 26 lines on the cylinder, the 25 lines other than the plaintext line would each represent a cipher message. The sender can copy any one of those lines in the letter.
The receiver is supposed to have the same cylinder. To decipher the message, the receiver arranges the wheels so that the cipher message appears in one line. Then, one of the other 25 lines would reveal the original plaintext. Since the lines other than the correct line will not make sense, the correct line can be identified.
Jefferson pointed out that by changing the order of the wheels in the cylinder, an immense variety of different ciphers might be produced for different correspondents. Supposing a typical cylinder contains 36 wheels, Jefferson estimated the number of orderings (36!) to be "a number of which 41.5705351 is the Logarithm of which the number is 372 with 39 cy[p]hers (zeros) added to it".
Pictures of a modern recreation of the wheel cipher can be seen at Monticello Report. The National Cryptologic Museum (see also here) exhibits a wheel cipher device acquired from a West Virginian antique dealer, who found it in a home near Monticello. Connection of the device to Jefferson, however, is yet unproven and the device is said to be "apparently for use with the French language" (supposedly, this means the wheel contains an alphabet of 25 letters without "w" as is the case with Bazerie's device mentioned below).
Although Jefferson's wheel cipher was an ingenious device, actual production of the device was not easy. Thus, when Robert Patterson proposed a new cipher (see the next section), Jefferson commented "I ... find it much more convenient in practice than my wheel cypher" (22 March 1802).
The wheel cipher was re-invented at least twice in later years. The Bazeries cylinder, proposed to the French army by Étienne Bazeries in 1891, and M-94, devised by Parker Hitt and officially employed by the US army in 1922 and used until 1945, were both essentially the same as Jefferson's wheel cipher.
Jefferson enciphered the Lord's Prayer.
The cipher used here is Patterson's cipher with the following keys:
key of letters 18.104.22.168.22.214.171.124.5.|126.96.36.199.188.8.131.52.5.|3.
key of lines 184.108.40.206.220.127.116.11.4.|18.104.22.168.22.214.171.124.9.|1.
Patterson's cipher is a scheme proposed by Patterson to Jefferson in December 1802. See here for details.
To encipher the Lord's Prayer, the text is first written with the letters aligned vertically.
Then, the vertical lines are transcribed horizontally.
Now the keys come into play. The first section of the key of lines 126.96.36.199.188.8.131.52.4. prescribes that the first 9 lines of the transposed lines should be transcribed in this order. The first section of the key of letters 184.108.40.206.220.127.116.11.5. prescribes the number of nulls (insignificant letters) to be inserted at the beginning of each line.
To decipher, a number of nulls are first deleted according to the key of letters. Then, the key of lines are written by each line. The lines are transcribed according to the key of lines, which reveals the plaintext vertically.
Three years after Patterson proposed his new transposition cipher scheme to Jefferson, he made another proposal (30 December 1805). It involved steganography rather than cryptography.
Patterson realized that any cipher practiced then had one defect in common. That is, in case it is intercepted, the enemy would immediately know that it contains some secret information. Thus, if the fact could be concealed and the letter appeared perfectly innocent, the common politeness, even of an enemy, would most frequently let it pass to the intended recipient.
In order to embed a secret message in a seemingly innocuous plaintext, Patterson thought of using the dot of an "i" and the bar of a "t", referred to as "adjuncts" by Patterson. He considered using 40 or 50 varieties in forms and positions of these adjuncts to express alphabetical letters, digrams, a space, and some frequently occurring words.
According to Patterson, the dot of the i may be varied in form eight or more ways: the strong dot, the weak dot, the small dash, horizontal, vertical, oblique descending to the right, oblique descending to the left, the comma, the reversed comma, and the acute accent. Further, each of these may be varied in position six different ways. That is, it may be placed at a small, or at a greater distance above the body of the letter, and this either directly above, or to the right, or to the left, of the body of the letter.
The bar of the t may be confined to the straight line. This, however, may be short or long and each of these may be varied in 28 different positions. That is, it may cross the stem of the letter having an equal portion on each side, or a greater portion of the stroke may be on the right of the stem than on the left, or on the left than on the right (1,2,3). It may just touch the stem on the right or on the left but not cross it (4,5). Or lastly it may in fact not touch it at all, but be wholly on the right, or on the left. (6,7) Further, it may be drawn either near the line of writing or at a greater distance above it (x2). It may be either parallel to the line of writing, or it may diverge a little from it towards the right (x2).
The left figure shows the table Patterson prepared on this principle.
Patterson included an example of this scheme.
The message embedded in this ostensible letter is:
"The cndc of spn twrds the U.S. mst no lngr b prctsd with impun. Wr s unavdbl. Dmnd yr psprt, and rtrn a sn a psbl."
This is supposed to read:
"The conduct of Spain towards the U.S. must no longer be practised with impunity. War has become unavoidable. Demand your passport, & return as soon as possible."
Patterson considered a little practice would render this scheme very easy both in writing and reading. Apparently, however, subtle variations in the "adjuncts" are hard to discern. Considering the many errors made even when relatively simple codes were used, this scheme was hardly practicable.