October 5, 2026

Louis XIV's Secret Instructions to Constantinople, Deciphered

In the summer of 1690, Louis XIV sent two letters in cipher to his ambassador at the Ottoman court. Ten years later, the English historian Paul Rycaut printed them, still in code, in his History of the Turks. As far as I know, nobody has published a full decipherment in the 326 years since.

With Claude doing the codebreaking, I’ve now read both letters in full. The decipherment is published on Satoshi Tomokiyo’s Cryptiana, which had listed the letters as “partially solved” since 2015. This post covers what the letters say, how the code works, how it was broken, and how we know the deciphered text is correct.

Page 453 of Rycaut's History of the Turks (1700), showing the heading 'Lettres du Roy Tres-Christien à Monsieur Castaignères' and columns of cipher numbers mixed with French text.
Rycaut, The History of the Turks (London, 1700), p. 453. The letters begin at bottom left under “Lettres du Roy Tres-Christien à Monsieur Castaignères”. The cipher starts in the right column. Internet Archive scan.

The letters

In 1690, France was fighting most of Europe in the Nine Years’ War. The Ottoman Empire, meanwhile, was at war with the Holy Roman Emperor in Hungary; Ottoman armies had besieged Vienna only seven years earlier. Louis XIV, the “Most Christian King”, had every reason to keep the Sultan fighting the Catholic Emperor. His man at the Ottoman court was Castagnères de Châteauneuf, newly arrived at Adrianople (Edirne), where the Sultan’s court then was. His predecessor, Girardin, had died in office the year before.

The two letters are dated Versailles, 31 July and 9 August 1690. Both are signed “Louis” and countersigned by Colbert. Some passages are in plain French: thanks for the ambassador’s dispatches, the protection of Latin monks at the holy sites in Jerusalem, and a long passage dismissing William III’s victory at the Boyne. Everything else is in code.

What Louis wrote

Bribes, with conditions. The ambassador had been working to get the Sultan to declare the Hungarian rebel Imre Thököly (“le comte Tekeli”) Prince of Transylvania, and to back him with Ottoman troops. Louis approves. But money only moves once Thököly actually holds Transylvania and its Estates have recognized him, “en ce cas et non autrement” (“in that case and no other”). The limit is 40,000 écus in total, shared between the Grand Vizier and the Khan of the Tatars, the same sum his predecessor had been allowed. Thököly himself gets no pension: Louis says he paid Thököly only while he held the fortress of Munkács (“Mongatz”).

No refuge in France. Four of Thököly’s lieutenants (Horvat, Petrocci, Sandor and Nemessani) had asked for French protection. Louis tells the ambassador to steer them back to Thököly in Hungary or Transylvania and away from France, “où j’ai assez de raison de ne pas souffrir aucune autre religion que la catholique” (“where I have reason enough not to tolerate any religion but the Catholic”). He wrote this to his envoy at a Muslim court five years after revoking the Edict of Nantes.

The Grand Vizier’s promise. The Grand Vizier has promised not to make peace without first telling France. Louis calls it “une si faible assurance, qui ne l’engage à rien” (“so weak an assurance, which binds him to nothing”), and in the same breath refuses to bind himself in return. The Ottomans are to be told that France and the Emperor will not make peace for years, and that the Christian princes cannot unite until James II is restored to the English throne.

Intelligence for the Grand Vizier. In the second letter, Louis authorizes the ambassador to tell the Grand Vizier what France had learned from inside the Emperor’s council: the Emperor’s few troops in Hungary would pull back behind the Morava river and stay on the defensive for the rest of the campaign, and Niš (“Nissa”) would be supplied for a siege. Within weeks the Ottomans had retaken Niš, and in October Belgrade.

The English ambassadors. Louis tells the ambassador not to oppose Lord Chandos (“le seigneur Chandos”) being recognized as English ambassador at the Porte, unless he is sure he can get Chandos’s audiences refused. Nor need he worry about what happens to Sir William Trumbull (“le sieur Trumbal”), the English ambassador already at Constantinople.

The code

This is not a letter-for-letter cipher. It is a code, or nomenclator, of about 420 numbered entries:

  • Below about 80: mostly single letters, with several numbers for each common letter (2 and 3 are both a; 53 and 54 are both s).
  • Above that: syllables (ra, te, con), whole words (que, pour, troupes) and proper names (Girardin, le Grand Seigneur).

