92 39 73 43 · 30 27 69 · 24 78 27 69 66 50 39 21 71 37
n a c h · d e r · O b e r p f a l t z
a = 18 39 46 74 85 · e = 19 27 41 62 75 86 · n = 11 26 49 64 92 98

Hof → Silesia · homophonic cipher in two-digit figures with code groups, inside clear German · 29 December 1640

Johan Banér to Torsten Stålhandske, Hof, 29 December 1640

Johan Banér
fromJohan Banér
Torsten Stålhandske
toTorsten Stålhandske

Pontificia Università Gregoriana, APUG 568 f. 239r–v, among Athanasius Kircher’s letters · a copy of an intercepted field letter, written at Hof days before Banér’s winter march on Regensburg · posted on Cipherbrain in June 2019, where the attempts failed; no decipherment found since

The key was recovered from cribs in the adjacent clear German, with a language model of 1630s German · 246 of 274 cipher figures decrypted; a courier’s name, one corrupt stretch and all fourteen code groups remain open

Daniel Bourdeau · posted · updated

Method: key recovered based on adjacent plaintext · Extent: partial (90% of the cipher)

Summary. A copy of an intercepted letter from the Swedish field marshal Johan Banér to Major General Torsten Stålhandske, dated Hof, 29 December 1640, survives in the correspondence of Athanasius Kircher at the Gregoriana (APUG 568 f. 239). Klaus Schmeh posted it on Cipherbrain in 2019 with Philip Neal’s transcription; the readers who tried it, Neal among them, did not decipher it, and no decipherment was found elsewhere. Most of the letter is in clear German; seven passages are in two-digit figures, with fourteen three-digit code groups. None of the Swedish keys on DECODE fits it, Banér’s own among them, and a language model alone cannot settle 74 homophones from 274 figures. The key was recovered from two cribs taken from the adjacent clear text (durch after “von zeit zu zeit”, and und): with them fixed, the solver produced nach der Oberpfaltz und, and the rest of the key followed from that phrase. The decrypted passages say that Banér means to march “nach der Oberpfaltz und gegen die [442]”; he expects the enemy to gather against him “und etwa auch die in Schlesien agirende [361] dazu ziehen”; Stålhandske is to “gute acht geben”, follow the enemy “mit guten Fürsichtigkeit”, report “durch Espionen”, and tell him “wohin er seine Marche zu richten”. 246 of 274 cipher figures decrypted (89.8%), measured. Checking against the manuscript scans corrected four figures of the transcription. Open: the second courier’s name and a stretch in the fifth passage, where the figures are confirmed and every value is fixed by other words, so the only surviving copy is corrupt there; and all fourteen code groups, for which no key survives.

01 The document

The heading reads Copia Intercipirtes Schreibens General Baners an General Major Stallhausen: Stålhandske, who commanded the Swedish troops in Silesia. The letter is dated Hoff den 29 Decem. A. 1640 and signed with a flourished B. Kircher’s file calls it Copia litterarum interceptarum Generalis Baners Hoff in Silesia. The copy reached Rome, presumably so that Kircher could try the cipher; there is no decipherment on the two pages posted.

The upper half of f. 239r: clear German with lines of two-digit numbers
The first page, upper half: the heading, the first two cipher passages (the routes of an earlier letter), and the third, which decrypts as nach der Oberpfaltz und gegen die [442]. Image: Pontificia Università Gregoriana, APUG 568 f. 239r, via the Museo Galileo Kircher Correspondence Project.

The cipher passages (S1–S7 here) hold 274 two-digit numbers with 74 distinct values from 2 to 98, and fourteen three-digit numbers: 361, 442, 464, 508, 513 and 568, which stand for names or nouns, and a cluster 766–783 in the fifth and sixth passages. The work started from Neal’s transcription and the blog’s small images; it was then checked figure by figure against the Museo Galileo’s scans of f. 239r–v (1469 × 2304 px, served openly), which correct four figures: the first figure of S4 is 86 (Neal 66), a figure in Schlesien is 86 (Neal 36), one in guten is 47 (Neal 57), and the figure Neal could not read in S7 is 92.

02 How the key was recovered

The Swedish keys. DECODE holds the Riksarkivet’s box of Swedish chancery keys (Chifferklaver, låda II, records R4103–R4329). Their archivists’ covers name the correspondents and give the values of a. Banér’s keys there, the Horn–Banér cipher (R4122), the code in use with Oxenstierna from late 1634 (R4123, copied in R4325 as Generalis Campi Marschalli Johan Banneris Cyffer), and the other alphabets of the 1640 chancery register (R4325, R4266), were transcribed and tried, as they stand and at every offset from −30 to +30. None fits.

