Unnamed sender → the compiler · invented alphabet for Arabic · about 1325–1360 · ciphertext-only break

The fourth cipher riddle, about 1325–1360

Go to the full text ↓

The compiler of a Mamluk cipher book recorded a riddle across leaves now bound apart. A solver given only the signs produced enough Arabic to identify the riddle. The compiler’s clear copy then helped refine the key.

Daniel Bourdeau · posted · updated

Method: ciphertext-only break · Extent: complete

Credits · Brice Dudout (verification)

At a glanceCiphertext-only break · complete

The document
A riddle in a probably 15th-century copy of correspondence dated about 1325–1360 from internal evidence.
Where
University of Pennsylvania, Kislak Center, LJS 51, f. 48r line 8 through 48v line 13, continued on f. 21r lines 1–5.
The cipher
290 signs across 24 lines, written right to left with a dotted stem between words.
How it was deciphered
Blind annealing produced recognizable words on ff. 48r–48v. Aligning the signs with the compiler’s clear copy refined the letter assignments. The key then identified the five-line ending on f. 21r.
What it says
A riddle about something “soft of sides, wide of flanks” that visits at night and leaves at morning. The compiler gives the answer as the raised couches of Sūrat al-Wāqiʿa.
Still open
One sign on f. 21r takes two readings. Several expressions remain uncertain in translation. An Arabist’s check is still needed.

01 The block

LJS 51 is a Mamluk secretary’s book of the ciphers he exchanged with colleagues. Most messages use an alphabet of invented signs, and the compiler usually says that he worked it out and then gives the text in clear. The compiler never names himself. The compiler was very probably Tāj al-Dīn Ibn al-Durayhim (d. 762/1361). The attribution rests on first-person references to his works, discussed in the corpus study. Penn’s catalogue names no compiler. The f. 106v cipher of the same book is another cipher in the same volume, with its own page.

On f. 48r, under a one-word heading (ورابعها, “and the fourth of them”; the word was at first taken as doubtful), nineteen lines of signs run from line 8 of f. 48r to line 13 of f. 48v. The modern binding separates these lines from the ending. The remark on f. 49r that a cipher “was not solved except after much toil” belongs to the short block on 49r lines 1–4, not to this one. The project’s survey of the book listed the block among its unanswered ciphers.

What this result is, and is not. This is the oldest text on this site for which blind annealing produced recognizable plaintext: a block in a probably 15th-century copy of a Mamluk secretary’s cipher correspondence of about 1325–1360, whose plaintext the compiler had written elsewhere in the volume. It is not the oldest break of this text. The last five lines of this cipher stand at the top of f. 21r (a misbound quire separates them from f. 48v), and right after them, before he gives the clear text, the compiler says that he worked it out quickly because it was easy. The whole volume records ciphertext-only breaks made in the fourteenth century. As a document, the copy is not clearly older than the Siena letters of 1413. Medieval worked examples of the same kind exist too: Ibn al-Durayhim’s Miftāḥ al-kunūz solves two ciphers of invented symbols step by step from letter frequencies (Mrayati, Meer Alam and al-Tayyan, Arabic Origins of Cryptology vol. 3, p. 33 and pp. 101–124; not seen here). This framing follows a review of the page by Brice Dudout.

The Arabic word warabi'uha at the top right, above six lines of invented cipher signs separated by small dotted strokes
F. 48r, lines 7–13: the heading ورابعها and the first six lines of the block. The page reads from right to left; the first line is ولينه الاعطاف. Image: University of Pennsylvania, Kislak Center, LJS 51, f. 48r, via OPenn (image 0084_0100).

The transcription distinguishes 29 shapes and records 63 word dividers. A word may run over a line end.

The whole of LJS 51 as a book you can turn, opened at ff. 47v–48r: the block begins at line 8 of f. 48r and runs on over the leaf to f. 48v (an Arabic codex is turned from left to right). Drag or click a page to turn it, use the slider or the arrow keys, and drag the background to look around. The pages are OPenn’s photographs, cropped to the leaf; the boards and spine are modelled from the cover photographs, not measured. Open it full screen. Image: University of Pennsylvania, Kislak Center, LJS 51, every page image and the spine, via OPenn.

