At a glanceKey from adjacent plaintext · complete
- The document
- Seven lines of invented signs that Ibn al-Qaysarani wrote to the unnamed compiler of a book of cipher verses. This project’s survey places the text of the book at about 1330–1370, an estimate from an anecdote dated 730-odd AH and the people named. Penn dates the manuscript “14--” and gives no date for the text.
- Where
- University of Pennsylvania, Kislak Center, LJS 51, f. 106v, the last page of text. Not on DECODE. It was no. 2882 of this project’s catalogue of open ciphers.
- The cipher
- One sign for each Arabic letter, 22 signs in all, written right to left with a dotted stroke between words. Lam-alif has a sign of its own.
- How it was deciphered
- Red letters over the first five signs give five of the six letters of the first word. The word for “eyelids” comes three times, and the metre and the rhyme fixed the rest.
- What it says
- Two verses: love has made the poet’s heart a drowsy-eyed girl’s dwelling; he lies awake with sound eyelids while she sleeps with “sick” ones.
- Still open
- No sign is without a value. Seven signs are doubtful on the page and take their value from their words, and one word is taken against the page (ṣiḥāḥ is written ṣiḥāj) and one is damaged (the first lahā of line 2). A model’s review for the second maintainer (issue #714), not a person’s, graded the reading B. This is the first modern reading; the compiler’s own solution is lost. The verses were not found in the sources searched; al-Qalqashandī and Arabic Origins of Cryptology were not searched.
01 The page
LJS 51 is a first-person account by a Mamluk secretary of the cipher verses he exchanged with colleagues. A message is introduced by “so-and-so wrote to me”, the cipher follows in an alphabet invented for the occasion, and then the compiler writes that he worked it out and gives the verses. The manuscript has lost its beginning and its end. On the last page, f. 106v, a message from Ibn al-Qaysarani stands in seven lines of signs. Under it the compiler begins “I unravelled it at once … and found that he had made the lam-alif …”, and there the manuscript breaks off. The leaf with his solution is gone. The sender’s name was read as Ibn al-Qaysarani in the project’s survey of the volume and was not re-read letter by letter here. A separate attempt on the same leaf (see section 04) re-read the name at 5x as Ibn al-Qubabi (or al-Qabbani); the two readings are not reconciled.

The transcription has 89 signs of 22 kinds in 21 words. A word runs over the end of a line twice. Two signs of line 1 are rubbed, and three signs of line 2 stand in a damaged patch.
02 How the key was recovered

- The gloss. The red letters over the first five signs read و ن ا ع س. With the sixth sign as ة the first word is وناعسة, “and many a drowsy-eyed woman”.
- A repeated word. The same four signs, ending in ا ن, come three times: after one rubbed sign in line 1, after وا in lines 4–5, and after وا in line 7, there with ها after them. They are اجفان, “eyelids”: الاجفان, واجفاني, واجفانها. This gives ج, ف and ه, and the rubbed sign is the lam-alif the compiler mentions.
- The metre. With قد for the two-sign word, line 1 and the first two words of line 2 scan as a half-verse in the ṭawīl metre: wa-nāʿisati l-ajfāni qad jaʿala l-hawā. جعل gives ل.
- The sleepers. ولم انم, ونامت and ولم تسهد in lines 5 and 6 give م and ت, and confirm د.
- The rhyme. The last words of the two verses differ in one sign and share a middle sign with a word of line 4: ارضا, مرضا and سهرت. This gives ر and ض.
- The rest. The second half-verse has to scan and to end in لها ارضا, which leaves لها مهجتي مثوا وخدي. The last open word, four signs in line 5, is صحاح, “sound”, set against مرضى, “sick”.
Two guesses failed on the way. The damaged word of line 2 was first taken as جهنم, and the sign for ر was first read as ع, which gave no word in line 4.
| Letter | Times | Sign, in words |
|---|---|---|
| ا | 18 | small loop with a flag to the left and a tick up to the right |
| و | 9 | zigzag like a slanted N |
| ه | 7 | two stems with loops at the top, joined by a bar |
| م | 7 | small triangle, a bar to the right, a stroke down ending in a hook or a bowl |
| ن | 6 | tall stroke, a loop on its right, a tail swept to the left |
| ل | 6 | loop at the lower left, a second loop above, a tail to the right |
| ج | 5 | cup over a stem that ends in a closed loop |
| ت | 4 | slanted stroke into a bowl with a loop at its end, like a 6 |
| ر | 3 | triangle, bar, small loop |
| د | 3 | hook and wave on the baseline |
| س | 3 | figure 8 |
| ي | 3 | loop or lozenge on a vertical stem |
| ف | 3 | flag with a small square or loop at the foot |
| ع | 2 | two loops on the baseline |
| ض | 2 | three teeth with a stem down at the left |
| ح | 2 | cup on a stem with a hook to the right at the foot |
| ة, لا, ق, خ, ث, ص | 1 each | rubbed circle; tall stroke joined to a bowl; arrowhead over a crossed circle; flat bar over a crossed circle; open curve with a loop on top; one stem with a loop on each side of its top |
03 The verses
As the cipher spells them, letter for letter: final alif maqṣūra is written as alif, and there is no hamza and no doubling mark.
وناعسة لاجفان قد جعل الهوا لها مهجتي مثوا وخدي لها ارضا
سهرت واجفاني صحاح ولم انم ونامت ولم تسهد واجفانها مرضا
In normal spelling, with vowels:
وناعسةِ الأجفانِ قد جعلَ الهوى / لها مهجتي مثوًى وخدّي لها أرضا
سهرتُ وأجفاني صِحاحٌ ولم أنمْ / ونامتْ ولم تسهدْ وأجفانُها مرضى
Many a girl with drowsy eyelids: love has made my heart her dwelling, and my cheek the ground beneath her.
I lay awake, though my eyelids are sound, and did not sleep; she slept and was never wakeful, though her eyelids are sick.
The second verse turns on the two pairs: the lover with sound eyes does not sleep, and the girl whose eyes are “sick”, that is languid, sleeps. All four half-verses scan as ṭawīl, and both verses end in -rḍā.
04 What is uncertain
Every sign has a value. These seven are doubtful on the page and take their value from their words (grade M where the sign is damaged, I where it is inferred):
- Line 1, sign 6, the ة of وناعسة: a rubbed circle (I).
- Line 1, sign 7, the lam-alif: rubbed (I). No separate alif stands before it, so the cipher has لاجفان.
- Line 2, the three signs of the first لها, in the damaged patch; the divider after them has lost its dots (M).
- Line 2, the ع of جعل: the sign is as close to the ر sign as to the ع of line 1 (I).
- Line 5, the last letter of صحاح: its foot is a closed loop, as in the sign for ج, where the ح before it has a hook (I). The writer or the copyist may have slipped.
The signs read ق and خ differ only at the top and come once each, in قد and وخدي. If they are one sign, the second word is وقدي, “and my stature”, which reads less well. The mark over the first sign of the gloss is small, and its و comes from the word.
Besides the metre, the rhyme and a key in which no sign has two values, the reading was put through the project’s
statistical test (docs/_validate.py), with a letter model built for it from 2.17 million letters of
writers of the compiler’s own time and circle: the diwans of Ṣafī al-Dīn al-Ḥillī and Ibn Nubāta, two books of
al-Ṣafadī (love verse and the letters he exchanged with other secretaries) and al-ʿUmarī’s chancery manual, from the
OpenITI corpus. The reading scores −2.537 per letter. Keys of the same shape at random score −4.901 on average
(the reading is 5.3 standard deviations above them), and keys fitted by the same solver to the signs shuffled score
−2.881 at best on average and −2.745 at their best (3.4 standard deviations below the reading). That is a pass,
but a narrow one, and the test is inconclusive at 89 signs: it shows that the text is Arabic-like under the key and does not carry the reading, which rests on the metre, the rhyme, the grammar and the red gloss. The text is short: run again with three other random seeds, the test gave one “weak” (2.7
standard deviations) and two passes, and in all four runs the reading scored above every fitted key. A fake reading fitted to
the shuffled signs, run as a control, does not pass. Seven of the 22 signs rest on the sense of one word each (قد, مثوى, وخدّي, صحاح and two single signs, ة and لا), and the words are chosen by sense; none of the alternatives gives a verse that reads as well. The signs were not
compared with the other alphabets of the volume (ff. 1r–106r), the last signs of ṣiḥāḥ and the first lahā of line 2 were not re-read on the master image, and al-Qalqashandī’s Ṣubḥ al-aʿshā (vol. 9) and Arabic Origins of Cryptology, where such verses might have been printed, were not searched. Two searches for the exact wording of the verses found no other copy,
so it is not known whether they are Ibn al-Qaysarani’s own.
A separate attempt on the same leaf, made from the images alone, did not read it and is kept in
targets/ljs51/. Compared with this key on 16 November 2026, its sign labels, matched to this folder’s signs by best fit, agree at 77 of 85
aligned positions (eight of them labels used once), found the ṭawīl metre (its second verse scanned only with an added null alif) and a rhyme in -ā after ض, and had the two commonest signs (ا and و) right. Of its
values for other signs, 11 of 37 positions agree; it gave the alif sign a second value as lam, which this key does not have, and its
words are mostly not these. It is a failed search, run with a letter model whose normaliser split vowelled words (fixed since; not rerun, so it is not shown that the fixed model would fail): with the metre alone, more than 100,000 readings of the opening half-verse scanned, and it
ended with a scanning candidate, not a reading. It read the second and fourth red letters over the first five signs as ta and
ghayn, where this page reads nun and ayn.
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, f. 106v: two verses
Two love verses in the tawil metre sent in cipher by Ibn al-Qaysarani to the compiler of the volume: love has made the poet's heart the dwelling of a drowsy-eyed girl and his cheek the ground beneath her; he lies awake with sound eyelids while she sleeps with 'sick' ones. The compiler's own solution was on a leaf now lost.
Transcription
# Penn LJS 51, f. 106v (OPenn image 0084_0217), lines 6-12: the seven cipher lines. # Read right to left on the page; here each line is given in reading order, left to right. # One Latin label per sign (sign list with shapes in NOTES.md); | is the dotted vertical word divider. # (x) = sign damaged, read from what survives; [|] = divider lost in the damaged patch of line 2. # No divider stands at a line end where a word runs over (lines 2-3, 4-5). 1: N T K D E (O) | (J) Y B K T | A S | 2: Y D M | K M H N K | (M) H (K) [|] Z 3: H Y G F | Z C N K | N Q S F | 4: M H K | K R W K | E H R G | N K Y 5: B K T F | X U K (U) | N M Z | K T Z 6: | N T K Z G | N M Z | G E H S 7: | N K Y B K T H K | Z R W K |
Decryption
# Reading: Penn LJS 51, f. 106v, the cipher note of Ibn al-Qaysarani
Two verses in the ṭawīl metre, rhyme -ḍā. Every one of the 89 signs has a value.
## As enciphered (letter for letter, `python decode.py`)
وناعسة لاجفان قد جعل الهوا لها مهجتي مثوا وخدي لها ارضا
سهرت واجفاني صحاح ولم انم ونامت ولم تسهد واجفانها مرضا
## In normal spelling, vocalised
وناعسةِ الأجفانِ قد جعلَ الهوى / لها مهجتي مثوًى وخدّي لها أرضا
سهرتُ وأجفاني صِحاحٌ ولم أنمْ / ونامتْ ولم تسهدْ وأجفانُها مرضى
## Notes
- The cipher writes final alif maqṣūra as alif (الهوا، مثوا، مرضا), no hamza, no shadda, and "الأجفان" as one
lam-alif sign followed by جفان.
- Doubtful signs, all read from sense and metre: the last sign of وناعسة (abraded; ة), the lam-alif sign (abraded),
the three signs of the first لها in line 2 (in a damaged patch), and the last letter of صحاح, whose sign looks
nearer to the ج sign than to the ح sign before it.
## Read against the shape on the page (marked in place)
- **صحا{ح}** (line 5): the last sign is written like ج (a closed loop at the foot, as in lines 4 and 7), not like the
ح sign before it. As written the word is صحاج. It is read صحاح from the sense (the antithesis with مرضى); a slip of the
writer or the copyist is possible. This is the strongest emendation in the text.
- **{ل}ها** (line 2, the first لها): three signs in a damaged patch. The ه is whole; before it only a small loop below the
baseline survives, and the divider after the group has lost its dots. The value comes from the parallel لها ارضا (line 4) and
from the metre; from the image alone the first sign could be any sign with a lower loop.
Seven of the 22 signs rest on the sense of one word each (ح, ص, ث, خ, ق, ة, لا). The decision: both marked words are
counted as read, as one-digit slips with the rest of the word fixed by the key (convention of 14 Nov 2026); 19 of 21 words
stand without either.Translation
# Translation: Penn LJS 51, f. 106v
Many a girl with drowsy eyelids: love has made my heart her dwelling, and my cheek the ground beneath her.
I lay awake, though my eyelids are sound, and did not sleep; she slept and was never wakeful, though her eyelids are sick.
("Sick" eyelids are the languid eyes of the beloved, a standard figure of Arabic love poetry; the second verse plays
the sound-eyed sleepless lover against the sick-eyed sleeper.)Key: key.json
05 Sources
- University of Pennsylvania, Kislak Center, LJS 51, f. 106v: OPenn, image 0084_0217 (master TIFF).
- Digital Scriptorium DS738, the catalogue record of the manuscript.
- The earlier ciphertext-only attempt on the same leaf, with its transcription, solvers and log:
targets/ljs51/in the repository. - The survey of the volume that found this cipher without its solution (it checked the layout of every page, not each plaintext):
research/sweep_2026-11-15_arabic/part_A.mdin the repository.
The transcription, key, decoder and notes are in the repository (targets/qaysarani1350/). Manuscript images: University of Pennsylvania Libraries, public domain, via OPenn.
Cite this page
Daniel Bourdeau, “Ibn al-Qaysarani’s cipher verses, about 1330–1370 (Penn LJS 51)”, Cyphersolver, posted 16 November 2026, https://cyphersolver.com/qaysarani1350.html.
