Arabic cipher scripts · Penn LJS 51, f. 63v

The tree script in Penn LJS 51

A Mamluk-era Arabic couplet shows how a medieval cipher turned the alphabet into rows of branching trees.

Daniel Bourdeau · posted · updated

Method: existing decipherment · Extent: complete

At a glanceExisting decipherment · complete

From
The compiler (probably Ibn al-Durayhim)
To
Readers familiar with the tree script
Exchange note
The compiler says he re-enciphered the couplet in tree script for anyone who could read it.
The folio
University of Pennsylvania, Kislak Center, LJS 51, f. 63v. The compiler rewrote an Arabic couplet as five rows of trees. Read the English translation.
The rule
Count the branches on the right for the abjad group and on the left for the letter’s position.
Earlier accounts
The Shawq al-mustahām illustrates the alphabet. Ibn al-Durayhim’s Miftāḥ al-kunūz explains how to draw it.
Prior identification
Lisa Fagin Davis connected the manuscript’s tree script with the Shawq plate.

01 The folio

On f. 63v of Penn LJS 51, the compiler writes out a couplet as five rows of small trees. He calls it al-qalam al-mushajjar (القلم المشجّر), the tree script, and says he copied the verse this way so that whoever knew the script could read it. Two treatises help explain the page. The Shawq al-mustahām illustrates the alphabet. Ibn al-Durayhim’s Miftāḥ al-kunūz explains how to draw each letter by counting branches. Ibn al-Durayhim’s Cipher Casebook (Penn LJS 51).

The three scans side by side

Start with alif at the upper right of the Shawq alphabet and the Penn folio. Both give it one branch on each side of the stem. The Miftāḥ example starts at the right with mīm, drawn with three left branches and four right branches. Select any scan to enlarge it, or go to the letter-by-letter comparison.

Five rows of branching trees marked with red Arabic letters. The compiler’s note is above the trees, and the couplet in ordinary Arabic is in the right margin.
Penn LJS 51, f. 63v. The couplet in five rows of trees with red letters above them. Full folio. Image: University of Pennsylvania Libraries, Kislak Center, LJS 51, f. 63v, public domain, via OPenn (image 0084_0131).
Three rows of tree signs with their Arabic letter values underneath, starting with alif at the upper right
Shawq al-mustahām. The tree alphabet in Hammer’s edition, with the Arabic letter under each sign. Full page, Arabic p. 38. Image: Bavarian State Library, 4 A.or. 1025 Arab., Joseph von Hammer’s 1806 edition, Arabic p. 38, via the Internet Archive.
Twelve tree signs joined along four baselines, one per word, with Arabic letters above them
Ibn al-Durayhim’s Miftāḥ al-kunūz. The worked example محمد ابن عم علي as printed in the 1987 edition. Full page, p. 335. Manuscript facsimile, p. 313. Image: Ibn al-Durayhim, Miftāḥ al-kunūz, 1987 Damascus edition, vol. 1, p. 335, via the Internet Archive.
The 3D book opens to ff. 63v–64r. Drag or click to turn a page from left to right, or use the slider and arrow keys. Open the 3D book full screen. Image: University of Pennsylvania, Kislak Center, LJS 51, manuscript photographs via OPenn.

02 The tree alphabet in the Shawq al-mustahām

The Shawq al-mustahām fī maʿrifat rumūz al-aqlām, traditionally attributed to Ibn Waḥshiyya, presents the tree alphabet under the name of Dioscorides. The accompanying story says he wrote about plants and their properties in this script and that other sages used it in their books. Joseph von Hammer’s 1806 edition prints the tree signs in abjad order. The plate begins with a Y-shaped alif, just like the folio. The signs that follow add branches on one side as the letters advance through the first abjad group. The treatise’s authorship is disputed. Hammer’s edition, Arabic p. 38 and English § XVI. Toral-Niehoff and Sundermeyer, p. 251.

