Commandant Bazeries of the French army succeeded in decoding secret letters written in 1691 by Louis XIV and his war minister Louvois to General Catinat and published the results in Émile Burgaud, Étienne Bazeries, Le Masque de fer: révélation de la correspondance chiffrée de Louis XIV (1893) (Google). The letters revealed by the codebreaking led to a hypothesis about the identity of the legendary Man in the Iron Mask, which, however, is not now widely accepted by the historians.
Contents:
Bazeries Codebreaking of Louis XIV's Great Cipher
Bazeries' Hypothesis about the Man in the Iron Mask
According to Le Masque de fer (1893), which describes Bazeries' achievements in the third person, the things started in 1891 when Commandant Gendron, who was studying the campaigns of General Catinat, brought to Bazeries the letters almost entirely in code, which were printed in Mémoires et correspondance du maréchal de Catinat (1819) (Google) (That Bazeries used this printed source can be seen in the references on p.56-58, 265):
8 July 1691 from Louvois (p.295- ) about 1050 code numbers; quoted on p.1-3 and p.43-46 of Bazeries (1893); allegedly containing a reference to the Man in the (Iron) Mask
9 July 1691 from Louvois (p.299- ) about 1600 code numbers; quoted on p.47-48 of Bazeries (1893)
19 August 1691 from Louis XIV (p.305- ) about 1250 code numbers; quoted both in plaintext and ciphertext on p.292-300 of Bazeries (1893)
24 August 1691 from Louis XIV (p.309- ) about 1100 code numbers
29 August 1691 from Louis XIV (p.315- ) about 500 code numbers
6 September 1691 from Louis XIV (p.318- ) about 400 code numbers
14 September 1691 from Louis XIV (p.320 -) about 6300 code numbers; annotated deciphering in another article
In total, about 12200 code numbers (Bazeries gives 12125 (p.263; p.260 has an incorrect figure 11125)).
(Louvois died on 16 July 1691 and Catinat was ordered to address directly to the king for the time (p.79).)
Although a number of cryptographers had already been consulted in vain, Bazeries declared his could decode them. He observed that the code had at most figures up to 600 and encoding despatches with such a small set of figures implied the figures represented syllables (p.257-258). That is, although a code of 600 figures representing syllables is much harder than a simple substitution system with 26 or so figures representing letters because usual frequency analysis is of little use, once an initial breakthrough is made, similar reasoning might be employed to identify one code group after another.
Bazeries considered the starting point is always a search for a probable word (i.e., a word that can be supposed to be present in the letter). For this military correspondence, Bazeries assumed "les ennemis" should occur frequently. Still, it may be encoded as "les ennemi s" (with "ennemi" represented by a dedicated code group) or "les en ne mi s" (with "ennemi" represented by three syllables), etc. By examining repetitively used patterns, it was assumed that the following sequences, with slight variations, represented "les ennemis".
This worked. Since 22, 124, and 125 were among the most frequently occurring code groups (occurring 187 times, 185 times and 127 times, respectively), this revealed 1077 groups among the 12125 code groups of the seven dispatches. (Heuristically, Bazeries may have first identified the frequently occurring sequences above and hit upon "les ennemis" in considering various high-frequency syllables "le", "la", "de", "en", "on", "les", "des", etc. for 124 and 125 (as described in Fletcher Part, Secret and Urgent (1939), p.135).)
This initial breakthrough allowed identification of further variants, for example,
Continuing in this way, code groups could be identified one after another (p.262-264).
Even those used only once could be identified from the context.
Long after Bazeries achieved the codebreaking in Nante in 1891, a deciphered text of the letter of 19 August 1691 was found in the archives and confirmed the exactitude of his decoding (p.292).
The code contained figures up to 587. Frequently used letters/syllables are assigned more than one figure. Assignment of figures to letters/syllables/words is not in alphabetical order, meaning it is a two-part code consisting of an encoding table in alphabetical order and a decoding table in numerical order (printed on p.273-280 and p.280-289, respectively). There is even a code group (27) for deleting the preceding code group. (p.271-272)
Electronic data of the despatches and interlined deciphering as well as the coding/decoding tables is available at Les lettres de Catinat.
See another article for an overview of ciphers of this period including this one.
The main topic of Le Masque de fer (1893) was to present a hypothesis about the identity of the legendary Man in the Iron Mask. The codebreaking is only treated in the annex, placed even after an appendix.
The book is organized as follows.
The letters in code brought to Bazeries were addressed to General Catinat in 1691. France was then engaged in the War of the Grand Alliance (a.k.a. the Nine Years' War) against the alliance of England, the Dutch, the Holy Roman Emperor, etc. While the main theatre was the Low Countries, there were also hostilities in northern Italy, where the Duke of Savoy sided with the grand alliance in June 1690 because of the overbearing attitude of France (as a background, see around p.110 in the chapter "The War in Peidmont (1690-1696)" in Symcox, Victor Amadeus II: Absolutism in the Savoyard State, 1675-1730 (Google).
The French held two strategic places in northern Italy: Pignerol in the west and Casale in the east. Catinat was sent to this theatre and soundly defeated the Duke of Savoy at the Battle of Staffarda in August 1690 (Wikipedia). Catinat took Susa in November. But, unable to subsist in the devastated Piedmont, the French withdrew for winter quarters west of the Alps.
The campaign of 1691 in Italy began felicitously for the French. Catinat took Villefranche and Nice in March and Carmagnola in June (the latter to be retaken in October). However, the siege of Cuneo (Coni in French) undertaken by the Marquis of Feuquières and General Bulonde in June ended up in a disaster, precipitated by a hasty withdrawal of General Bulonde at the approach of the Imperial relief led by Prince Eugene of Savoy (Wikipedia; Bazeries p.19-22).
Louvois' letters in code, dated 8 July and 9 July 1691, were written when he received Catinat's report of the fiasco and, even before the codebreaking, it was clear that they related to Cuneo (Bazeries p.42-43; Memoires de Catinat p.42). Indeed, when Bazeries deciphered the despatches, they mentioned the king's order to arrest Bulonde.
From this, Bazeries considered General Bulonde was the Man in the Iron Mask and described his career in detail in Le Masque de fer (1893).
It must be remembered that although Bazeries claims there can be no doubt to his reading (p.266-268), the crucial reading of "330 masque" is only a conjecture made on this sole instance. (In Memoires de Catinat, there is one other instance of 330 in the letter of 14 September 1691 (p.332) but the context shows it is an error for 380 (estre). As for the following 309, it occurs many times, despite some sources, and its value as null or punctuation may be said to be established.)
An obvious alternative "garde" may be discarded because there is "214 gard", which is used about 20 times (e.g., "211<prendre> 214<gard> 154<e>" in the letter of 14 September 1691) and may be said to be established.
Although no one appears to have come up with a more convincing reading for "330", General Bulonde has long since ceased to be the favorite candidate among the historians. David Kahn, the authority in cryptology, examined a great cipher found in the archives, not the one used in the letters concerned but belonging to the same period, and showed that it does not include "masque" in its vocabulary (David Kahn, "The Man in the Iron Mask - Encore Et Enfin, Cryptologically", Cryptologia 29(1): 43-49 (2005)).