John Jay's Codes and Ciphers

Prelude (1779)

The American Revolution saw many codes and ciphers coming into use and falling into disuse in turn. John Jay was one of the foreign ministers who felt concern about the security of their correspondence and took much interest in codes and ciphers.

John Jay was appointed minister to the Spanish court in 1779. Arriving in January 1780 at Cadiz and in April at Madrid, he endeavoured for two years to gain support for the American cause and then joined Benjamin Franklin in Paris in June 1782 for peace negotiations.

On 25 October 1779, while on board near Reedy Island at the mouth of the Delaware River waiting for departure to Spain, he wrote to his friend Robert R. Livingston and enclosed a cipher for their private correspondence. It was simple substitution of mixed numbers 1-26 for the 26 letters of the alphabet (WE074 as classified by Ralph E. Weber).

On 22 December, before receiving this letter, Livingston in his part wrote to Jay that he wished to settle a cipher with him that he might for the future write with more freedom than he could then dare to do. (Richard B. Morris, John Jay, the Making of a Revolutionary, p.671)

When, after more than three months later, Livingston received Jay's letter, he saw at once that the proposed cipher was not safe enough.

I have just stayed out of Congress to let you hear by this opportunity that your friends in this part of the world are well and not unmindful of you, and to acknowledge the receipt of yours from Reedy Island, which, after long and wearysome peregrinations, reached me three days ago at this place.
The cipher [it] contains is not sufficiently intricate to be in any wise relied on. If the conveyance by which this is to go should be delayed, I will enclose one that you may venture to express your most hidden thoughts in. If not, we will continue the use of yours till a better is established.
(10 February 1780, Livingston to Jay; Jay Papers, ID 6865)

It is noted that Livingston used Jay's cipher for one passage in this letter.

Livingston later mentioned his use of this cipher on several occasions.

If I have not been unfortunate you must at your arrival have found several letters from me, some of them written in our first cipher which you tell me has become useless so that they are probably unintelligible to you.
(6 July 1780, Livingston to Jay)

Book Code Interlude (1780)

Proposal to Livingston (Boyer, WE078)

Almost at the same time when Livingston expressed his concern, Jay himself saw the problem and proposed a book code based on Boyer's French Dictionary (WE078).

The cipher I sent you has become useless & must be omitted. Take the following.
The second part of Boyer's Dictionary, in which the English is placed before the French. It is not paged. You will therefore number the pages, marking the first page with No. 1 and so on. ...
(19 February 1780, Jay to Livingston; Jay Papers ID 7590, Page 15)

A book code encodes a word by the page and the line where the word occurs in a book (a dictionary is typically used because it facilitates finding a word to encode). When a page consists of two or more columns, the column is indicated by a letter ("a", "b", ...), an underline, or an overdot, or the word position may be reckoned in the whole page without regard to columns. Occasionally, it was arranged by the correspondents that some offset was to be added to the page and/or line numbers. .

Apparently, Jay did not believe book code could be an ideal way of secret communication. On the same day, he wrote to Schuyler to seek another possibility.

I will share them with you if you please, and to do it the more effectually, wish you would send me a plan and explanation of the cipher you once shewed me at Rhynebeck, but which I do not now well recollect. Let the key word be the name of the man who so long and regularly placed every day a tooth pick by Mrs. Schuyler's plate, written backwards, that is the last letter in the place of the first, and so on.
(19 February 1780, Jay to Schuyler)

With Gouverneur Morris, Carmichael and President of Congress (Entick, WE080)

In the same month, a book code based on Entick's Spelling Dictionary (WE080) was used in several letters Jay received from his secretary, William Carmichael. Apparently, Carmichael learned of the book code from Arthur Lee (see here).

These uses of book code were preceded by another book code arrangement with Gouverneur Morris, who used a book code, considered to be based on Entick's Spelling Dictionary, in his letter of 3 January 1780 to Jay. Jay's note dated 2 March 1780 shows another proposal for Gouverneur Morris of offsetting the page and line numbers by 200 and 50, respectively.

Jay also used Entick's Spelling Dictionary for writing to the President of Congress but confessed his dislike of it:

I do not like the cipher in which I write, and shall therefore defer further particulars till Mr. Thomson shall receive the one now sent him.
(Jay to President of Congress, 3 March 1780)

He even said "writing in cypher is tedious and disagreeable" in his letter to Carmichael (25 February 1780).

With Thomson and President of Congress (Boyer, WE079, WE081)

The code mentioned above as sent to Thomson was WE079, which was sent to Charles Thomson on 29 February 1780 (Jay Papers). However, it is wondered how Jay would like WE079 any better than WE080. It was also based on Boyer's Dictionary, with the column being indicated by an underline instead of a letter, while maths of offsetting may be slightly less complicated. Jay suggested with it a list of some seventy roman numeral codes.

Livingston in his part found a book code troublesome. Further, he could not obtain the edition of the dictionary specified by Jay. Thus, he sent Jay a new cipher of different principles on 26 August 1780. It would take some time, however, for this letter to reach Jay. In the mean time, Jay used a book code (WE081) at least for coding a part of notes about his conference with the Count de Floridablanca on September 23 1780 in his long letter of 6 November to the President of Congress (Wharton omits the cipher passage). A manuscript (transcript) shows underlines and WE081 looks the same as WE079 except that pages precede lines,.

Jay used similar book code with underlines in a letter of 28 January 1781 to the President of Congress (not printed in Wharton) . This system is noted by Weber (p.51) but, again, apparently his source omitted underlines. Translation is known for the code of this letter as well as for the code of the letter of 6 November 1780 (WE081). Collation shows they merge fairly well and they may be considered to follow the same scheme. The code of the 28 January letter puts pages after the lines and it seems identical to WE079.

Proposal to Robert Morris (Entick, WE082)

Further, on 10 November 1780, Jay proposed a similar but more complicated book code based on Entick's Dictionary to Robert Morris (WE082).

Should the following cipher reach you safe, we may afterwards write with less reserve. Entick's Spelling Dictionary printed in 1777, paged backwards. The last page in the book is numbered 468. Let this be page the first and mark the first page (which is the titlepage) 468. Count the words from the top, distinguishing the columns by a . over the first figure for the first column, and a . over the second figure for the second column. For instance, the word absent is the fifth word in the first column of the 434th page, and is to be thus written 5.,434.
(19 November 1780, Jay to Robert Morris)

Robert Morris apparently planned to follow the proposal in June 1781 but would eventually abandon it (Weber p.110, n.16).

With Bingham (Entick, WE083)

While book code would fall out of use in diplomatic channels, it had an advantage that correspondents did not have to prepare a code table. In September 1781, Jay told a trader in Philadelphia, William Bingham, to use book code based on Entick's Dictionary (WE083) and Bingham used it at least in his letter of 14 August 1782 to Jay.

Polyalphabetic Trials (1780-1781)

Livingston's proposal

The new cipher proposed by Livingston on 26 August 1780 was a polyalphabetic cipher with a nonce keyword XZA, with about 10 codes defined for high-frequency words (WE034). (A manuscript cipher can be found in PCC, Roll 72, Page 139.) His explanation is as follows:

I have not been able to procure at this place the key to the cipher that you directed me to, though I believe I have it at home; besides that it is very intricate and troublesome; I shall therefore be obliged to confine what I have to say to mere common occurrences. I enclose you a cipher which is very simple, and not to be deciphered while the key is concealed, as the same figure represents a variety of letters. In order that you may know whether it comes safely to hand I have in this letter used the precaution mentioned in yours.
(Livingston to Jay, 26 August 1780)

The "precaution" had been explained by Jay as follows.

Be particular in informing me whether this letter comes to your hands free from marks of inspection. I shall put a wafer under the seal; Compare the impression with those you have formerly received from me. If you should have reason to suspect that all is not fair, I will, on being informed of it, send you another cypher. Be cautious what you write in the common way, as I am persuaded few letters would reach me through the post offices of France or Spain uninspected.
(Jay to Livingston, 19 February 1780)