02 How the key was recovered

View this cipher’s visual key for its manuscript signs, Arabic values and recorded occurrences.

  1. Keys and texts that do not fit. The signs are of the same family as those of the f. 47r block, so its key was tried first: it does not read this block. The texts near the block were tested by length and word pattern: the two verses on f. 49r (72 letters), the first five verses of the f. 47r riddle (about 208 letters) and the compiler’s eight answer-verses (about 320 letters). None fits.
  2. Annealing from the signs alone. A solver searched over keys of one letter per sign, keeping the dividers as word spaces and scoring each trial with the project’s Arabic letter model of the Mamluk period (ar-mamluk), six restarts of 40,000 steps each, with no plaintext given. One restart read Arabic words: “… اهل اصلاح تثور اذا ب ن الليل وترحل عند الصفاح ترميها … وهي معدوده من نعيم اهل الجنه …”. The other five gave only partial words.
  3. The clear copy. Those words are the riddle that the compiler writes in clear on f. 21r line 7 to f. 21v line 2. The later work on the whole volume (the volume’s own page) showed that this clear text is the solution of this block: quire 3 is bound out of place, the cipher on ff. 20r–20v belongs to a verse riddle continued on f. 47r, and the five cipher lines at the top of f. 21r are the end of this block, so f. 21r once followed f. 48v. Aligned with that text, with the key learned again from the alignment, 218 of 229 signs took their letter at first.
  4. Checked on the page. Every place where the key and the riddle disagreed was re-read on the master images at 2–3 times enlargement. Five were transcription errors (two signs that are not on the page, one missed, one misread, one written above the line) and six dividers were misplaced. On ff. 48r–48v, after correction, 220 of the 228 signs (96.5%) give the riddle’s letter. These folios cover the first 232 of the riddle’s 293 letters and end at جملته. On f. 21r the original key gives 59 of the final 62 letters. The squat W2 supplies ا, and the horned EK supplies ح in حين and ش in واشكر.

Because the solver reached the riddle without being given it, the reading is not a product of the alignment; the 96.5% is the agreement of the key with the clear copy once both are known. A later search by word lengths over the passages of the book found the same riddle (43 of 49 groups). Run against all 206 plaintexts in the book, the decoded block matches the riddle at 95.2% (the first transcription), the next best text at 22.3%, and the median text at 9.2%.

An independent re-run. Brice Dudout repeated the blind break with none of this project’s code. He built his own 4-gram model from the same five OpenITI texts behind ar-mamluk and wrote his own annealer. 7 of his 11 restarts reached the riddle (about −2.10 per sign). On shuffled ciphertext the best of 12 restarts scored −3.18, and none gave sense. He also checked that the model had not seen the plaintext. None of 14 phrases peculiar to the riddle (لينه الاعطاف, تجافاها, نعيم اهل الجنه, بعقد جايز, فرش مرفوعه …) occurs in the five source texts, and only 0.7% of its 12-letter strings do. The 228 signs are 4 to 7 times the unicity distance of a simple substitution in Arabic.

LetterSign labelsTimes
اW57
هTB30
لX22
وv18
رSL17
نQ15
مSW15
يO815
تTH13
عLM11
بTRV9
فCR7
جTBL7
سKF6
كHK6
حE6
ذS6
دR26
يAY4
طHH4
زA3
ظKS3
صTT2
قOM2
ح/شEK2
لXN1
شK1
غG61
اW21

The labels are the transcription’s names for the invented shapes. The table counts both portions. EK occurs once with each of its two readings.

The reading of ff. 48r–48v was also put through the project’s statistical test (docs/_validate.py, model ar-mamluk). It scores −2.627 per letter, against −5.236 on average for random keys of the same shape (5.5 standard deviations above them). Verdict: pass. That test’s shuffled-text null had only six runs, and it compared the final key, which was fitted to the clear copy, with blind refits. So it was rerun blind against blind, with the same annealer started from random keys every time (null_blind.json). The best of 20 runs on the real signs reached −2.658. The 60 runs on shuffled signs (best of two restarts each) averaged −2.992, and the best of them reached −2.856. None of the 60 shuffle maxima reached the real maximum, which was 4.5 standard deviations above their mean. The unequal restart budgets preclude a permutation p-value.

