01 The five letters
The volume (ark btv1b52503046q, 486 canvases, 127 folios) is the autograph collection of the Ruffo di Scilla princes, sold in 1854 and bought by the
BnF in 1857; Morel-Fatio catalogued it in 1892 as no. 172. Its hundred items are letters to Ferdinand and Isabella from most of the crowned heads of Europe. Five are
wholly or partly in cipher. The item numbers are the notice’s; the folio numbers are the volume’s own, and the canvases have to be mapped from the notice because
almost every canvas label on Gallica is NP.
| Item | ff. | Canvases | Letter | Cipher | State |
|---|---|---|---|---|---|
| no. 5 | 5–6v | 32–35 | Federico III of Naples to the Catholic Monarchs, San Germano, 11 Jan 1497; Italian, partly ciphered | Joan Ram Escrivà’s cipher no. 1 | solved and printed, Parisi 2020 |
| no. 92 | 116–116v | 440–441 | Gonzalo Fernández de Córdoba to Lorenzo Suárez, 17 Aug 1500; copy sent to Almazán; Spanish, clear and cipher mixed | Cifra general de los Reyes Católicos | key proved here; text unpublished |
| no. 93 | 118–118v | 446–447 | Lorenzo Suárez [de Figueroa, the ambassador at Venice], to the Catholic Monarchs, Venice, 24 Feb 1504; wholly in cipher | secretariat build; code initials c/g/h/l/m/n/p/q/r/t/z | open |
| no. 94 | 120–121v | 452–455 | The viceroy of Sicily to Ferdinand, Messina, 27 Apr 1503; Spanish, clear and cipher mixed, four pages | secretariat build; code initials g/l/m/n/p/r/v/z | open |
| no. 95 | 122–122v | 458–459 | Unaddressed cipher, 8 Jan 1497; wholly in cipher, scriptio continua | alphabet reconstructed by G. Lasry, 2022 | read in part here |
No decipherment survives anywhere in the volume for nos. 93, 94 or 95. F. 121v carries the superscription of the viceroy’s letter, Alto y muy poderoso prinçipe Rey y Señor, the wax seal, and a later Spanish endorsement written sideways down the left margin: Del virrey de Siçilia en çifra. That is all anyone in the archive ever said about it.
All five are in one office’s style, and it is worth stating once because it governs everything below. A cipher of Ferdinand’s secretariat is two things at once: a homophonic alphabet, three to five invented signs per letter, and a nomenclator of two-, three- and four-letter groups — consonant, vowel, consonant — written in ordinary Latin letters in the same hand, standing for words, names and syllables. The nomenclator is one-part: the vocabulary runs alphabetically and the groups run in a fixed order beside it, so the initial letter of a group tells you roughly where in the alphabet its plaintext sits. Three such keys of this period are in print or reconstructed, and each uses a different band of initials. That is what makes it possible to say which key a letter is in without reading a word of it.
02 No. 5 was already solved, in 2020
The first check on any of these is whether somebody has already done it. Searching for the shelfmark rather than the cipher turns up Ivan Parisi, Un cifrario in prestito per una lettera segretissima di Federico d’Aragona re di Napoli ai Re Cattolici nel BnF, Espagnol 318, in Studi di storia medioevale e di diplomatica, n.s. IV (2020), pp. 157–177 — open access, DOI 10.54103/2611-318X/14378. It prints the letter entire.
The article’s point is an anomaly. Federico of Aragon, the last Aragonese king of Naples, wrote to Ferdinand and Isabella on 11 January 1497 to confirm a pre-agreement for the marriage of his nine-year-old son Ferrando, duke of Calabria, to one of the Spanish infantas — and had the secret part enciphered in the Spanish ambassador’s cipher, the key issued to Joan Ram Escrivà, who was standing in Naples at the time. Parisi pins the encipherer by a Spanish speaker’s mistake: whoever wrote the cryptogram failed to use the double-s sign in possano, obedientissimo and promesso, an error an Italian would not make and a Spaniard would. So the king of Naples handed his minute to the ambassador, and the ambassador made the fair copy and enciphered it.
The letter’s own first clear line names him — Da poi de havere resposto ad micer Joan Scrivà, oratore de le Maiestate Vostre — which is the one clue on the
leaf that this is a borrowed key. The nomenclator elements Parisi lists are legible on the Gallica image at 3000 px and match what one reads there directly:
qix del, qao duque, qav de, qae con, qed cosa,
qie como, rae el, rof en, ru mensajero, saf Italia,
sul la, tad no, tay parte, vee que, vet si,
vog sobre, xer and xoq Vuestras Altezas, xit una, pam bien.
Note the band of initials: p, q, r, s, t, v, x. It will matter in §05.
03 No. 92: the cipher proved on its glosses
F. 116 is headed by its sender, la respuesta q[ue] enbio a los s[eño]res en xbij de ag[osto] 1500, and opens in clear:
Muy mag[nifico] Señor: a los xiiij d[e]l presente recebi v[uest]ra letra con hun breve d[e]l papa y otras dos cartas del embax[ad]or veneçiano con uno suyo, dando priesa en my yda a la resistençia del turco. E porq[ue] esto es conforme a la voluntad e mandami[ento] q[ue] yo tengo de sus al[teza]s, en virtud de Jhu Xpo yo me dispongo a ello con toda la celeridad y presteza q[ue] el caso requiere…
and then alternates clear and cipher for two pages. It is Gonzalo Fernández de Córdoba, the Great Captain, writing to the Lorenzo Suárez of the notice — Lorenzo Suárez de Figueroa, Spain’s ambassador at Venice until his death there in 1506, whose own ciphered letters Galende Díaz lists — about the expedition against the Turk — the copy kept for the secretary Miguel Pérez de Almazán. Tomokiyo’s page on the Spanish ciphers notes that the Great Captain “used this cipher” — Ferdinand and Isabella’s general cipher of about 1500–02 — in this letter, and marks the letter itself undeciphered.
That can be turned from a resemblance into a proof, because a later hand wrote a partial decipherment between the lines of f. 116r. The glossator got a few words out and gave up; his words are the control.
h boy zez xiz 7 xuy baz. In the printed key boy is Tiempo, zez Por, xiz Esta,
xuy En, baz Tanto; 7 is the alphabet’s r and h its e, the conjunction the
glossator spelled y.Juan Carlos Galende Díaz printed the key in 1994, from a file of twelve ciphers in the Real Academia de la Historia (B.R.A.H. 9/15): his appendix 1 is the Cifra general de los Reyes Católicos, ff. 7–9 of that file. Reading its plates against the glosses gives eight independent hits and nothing that fails:
| Gloss on the leaf | Cipher | In the printed key |
|---|---|---|
| lo | yuy | Lo |
| y · tpo | h · boy | (alphabet e) · Tiempo |
| por | zez | Por |
| estar | xiz + 7 | Esta + r |
| en | xuy | En |
| tanto | baz | Tanto |
| el negoçio | xix zol | El · Negocio |
| de | xup | De |
| puede | zuy | Puede |
| no | zik | No |
| — | bob | Que |
A gloss-anchored line then decodes straight through:
ct h boy zez xiz 7 xuy baz ff k …
pt y tiempo por esta r en tanto p g …
— …y tiempo, por estar en tanto…, which is what the glossator wrote above it. F. 116v ends half in clear, and the codes sit inside sentences one can read
without any key at all: …no desconfio que mucho se pudiera aprovechar … esta var … zin se ha ofreçido … yo me desnudo y
descargo y me satisfago en que n[uest]r[o]…, with zin = Nápoles, xar = después, biz = toda,
xuy = en. Below that a later inventory hand: Inventº 11 Ottº 53.
So the cipher of no. 92 is settled, and what is left is labour rather than cryptanalysis: the code groups are plain Latin letters and read off easily, while the
alphabet signs have to be matched one by one against a 1994 photocopy of a sixteenth-century table. The key is transcribed here as
keys/cifra_general.txt — 683 code groups
from the plates (pp. 167–173), plus the twenty-one personal signs: Papa = A, Emperador = B, Rey de Françia = F, Rey de Spanya = G, Reyna de Spanya = 4, Principe de
Spanya = C, Rey de Inglaterra = S, Rey de Napoles = □, Duque de Calabria = R, Infanta doña Juana = oTT, Don Fadrique prinçipe de Altamira = S†.
04 No. 95: a key without a text
F. 122 is a single leaf of 31 dense lines, no address, no salutation, no clear word anywhere, dated 8 January 1497 — three days before Federico’s letter at the
other end of the volume. In May 2022 George Lasry sent Tomokiyo an “approximate” solution, and Tomokiyo published it: an image of the alphabet, one to three signs per
letter, with a row of unassigned signs and a handful of code groups — bac bnh bon dah daf dae oht bed dal boo del. No plaintext has ever been printed.
Reading the signs by eye against that image does not work: ÷ against ≐, the plain 7 against the 7 with a small o and the crossed 7, are distinctions a printed reconstruction makes crisply and a hurried 1497 hand does not. So the leaf was taken apart mechanically instead. Adaptive-threshold binarisation; connected components grouped into glyphs by horizontal overlap with diacritics attached, which gives 963 glyphs over 31 lines, a median of 31 to the line; Ward clustering of 28×28 normalised bitmaps; then the clusters — not the individual signs — labelled by eye from contact sheets against Lasry’s key.
The check that the labelling is right came before any decipherment, and it is the frequency profile. The clean clusters carry about two thirds of the 963 glyphs, so their shares of the whole leaf are all deflated by roughly a third — but the order is the thing. Counted against every glyph on the page, e takes 9 %, a 7 %, o 5 % and n 5 %, then s, c, u, r, d, m, t and i, with q last at about 1 %. That is the Spanish ranking, e–a–o–n–s, arrived at from a key reconstructed by somebody else and a clustering that knew nothing about language; and the 1 % for q is the tell, since q is rare but never absent in Spanish.
etem uygrane sdcosa erono: …[so]bre muy
grandes cosas … ero no…, the d of grandes landing one sign late. The blanks are places where two signs touch and the segmenter took them as
one.What comes out, checked line by line on 31 annotated strips, is Spanish about the French. The verified stretches:
…emos franceses… (l. 4); bac que puedan merc[ed] … de Francia… (6); …dos cosas … a traer… (7); …con esto… (8);
señoría … que esta … por (11); que me toca … mucho … sera … que bnh … haga (12); con esto … acorde … lo bueno… (13);
…quedar … que … Francia… (15); …si a tratado … que gouernad … pero (16); …muy grandes cosas … no creo que… (17); …certaran … pues que
se … esto … la parte aun (18); que se … encubren … que … quieren go- | -uernar (19–20, across the line break); por obra creo que … amigo
(22); escreuir a… (23); dificultad … en los… (25). The nomenclator groups appear in clear letters in the middle of the sign runs:
bac, bon twice, bnh four times, dal, and probably bed. bnh is the frequent one and is
most likely a person or a place.
Two of Lasry’s assignments were corrected on the way: the sign shaped like an n with a cross-tail is m, not y; and his two 7-forms are confirmed as distinct — the plain 7 is d (it makes puedan) and the 7 with a small o is s (it makes franceses and escreuir) — but they are distinguishable by cluster and not by eye, which is why the eye-only reading had them backwards at first.
About a third of the signs are still unresolved, and the honest description of the rest is in the repository as
f122r_reading.md, line by line, with
… where the leaf is not read. Three independent methods were run at it — the eye on the strips, the cluster-and-language-model hybrid, and a
segmentation-free decoder that slides every template along the line and tiles it by dynamic programming — and they agree on the same two thirds and fail on the same
third. That convergence is the useful negative: the limit is the sign shapes at Gallica’s 4,077-pixel scan, not the method.
05 Nos. 93 and 94: named, and blocked on a key
These are the two that are genuinely unread, and the catalogue’s phrase for them, “unidentified cipher”, can be narrowed. Both are written the way the office’s
ciphers are written: single invented signs, interleaved with groups of two to four Latin letters. In no. 93 the groups read gto pie roe hug heg mat gnd gab zoe
mae cpm lnq hoe hac zup qup gre zen gne; in no. 94 gag rah mnb mms nob gik luy mei nen mok pol pat par paq vaz mal nyb nyl gob gib lob moe nak rag
lue. The standalone signs are + ÷ ʒ ff ıı :/ ⧻ 7.
The initial band of the code groups is the discriminator, because the nomenclator is one-part:
| Key | Code initials | Used by |
|---|---|---|
| Escrivà’s cipher no. 1 (Parisi 2004, app. II) | p, q, r, s, t, v, x | no. 5 |
| Cifra general de los Reyes Católicos (Galende Díaz 1994, app. 1) | v, x, y, z, b, c | no. 92 |
| Gran cifra of the Great Captain, 1501–04 (Bergenroth; CNI 2018) | h, l, m, p, q, r, s, u/v | ? |
| no. 93 | c, g, h, l, m, n, p, q, r, t, z | — |
| no. 94 | g, l, m, n, p, r, v, z | — |
Both fall outside the two keys that are in print and inside the band of the third. There is one concrete hook: Bergenroth reads LUQ = capitán,
and no. 93 has the group lnq — u and n being the same two minims in this hand. He also has muy = de, and
muy occurs in no. 93. That is a lead and not a demonstration: his list and the CNI’s are both partial, and most of the groups in these two letters are in
neither.
One alternative was worth testing and failed. If those groups were not code units but runs of letter-shaped signs — which is exactly what the Cifra general’s
own alphabet looks like, its i drawn as a 3, its o as a b, its n as a q — then no key would be needed and an ordinary homophonic solver would
break the leaf. Lines 1–21 of f. 118r were transcribed sign by sign, 1,016 tokens over 40 distinct signs, and annealed against a Spanish 5-gram model from eight starts.
The best key scores −3.5 nats per token where real Spanish scores −1.8, and the output is vowel soup. The token statistics say why: 66 % of all p signs
occur inside pie, 28 % of g inside gto, and the commonest trigrams (gto ×21, pie ×19,
gnꝺ ×15, heg ×13) are far too concentrated for letter runs. The groups are atomic. Nos. 93 and 94 are nomenclator problems and need the key.
Which is where they stop. The Gran cifra survives only as Bergenroth’s nineteenth-century reconstruction in BNE MSS 20.211/52, and the Biblioteca Nacional returns a bot-check page on its viewer, its search and its image endpoints alike; the manuscript is absent from Europeana and Hispana; Bergenroth’s eleven volumes of Simancas transcripts on the Internet Archive are handwritten, and their OCR yields almost nothing (three hits for cifra across 3.3 MB of text). Arturo Quirantes has published two photographs of key sheets, but one is the first-campaign alphabet of 1494–98 — same sign repertoire, different values, as he warns — and the other is a partial list of the second. A second candidate is documented and unpublished: Galende Díaz’s file B.R.A.H. 9/15 opens with a Cifra del visorrey at ff. 1–6, which he describes and does not reproduce. No. 94 is a viceroy’s letter.
The dates are worth stating for whoever picks this up. No. 94 is Messina, 27 April 1503 — the day before Cerignola. No. 93 is Venice, 24 February 1504, in the weeks after the Garigliano, when Naples had just been lost to Spain for good and Venice was deciding what to do about it.
06 Method, including what failed
Almost all of the work here was bibliographic, and the order mattered: shelfmark first, cipher second. Searching Espagnol 318 rather than “Spanish cipher 1497” found Parisi’s article, which closed no. 5 in an afternoon; searching for the cipher family found Galende Díaz’s appendix, which is the key to no. 92; searching for what Tomokiyo had done found Lasry’s alphabet for no. 95, published as an image nobody had applied. Three of the five were resolved by reading rather than solving.
The machine side was a pipeline for turning a page of signs into a sequence of letters, built for no. 95 and reusable:
seg.py (binarisation), glyphs.py (component grouping), cluster.py and montage.py (Ward clustering and contact
sheets), assign95.py (the cluster-to-letter table), lm.py (a Spanish 5-gram model built on Don Quijote, normalised to the
twenty-two letters of the period’s alphabet), and hybrid95.py (beam decode with the verified clusters held fixed). Line pitch comes from the
autocorrelation of the ink profile: 113 px on f. 116r, 128 on f. 118r, 100 on f. 120r, 114 on f. 122r.
Three attempts on the unresolved third of no. 95 are recorded because they did not work.
- Clipping each glyph to its line band before segmenting, to stop descenders from the line above contaminating the boxes. It made things worse: the band cuts the tall signs in half, and nearest-neighbour matching of the mutilated shapes collapses onto d and n. The junk boxes are touching signs, not descenders.
- A segmentation-free decoder — slide every labelled template along the line by FFT correlation, tile the line left to right by dynamic programming with area-proportional scores and a penalty per column of skipped ink, then beam-decode the tiles. With the tile count right it reads the same lines the eye read and no more; 23 % of tiles have their top two letters within 0.05 of normalised correlation, and the language model, given that freedom, writes Don Quijote over them (don quiiote que el que).
- The letter-run hypothesis on no. 93, described in §05.
Scipy’s signal module is blocked by an application-control policy on the machine this ran on, so the correlations are done with numpy.fft
directly; it is in the source in case anyone meets the same wall.
07 Sources
- BnF, Département des Manuscrits, Espagnol 318, ark
btv1b52503046qon Gallica; noticecc349255in Archives et manuscrits. The IIIFfull/fullimages are 4,077–4,155 px wide and are the only ones that will do; Gallica returns HTTP 429 after about six of them in a row. - Ivan Parisi, “Un cifrario in prestito per una lettera segretissima di Federico d’Aragona re di Napoli ai Re Cattolici nel BnF, Espagnol 318”, Studi di storia medioevale e di diplomatica, n.s. IV (2020), 157–177 — open access.
- Ivan Parisi, “La correspondencia cifrada entre el rey Fernando el Católico y el embajador Joan Escrivà de Romaní i Ram”, Pedralbes 24 (2004), 55–116; appendix II has the alphabet and nomenclator used in no. 5.
- Juan Carlos Galende Díaz, “La escritura cifrada durante el reinado de los Reyes Católicos y Carlos V”, Cuadernos de Estudios Medievales y Ciencias y Técnicas Historiográficas XVIII–XIX (1993–94), 159–178; appendix 1 is the Cifra general, pp. 167–173.
- S. Tomokiyo, “Spanish Ciphers during the Reign of Ferdinand and Isabella”, and his page of George Lasry’s decipherments, where the f. 122 alphabet is published as an image.
- Arturo Quirantes, “El CNI y el (no tan secreto) código del Gran Capitán” and “Descubierta un segundo código del Gran Capitán” (2018), with photographs of BNE MSS 20.211.
- Working files, images, key transcription and every script named above: esp318/, with NOTES.md as the record of what was tried.