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.
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.
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).
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.
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:
He even said "writing in cypher is tedious and disagreeable" in his letter to Carmichael (25 February 1780).
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.
Further, on 10 November 1780, Jay proposed a similar but more complicated book code based on Entick's Dictionary to Robert Morris (WE082).
Robert Morris apparently planned to follow the proposal in June 1781 but would eventually abandon it (Weber p.110, n.16).
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.
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:
The "precaution" had been explained by Jay as follows.
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.
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.)
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.
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:
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).
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).
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.
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.
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.
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.
(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:
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."
Livingston proposed modification to WE007 in the postscript of his letter of 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.
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.