03 The riddle

As the cipher spells it, letter for letter, in the manuscript’s lines (final alif maqṣūra is written ي):

ولينه الاعطاف واسعه الاكانف وطيها مباح علي انها تتجافاها اهل اصلاح تزور اذا جن الليل وترحل عند الصباح ترميها القسي وتطعنها الاسنه وهي معدوده من نعيم اهل الجنه وجهها يستر بالظهور وافتراشها بعقد جايز غير محذور يحمد منه ما يذم في المذاهب وظهرها اوطا ظهر للراكبان جملها ربها جملته وان زادها رفعته فاذكر اسم ربك حين تاوي اليها واشكر نعمه ربك اذا استويت عليها

With the scribe’s slips put right from the clear copy (in brackets):

ولينه الاعطاف واسعه الا[كناف] وطي[ب]ها مباح علي انها [ت]جافاها اهل ا[ل]صلاح تزور اذا جن الليل وترحل عند الصباح ترميها القسي وتطعنها الاسنه وهي معدوده من نعيم اهل الجنه وج[مع]ها يستر بالظهور وافتراشها بعقد جايز غير محذور يحمد منه[ا] ما يذم في المذاهب وظهرها اوطا ظهر للراكبان جملها ربها جملته وان زادها رفعته فاذكر اسم ربك حين تاوي اليها واشكر نعمه ربك اذا استويت عليها

The English for ff. 48r–48v follows the project’s translation of the clear riddle, with † marking readings taken from the cipher. The final two sentences translate the f. 21r cipher directly.

And [one] soft of sides, wide of flanks, and its good things are permitted, though the people of righteousness shun it. It visits when night falls and departs at morning. The bows shoot at it †, and the spearheads pierce it, yet it is counted among the bliss of the people of Paradise. Its gathering is covered by the backs (or: by appearing), and spreading it out is by a permitted contract, not forbidden; of it is praised † what is blamed in the schools of law. Its back is the most trodden back for the two riders; its Lord adorned it (جمّلها) … (جملته, not translated). And if he increases it, it raises him. So mention the name of your Lord when you retire to it, and give thanks for the blessings of your Lord when you settle upon it.

The cipher closes with وان زادها رفعته and استويت where the clear copy has وازدها نعمته and استوت بك. After the clear copy the compiler writes that its answer is mentioned in Sūrat al-Wāqiʿa: the raised couches (furush marfūʿa). The translation notes read the riddle as a play on the bed and the wife (firāsh), hence the “permitted contract” of marriage.

The clear copy, re-read on the image. The project’s record of the clear copy on f. 21r read some words differently from the cipher, and the first version of this page said that the cipher corrects the clear copy there. Those words were then re-read on the f. 21r master image at 2–4 times enlargement (a model’s reading, not yet an Arabist’s). In most of them the clear copy agrees with the cipher, and it was the record that misread it.

The cipher also confirms اوطا ظهر, which the record marked as doubtful. † marks this page’s renderings of ترميها القسي and يحمد. They are not the project’s translation of the clear copy.

04 What is uncertain

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.

Penn LJS 51, ff. 48r–48v and 21r: the rhymed-prose riddle

A riddle in rhymed prose (the fourth enciphered piece of the series), which the compiler writes in clear on f. 21r: something soft of sides and wide of flanks that visits at night and leaves at dawn, counted among the bliss of Paradise and spread out 'by a permitted contract'. The compiler gives the answer as the raised couches (furush marfūʿa) of Sūrat al-Wāqiʿa. It closes by telling the reader to give thanks on settling there.

Transcription

transcription.txt