Lisa Fagin Davis connected the tree script in LJS 51 to the Shawq plate in a description she prepared after examining the manuscript for Lawrence Schoenberg in the mid-1990s. She posted the description publicly in January 2026. The sign-by-sign reading below shows how the branch counts on f. 63v compare with Ibn al-Durayhim’s instructions. Davis’s manuscript description.

Letter-by-letter comparison

Hammer’s printed Shawq plate follows the Eastern abjad counts for all 28 letters. The Penn couplet contains 22 of those letters. Of its 79 trees, 76 match the plate, both trees for ṣād differ, and one tree for lām is damaged. The counts below exclude the tip of the central stem and the lines joining the trees at their base. Bavarian State Library copy, Arabic p. 38. UNC Chapel Hill copy, Arabic p. 38. Folio transcription and counts.

Ṣād (ص) has four left branches and five right in the Shawq. Both red-glossed occurrences on f. 63v, row 1 tree 12 and row 3 tree 1, have one left branch and five right. The right side still points to the fifth group. The left side moves ṣād from fourth to first within it. Hammer’s plate uses 1/5 for sīn (س), which is absent from the couplet.

Ṣād and sīn closeups

Penn ṣād in row 1, with red ṣād above a tree with one left branch and five right branches
Penn ṣād ص
Row 1, tree 12 1 left5 right Image: Penn Libraries, LJS 51, f. 63v, via OPenn.
Penn ṣād in row 3, with red ṣād above a leaning tree with one left branch and five right branches
Penn ṣād ص
Row 3, tree 1 1 left5 right Image: Penn Libraries, LJS 51, f. 63v, via OPenn.
Printed Shawq ṣād, with four left branches and five right branches and ṣād underneath
Shawq ṣād ص
Middle row of the plate 4 left5 right Image: Hammer’s 1806 edition, Arabic p. 38, UNC Chapel Hill Libraries copy, via the Internet Archive.
Printed Shawq sīn, with one left branch and five right branches and sīn underneath
Shawq sīn س
Middle row of the plate 1 left5 right Image: Hammer’s 1806 edition, Arabic p. 38, UNC Chapel Hill Libraries copy, via the Internet Archive.

Lām (ل) matches the plate in six trees. A tear crosses the crown of the seventh, row 3 tree 15. The visible strokes can be counted as 3/4 if the possible stem tip is taken for a branch. The red gloss and parallel sign cipher support lām.

The crops show the printed Shawq signs and a representative tree for each letter present on f. 63v. Both Penn ṣād trees and the torn lām are included. Select a crop to view it at full size.

