Republished copy of Daniel Bourdeau’s Unsolved Historical Ciphers, released under CC BY 4.0. Text unchanged; hosted by JIC alongside its translations; not an official copy by the author · View the original ↗
3 11 26 21 17 14 6 15 26 1 8 17
19 21 9 14 19 15 25 3 14 15 3
11 13 15 12 26 1 8 17 21 18

Vienna · substitution cipher in figures, two figures for each vowel · 1644

Fra Giovanni di Lucca to Ferdinand III

Ferdinand III
toFerdinand III

30 May 1644 · Österreichisches Staatsarchiv, HHStA, Staatskanzlei Interiora, Chiffrenschlüssel Kt. 20 Fasc. 27 ff. 18–19 · DECODE R2159

Two hundred and thirty-one dot-delimited figures of Italian, with no decipherment on DECODE; Tomokiyo had published the opening words · the key was recovered with those words as a crib and all 231 figures decrypted · checked against the manuscript, whose clear text names the speaker as Koniecpolski

Daniel Bourdeau · posted · updated

Method: key recovered based on plaintext from external sources · Extent: complete

Summary. S. Tomokiyo’s page of unsolved ciphers carries this item with the remark that it “can be deciphered to read Al principe di trenti…” and that “someone versed in Italian would be able to complete the decryption”. His transcription seemed to contradict the crib: principe is written 26 21 17 17 6 15 26 1, so the figure 17 would be i and n in the same word, which no substitution allows. The first session therefore treated 17 (i or n) and 19 (t or s) as polyphonic. The manuscript images later showed that the writer’s crossed 4 had been transcribed as 17 in ten groups: every “17 = n” is a 14 on the page, and 17 is only i. So twenty-three figures carry one letter each (two figures each for a, e, o, u, i). The remaining figure, 19, is s six times, and s has no other figure; three times it stands where t is wanted. The page shows 19 in both places of Transiuania, so the evidence favours encipherment slips by the writer over transcription errors. The cipher has no polyphonic figure. The key was recovered by fixing the eight letters the crib gives without contradiction and annealing the other sixteen against an Italian 5-gram model: every seed returns the same decryption, and the same procedure on five shufflings of the ciphertext returns nothing. The paragraph relays an offer to Ferdinand III, in the spring of Rákóczi’s invasion of Hungary: to keep the Turk from helping the Prince of Transylvania, to raise the Prince of Moldavia against him, to supply two thousand Cossacks, and to press the Emperor to make no peace until he is humbled or beaten. The clear text around the cipher names the speaker: the Grand Hetman Stanisław Koniecpolski, at Brody. Status: complete, and checked against the manuscript (22 September 2026). Three slips (19 for t) and two short spellings remain as the writer left them.

01 The document

Tomokiyo transcribed the cipher paragraph in his article on variable-length figure codes in the Austrian archives (DECODE R2159, R1408, R2179 and a Starhemberg letter of 1758). His note on this one: from Fra Giovanni di Lucca to the Emperor, 30 May 1644, in Italian; “the number groups may consist of one or two digits, but there is no difficulty in identifying individual groups because the groups are delimited by dots.” DECODE’s public record says Non-decrypted (no decipherment on file), cipher type Unknown, symbol set numerical, two pages, partly encrypted, with a placeholder date range of 1686–1877. The images need a DECODE login. The first session’s decryption rested on Tomokiyo’s transcription alone; on 22 September 2026 the cipher was checked group by group against the image of f. 18r, and ten groups corrected from 17 to 14 (§03). The text below is the corrected one.