# LJS 51 ff. 48r l.8 - 48v l.13, by eye from master 0084_0100/0101 (crops output/ljs51/crops/solve48r/), signs right to left, | = dotted-stem divider
# v2 (27 Nov 2026): 2-3x recheck, see recheck_2x.md
# labels: see REPORT.md (same labels as keys_eye/47r.1.json; new shapes added)
48r08 v X AY Q TB | W X W LM HH W CR
48r09 | v W KF LM TB | W X W HK W Q CR
48r10 | v HH AY TB W | SW TRV W E | LM X O8 |
48r11 W Q TB W | TH TH TBL W CR W TB W |
48r12 W TB X | W TT X W E | TH A
48r13 v SL | W S W | TBL Q | W X X O8 X |
48v01 v TH SL E X | LM Q R2 | W X TT TRV
48v02 W E | TH SL SW O8 TB W | W X OM KF O8 |
48v03 v TH HH LM Q TB W | W X W KF Q
48v04 TB | v TB O8 | SW LM R2 v R2 TB | SW Q |
48v05 Q LM O8 SW | W TB X | W XN TBL Q
48v06 TB | v TBL TB TB W | O8 KF TH SL |
48v07 TRV W X KS TB v SL | v W CR TH SL W K
48v08 TB W | TRV LM OM R2 | TBL W O8 A | G6 O8 SL |
48v09 SW E S v SL | O8 E SW R2 | SW Q TB
48v10 SW W | O8 S SW | CR O8 | W X SW S W TB TRV |
48v11 v KS TB SL TB W | W v HH W | KS TB
48v12 SL | X X SL W HK TRV W Q | TBL SW
48v13 X TB W | SL TRV TB W | TBL SW X TH TB
# Continuation on 21r, master 0084_0046; block_21r_1_5 in keys_eye/20r.8+47r.1.json.
21r01 | v W Q | A W R2 TB W | SL CR LM TH TB
21r02 | CR W S HK SL | W KF SW | SL TRV HK | EK AY
21r03 Q | TH W v O8 | W2 X O8 TB W | v W EK HK
21r04 SL | Q LM SW TB | SL TRV HK | W S W | W KF
21r05 TH v O8 TH | LM X AY TB W |
Decryption

reading.md

# Reading: Penn LJS 51, f. 48r l.8 - 48v l.13, continued on f. 21r l.1–5

The cipher begins on f. 48r and ends at the top of f. 21r. The compiler gives the clear riddle immediately after the final five lines, on f. 21r l.7 – 21v l.2.

## As enciphered (letter for letter, `python decode.py`, one line per manuscript line)

48r l.8  ولينه الاعطاف
48r l.9  واسعه الاكانف
48r l.10 وطيها مباح علي
48r l.11 انها تتجافاها
48r l.12 اهل اصلاح تز
48r l.13 ور اذا جن الليل
48v l.1  وترحل عند الصب
48v l.2  اح ترميها القسي
48v l.3  وتطعنها الاسن
48v l.4  ه وهي معدوده من
48v l.5  نعيم اهل الجن
48v l.6  ه وجهها يستر
48v l.7  بالظهور وافتراش
48v l.8  ها بعقد جايز غير
48v l.9  محذور يحمد منه
48v l.10 ما يذم في المذاهب
48v l.11 وظهرها اوطا ظه
48v l.12 ر للراكبان جم
48v l.13 لها ربها جملته

21r l.1  وان زادها رفعته
21r l.2  فاذكر اسم ربك حي
21r l.3  ن تاوي اليها واشك
21r l.4  ر نعمه ربك اذا اس
21r l.5  تويت عليها

## Running text, the scribe's slips emended in [ ] from the clear copy on f. 21r

ولينه الاعطاف واسعه الا[كناف] وطي[ب]ها مباح علي انها [ت]جافاها اهل ا[ل]صلاح تزور اذا جن الليل وترحل عند الصباح
ترميها القسي وتطعنها الاسنه وهي معدوده من نعيم اهل الجنه وج[مع]ها يستر بالظهور وافتراشها بعقد جايز غير محذور يحمد
منه[ا] ما يذم في المذاهب وظهرها اوطا ظهر للراكبان جملها ربها جملته

وان زادها رفعته فاذكر اسم ربك حين تاوي اليها واشكر نعمه ربك اذا استويت عليها