Branch counts from the viewer’s left and right, written left/right
LetterShawqLJS 51, f. 63vComparison
ا Shawq alif1/1
Penn alif, row 1, tree 11/1
Match
ب Shawq bāʾ2/1
Penn bāʾ, row 1, tree 62/1
Match
ج Shawq jīm3/1
Penn jīm, row 4, tree 23/1
Match
د Shawq dāl4/1
Penn dāl, row 3, tree 34/1
Match
ه Shawq hāʾ1/2
Penn hāʾ, row 2, tree 161/2
Match
و Shawq wāw2/2
Penn wāw, row 1, tree 92/2
Match
ز Shawq zāy3/2
Penn zāy, row 4, tree 43/2
Match
ح Shawq ḥāʾ1/3
Penn ḥāʾ, row 2, tree 111/3
Match
ط Shawq ṭāʾ2/3
Penn ṭāʾ, row 2, tree 82/3
Match
ي Shawq yāʾ3/3
Penn yāʾ, row 1, tree 23/3
Match
ك Shawq kāf1/4
Penn kāf, row 5, tree 71/4
Match
ل Shawq lām2/4
Penn lām, row 1, tree 112/4 (6 trees)Penn lām, torn crown, row 3, tree 153/4? (1 tree)
Six match, one torn
م Shawq mīm3/4 — Absent from folio
ن Shawq nūn4/4
Penn nūn, row 2, tree 104/4
Match
س Shawq sīn1/5 — Absent from folio
ع Shawq ʿayn2/5
Penn ʿayn, row 4, tree 112/5
Match
ف Shawq fāʾ3/5
Penn fāʾ, row 4, tree 53/5
Match
ص Shawq ṣād4/5
Penn ṣād, row 1, tree 121/5Penn ṣād, row 3, tree 11/5
Different in both trees
ق Shawq qāf1/6
Penn qāf, row 4, tree 61/6
Match
ر Shawq rāʾ2/6
Penn rāʾ, row 1, tree 82/6
Match
ش Shawq shīn3/6
Penn shīn, row 2, tree 123/6
Match
ت Shawq tāʾ4/6
Penn tāʾ, row 3, tree 114/6
Match
ث Shawq thāʾ1/7 — Absent from folio
خ Shawq khāʾ2/7 — Absent from folio
ذ Shawq dhāl3/7
Penn dhāl, row 3, tree 133/7
Match
ض Shawq ḍād1/8 — Absent from folio
ظ Shawq ẓāʾ2/8 — Absent from folio
غ Shawq ghayn3/8
Penn ghayn, row 1, tree 133/8
Match

03 The branch rule in Ibn al-Durayhim’s Miftāḥ

Ibn al-Durayhim’s fourteenth-century treatise tells the reader to start with a stem. The branches on the viewer’s right give the number of the abjad group. The branches on the left give the letter’s position in that group. The groups are mnemonic words that preserve a traditional order of the Arabic alphabet. The treatise demonstrates the rule with محمد ابن عم علي, “Muḥammad is ʿAlī’s cousin.” Its first letter, م, is third in the fourth group, so it takes three left branches and four right branches. The editors flag a copyist’s error affecting the shapes for alif and dāl in the example. 1987 Arabic edition, vol. 1, pp. 313 and 335. Arabic Origins of Cryptology, vol. 3, pp. 42 and 74–76.

Eastern abjad groups used in the treatise
Right branchesGroupLetters in order of increasing left branches
1abjadا ب ج د
2hawwazه و ز
3ḥuṭṭīح ط ي
4kalamanك ل م ن
5saʿfaṣس ع ف ص
6qarashatق ر ش ت
7thakhadhث خ ذ
8ḍaẓaghض ظ غ

An earlier positional method appears in Ibn Wahb’s work. He identifies each letter by its word and place in a verse containing every letter of the alphabet. The Damascus editors compare this with the tree script, which draws those two counts using the abjad groups. Al-Qalqashandī’s later summary of Ibn al-Durayhim lists several ways to conceal letters, including substituting pictures and names of trees, and passes over the branch-count rule. Damascus edition, vol. 2, p. 169. Al-Qalqashandī, Ṣubḥ al-aʿshā, vol. 9, pp. 229–232.

04 Reading the 79 trees on f. 63v

Shihāb al-Dīn al-Mutarjim sent the couplet in a sign cipher. The compiler records that cipher, then rewrites the verse in trees. Red Arabic letters stand over the trees, and a copy in ordinary Arabic runs up the right margin. The trees read right to left within each row, starting at the top. The first four give ا ي ر ي. The first is a fork with one branch on each side, the second has three on each side, and the third has two on the left and six on the right. Sign-by-sign transcription.

The Eastern table accounts for 76 of the 79 trees. Both occurrences of ṣād (ص), in rows 1 and 3, have one branch on the left and five on the right. This puts ṣād first in the fifth group, as in the Maghribi ṣaʿfaḍ. In the Eastern table, ṣād is fourth in that group. The signs for shīn and ghayn agree with the Eastern order. Giving ṣād the position it has on the folio brings the agreement to 78 of 79. The remaining tree, row 3, sign 15, is torn at the crown. Its recorded count gives mīm, while the gloss and parallel text support lām, which requires one fewer left branch. Six letters are absent from the verse, leaving their positions in this copy untested. Branch counts and comparison tables.