The clerk spelled words out of syllables and letters as often as he used whole-word codes, and there are no word breaks. “Prince de Transylvanie” is three codes (prince · de · Transylvanie); “gratification” is seven (g · ra · ti · fi · ca · ti · on).

Tomokiyo had already done the groundwork. In 2015 he rebuilt part of the codebook from a different source: John Wallis’s interlinear decipherment of a 1693 dispatch of Louis XIV, printed in David Kahn’s The Codebreakers. Tomokiyo recognized that the 1690 letters use the same code, and noticed a regularity in it: entries with the same first letter tend to share a last digit. With that table, about half of the letters’ 1,155 code groups could be read. That was enough, as he put it, to “barely allow one to see the topic”. Of the 195 different codes used, 73 were unread or only guessed.

The layout

The regularity Tomokiyo noticed comes from the way the codebook is laid out. It is a grid:

  • Columns are the last digit of the code, taken in the order 1, 2, … 9, 0.
  • Rows are the tens, from 8 (codes 81–90) to 35 (codes 341–350).
  • One alphabetical list runs down column 1 (81, 91, 101, …) and carries on at the top of column 2, then column 3, and so on. For each letter of the alphabet, the syllables come first (ba, be, bi, bo, bu), then the words. The m-syllables even wrap from the foot of one column to the head of the next: ma is 355, me is 86.
  • Column 0 holds proper names and titles. Codes 360–420 are a supplement that continues the same columns.

So every number tells you roughly where its word falls in the alphabet:

ColumnCodes, top to bottom
1… 121 ambassade, 141 Angleterre, 161 arme, 181 avantage, 191 ba, 201 be, 211 bi, 221 bo, 231 bu … 301 ca … 341 cu
4… 224 ha, 234 he, 254 ho, 264 hu, 284 Hongrie …
8… 278 ta … 318 tu, 328 troupes, 338 traité, 348 trouve, 358 toujours
0260 le Grand Seigneur, 270 Girardin, 290 le Mufti …
Close-up of the cipher on page 453: rows of numbers such as 305. 406. 324. 256. 228., interrupted by plain French phrases like 'J'approuve pareillement tout ce, que vous avez fait pour'.
The first cipher passage of the 31 July letter. “260” and “290” in the sixth and seventh lines are le Grand Seigneur and le Mufti: “…rendus à votre caractère, tant par le Grand Seigneur que par le Mufti et le vizir. J’approuve pareillement…”

How it was broken

1. Predict, then fit. Each of the 73 unknown codes got a predicted alphabetical zone from its place in the grid. A candidate reading then had to satisfy two things at once: it had to make sense in every passage where the code appears, and it had to fall inside its zone. That works like a crossword with two sets of clues, and most codes fell quickly:

  • the names: 270 Girardin, 173 Empereur, 149 Vienne, 141 Angleterre, 284 Hongrie, 317 Pologne, 368 Turcs, 388 Transylvanie;
  • common words: 136 moins, 258 sans, 302 dans, 335 lui, 352 des.

Every reading fell inside its predicted zone.

2. Check the printed page. Tomokiyo worked from a transcription, and Rycaut’s typesetter made mistakes of his own. Checking every doubtful group against scans of the 1700 printing sorted the leftovers into three kinds: misprints, deliberate dummy groups (nulls), and real code.

  • Misprints: 355 ma printed for 331 co in “couronne”; 50 for 60; 254 for 252 in “donner”; 65 y for 63 x in “n’excède”; “prieurs” for “plusieurs”.
  • Nulls: 406 appears four times and fits nowhere. Codes 410 and 420 act as brackets around dummy groups: “croire que ⟨410 · x · 40 · 420⟩ la paix se puisse faire” reads perfectly once the bracketed groups are dropped.
  • Numerals: “40” printed underlined among the codes is the literal number, “40 mille écus”.