3 11 26 21 17 14 6 15 26 1 8 17 19 21 9 14 19
15 25 3 14 15 3 11 13 15 12 26 1 8 17 21 18 6 13 14 18 2 14 12 13 8 18 6 10 1 15 11 22 25
21 6 18 14 13 14 11 17 8 15 9 3 15 23 22 13 1 5 9 21 18 21 15 25 13 11 19 3 32 7 6 18
14 22 21 9 8 17 11 25 15 19 7 19 3 21 9 4 15 19 13 2 14 18 17 11 26 21 17 14 6 15
26 1 8 15 4 18 2 13 8 3 14 17 9 7 22 11 17 8 3 21 13 8 23 12 17 11 15 3 6 18 19
9 6 10 15 7 22 12 3 14 8 1 21 13 9 25 18 17 6 13 14 23 14 3 19 25 9 11 7 22
1 21 3 9 11 15 12 26 7 21 3 22 13 21 7 6 10 7 14 18 14 5 3 6 15 9 26 3 6 7
5 17 14 6 10 7 14 18 14 11 10 3 4 17 10 25 12 17 11 15 9 19 13 18 23 15 14
22 18
Italian letter in which a clear line is followed by eight lines of dotted one- and two-digit numbers
f. 18r, the cipher paragraph: it follows the clear della Religione e ragion di stato and runs for eight lines of dotted figures back into the clear tal cosa fin’ ora non è hauto effetto. The figures decrypt to Al principe di Transilvania lo impedirò con ogni modo che il Turco non li dia aiuto … The crossed figure in principe and con una is the writer’s 4, so the group is 14, not 17. Image: Österreichisches Staatsarchiv, HHStA, Staatskanzlei Interiora, Chiffrenschlüssel Kt. 20 Fasc. 27 f. 18r, via DECODE R2159.

231 groups, 24 distinct figures (1–15, 17–19, 21–23, 25, 26, 32), index of coincidence 0.050. As first transcribed there was exactly one doubled pair, 17 17, twice in the same word, and it drove the first session’s polyphonic hypothesis below. On the page that pair is 17 14: the corrected text has no doubled group at all, and the writer simply avoids double letters (Cosachi, dumilia, habi).

02 Recovering the key

  1. Unconstrained annealing fails. A homophonic annealer with a 5-gram Italian model (Villari’s Machiavelli e i suoi tempi, I promessi sposi, La Mandragola; 4.1 million letters, v written u) was run from sixteen seeds. All sixteen converged on the same optimum, estreesitenetrentiuenieseist…, which is not Italian. The solver recovers a matched 231-letter Italian control in one seed of three, so this is a flat landscape, not a proof.
  2. As transcribed, the crib is inconsistent with a substitution. Al principe di = 3 11 | 26 21 17 17 6 15 26 1 | 8 17. From di, and from il = 17 11 later in the text, 17 is i; in principe the second 17 must be n. Eight letters survive without contradiction: 3 a, 11 l, 8 d, 17 i, 26 p, 21 r, 1 e, 19 t.
  3. Crib-fixed annealing. With those eight fixed and the other sixteen figures free, six seeds converge on one decryption at −2.50 nats per 5-gram: alpriicipeditrantiuanialoimpediroconoinmodocheilturcononlidiaaiutoefaroriuoltase…: lo impedirò … che il Turco non li dia aiuto e farò rivoltare… Word after word is Italian, to the last group.
  4. On the uncorrected transcription two figures seemed to carry two letters (see the note after the key). Holding the rest, 17 decrypts as n in principe (twice), manderò, con una, non, vinto, and i in di, il, impedirò, li, lui, dumilia, finché; 19 as t in Transilvania, rivoltare, sua, humiliato, vinto, and s in Transilvania, se sarà bisogno, Cosachi. No third value is needed for either. A Viterbi decode over the two alternatives with the same model makes each choice mechanically and agrees with the hand decryption except at two places noted below.
  5. Control. The crib-fixed procedure on five shufflings of the same ciphertext (same figures, same counts, same eight letters fixed) reaches −3.40 to −3.68 per 5-gram against −2.50 for the letter, about 200 nats over 227 5-grams. The unconstrained false optimum in step 1 scored the same as the true decryption, so the model does not pick the solution by itself. The eight crib letters do, and the shuffles show that eight fixed letters on this text do not manufacture Italian on their own.

03 The key

123456789101112131415171819212223252632
egabfcedahlmoniiosrtuupr
731633131010126136132018141491484771

Third row: occurrences. Figures 16, 20, 24 and 27–31 do not occur; q, z and consonantal v are absent from the text. The arrangement shows no alphabetical order. b, g and the second r rest on one to three occurrences each, in words no other letter fits (bisogno, Bogdania, habbi; ogni, bisogno, Bogdania; rivoltare).