Why a solver alone fails. Unconstrained homophonic annealing finds keys that score better than real German would. A control settled this: 1630s German from the Theatrum Europaeum, cut to the same segment lengths and enciphered with Banér’s 1634 key, scores −279 under the model built here (de-1640s), and the solver’s optima sit at −390 to −430. With eight known values the same solver, restricted to a few homophones per letter, lands on the true key. So the letter needed cribs.

The cribs. The sixth passage follows mich aber von zeit zu zeit and opens 40 16 23 28 29: durch. The pair 28 29 (ch) comes seven times. 16 64 40 is und. With those fixed, the solver wrote nach der … pfaltz und in the third passage, the one that ends [442] loszugehen. Banér did march from Hof into the Upper Palatinate in the first days of January 1641, and surprised the Reichstag at Regensburg:

The third cipher passage: 92 39 73 43 30 / 27 69 24 78 27 69 66 50 39 21 71 37 16 64 40 / 33 62 51 75 98 63 77 27 442 loszugehen
… Continance erleiden will, 92 39 73 43 30 27 69 24 78 27 69 66 50 39 21 71 37 16 64 40 33 62 51 75 98 63 77 27 442 loszugehen: nach der Oberpfaltz und gegen die [442] loszugehen. Image: Pontificia Università Gregoriana, APUG 568 f. 239r, via the Museo Galileo Kircher Correspondence Project.

That phrase fixes twenty values, each consistent with durch and und. From there the key was extended word by word, and no value was kept unless it gave sense in at least two words: Schlesien agirende, dazu ziehen, gute acht geben, sobaldt, ehender, solche, Fürsichtigkeit nachvolgen, wohin er seine Marche zu richten, entgegen. The key has 70 values, one to six per letter, in no alphabetical or banded order.

03 The decrypted text

Clear text in roman, the decrypted passages in italics, code groups in brackets, letters not recovered as ?. The transcription of the clear text is Neal’s.

… welches ich im Duplo, als ein Exemplar Jobs[508], das andere aber in [513] n Johann ??????????? über [568] abgehen lassen …

… undt gesonnen, wofern es nimmer die Ratio Belli undt des feinds … Continance erleiden will, nach der Oberpfaltz und gegen die [442] loszugehen, undt meinen aeussersten fleis anzuwenden. … es werde der feindt seine aeusserste macht von allen oertern her colligiren, undt so starck als es ihm muglig mir entgegen leitten, etwa auch die in Schlesien agirende [361] dazu ziehen.

So wollt der herr General Major darau[f] gute acht geben und sobaldt (e)ich sein gegen[773] ehender [464] auf solche W?????????????? zu [775] dem [767] ?? ein guten Fürsichtigkeit nachvolgen, mich aber von zeit zu zeit durch E(sp)ionen sie ko[m]en, dass sie mö[g]en, wie sein undt des feindes gelegenheit sey, eigentlich undt unschwierig berichten, damit ich ihm inmittelst mit seiner andeutung wohin er seine(n) Marche zu richte(n), entgegen wolten komme …

In sense. Banér sent his letter of the 16th from Erfurt in duplicate, one copy by [508], the other by a Johann by way of [568]. He has come to Hof and means, if the reason of war and the enemy’s bearing allow, to march through the Upper Palatinate and against [442], most likely Regensburg or the Bavarians. He expects the enemy to gather every force against him, “and perhaps also draw in the [troops] acting in Silesia”. Stålhandske is therefore to keep good watch, and as soon as the enemy moves off, to follow with good caution. He is to report from time to time through spies on his own and the enemy’s situation, so that Banér, told where he means to direct his march, can come to meet him.

Top of f. 239v: the end of the sixth passage and the seventh, 38 24 29 77 92 27 ...
The seventh passage, after mit seiner andeutung: 38 24 29 77 92 27 23 13 41 44 98 86 … wohin er seine(n) Marche zu richte(n), entgegen wolten. Image: Pontificia Università Gregoriana, APUG 568 f. 239v, via the Museo Galileo Kircher Correspondence Project.

04 What stays open

The copy is the only witness known. The sent original, or a register copy in Banér’s papers in Stockholm, would settle the corrupt stretches; neither is digitised.

05 Sources

Files: baner1640/: ct_neal.txt (ciphertext), key.json, decode.py (decryption and measurement), reading.md, solve3.py (annealer), NOTES.md.