At a glanceExisting decipherment · complete
- The letter
- George W. Erving, American chargé at Madrid, to James Madison, Secretary of State, private letter No. 21, 24 March 1807, “In the Cypher of the Legation”.
- Where
- National Archives, RG 59, Despatches from Spain vol. 10, microfilm M31 reel 12, frames 0283–0286 (with Madison’s decode); the “Duplicate” in the Madison Papers, Library of Congress (mjm014714). Printed in Papers of James Madison, Secretary of State Series 13:529–31.
- The cipher
- The numbered word-and-syllable code Charles Pinckney had used in Spain, in which the is 1651 and of 133.
- How it was checked
- From Madison’s interlinear decode, collated with the undecoded duplicate and with Pinckney’s own decoded despatches in the same code, which fix the disputed groups.
- What it says
- Godoy told the Prussian chargé that Bonaparte had offered him the Electorate of Hanover; he hoped by holding it to make a separate peace with England and “exchange Hanover for Gibraltar”.
- Still open
- Nothing in the letter: the one loss, the rest of sp[eak], is missing in both copies and is Erving’s own.
- Credit
- James Madison’s contemporary decode, and Pinckney’s despatches decoded at the time (Jacob Wagner, 1803).
This page was split on 14 October 2026 from a combined page (legation.html) that also held John Quincy Adams’s St Petersburg despatch No. 88 of 1812, which is in Adams’s own code, a different cipher with its own page: Adams at St Petersburg, 1812. Erving’s later letter of 10 August 1807, in the same Pinckney code, has its own page too: Erving to Madison, August 1807.
01 The letter and the printed decode
George W. Erving, chargé at Madrid, wrote privately to Madison on 24 March 1807 (No. 21) “In the Cypher of the Legation”, the code Charles Pinckney had used in Spain. He reports a secret conversation between the Prince of the Peace (Godoy) and the Prussian chargé Henry: Bonaparte has offered the Prince the Electorate of Hanover for himself, and the Prince hopes by holding Hanover to make a separate peace with England and exchange it for Gibraltar. The Madison editors (PJM-SS 13:529–31) print the letter from Madison’s interlinear decode on the first received copy and state that the key has not been found (Weber, pp. 152–53). The decode has holes: “Haweder”, “Ha——er”, “Giblartar [sic]”, “see the he was more so”, “sp[eak]”, and at note 8 “to the […]” where Madison wrote “se al e”.
Three sources were used: the first received copy with Madison’s decode (NARA RG 59, Despatches from Spain vol. 10, microfilm M31 reel 12, frames 0283–0286); the “Duplicate” in the Madison Papers at the Library of Congress (mjm014714), coded throughout and not decoded; and Pinckney’s own despatches in the same code (M31 reel 7 frames 0346–0352, 22 February 1803, one copy decoded by Jacob Wagner on frame 0348; reel 8 frames 0083–0084, January 1804). Pinckney’s pages confirm the common values: 1651 the, 133 of, 1343 and, 244 to, 1578 that, 69 in (Wagner: “the In-tend-ant” = 1651.69.1586.103), 1515 late.
02 The holes closed
| Founders prints | Groups (both copies agree) | Reading | Evidence |
|---|---|---|---|
| “to the […]” (n. 8; Madison “se al e”) | 69.1651.1183.1497.1298 | in the scale | 69 is in: Madison himself so decodes it (“his retreat in Ha—er”, “went in-cog”), as does Wagner in 1803; his “to the” is a slip. 1497 is al (Madison, and in Gibraltar). Madison reads 1183 as se (se-em-ed), and se-al-e can only be scale: “might be of importance in the scale; again, to raise up an insuperable obstacle … & lastly to get the Prince within his grasp”, the second of Erving’s three objects. Either the key’s 1183 is sc or Erving took the neighbouring group. |
| “Haweder”, “Ha——er” (n. 5) | 724.529.934 (five times) | Hanover | 724 Ha and 934 er in all five; Madison left 529 blank or guessed “wed”, but decoded the same three groups “Hanover” himself at “exchange Hanover for Gibraltar”. 529 = nov. |
| “see the he was more so” (n. 6) | 1578.926.390.720.1219 | see that he was more so | 1578 is that everywhere else, as the editors note; the code is right and Madison’s “the” is a slip. |
| “Giblartar [sic]” | 1619.1508.1497.1594 (twice) | Gibraltar | At the second occurrence Madison wrote “Gibraltar”; with 1497 = al the groups spell the name correctly. The [sic] belongs to Madison’s decode, not to Erving. |
| “sp[eak]” (n. 4) | 244.1212.133 | to sp[eak] of | 1212 is sp (gra-sp, 408.1013.1212). The rest of the word is missing in both copies, so the omission is Erving’s. It stays as the editors print it. |
| “been lately doing” (n. 7, coded only in the Duplicate) | …1164.1515.38.769.66… | been late-ly do-ing | 1515 late (Pinckney 1803), 38 ly, 66 ing: the Duplicate’s coding agrees with the clear text of the first copy. |
So every hole in the printed text closes, and the only real loss is Erving’s own dropped -eak. Madison had the key: the holes are his slips, not
missing entries. The contribution is small. The letter was already in print and legible; two of the corrections (that, speak) the editors
had themselves suggested in their notes, and Hanover they had nearly established. What is new is in the scale, the proof that the
“Haweder” and “Giblartar” forms are Madison’s and not Erving’s, and the demonstration that the Pinckney code is recoverable from
the microfilm. The decipher-along above runs the recorded groups of the Hanover passage through the Pinckney key as it was later rebuilt for the August letter
(targets/erving1807aug/key_pinckney.tsv); groups that key does not list are shown as unknown.
03 What remains open
- In this letter, nothing. The missing -eak after 1212 sp is absent from both copies. Some line alignments of the opening paragraph in the
group list (
erving_groups.txt) are approximate; the groups at the holes were checked on both copies. - Erving to Madison, 10 August 1807 (M31 reel 12, frames 0362–0366), several pages in the same code with no decode on the NARA copy: done since, by an outside contribution, on its own page (Erving to Madison, August 1807), where the Pinckney key was rebuilt to 414 rows.
- A full Pinckney key. Pinckney’s decoded despatches of 1802–04 (Founders 02-03-02-0170, 02-03-02-0313, 02-04-02-0419, 02-04-02-0611, 02-06-02-0346 with Brent’s three-page decipherment, 02-06-02-0560, 02-07-02-0022) are on M31 reels 7 and 8 and should give a few hundred more pairs.
Full texts
The transcription and the decryption of every document on this page, so that the reading can be used and checked. Short files are shown here; all are in the repository.
Erving to Madison, Madrid 24 Mar 1807, No. 21
George W. Erving, US chargé at Madrid, to Secretary of State Madison, 24 March 1807, in Pinckney's legation code: the Prussian chargé reports a secret meeting with the Prince of the Peace, who says Bonaparte offered him the Electorate of Hanover and dreams of exchanging it for Gibraltar; Erving reads the offer as a French move to weaken Spain and bind the Prince to France. Madison's interlinear decode is the reading; the project closed its holes.
Transcription
# Erving to Madison, Madrid 24 Mar 1807, private No 21 "in the Cypher of the Legation" (Pinckney's code). # Groups as read from NARA M31 reel 12 frames 0284-0286 (RC1, Madison's interlinear decode, given after =) # collated with LoC Madison Papers mjm014714 images 0604-0607 (RC2 "Duplicate", undecoded). # Format: groups | Madison's decode (from the RC1 image) | notes 1651.571.792.1340.604.968.1694.525.347.69.475.975.295 | The prussian charge affairs has informed me | 133.624.1387.1162.526.248.674.926.723.1407 | of a conversation which he had with | 1651.1661.1651.865.1166.1516.926 | the Prince the night before last. He | 1367.517.553.704.1651.1661 | short note from the Prince | 1691.151 | afternoon | 624.34.89.374.381 | a rendevous | 1657.410.382 | private house | 664.69.956.298.216.101.625 | went incog wrapped up in his Cloak | 69=in, 956=cog 377.69.408.1685.1432.1498.1651.1661 | ... The Prince | 972.66.1114.673.1481.390 | asking him whether it was | 1651.571.792.1340.604.968.1694.525.764.1554.133.324.624.91 | the Prussian Charge affaires dispaches of such a day | 69.475.975.1651.1524 | informed the King | 408.1651.1661.763.394.1481.424.1343.1656.162 | his the Prince dispositions and projects | 1201.1290 | against France | 421.611.795.1686.1651.1287 | intercepted by the French | 1603.1583.926.594.524.1340.114.934.975.1578.926 | Mister Henry answered that he | 1651.1661.242.97.1114.1578.926 | The Prince told him that he | 69.253.40.298.709.1428.1545.1412 | intimation from Lord Howick | 257.1651.523.1560.1607 | thro' the Russian Minister | 1651.1560.335.133.1651.765 | the contents of the dispatches | 926.1651.1661.115.627.1589 | he the Prince suspected | 133.1651.333.1010.284 | of the English Government | 1603.1583.926.594.524.1340.114.934.975 | Mister Henry answered | 1560.335.665.908.533.111.38 | contents were correctly stated | 38=ly 313.97 | stated | 333.1250.1203 | English must | 742.871.1686.293.133.870.1212.163 | at them by means of their Spies | 236.1603.1583.926.594.524.244.1212 | led Mister Henry to sp | 1212=sp; "eak" missing in BOTH copies 133.1651.146.1194.422.1290.1343.1651.1661.242.97.1114.1578.825.593.640.1590 | of the march of troops into France and the Prince told him that Bonaparte | 244.1114.134.66 | to him offering | 305.977.691.743.133.724.529.934.478 | Electorate of Ha-?-er for | Madison: "Haweder" 1114.1419 | himself | 926 | he | 377.111.146.1194.244.125.755.1635.1578.903.1603.1583.926.594.524.313.97 | up troops to occupy that Country. Mister Henry stated | 244.1451.956.380.1000.1651.1656.162.1497.1521.377.1651.1661.1183.30.97.244 | to discourage the project all the Prince seemed to | 1688.408 | but his | 927.724.529.934 | having Ha--er | 244.471.624.1181.1.743.628.1407.970 | to make a separate peace with England | 1540.605.724.529.934.478.1619.1508.1497.1594 | exchange Hanover for Giblartar | Madison's own slip: 1497=al (his "se al e"), so Gi-b-ral-tar 133.324.624.1656.162 | of such a project | 674.1603.1583.926.594.524.134.975.244.1481 | which Mr. Henry offered to it | 390 | was | 720.634.1181.97.674 | more passed which | 244.488.994 | to detail | 637.133.1651.1387.1162.526.248.1343 | part of the conversation and | 926.234.1651.1661 | he left the Prince | 408.1242 | his plans | 926.1114.1419 | he himself | 887.825.593.640.1590.390 | Tho' Bonaparte was | 65.1331.226.253.268.1340 | deep politician | 1578.926.390.720.1219 | the(!) he was more so | 1578=that everywhere 1407.970.926.313.97.1578.926 | with England he stated that he | 1535.1362.578.792.208.970.474.244.970.1487.1481 | every possible effort to effect it | 1651.333.665 | the English were | 674.1603.1583.926.594.524.347.313.97.244.295 | which Mr. Henry has stated to me | 1651.1181.1531.763.394.1481.424.133.884.1010.284.1343.133.1651.1661 | the secret disposition of this Govt. and of the Prince | 1651.134 | the offer | 1484.553.1422 | is not one | 1481 | It | 1481.58 | its objects | 528.1498.881.133.1210.1686 | weakning of Spain by | 1563.622.624.580.424.133.1481.477 | considerable a portion of its force | 1651.1661.1686.884.1505.1027.1529.144 | the Prince by this bribe firm | 359.610.110.69.313.133.1694 | uncertain state of affairs | 133.1210.1201.1290.1613.1027 | of Spain against France might be | 69.1651.1183.1497.1298 | "to the" se al e | 69=in (not to); read: in the sc-al-e = "in the scale" 1181.1.743.628.500.1210.1343.970 | separate peace between Spain and England | 1651.1661 | the Prince | 408.1013.1212 | his grasp | 133.1651.1661.1280.1027.772 | of the Prince may be first | 825.593.640.1590.1686.618.885.1554.982.945 | Bonaparte by acquiescence. Then | 133.1651.89.742.725.133.1651.1524.1415.925 | of the death of the King whose health is | 1114.1419.884.52.189.742.69.724.529.934.360.1651.1413.133.1290 | himself his retreat in Ha--er under the wing of France | 326.609.1216.69.624 | successor in a | 926.347.534.244.1169.310.1023 | he has reason to believe | 244.1114.1419.71.721.1596.77.1298 | to himself immortal fame | 1619.1508.1497.1594.1686.1340.1540.605.478.724.529.934 | Gibraltar by an exchange for Ha--er | 1651.1661.242.97.1603.1583.926.594.524.1578.926 | the Prince told Mr Henry that he | 1578 | that | 1370.723.926.1474.1645.1578 | ... she had actually declared | 1578.926.347.87.1518.975.1114.1419 | that he has lately declared himself | 709.1521.1343.176.226.268.111.469.583.244.1651.523.594.1607.1343.748.887.136.97 | full and explicit manner to the Russian Minister and authorized his | 244.408.1530.408.398.71.335.525.1343.69.1584.69.832.133.1651.1494 | to his Court his sentiments and intentions in favor of the Allies |
Decryption
# Erving to Madison, Madrid 24 Mar 1807, private No 21 "in the Cypher of the Legation" (Pinckney's code). # Groups as read from NARA M31 reel 12 frames 0284-0286 (RC1, Madison's interlinear decode, given after =) # collated with LoC Madison Papers mjm014714 images 0604-0607 (RC2 "Duplicate", undecoded). # Format: groups | Madison's decode (from the RC1 image) | notes 1651.571.792.1340.604.968.1694.525.347.69.475.975.295 | The prussian charge affairs has informed me | 133.624.1387.1162.526.248.674.926.723.1407 | of a conversation which he had with | 1651.1661.1651.865.1166.1516.926 | the Prince the night before last. He | 1367.517.553.704.1651.1661 | short note from the Prince | 1691.151 | afternoon | 624.34.89.374.381 | a rendevous | 1657.410.382 | private house | 664.69.956.298.216.101.625 | went incog wrapped up in his Cloak | 69=in, 956=cog 377.69.408.1685.1432.1498.1651.1661 | ... The Prince | 972.66.1114.673.1481.390 | asking him whether it was | 1651.571.792.1340.604.968.1694.525.764.1554.133.324.624.91 | the Prussian Charge affaires dispaches of such a day | 69.475.975.1651.1524 | informed the King | 408.1651.1661.763.394.1481.424.1343.1656.162 | his the Prince dispositions and projects | 1201.1290 | against France | 421.611.795.1686.1651.1287 | intercepted by the French | 1603.1583.926.594.524.1340.114.934.975.1578.926 | Mister Henry answered that he | 1651.1661.242.97.1114.1578.926 | The Prince told him that he | 69.253.40.298.709.1428.1545.1412 | intimation from Lord Howick | 257.1651.523.1560.1607 | thro' the Russian Minister | 1651.1560.335.133.1651.765 | the contents of the dispatches | 926.1651.1661.115.627.1589 | he the Prince suspected | 133.1651.333.1010.284 | of the English Government | 1603.1583.926.594.524.1340.114.934.975 | Mister Henry answered | 1560.335.665.908.533.111.38 | contents were correctly stated | 38=ly 313.97 | stated | 333.1250.1203 | English must | 742.871.1686.293.133.870.1212.163 | at them by means of their Spies | 236.1603.1583.926.594.524.244.1212 | led Mister Henry to sp | 1212=sp; "eak" missing in BOTH copies 133.1651.146.1194.422.1290.1343.1651.1661.242.97.1114.1578.825.593.640.1590 | of the march of troops into France and the Prince told him that Bonaparte | 244.1114.134.66 | to him offering | 305.977.691.743.133.724.529.934.478 | Electorate of Ha-?-er for | Madison: "Haweder" 1114.1419 | himself | 926 | he | 377.111.146.1194.244.125.755.1635.1578.903.1603.1583.926.594.524.313.97 | up troops to occupy that Country. Mister Henry stated | 244.1451.956.380.1000.1651.1656.162.1497.1521.377.1651.1661.1183.30.97.244 | to discourage the project all the Prince seemed to | 1688.408 | but his | 927.724.529.934 | having Ha--er | 244.471.624.1181.1.743.628.1407.970 | to make a separate peace with England | 1540.605.724.529.934.478.1619.1508.1497.1594 | exchange Hanover for Giblartar | Madison's own slip: 1497=al (his "se al e"), so Gi-b-ral-tar 133.324.624.1656.162 | of such a project | 674.1603.1583.926.594.524.134.975.244.1481 | which Mr. Henry offered to it | 390 | was | 720.634.1181.97.674 | more passed which | 244.488.994 | to detail | 637.133.1651.1387.1162.526.248.1343 | part of the conversation and | 926.234.1651.1661 | he left the Prince | 408.1242 | his plans | 926.1114.1419 | he himself | 887.825.593.640.1590.390 | Tho' Bonaparte was | 65.1331.226.253.268.1340 | deep politician | 1578.926.390.720.1219 | the(!) he was more so | 1578=that everywhere 1407.970.926.313.97.1578.926 | with England he stated that he | 1535.1362.578.792.208.970.474.244.970.1487.1481 | every possible effort to effect it | 1651.333.665 | the English were | 674.1603.1583.926.594.524.347.313.97.244.295 | which Mr. Henry has stated to me | 1651.1181.1531.763.394.1481.424.133.884.1010.284.1343.133.1651.1661 | the secret disposition of this Govt. and of the Prince | 1651.134 | the offer | 1484.553.1422 | is not one | 1481 | It | 1481.58 | its objects | 528.1498.881.133.1210.1686 | weakning of Spain by | 1563.622.624.580.424.133.1481.477 | considerable a portion of its force | 1651.1661.1686.884.1505.1027.1529.144 | the Prince by this bribe firm | 359.610.110.69.313.133.1694 | uncertain state of affairs | 133.1210.1201.1290.1613.1027 | of Spain against France might be | 69.1651.1183.1497.1298 | "to the" se al e | 69=in (not to); read: in the sc-al-e = "in the scale" 1181.1.743.628.500.1210.1343.970 | separate peace between Spain and England | 1651.1661 | the Prince | 408.1013.1212 | his grasp | 133.1651.1661.1280.1027.772 | of the Prince may be first | 825.593.640.1590.1686.618.885.1554.982.945 | Bonaparte by acquiescence. Then | 133.1651.89.742.725.133.1651.1524.1415.925 | of the death of the King whose health is | 1114.1419.884.52.189.742.69.724.529.934.360.1651.1413.133.1290 | himself his retreat in Ha--er under the wing of France | 326.609.1216.69.624 | successor in a | 926.347.534.244.1169.310.1023 | he has reason to believe | 244.1114.1419.71.721.1596.77.1298 | to himself immortal fame | 1619.1508.1497.1594.1686.1340.1540.605.478.724.529.934 | Gibraltar by an exchange for Ha--er | 1651.1661.242.97.1603.1583.926.594.524.1578.926 | the Prince told Mr Henry that he | 1578 | that | 1370.723.926.1474.1645.1578 | ... she had actually declared | 1578.926.347.87.1518.975.1114.1419 | that he has lately declared himself | 709.1521.1343.176.226.268.111.469.583.244.1651.523.594.1607.1343.748.887.136.97 | full and explicit manner to the Russian Minister and authorized his | 244.408.1530.408.398.71.335.525.1343.69.1584.69.832.133.1651.1494 | to his Court his sentiments and intentions in favor of the Allies |
Decryption
# Erving to Madison, 24 March 1807 (No. 21): the holes in Madison's decode closed (copied from NOTES.md, "Results")
Copied verbatim from NOTES.md. Madison's own interlinear decode, run by run beside the code groups, is in
`erving_groups.txt`; the full letter with his decode in italics is printed in PJM-SS 13:529-31 (Founders Online,
Madison/02-13-02-0559, linked, a modern edition). This table gives the project's readings where his decode has holes
or slips.
| Founders | groups (both RCs agree) | reading | evidence |
|---|---|---|---|
| "to the […]" (n. 8, JM "se al e") | 69.1651.1183.1497.1298 | **in the scale** | 69 = *in* (JM himself: "his retreat *in* Ha--er", 742.69.724; "went *in*-cog" 664.69.956; Wagner 1803 "the *In*tendant"), so JM's "to the" is his slip. 1497 = *al* (JM, and Gi-b-*r al*-tar). 1183 read *se* by JM (se-em-ed); the word se-al-e can only be *scale* ("of importance in the scale; again, to raise up..."), so either the key's 1183 is *sc* or Erving took the neighbouring group. The clause is the second of Erving's list: first ... again ... lastly. |
| "Haweder", "Ha——er" (n. 5) | 724.529.934 (5 times) | **Hanover** | 724 = Ha, 934 = er in all five; JM left 529 blank or guessed "wed", but at "exchange Hanover for Gibraltar" he decoded the same three groups as "Hanover" himself; 529 = *nov*. |
| "see the he was more so" (n. 6) | 1578.926.390.720.1219 | **see that he was more so** | 1578 = *that* in all other places, as the editors say; the code is right and JM's "the" is a slip. |
| "Giblartar [sic]" | 1619.1508.1497.1594 (twice) | **Gibraltar** | the second occurrence JM wrote "Gibraltar"; 1497 = *al*, so the group order is Gi-b-ral-tar. The [sic] belongs to JM's decode, not to Erving. |
| "sp[eak]" (n. 4) | 244.1212.133 | **to sp[eak] of** | 1212 = *sp* (gra-sp, 408.1013.1212); the rest of the word is missing in **both** copies, so the omission is Erving's. Stays as the editors print it. |
| "been lately doing" (n. 7) | RC2: ...1164.1515.38.769.66... | *been late-ly do-ing* | 1515 = late (Pinckney 1803), 38 = ly, 66 = ing. |
So every hole in the printed text closes: the only real loss is Erving's own dropped *-eak*. Madison had the key. The
holes are his slips, not missing key entries.Decryption: 02-13-02-0559
Key: key.md, key_pinckney.tsv
04 Sources
- National Archives, RG 59, Despatches from U.S. Ministers to Spain, microfilm M31, reel 12, NAID 188605361, frames 0283–0286; reel 7, frames 0346–0352; reel 8, frames 0083–0084.
- Library of Congress, James Madison Papers: George W. Erving to James Madison, 24 March 1807, “Duplicate”, mjm014714.
- Founders Online: Erving to Madison, 24 March 1807, Madison/02-13-02-0559 (Papers of James Madison, Secretary of State Series 13:529–31).
- Ralph E. Weber, United States Diplomatic Codes and Ciphers, 1775–1938 (Chicago, 1979), pp. 152–53.
The Erving group list with Madison’s decodes (erving_groups.txt), the notes, the frame-scoring script and the reveal builder
(build_reveal.py) are in the repository folder targets/erving1807/. Microfilm images are not committed.