3. The hard ones. A few codes could only be settled from outside the cipher:

  • 254, in “les sieurs Ho-u-va-r-t, Petrocci, Sandor et Nemessani”, is the syllable ho, so the name is “Houvart”. It is Horvat, Thököly’s agent: in his own dispatch of 1 May 1690, the ambassador reports that “le sieur Horvat est icy depuis peu. Il fut présenté au Visir par le Sieur Sandor”.
  • 290, in “tant par 260 que par 290 et le vizir”, is a third dignitary alongside the Sultan and the Vizier. The Mercure galant of August 1690 printed a letter from a gentleman of the ambassador’s suite describing his audiences. On 29 March the ambassador saw the Sultan, and “le mesme jour” he called on the Mufti, “qui n’est pas moins consideré en ce Pays, que le Pape l’est dans tous les Royaumes Catholiques” (“who is no less esteemed in this country than the Pope is in all the Catholic kingdoms”). The old man, “pour le recevoir avec plus d’honneur que ses Predecesseurs n’en avoient rendu à aucun Ministre de son caractere”, would not be found seated when the ambassador came in. “Son caractère” is the cipher’s own “honneurs rendus à votre caractère”, and 290 sits in the names column. It is le Mufti.
  • 358, in “cela ne vous doit pas empêcher d’y faire 358 tout ce qui vous sera possible”, is the last t-word in column 8. The sentence needs an adverb, and toujours is the only t-adverb that fits. This is the one reading that rests on the codebook layout alone.

Independent confirmation

After the decipherment was finished, we found the King’s own drafts of both letters in print. Eudoxiu Hurmuzaki’s Documente privitoare la istoria românilor, a huge collection of documents on Romanian history, reproduces extracts from the French foreign ministry’s Turkish correspondence (Correspondance politique, Turquie, vol. 22):

  • 31 July: Supplement I, vol. 1 (1886), p. 289.
  • 9 August (the draft is dated 7 August): vol. XVI (1912), p. 255.

Both match the decipherment clause for clause, and the 9 August extract matches word for word. The drafts also corrected one of our readings: 260 is le Grand Seigneur, not la Porte as we first had it. They confirmed that the groups bracketed by 410 and 420 are dummies, since the drafts have nothing there. And they showed where the clerk slipped: the draft reads “défensive pendant tout le reste de la campagne”, but the cipher has the null 406 in that spot, so the clerk simply dropped the word.

Both volumes are on the BCU Cluj digital library: Supplement I, vol. 1 and vol. XVI.

The full text

This is the deciphered text, joined to Rycaut’s plain-French passages, with modernized spelling. ”…” marks plain-text passages left out here. Square brackets mark words lost where the cipher breaks off.

Versailles, 31 July 1690

Lors je ne suis pas moins content des honneurs qui ont été rendus à votre caractère, tant par le Grand Seigneur que par le Mufti et le vizir. J’approuve pareillement tout ce que vous avez fait pour procurer les avantages du comte Tekeli, et disposer le Grand Seigneur à le déclarer prince de Transylvanie, même à employer ses forces pour le mettre en possession de cette principauté. Mais ce n’est qu’à condition qu’il y sera bien établi, et après qu’il aura été reconnu par les États du pays, que je vous permets de m’engager à la gratification que j’avais donné pouvoir au feu sieur Girardin de promettre en ce cas-là seulement, qui ne se doit point étendre ni pour la Moldavie ni pour la Valachie.

Quant à la protection qui m’est demandée par les sieurs Horvat, Petrocci, Sandor et Nemessani, vous devez leur faire connaître que leur principale ressource doit être dans un fidèle attachement aux intérêts du comte Tekeli, et à s’établir avec lui, soit en Hongrie ou en Transylvanie ; mais il est bon de les détourner de songer à se retirer dans mon royaume, où j’ai assez de raison de ne pas souffrir aucune autre religion que la catholique.

Quelque protestation que le grand vizir vous ait faite de ne pas faire la paix qu’il ne m’en ait auparavant donné avis, je ne crois pas qu’on doive faire beaucoup de fondement sur une si faible assurance, qui ne l’engage à rien. Mais comme je ne juge pas à propos d’entrer dans aucun engagement avec le Grand Seigneur qui m’empêche de faire la paix sans sa participation, lorsqu’elle conviendra au bien de ma couronne, il suffit que vous conti[nuiez]…

[La victoire que] ma flotte a remportée sur celle de mes ennemis vous donnera encore de nouveaux moyens de faire voir aux ministres qu’ils doivent beaucoup espérer des heureux succès de mes armes, et qu’ils en pourront tirer de grands avantages s’ils continuent la guerre avec vigueur et fermeté. Sur toutes choses, faites-leur bien comprendre qu’ils ne doivent pas appréhender que de plusieurs années la paix se fasse entre moi et l’Empereur, et que, jusqu’à ce que le roi d’Angleterre soit rétabli sur le trône, il se trouvera des difficultés insurmontables à la réunion des princes chrétiens.