The two ciphers also help read the marginal copy. They support three corrected readings that can be made out in the margin, ايري, لا يجوز and يجوز. Both give فنكته before the final word, where the margin is rubbed. Parallel sign cipher. Checks against the margin.

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

English translation

My member is big, and the little one says to me, “Pierce my insides with it and be a hero.”
I cried, “This isn’t permitted.” He told me, “As far as I’m concerned, it is.” So I had sex with him, taking his word for it.

“The little one” translates al-ṣaghīr. The Arabic leaves its referent implicit. Fa-niktuhu is a blunt expression for having sex with him. Ibn Manẓūr, Lisān al-ʿArab, root n-y-k.

The closing taqlīdan (تقليدًا) tells how the speaker acted. “By imitation” is possible in isolation. In legal usage, taqlīd means accepting another person’s judgment without examining its grounds. Here lā yajūz, “it isn’t permitted,” is answered by ʿindī yajūz, “in my view it is.” “Taking his word for it” is a tentative reading of the joke. The speaker treats his companion’s permission as a ruling he can follow. Al-Jurjānī’s definition of taqlīd. Lane, root q-l-d. Casebook translation supplement.

The letter-sign encipherment on folio 63v

From
Possibly Shihāb al-Dīn Aḥmad al-Mutarjim
To
Unclear
Exchange note
The preceding folio mentions al-Mutarjim, but the cipher block has no separate introduction.

In lines 1–6 the couplet appears in letter signs. The tree script below it enciphers the same words with a different system. The marginal clear copy and the red letters over the trees preserve the reading for comparison. Read the shared translation.

Manuscript excerpt from Penn LJS 51, folio 63v, lines 1–6
Folio 63v, lines 1–6. University of Pennsylvania, Kislak Center, LJS 51, via OPenn (image 0131).
Manuscript excerpt from Penn LJS 51, folio 63v, lines 8–12
Folio 63v, lines 8–12. University of Pennsylvania, Kislak Center, LJS 51, via OPenn (image 0131).

Sign-by-sign alignment and reading notes for 63v.1

Every tree, by letter

All 79 trees of f. 63v, cut one by one from Penn’s master image (the trees of a word share one ground line, so each tree was found from its trunk and the red letter over it) and grouped by the letter of the compiler’s plaintext they stand for, in reading order. Trees of one letter should share one branch count; the master list of all signs shows every tree large enough to compare, and the number links there.

TreeOn the pageLetterTimes
tree اا11
tree بب4
tree تت2
tree ثث2
tree حح3
tree دد5
tree ذذ1
tree رر4
tree شش1
tree صص2
tree طط1
tree عع2
tree غغ1
tree فف1
tree قق3
tree كك2
tree لل9
tree نن5
tree هه3
tree وو6
tree يي11

05 The tree script and the compiler

Penn dates the surviving copy to the fifteenth century, possibly in Syria. On f. 102v the compiler calls the Miftāḥ al-kunūz “my book” and names its chapter on maqlūb, or rearrangement. That chapter appears in Ibn al-Durayhim’s treatise. On f. 50r the compiler gives al-Durayhim as the sobriquet of a remote ancestor. Taken together with the branch counts on f. 63v, these details support identifying the compiler as Ibn al-Durayhim. The folio preserves the method in use on an exchanged verse, with glosses and parallel copies that make it possible to check the reading. Penn’s manuscript catalogue. The casebook’s account of the compiler.

06 Sources

Cite this page

Daniel Bourdeau, “The tree script in Penn LJS 51”, Cyphersolver, posted 29 November 2026, updated 30 November 2026, repository commit 5abf8bd9aa, https://cyphersolver.com/ljs51-tree-script.html.