17 is not polyphonic: checked against the manuscript. The first session proposed that every “17 = n” might be a 14 transcribed as 17, since a 4 and a 7 are close in seventeenth-century hands. The image of f. 18r settles it. The writer’s 4 is a crossed stroke that looks like a barred 7; his 7 is plain. Tomokiyo’s transcription reads the crossed 4 as 14 in most places but as 17 in ten: principe twice (26 21 17 14 6 15 26 1), manderò (12 3 14 8), con una (6 13 14 23 14 3), non twice (14 18 14) and vinto (23 15 14 22 18). Every plain 17 on the page is i. Tomokiyo’s crib Al principe di was right all along. 19 is s: it stands for s six times, and s has no other figure. Three times it stands where t is wanted (Transiuania, rivoltare, humiliato); since the page has the same figure in both places of Transiuania, these are more likely the writer’s encipherment slips for 22 than transcription errors. Whether the two uses of 19 differ in shape has not been checked. The cipher has no polyphonic figure. The key above is the corrected one: 19 is s; the three places where t is wanted are the writer’s slips.

04 Decipherment

Al principe di Transil[u]ania lo impedirò con ogn[i] modo che il Turco non li dia aiuto, e farò rivoltare contra di lui, se sarà bisogno, il principe di Bog[o]dania, et li darò dumilia Cosachi, et manderò a voi con una sua lettera all’Imperatore che non faccia pace fin che non l’habbi humiliato o vinto.
As to the Prince of Transylvania: I shall by every means prevent the Turk from giving him help, and if need be I shall make the Prince of Moldavia rise against him and give him two thousand Cossacks, and I shall send [him] to you with a letter of his to the Emperor, that he make no peace until I have humbled or defeated him.

05 Context

In February 1644 György Rákóczi I, Prince of Transylvania, invaded Habsburg Hungary in alliance with Sweden and France and with the Porte’s leave. Through the spring Ferdinand III’s diplomacy worked to have the Ottoman support withdrawn and to find pressure on Rákóczi’s eastern flank. The paragraph is a first-person offer, carried by the friar, from someone who claims to be able to work on the Porte, to set the Prince of Moldavia (Vasile Lupu) against Rákóczi, and to dispose of two thousand Cossacks. Who is speaking is not in the cipher, but the clear text around it says who. The friar, sent on from Vilnius by the King, came to il suo Generalissimo il Sig.re Stanislao Conespolschi, the Grand Hetman Stanisław Koniecpolski. He told him it was the moment to help the Emperor, and Koniecpolski “answered angelically” that he would, from affection for the House of Austria and from zeal for religion and reason of state. Then comes the cipher. After it, the friar reports that the offer has not yet taken effect, because Rákóczi has sent a great sum of money to Constantinople to have the Prince of Moldavia deposed (fatto mazul). The letter is dated from Brody, Koniecpolski’s residence. Koniecpolski kept his own relations with Moldavia and the Tatars, and had beaten the Tatars at Ochmatów that January. (The clear frame is summarised here, not transcribed letter by letter.)

Fra Giovanni di Lucca (Giovanni Giuliani da Lucca), Dominican, is known from his Relatione and Itinerario as a missionary of the 1620s and 1630s to the Tatars, Circassians, Abkhazians, Mingrelians and Georgians, and from later work in Moldavia (Cristian Luca, 2004, not consulted here). A Dominican who moved between Moldavia, the Cossack lands and Vienna is the sort of courier such an offer would use.

06 Method and files

  1. Ciphertext from Tomokiyo’s article; counts, doubles and index of coincidence checked (targets/lucca/ct.txt). Corrected 22 September 2026 against the DECODE images: ten groups 17 → 14.
  2. Italian 5-gram model with absolute discounting and interpolation, Roman-numeral page references stripped (targets/lucca/lm.py).
  3. Homophonic annealer, unconstrained (targets/lucca/solve.py), then with the eight consistent crib letters fixed (targets/lucca/crib_anneal.py).
  4. Language-model decoding (Viterbi) over {i, n} for 17 and {t, s} for 19, as first transcribed (targets/lucca/decode.py).
  5. Shuffled-ciphertext control of the crib-fixed procedure (targets/lucca/control.py).

Checked: transcription counts, crib consistency, convergence across seeds, five shuffled controls, word-level Italian, and (22 September 2026) every cipher group against the manuscript image. Summarised only: the clear frame that names Koniecpolski.

07 Sources

Analysis scripts and the ciphertext are in the repository (targets/lucca/).