Ne manquez pas de me faire savoir par vos premières dépêches à quoi montent les effets que le feu seigneur Vouir a laissés. Il y a de l’apparence que les liaisons de la cour de Pologne avec celle de Vienne formeront de nouvelles difficultés à la [conclusion d’]un traité de paix particulière entre les Polonais et les Turcs ; mais cela ne vous doit pas empêcher d’y faire toujours tout ce qui vous sera possible pour l’avancer et la conclure.

In English:

Moreover, I am no less pleased with the honours paid to your rank, by the Grand Seigneur as well as by the Mufti and the Vizier. I likewise approve all you have done to advance Count Thököly’s interests and to dispose the Grand Seigneur to declare him Prince of Transylvania, and even to use his forces to put him in possession of that principality. But it is only on condition that he is firmly established there, and after he has been recognized by the Estates of the country, that I permit you to commit me to the gratification that I had empowered the late Sieur Girardin to promise in that case only; and it must not extend to Moldavia or Wallachia.

As for the protection that Sieurs Horvat, Petrocci, Sandor and Nemessani ask of me, you must make them understand that their chief resource must lie in faithful attachment to Count Thököly’s interests, and in settling with him, whether in Hungary or in Transylvania; but it is well to turn them away from any thought of retiring into my kingdom, where I have reason enough not to tolerate any religion other than the Catholic.

Whatever protestation the Grand Vizier may have made to you that he would not make peace without first informing me, I do not think much reliance should be placed on so weak an assurance, which binds him to nothing. But as I do not judge it fitting to enter into any engagement with the Grand Seigneur that would prevent me from making peace without his participation, when that suits the good of my crown, it is enough that you continue…

[The victory that] my fleet has won over that of my enemies [off Beachy Head, 10 July 1690] will give you further means to show the ministers that they should hope for much from the happy successes of my arms, and that they may draw great advantages from them if they continue the war with vigour and firmness. Above all, make them clearly understand that they need not fear that peace will be made between me and the Emperor for several years, and that until the King of England is restored to his throne there will be insurmountable obstacles to a reunion of the Christian princes.

Do not fail to let me know in your first dispatches what the effects left by the late Seignior Vouir amount to. It seems likely that the ties between the court of Poland and that of Vienna will create new difficulties for the [conclusion of] a separate peace treaty between the Poles and the Turks; but that should not prevent you from always doing everything you can to advance it and bring it to a conclusion.

Page 454 of Rycaut's History of the Turks: the end of the 31 July letter signed Louis and Colbert, and the beginning of the 9 August letter.
p. 454: the end of the 31 July letter (“Signé, LOUIS. Plus bas, COLBERT.”) and the start of the 9 August letter.

Versailles, 9 August 1690

Quelque sujet que vous ayez de vous défier des lettres que les ambassadeurs turcs ont écrites au grand vizir, et que le sieur Veterani a fait porter diligemment à Andrinople, il n’y a pas lieu néanmoins de croire que la paix se puisse faire entre l’Empereur avec ses alliés d’une part et les Turcs de l’autre. Vous pouvez même assurer le grand vizir que je sais de bonne part que la résolution a été prise dans le conseil de l’Empereur de faire retrancher le peu de troupes qu’il a en Hongrie en deçà de la rivière de Morava pour y demeurer sur la défensive tout le reste de la campagne, et de munir la ville de Nissa de tout ce qui est nécessaire pour sa défense. …

Je vous ai déjà écrit que je ne donne point de pension au comte Tekeli, et que je ne lui ai accordé des gratifications que lorsqu’il possédait la place de Mongatz, et pour l’aider à résister aux armes de l’Empereur ; ainsi c’est sans fondement que l’on vient demander la pension échue du temps du sieur Girardin. Je vous défends de rien payer audit comte sans un ordre exprès de moi, vous permettant seulement, au cas qu’il soit mis en possession actuelle de la Transylvanie et que, par l’appui que le Grand Seigneur lui donnera, les États du pays l’y aient reconnu pour leur prince souverain, en ce cas et non autrement, de m’engager à faire payer, tant au vizir qu’au Han des Tartares, jusqu’à la concurrence des 40 mille écus que j’avais permis audit sieur Girardin d’employer pour cet effet. Ne voulant pas que vous passiez cette somme, soit au grand vizir ou au Han, en sorte que ce que je serai obligé de donner à l’un et à l’autre n’excède pas en tout lesdits 40 mille écus.