As it turned out, Jay thought Livingston's cipher might have been copied by the Spanish authority and proposed a new version. In his letter, Jay also pointed out that keywords played no significant role in Livingston's scheme (unlike Lovell's scheme below) and any words, even mere numbers, might be substituted.

Your cipher is intelligible, but as I suspect the letter which enclosed it was opened before it came to my hands, I think it would be prudent to alter it a little.
If I understand your explanation right, what you call the key letters are the letters which spell what you call the key word. In this instance you have in fact no key word though the letters over each column answer the purpose just as well as if they spell any particular word.
The cipher I enclose is on the same plan with yours, and yet sufficiently different. I will now in your cipher give you a key word for it. I am persuaded that the route in which this letter will pass is very different from that in which I suspect yours was opened, and therefore that I may without much risk use your cipher in this occasion - 24 2 18 3 4 ["YESCA" as enciphered by the XZA cipher].
I must observe, however, that whoever gets a copy of the enclosed cipher may use it without the key word. For, be the key word what it may, the number 1, 2, 3, 4, 5, or any numbers corresponding with the number of columns and applied in like manner as a key word, will answer the same purpose. Try it and you will find it so. I have on experiment found 1.2.3. perfect substitutes for your x.z.a.
Mr Toscan who is appointed Vice Consul at Boston has been so obliging as to wait a few days for my dispatches. Favor him with your notice and attention.
(25 April 1781, Jay to Livingston, Jay Papers ID 809, ID 7954 (draft))

Similar to the XZA cipher (WE034), this YESCA cipher (WE033) was a polyalphabetic cipher with some thirty codes. (A manuscript cipher can be found in Jay Papers ID 7596 and PCC, Roll 72, Page 141.)

Lovell's polyalphabetic substitution

Another polyalphabetic scheme was used by James Lovell, who led the Committee of Foreign Affairs. Unlike Livingston's proposal, a keyword in the Lovell scheme was not a nonce and was used to derive a cipher table. Lovell assigned keywords CR to John Adams, COR to Benjamin Franklin, and UNT to William Palfrey. The keyword for Jay was BY (WE047). A manuscript assigning these keywords is found in PCC, Roll 72, Page 144.

PCC, Roll 72, Page 133 contains a resolution of the Congress on 10 August 1781 in which a passage "further cession of the right of the United States to the navigation of the river Mississippi" is enciphered in Lovell's polyalphabetic substitution with the keyword BY.

This may be compared with a letter a year before (16 June 1780) to Jay from the Committee of Foreign Affairs in the name of James Lovell, Robert R. Livingston, and William C. Houston (PCC, Roll 72, Page 127), which was encoded with book code based on Boyer's Dictionary.

Use and Disuse of Polyalphabetic Schemes

The task of the Committee of Foreign Affairs was taken over by a new Department of Foreign Affairs. Livingston took office as the first Secretary of Foreign Affairs of the United States in October 1781. Livingston used the YESCA cipher in his letter of 1 November 1781 ("No. 1") to Jay and described the cipher as follows:

I shall use our private cipher, as corrected by that sent by Mr. Toscan, till you receive the one transmitted by Mr. Thomson, in which case, as it is less troublesome, be pleased to use that, if you are sure it came safe.
(Livingston to Jay, 1 November 1781)

Toscan is the person who carried Jay's letter of 25 April 1781, to America. The cipher "transmitted by Mr. Thomson" is WE007 discussed in the next section.

Polyalphabetic substitution was an elegant scheme but switching substitution tables was prone to inducing errors. Lovell's cipher is notorious for confusing his correspondents and Livingston's letter of 1 November 1781 is said to contain "so many errors that the despatch makes little sense" (Weber, p. 36).

Diplomatic Code (1781-1782)

WE006 and WE007 Transmitted

Robert Morris, to whom Jay had proposed a book code WE082, chose to use a code of 660 elements (WE006) in his letter to Jay on 4 July 1781. As of 7 July 1781, he sent Jay the code (the manuscript code list is at Jay Papers ID 7592).

Unlike book code, this type of code list (often called a nomenclator) saves the trouble of counting the lines and it is free from maths for offsetting. Random mapping between plaintext words and code numbers makes cryptanalysis difficult. (In book code, mapping is in the alphabetical order.) Acquisition of a specified edition of a specified dictionary is not necessary, though at the cost of preparation of code lists. Further, code numbers for alphabetical letters provide flexibility of spelling any word.

As early as ca. 13 July, he wrote in WE006 (Jay Papers ID 7668). He wrote again in the same code on 29 July (Jay Papers ID 7008 and ID 10231) and its enclosure dated 15 July (Jay Papers ID 7666).

If Major Franks is lucky enough to deliver you my dispatches sent by him, you can then decipher this letter and the other enclosures; if he does not I shall explain them hereafter. (Robert Morris to Jay, 29 July 1781)

Such was the time that transatlantic communication often got seized by the British or otherwise lost on its way. It was thus quite common to send not only a duplicate but a triplicate, a quadruplicate, and even a "5plicate" were occasionally sent in different routes to ensure at least one copy would get through. However, seizure or loss of packets was not to be the sole reason of trouble.

About the same time, Charles Thomson, secretary of the Continental Congress, sent a code (WE007) on 11 July by the hands of Major Franks.

You have also a cypher which you may use either in your public dispatches or with your friend the secretary who presents his most respectful compliments to Mrs. Jay, and begs your acceptance of the same.
Charles Thomson to Jay, 11 July 1781 (Jay Papers ID 4637) Some sources attribute this letter to Livingston. See Jay Papers ID 7762 and Weber p.80

This was a code of about 600 elements (the manuscript code list is at Jay Papers ID 7591 for encoding and Jay Papers ID 7595 for decoding). As Livingston said in his No. 1 (see above), such a code was "less troublesome" than a polyalphabetic system like YESCA (WE033).

Franks brought letters from America to Jay in September (Jay to John Adams, 15 December 1781) and went on to Paris. Thus, Jay did receive both Morris' code (WE006) and Thomson's (WE007). He even used WE007 himself in his letter of as early as 20 September 1781 to Livingston. A manuscript is found in PCC, Roll 117, Page 369 and Jay Papers ID 4164 and ID 11910.

The duplicate of the WE007 code was sent by Thomson (See Jay's letter of 28 April and 9 May 1782 quoted below) in a packet to France and forwarded by Thomas Barclay, consul in France, to Jay. Jay received the packet on 29 November but was alarmed to notice a mark of inspection. He was exasperated that Barclay had sent the packet by the post.

Whatever the carelessness on Barclay's part, Jay indeed received WE007 and its duplicate.

Wrong Cipher

Confusion began by a mistake on Livingston's side. By Secretary Thomson's mistake, Livingston used not WE007 as he intended to but "a cipher sent by Mr. Palfrey" for coding his letter of 28 November 1781 ("No. 2") to Jay and trusted it to Marquis de La Fayette, who was returning to France after the victory of Yorktown.

Soon thereafter, Livingston realized the mistake. William Palfrey, who was to bring the cipher to Jay, had been lost at sea in December 1780. Livingston told Jay of the wrong cipher in his letter of 13 December 1781 ("No. 3"). He used WE007 to encode this letter and enclosed the duplicate of his No. 2 (the letter of 28 November 1781) encoded in the same.

Livingston explained the error as follows.

My last letter, of the 28th of November, sent by the Marquis de la Fayette, must for the most part have been unintelligible to you, owing to an unfortunate mistake of Mr. Thomson, who delivered me a cipher sent by Mr. Palfrey, which you never received, instead of that sent by Franks. The duplicate enclosed is in the last, so that you will no longer be at a loss for my meaning. (Livingston to Jay, 13 December 1781)

As regards the "cipher sent by Mr. Palfrey", an alternative coding of the letter is found as Jay Papers ID 598 and ID 1537. The ID598 manuscript shows decoding with WE007 was attempted by someone but abandoned after only trying for the first four codes ("493(SHI) 227(IG) 259(THEIR) 226(EDGE)"). The code used in these manuscripts appears to have 227 for "the" (THE=227). The Jay Papers website notes the code list of Jay Papers ID 7593 (THE=596) was used in Livingston's letter of 28 November 1781. This, however is a one-part (alphabetical) code of words ranging from 11 (abandon) to 654 (your) and it is obvious that this is different from the one used in ID 598.

Anyway, Livingston's excuse turned out to be superfluous, for Jay thought he had received neither No. 1 nor No. 2. However, this was not the end of the story. Somehow, Jay found cipher of this letter unreadable!


On 6 February 1782, Jay wrote two letters.

To Livingston, he wrote:

The secretary of the minister of state sent me yesterday morning your favor of the 13th of December last....

These are the first letters or papers of any kind that I have as yet had the pleasure of receiving from you since your appointment, and they must for the present remain unintelligible for the want of your cipher. The one mentioned to have been enclosed with these papers is missing, and the other never came to hand.

On the 29th of November last I received a packet, in which I found enclosed a set of ciphers endorsed by Mr. Secretary Thomson, and nothing else. Mr. Barclay had sent it by the post, under cover to a banker here. It had evident marks of inspection, but I acquit the banker of any hand in it.


There are letters in town brought by the Marquis de la Fayette to France; but I have not yet received a line by or from him.

We must do like other nations--manage our correspondence in important cases by couriers, and not by the post.


You may rely on my writing you many letters, private as well as official, and as I still have confidence in Mr. R. Morris' cipher, I shall sometimes use it to you.

(Jay to Livingston, 6 February 1782)

"Mr. R. Morris' cipher" mentioned in this letter is WE006 as seen below.

To the President of Congress, Jay wrote:

I have just received, through the hands of the minister's secretary, a letter from Mr. Livingston, dated the 13th of December, marked No. 3. It is in cipher, but I can not read it, nor a duplicate of No. 2, enclosed in it, for want of a key, which, though mentioned to have been enclosed, is missing. None of his other letters have reached me. A duplicate of Mr. Thompson's cipher brought by Mr. Barclay, came to me through the post-office with such evident marks of inspection that it would be imprudent to use it hereafter.

(Jay to the President of Congress, 6 February 1782)

In his frustration, Jay took out his old YESCA cipher to draft a passage in his letter to Livingston on 14 March 1782 (see draft in Jay Papers). The ciphered passage was: The minister delays. I think that America will not have from Spain aids of importance if any.

On 28 April 1782, Jay wrote, in his very long letter (running more than forty pages in Wharton), again about the Spanish censorship and used Morris' cipher (WE006) to encode some passages in the letter.

All the ciphers in this letter are those in which I correspond with Mr. Morris, and the only ones I have received from him. They were brought by Major Franks, and marked No. 1. Several of my former letters to Mr. Thomson and you mentioned that his cipher was not to be depended upon. The copy of it brought by Mr. Barclay, which is the only copy I have received of the original by Major Franks, having passed through the post-office, came to my hands with marks of inspection on the cover. (Jay to Livingston, 28 April 1782)

(It is noted here that Morris' cipher "No. 1" is WE006. Another cipher of Morris', "No. 4", is WE008 and was sent to Franklin.)

Meanwhile, ignorant of Jay's frustration, Livingston continued to use WE007 in his letters of 2 February 1782 (Jay Papers ID 7929, ID 11361, PCC Roll 105, Page 373) and 20 April 1782 (Jay Papers ID 817).

Apparently, Livingston received about this time Jay's letter of 6 February about want of cipher and marks of inspection. Livingston's letter of 28 April 1782 included passages coded in WE007 (omitted in Wharton) but he did not use the code for the enclosed resolution of the Congress, saying:

I have the honor to enclose an important resolution, which I fear to put in cipher, both because you seem to be at a loss about your cipher and because it would be of little use considering the accident which you say has happened to it.
(Livingston to Jay, 28 April 1782)

Livingston expressed on 9 May his surprise that Jay could not read his code:

Your letter of the 6th of February, with a duplicate of that of August last, directed to the President, has been received and read in Congress. I am extremely surprised to find from that and yours to me that so few of my letters have reached you, since no vessel has sailed from this, or, indeed, from any of the neighboring ports, without carrying letters or duplicates of letters from me. The whole number directed to you, including the duplicates, from October to this time, amounts to twenty-four; so that they must certainly be suppressed in many instances.

But what astonishes me more is to find that you can not read my letter No. 3, and the duplicate, of No. 2, when, upon examining my letter book, I find it is written in the very cipher which you acknowledge to have received, and in which your letter of the 20th of September is written; so that if it is not intelligible, it must have undergone some alteration since it left my hands, which I am the more inclined to think, because you speak of a cipher said to be enclosed of which my letters make no mention, and only notes a slight alteration in Mr. Thomson's cipher. My first letter was in our private cipher; this you had not received. My second, by the Marquis de la Fayette, in cipher, delivered to me by mistake by Mr. Thomson, and lost with Mr. Palfrey. My third, in the cipher sent by Major Franks, a duplicate of which was sent by Mr. Barclay; and that enclosed a copy of my letter No. 2. I had then discovered the mistake, so that I can in no way account for your being unable to decipher it.

(Livingston to Jay, 9 May 1782)

Actually, as noted above, Jay himself used WE007 in his letter of 20 September 1781. A manuscript letter of 13 December 1781 at Jay Papers ID 7926 shows his deciphering of passages in WE007.

Towards the end of the letter, Livingston wrote "I am embarrassed beyond expression at the misfortune that happened to Mr. Thomson's cipher. I shall enclose another with this, and send them both to Mr. Harrison, with special directions to send them safely to you."

Puzzled as he was at Jay's words, Livingston was sufficiently alarmed by the reported Spanish censorship to think of sending a new cipher. However, a margin note of the May 9 letter (on the last page of Jay Papers ID 7934) said "It was impossible to get the cipher [finished] in time to send it. Use Mr Morris's [till] you receive it."

Enter WE008

Livingston proposed modification to WE007 in the postscript of his letter of 6 July 1782.

Finding it extremely difficult to send you a cipher free from inspection, I wish you to alter yours by advancing your ciphers one unit. ... as for A, instead of 392 write 393. For AB, 191. (Livingston to Jay, 6 July 1782)

(This postscript is not printed in Wharton but manuscripts are found in PCC, Roll 139, Page 236 and PCC, Roll 72, Page 121)

Meanwhile, Jay joined Franklin in Paris for peace negotiations. In a letter of 8 August to Jay, Livingston used "Doctor Franklin's cipher" (WE008). Like WE006 and WE007, this was a code of about 670 elements. Livingston enclosed the resolution of Congress of 7 August encoded in both WE007 and WE008. The manuscript of the WE007 version is found in PCC, Roll 72, Page 147 and the WE008 version is found in PCC, Roll 72, Page 149.

Livingston continues to use WE008 at least in his letters of 5 September, 18 September, 21 November, 3 December (to Franklin), 12 November 1782, and 4 January 1783 (to Jay).

Apparently, Robert Morris and Gouverneur Morris maintained their own channel of WE006. A letter from Jay to Gouverneur Morris of 13 October 1782 and a letter from Gouverneur Morris to Jay of 1 January 1783 used WE006.

New Turn

On 18 September 1782, Livingston mentioned a new cipher sent to Jay (see here) but, without acknowledgement from Jay, he still used WE008 as of 4 January 1783. Somehow, Jay could not receive the code as late as June 1783.

Jay left Paris in May 1784 and arrived at New York in June. He became the second Secretary of Foreign Affairs after long vacancy left by Livingston's resignation in June 1783. In that capacity, he corresponded with Jefferson in Paris with THE=224 code (Jefferson-Jay code) and with John Adams in London with THE=82' code (Jay-Adams code, WE013) (see here).

While safe delivery remained a problem, code of hundreds or more of elements representing words, syllables, and letters of the alphabet was becoming established as a preferred mode of secret communication. It would remain so until communication methods were completely changed by telegram.

©2008 S.Tomokiyo
First posted on 2 November 2008. Last modified on 24 June 2009.

Articles on Historical Cryptography
inserted by FC2 system