At a glanceKey from adjacent plaintext · partial (90% of the cipher)
- The letter
- Copy of an intercepted letter from Swedish field marshal Johan Banér to Torsten Stålhandske, Hof, 29 December 1640.
- Where
- Kircher’s correspondence, Gregoriana APUG 568 f. 239. Posted on Cipherbrain in 2019 with Philip Neal’s transcription.
- The cipher
- Mostly clear German; seven passages in two-digit figures, with fourteen three-digit code groups. No Swedish key on DECODE fits.
- How it was read
- Two cribs from the adjacent clear text (durch, und) led the solver to nach der Oberpfaltz und, and the rest of the key followed. 246 of 275 figures decrypt (89.5%).
- What it says
- Banér means to march “nach der Oberpfaltz”; Stålhandske is to watch the enemy and report by spies.
- Still open
- The second courier’s name, a corrupt stretch in the fifth passage, and all fourteen code groups.
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 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:

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.

04 What stays open
- Re-measured 5 October 2026.
measure_sense.pycounts only figures inside words that read: 246 of 275 (89.5%). The old count (246 of 274) also credited a stray n after code 513. Every unread stretch was re-read at 2× from the Museo Galileo scan: the copy has 13. 12. 32 where Neal dropped the 12, so 12 = p and Espionen is whole. The S5 stretch (…eise n o u i r e c h t e zu) was scored against movirte, nachrichte and others with a model of 1640s German: none fits the confirmed figures. The 29 open tokens are the corrupt name, the S5 stretch and one stray letter, all with confirmed figures and fixed values. - The second courier’s name (S2, eleven tokens after Johann, which decipher as ohrspacbuet). The figures are confirmed on the manuscript and every value is fixed by other words, so the copy itself is corrupt here. The first courier’s name decrypts as Jobs[508], probably Jobst and a surname in code (graded M).
- A stretch of the fifth passage (eisen o vi rechte, fourteen tokens), two tokens before ein guten, and a stray e in sobaldt e ich (probably er sich). The manuscript confirms every figure and every value is fixed by other words, so this copy, the only one known, is corrupt here; the sent original or a Swedish register copy would be needed.
- Slips of the copy (graded C): d e i n for die in; 93 (i) for n in Schlesien; one letter missing from Marche; the copy also drops a 12 from Espionen, restored from the scan (12 = p).
- The fourteen code groups. 442 is what Banér marches against; 361 is the force acting in Silesia; 508 and 568 are how the two copies went. The 7xx codes fall where letters are missing (darau[778] for darauff, au[772] for auss, ko[770]en), and five of them are letters: freed of fixed values, the solver itself returns au[772] solche [766]eise = auf solche Weise, and darau[778] = darauf, ko[770]en = kommen, dass sie mo[783]en = dass sie mögen (graded C). The other nine (361, 442, 464, 508, 513, 568, 767, 773, 775) stay open: no key survives and each occurs once.
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.
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.
Banér to Stålhandske, Hof, 29 Dec 1640 read in part
An intercepted copy, sent to Athanasius Kircher, of a letter from the Swedish general Johan Banér to Torsten Stålhandske, commanding in Silesia: Banér means to march into the Upper Palatinate, expects the enemy to gather against him and draw in the forces operating in Silesia, and tells Stålhandske to keep good watch, follow with caution when the enemy moves, report through spies and tell him where to direct his march.
Builds coherent sentences, but under the read bar of 95% of words read as sense (85% here); the holes are marked in the reading.
Transcription
# Philip Neal's transcription (Cipherbrain, 2 June 2019); segments separated by clear text # Checked against APUG 568 f. 239r-v (Museo Galileo images, archimede.imss.fi.it/kircher/568/large/239r.jpg, 239v.jpg), 22 Sept 2026: S4 first figure 86 (Neal 66), S4 token 17 86 (Neal 36), S5 "79 48 47" (Neal 57), S7 illegible figure = 92. 5 Oct 2026: S6 has 13 12 32 (Neal dropped the 12; read at 2x zoom), giving 12 = p in E-s-p-ionen. S1 34 20 78 83 508 S2 77 92 513 11 93 88 43 18 64 26 24 29 23 13 12 85 28 70 16 27 25 7 78 62 23 568 S3 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 S4 86 25 38 85 39 90 82 43 63 75 77 92 13 28 29 21 86 83 93 41 93 18 33 32 23 27 11 30 62 361 40 74 55 84 10 77 62 43 41 92 S5 63 18 23 39 16 778 79 84 71 27 46 28 29 25 51 27 70 75 64 84 92 30 13 24 42 46 53 63 71 86 32 73 43 83 62 77 98 33 27 51 62 64 773 41 29 62 11 30 86 69 464 18 16 772 36 88 68 28 81 86 766 27 32 13 41 26 24 16 77 23 62 87 29 97 86 55 90 775 63 62 67 767 88 2 86 32 92 79 48 47 86 49 80 90 23 13 44 28 29 25 77 79 31 62 77 57 92 85 28 81 90 20 68 33 62 98 S6 40 16 23 28 29 27 13 12 32 24 64 19 92 36 77 62 31 24 770 27 64 15 18 36 83 77 75 60 88 783 86 64 S7 38 24 29 77 92 27 23 13 41 44 98 86 26 18 23 28 81 86 37 90 23 77 73 29 25 27 92 62 64 57 33 62 79 86 11 96 24 52 97 62 64
Decryption
# Banér to Stålhandske, Hof, 29 December 1640 — reading
Key: `key.json` (value → letter, 70 two-digit values, recovered here; see NOTES). Ciphertext: `ct_neal.txt`
(Philip Neal's transcription). Word division, capitals and the [bracketed] clear context are mine.
Unread or doubtful letters are marked `?`; three-digit numbers are code words, left as `[nnn]`.
Emendations of the transcription or of the encipherer's slips are marked `{read: figure}`.
## S1 (after "welches ich im Duplo, als ein Exemplar")
34 20 78 83 [508]
i o b s
Jobs[508] — Jobst + surname in code, the courier of the first copy (M)
## S2 (after "das andere aber")
77 92 [513] 11 93 88 43 18 64 26 24 29 23 13 12 85 28 70 16 27 25 7 78 62 23 [568]
i n n i o h a n n o h r s ? a c b u e t u b e r
in [513] n Johann ohrs?acbuet über [568] ("abgehen lassen")
"Johann" and "über [568]" read; the stretch between (11 tokens) is unread: probably the courier's surname.
## S3 (after "undt gesonnen, wofern es nimmer die Ratio Belli undt des feinds ... 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]
n a c h d e r o b e r p f a l t z u n d g e g e n d i e
nach der Oberpfaltz und gegen die [442] ("loszugehen")
## S4 (after "... undt so starck als es ihm muglig mir entgegen leitten")
66 25 38 85 39 90 82 43 63 75 77 92 13 28 29 21 36 83 93 41 93 18 33 32 23 27 11 30 62 [361] 40 74 55 84 10 77 62 43 41 92
e t w a a u c h d e i n s c h l {e} s i e {n} a g i r e n d e d a z u z i e h e n
etwa auch die in Schlesien agirende [361] dazu ziehen
The manuscript has 86 for Neal's 66 and 36 (corrected in ct_neal.txt). Slips of the copy: "d e i n" for "die in";
93 (i) for n in "Schlesien".
## S5 (after "So wollt der herr General Major")
63 18 23 39 16 [778] 79 84 71 27 46 28 29 25 51 27 70 75 64 84 92 30 13 24 42 46 53 63 71 86 32 73 43
d a r a u g u t e a c h t g e b e n u n d s o b a l d t e i c h
darau[778] gute acht geben und sobaldt e ich
83 62 77 98 33 27 51 62 64 [773] 41 29 62 11 30 86 69 [464] 18 16 [772] 36 88 68 28 81 86 [766]
s e i n g e g e n e h e n d e r a u s o l c h e
sein gegen[773] ehender [464] au[772] solche [766]
27 32 13 41 26 24 16 77 23 62 87 29 97 86 55 90 [775] 63 62 67 [767] 88 2 86 32 92 79 48 57 86 49
e i s e n o u i r e c h t e z u d e m o ? e i n g u t e n
eisen o vi rechte? zu [775] dem [767] o? ein guten
80 90 23 13 44 28 29 25 77 79 31 62 77 57 92 85 28 81 90 20 68 33 62 98
f u r s i c h t i g k e i t n a c h v o l g e n
Fürsichtigkeit nachvolgen ("mich aber von zeit zu zeit")
"darau[778]" is "darauf(f)" if [778] is a syllable or the letter f; "sobaldt e ich" is probably "sobaldt [er s]ich" with
a dropped or misread figure. The phrase "eisen o vi rechte zu" (14 tokens) is not read.
## S6 (after "mich aber von zeit zu zeit")
40 16 23 28 29 27 13 12 32 24 64 19 92 36 77 62 31 24 [770] 27 64 15 18 36 83 77 75 60 88 [783] 86 64
d u r c h e s p i o n e n s i e k o e n d a s s i e ? o e n
durch Espionen sie ko[770]en, dass sie ?o[783]en ("wie sein undt des feindes gelegenheit sey ... berichten")
"durch" and "dass sie" read; "Espionen" complete (the manuscript has 12 = p, dropped by Neal; restored 5 Oct 2026); "ko[770]en" is "kommen" or "können" if [770] is a syllable code.
## S7 (after "damit ich ihm inmittelst mit seiner andeutung")
38 24 29 77 92 27 23 13 41 44 98 86 26 18 23 28 81 86 37 90 23 77 73 29 25 27 92 62 64 57 33 62 79 86 11 96 24 52 97 62 64
w o h i n e r s e i n e n a r c h e z u r i c h t e n e n t g e g e n w o l t e n
wohin er seinen (M)arche zu richten, entgegen wolten ("kommen")
## Translation (sense)
Banér sent his letter of the 16th in duplicate, one copy [by] Jobst(?) [508], the other by Johann ... via [568]. He
has come to Hof and intends, as far as the reason of war and the enemy's countenance allow, "to march through the
Upper Palatinate and against the [442]" (the Bavarians/imperialists at Regensburg). He expects the enemy to gather
all his strength 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] ... [marches off] ..., follow him with good caution", and report from
time to time "through spies ..." on his and the enemy's situation, so that Banér, told "where he means to direct his
march", can come to meet him.Reading
<!-- Reading of Banér's letter to Stålhandske, Hof, 29 Dec 1640 (Claude Opus 5.5, 23 Oct 2026), made from reading.md: the seven cipher spans S1-S7 put into sentences with the clear words around them that reading.md quotes (in ⟨ ⟩; the repository does not hold the full clear text of the letter). Word division and capitals only; no letter changed. [508] etc. = code words not read; […] = a run of figures not read (S2: 11 tokens; S5: "eisen o vi rechte", 14 tokens); [?x] = partly carried; [f] in "darau[778]" is not carried. --> # Banér to Stålhandske, Hof, 29 December 1640 ## Reading ⟨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 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[778] gute acht geben, und sobaldt [?er] [?sich] sein gegen[773] ehender [464] au[772] solche [766] […] zu [775] dem [767] [?] ein guten Fürsichtigkeit nachvolgen, ⟨mich aber von zeit zu zeit⟩ durch Espionen sie ko[770]en, dass sie [?]o[783]en ⟨wie sein undt des feindes gelegenheit sey ... berichten⟩, ⟨damit ich ihm inmittelst mit seiner andeutung,⟩ wohin er seinen Marche zu richten, entgegen wolten ⟨kommen⟩.
Translation
<!-- English translation of APUG568-239_reading.md (Claude Opus 5.5, 23 Oct 2026), with the same holes and code numbers; the clear words around the cipher spans are in ⟨ ⟩ as in the reading (the repository holds only these fragments of the clear text). --> # Banér to Stålhandske, Hof, 29 December 1640: English translation of the cipher spans in their clear context ⟨which [letter] I [sent] in duplicate, one copy⟩ [by] Jobst [508], ⟨but the other⟩ in [513] n Johann […] via [568] ⟨had sent off⟩. ⟨and minded, provided that the reason of war and the enemy's ... countenance will at all allow it,⟩ to move towards the Upper Palatinate and against the [442]. ⟨... and to lead against me as strong as is possible for him,⟩ perhaps also to draw in the [361] operating in Silesia. ⟨So the Lord Major General would⟩ keep good watch on [778] it, and as soon as [?he] [?] his against[773] sooner [464] on[772] such [766] […] to [775] the [767] [?] follow with a good caution, ⟨but [inform] me from time to time⟩ through spies they can[770], that they [?][783] ⟨how his and the enemy's situation is⟩, ⟨so that I, meanwhile, with his indication⟩ of where he means to direct his march, might ⟨come⟩ to meet him.
Key: key.json
05 Sources
- Klaus Schmeh, “An unsolved encrypted letter from the 17th century”, Cipherbrain, 2 June 2019, with Philip Neal’s transcription and readers’ comments: scienceblogs.de.
- Archivio della Pontificia Università Gregoriana, APUG 568 f. 239r–v (Kircher correspondence); images: 239r, 239v (Athanasius Kircher Correspondence Project, Museo Galileo).
- Riksarkivet, Chifferklaver låda II, on DECODE: R4122 (Horn–Banér), R4123 (J. Banér, from 1634), R4325 (chancery register 1640), R4266 (1640); tried, none fits.
- Language model: Deutsches Textarchiv, Theatrum Europaeum I (1635), Olearius (1647), Grimmelshausen (1669), with the DTA prints of 1470–1609.
Files: targets/baner1640/: ct_neal.txt (ciphertext), key.json, decode.py (decryption and measurement), reading.md, solve3.py (annealer), NOTES.md.