Je ne désire pas que vous vous donniez aucun mouvement pour empêcher que le seigneur Chandos ne soit reconnu à la Porte en qualité d’ambassadeur d’Angleterre, à moins que vous ne soyez assuré de pouvoir lui faire refuser les audiences en cette qualité ; et vous ne devez pas ainsi vous mettre en peine de la destinée du sieur Trumbal.

In English:

However much reason you may have to distrust the letters that the Turkish ambassadors wrote to the Grand Vizier, which Sieur Veterani had carried in haste to Adrianople, there is no reason to believe that peace can be made between the Emperor and his allies on one side and the Turks on the other. You may even assure the Grand Vizier that I know on good authority that the Emperor’s council has resolved to pull the few troops he has in Hungary back to this side of the river Morava, to stay on the defensive there for the rest of the campaign, and to furnish the town of Niš with everything necessary for its defence. … [In plain text, Louis goes on to say that William III’s victory in Ireland should impress nobody: an army of 40,000 had faced only four or five thousand French troops and about 15,000 undisciplined, badly armed Irish, and the French had withdrawn to Limerick without any considerable loss.]

I have already written to you that I give no pension to Count Thököly, and that I granted him gratifications only while he held the fortress of Munkács, and to help him resist the Emperor’s arms; so there are no grounds for now claiming the pension supposedly owed from Sieur Girardin’s time. I forbid you to pay anything to the said Count without an express order from me. I permit you only this: if he is put in actual possession of Transylvania and, through the support the Grand Seigneur gives him, the Estates of the country recognize him as their sovereign prince, in that case and no other, you may commit me to pay the Vizier and the Khan of the Tatars up to the 40,000 écus that I had allowed the said Sieur Girardin to spend for this purpose. I do not want you to exceed this sum, whether for the Grand Vizier or the Khan, so that what I am obliged to give the one and the other does not exceed 40,000 écus in all.

I do not wish you to make any move to prevent Lord Chandos from being recognized at the Porte as ambassador of England, unless you are sure you can have audiences in that capacity refused him; and so you need not trouble yourself about the fate of Sieur Trumbull.

Page 455 of Rycaut's History of the Turks: the end of the 9 August letter, with the 40 mille écus passage and the signatures Louis and Colbert.
p. 455: the end of the 9 August letter. The underlined “40” in the middle of the page is “40 mille écus”.

New code values

These are the values added to Tomokiyo’s table. For his original readings, see his article.

CodeReadingCodeReadingCodeReading
82chrétien84faire93espér-
121ambassade133entre136moins
138roy139ville141Angleterre
142comme146-ment149Vienne
152com(te)159votre161arme
164guerre166mais / -mets173Empereur
178religion181avantage183elle
199vizir203effet237pouvoir
252donne257principa(l/uté)258sans
260le Grand Seigneur261beaucoup265liaison
270Girardin272déclar-274jusqu’
275lettre281bon282défen(s/d)-
284Hongrie290le Mufti291bien
294honneur302dans305lors
314j’a-317Pologne / Polon-335lui
338traité348trouve351conseil
352des358toujours (probable)368Turcs
378 374Tar-tares388Transylvanie401–403punctuation
1, 4, 21, 37, 47, 405–407nulls410 … 420brackets around nulls40the numeral 40

What’s still uncertain

  • 358 toujours is probable, not proven. It fits the grid and the sentence, but the King’s draft of that paragraph isn’t printed anywhere I could find.
  • “Vouir”, the late seignior whose estate Louis asks about, appears in Rycaut’s plain text and is unidentified.

Everything else is either confirmed by the drafts or fixed by the code’s layout in every place it occurs.

How the work was done

I didn’t break this cipher by hand. Claude (Anthropic’s Claude Opus 5.5) did the codebreaking, and my job was mostly direction.

I’d asked Claude to find an entry on Tomokiyo’s list of unsolved historical ciphers that was genuinely solvable rather than merely famous. It screened the open entries and recommended this one: a long ciphertext in a code that was already partly known. I said yes.

Sources and thanks

Thanks above all to Satoshi Tomokiyo, whose 2015 reconstruction made this possible and who published the solution within days of hearing about it.