## Notes

- Emendations: الاكانف (ن and ا swapped), وطيها, تتجافاها (one ت written twice), اصلاح, وجهها, منه. جملها is not
  emended: the clear copy on f. 21r has جمّلها with a shadda (re-read on the image, 27 Nov 2026), not the record's جمالها. The ل of
  اصلاح may be a slip or a correction (NOTES.md, Transcription doubts).
- Where the cipher and the 20r.8 record of the clear copy differ, the cipher is followed: ترميها (record توهمها),
  القسي (record العسى[?]), يحمد (record وخمد[?]). Re-read on the f. 21r image (27 Nov 2026, a model's reading at 2-4x):
  the clear copy itself has ترميها and تحمد (same skeleton as يحمد, dots differ), and an undotted letter in العسي/القسي.
- Alif maqsura is written ي (علي), as in the cipher.

- The continuation uses a squat alif (W2) and the horned sign EK, read ح in حين and ش in واشكر. The clear copy gives وازدها نعمته and استوت بك where the cipher has وان زادها رفعته and استويت.
Translation

translation_en.md

# Translation: Penn LJS 51, f. 48r l.8 - 48v l.13, continued on f. 21r l.1–5

The project's translation of the clear riddle (chain 20r.8, `targets/ljs51corpus/translation_0006_0053.md`), with the f. 21r continuation translated from the cipher. Three places are changed to follow the cipher, marked †; those renderings are made here and
are not in the 20r.8 translation. Rhymed prose, not verse.

> And [one] soft of sides, wide of flanks, and its good things are permitted, though the people of righteousness shun
> it (tajāfāhā). It visits when night falls and departs at morning. The bows shoot at it (tarmīhā al-qisī) †, and the
> spearheads (al-asinna) pierce it, yet it is counted among the bliss of the people of Paradise. Its gathering is
> covered by the backs (or: by appearing, bi-l-ẓuhūr), and spreading it out (iftirāshuhā) is by a permitted contract,
> not forbidden; of it is praised (yuḥmad) † what is blamed in the schools of law. Its back is the most trodden
> [awṭaʾ] back [ẓahr] for the two riders; its Lord adorned it (jammalahā, جمّلها) ... (جملته, not translated).
> And if he increases it, it raises him. So mention the name of your Lord when you retire to it, and give thanks for the blessings of your Lord when you settle upon it.

† ترميها القسي and يحمد are the cipher's readings; the 20r.8 record of the clear copy has توهمها العسى[?] ("[People]
imagine it [al-ʿasā [?]: not translated]") and وخمد[?] (not translated). The 20r.8 translation marks awṭaʾ, ẓahr and
jamāluhā as doubtful in the clear copy; the cipher confirms اوطا ظهر. Re-read on the f. 21r image (27 Nov 2026): the
clear copy has جمّلها with a shadda, not جمالها, and the cipher agrees (جملها); it also has ترميها and تحمد, so the record
misread those two words. للراكبان (dual -ān after a preposition, classical -ayn) is in both copies and is not explained.

The translation notes on 20r.8 (which took the riddle for the third of al-Jawlānī's test pieces; the corpus work later
found it is this block's own plaintext, the fourth piece): a riddle (lughz) in rhymed prose; the compiler
gives the answer as the raised couches (furush marfūʿa) of Sūrat al-Wāqiʿa (Q 56:34). The text plays on the bed and the
wife (firāsh), hence "spreading it out by a permitted contract" (marriage) and "the people of righteousness shun it"
(cf. Q 32:16). "Spearheads pierce it" may refer to quilting needles; not established.

Key: key.json

05 Sources

The transcription, key, decoder, the 2x re-read and notes are in the repository (targets/ljs51f48r/). Manuscript images: University of Pennsylvania Libraries, public domain, via OPenn.

Cite this page

Daniel Bourdeau and Brice Dudout, “The fourth cipher riddle, about 1325–1360 (Penn LJS 51, f. 48r)”, Cyphersolver, posted 27 November 2026, updated 28 November 2026, repository commit 2944b822fe, https://cyphersolver.com/ljs51f48r.html.