A code study edition
English ↔ The Gold-Bug cipher
A Dream Within a Dream · in the cipher from Poe's own story
Edition: complete · every letter from Poe's 1843 key · unreviewed project draft
In “The Gold-Bug” (1843), Poe's hero William Legrand finds a pirate's message written in numbers and printer's marks, and cracks it by counting which sign appears most. Here Poe's own key carries his poem, letter by letter, and the panel enciphers anything you type.
Encipher it
Each letter becomes its sign in Poe's key. Letters his key never gave (j, k, q, w, x, z) stay as plain capitals. Try your own name.
Part one / The poem
The poem, line by line
Every letter of Poe's poem in the Gold-Bug key. Legrand's message ran all its words together; this edition keeps the spaces so each line can be read. Punctuation is dropped, because the cipher uses those marks as letters. Select a line number for its study note.
| Line | English · source | Gold-Bug cipher · Poe's key |
|---|---|---|
| Take this kiss upon the brow! | ;5K8 ;46) K6)) ?.‡* ;48 2(‡W | |
| And, in parting from you now, | 5*† 6* .5(;6*3 1(‡9 :‡? *‡W | |
| Thus much let me avow — | ;4?) 9?-4 08; 98 5¶‡W | |
| You are not wrong, who deem | :‡? 5(8 *‡; W(‡*3 W4‡ †889 | |
| That my days have been a dream; | ;45; 9: †5:) 45¶8 288* 5 †(859 | |
| Yet if hope has flown away | :8; 61 4‡.8 45) 10‡W* 5W5: | |
| In a night, or in a day, | 6* 5 *634; ‡( 6* 5 †5: | |
| In a vision, or in none, | 6* 5 ¶6)6‡* ‡( 6* *‡*8 | |
| Is it therefore the less gone? | 6) 6; ;48(81‡(8 ;48 08)) 3‡*8 | |
| All that we see or seem | 500 ;45; W8 )88 ‡( )889 | |
| Is but a dream within a dream. | 6) 2?; 5 †(859 W6;46* 5 †(859 | |
| I stand amid the roar | 6 );5*† 596† ;48 (‡5( | |
| Of a surf-tormented shore, | ‡1 5 )?(1 ;‡(98*;8† )4‡(8 | |
| And I hold within my hand | 5*† 6 4‡0† W6;46* 9: 45*† | |
| Grains of the golden sand — | 3(56*) ‡1 ;48 3‡0†8* )5*† | |
| How few! yet how they creep | 4‡W 18W :8; 4‡W ;48: -(88. | |
| Through my fingers to the deep, | ;4(‡?34 9: 16*38() ;‡ ;48 †88. | |
| While I weep — while I weep! | W4608 6 W88. W4608 6 W88. | |
| O God! Can I not grasp | ‡ 3‡† -5* 6 *‡; 3(5). | |
| Them with a tighter clasp? | ;489 W6;4 5 ;634;8( -05). | |
| O God! can I not save | ‡ 3‡† -5* 6 *‡; )5¶8 | |
| One from the pitiless wave? | ‡*8 1(‡9 ;48 .6;608)) W5¶8 | |
| Is all that we see or seem | 6) 500 ;45; W8 )88 ‡( )889 | |
| But a dream within a dream? | 2?; 5 †(859 W6;46* 5 †(859 |
Part two / How it works
Poe's key: twenty letters
This is the whole key as Legrand sets it out once the message is solved. Every letter is always written with the same sign, which is why counting the signs breaks it.
| Letter | Sign | Letter | Sign |
|---|---|---|---|
| A | 5 | M | 9 |
| B | 2 | N | * |
| C | - | O | ‡ |
| D | † | P | . |
| E | 8 | R | ( |
| F | 1 | S | ) |
| G | 3 | T | ; |
| H | 4 | U | ? |
| I | 6 | V | ¶ |
| L | 0 | Y | : |
1 · One letter, one sign
A simple substitution cipher: each letter always gets the same sign, and the signs are ordinary printer's marks and digits.
gold → 3‡0† · bug → 2?3
2 · Count the signs
Legrand counts every sign. 8 appears 33 times, so it must be e, the commonest letter in English.
8 → e
3 · Find the word the
Legrand notes the group ;48 at least five times. Ending in e, it can only be the, which gives t and h.
;48 → the
4 · The six missing letters
The pirate's message never uses j, k, q, w, x or z, so Poe never gives them signs. This edition writes them as plain capitals rather than inventing marks Poe did not make.
kiss → K6)) · weep → W88.
Because ( ) ; : ? . and - are letters in this cipher, the poem's punctuation is left out, and surf-tormented is written as two words.
Practice
Crack it
A word from the poem is shown in Poe's cipher. Pick the English word it hides.
0 of 0 correct
Practice with every word
Every word of the poem
All 85 different words of the poem, in the order they first appear. Work out each word from the key, then reveal the English.
How to practise
- Start with the 8s: each one is an e.
- Look for ;48, the word the, and fill in t and h.
- Use the key for the rest, then reveal.
- Write a note to a friend in the cipher and let them crack it the way Legrand did.
See the full word list (85 words)
| take | ;5K8 | line 1 · 1× |
| this | ;46) | line 1 · 1× |
| kiss | K6)) | line 1 · 1× |
| upon | ?.‡* | line 1 · 1× |
| the | ;48 | line 1 · 6× |
| brow | 2(‡W | line 1 · 1× |
| and | 5*† | line 2 · 2× |
| in | 6* | line 2 · 5× |
| parting | .5(;6*3 | line 2 · 1× |
| from | 1(‡9 | line 2 · 2× |
| you | :‡? | line 2 · 2× |
| now | *‡W | line 2 · 1× |
| thus | ;4?) | line 3 · 1× |
| much | 9?-4 | line 3 · 1× |
| let | 08; | line 3 · 1× |
| me | 98 | line 3 · 1× |
| avow | 5¶‡W | line 3 · 1× |
| are | 5(8 | line 4 · 1× |
| not | *‡; | line 4 · 3× |
| wrong | W(‡*3 | line 4 · 1× |
| who | W4‡ | line 4 · 1× |
| deem | †889 | line 4 · 1× |
| that | ;45; | line 5 · 3× |
| my | 9: | line 5 · 3× |
| days | †5:) | line 5 · 1× |
| have | 45¶8 | line 5 · 1× |
| been | 288* | line 5 · 1× |
| a | 5 | line 5 · 10× |
| dream | †(859 | line 5 · 5× |
| yet | :8; | line 6 · 2× |
| if | 61 | line 6 · 1× |
| hope | 4‡.8 | line 6 · 1× |
| has | 45) | line 6 · 1× |
| flown | 10‡W* | line 6 · 1× |
| away | 5W5: | line 6 · 1× |
| night | *634; | line 7 · 1× |
| or | ‡( | line 7 · 4× |
| day | †5: | line 7 · 1× |
| vision | ¶6)6‡* | line 8 · 1× |
| none | *‡*8 | line 8 · 1× |
| is | 6) | line 9 · 3× |
| it | 6; | line 9 · 1× |
| therefore | ;48(81‡(8 | line 9 · 1× |
| less | 08)) | line 9 · 1× |
| gone | 3‡*8 | line 9 · 1× |
| all | 500 | line 10 · 2× |
| we | W8 | line 10 · 2× |
| see | )88 | line 10 · 2× |
| seem | )889 | line 10 · 2× |
| but | 2?; | line 11 · 2× |
| within | W6;46* | line 11 · 3× |
| I | 6 | line 12 · 6× |
| stand | );5*† | line 12 · 1× |
| amid | 596† | line 12 · 1× |
| roar | (‡5( | line 12 · 1× |
| of | ‡1 | line 13 · 2× |
| surf-tormented | )?(1 ;‡(98*;8† | line 13 · 1× |
| shore | )4‡(8 | line 13 · 1× |
| hold | 4‡0† | line 14 · 1× |
| hand | 45*† | line 14 · 1× |
| grains | 3(56*) | line 15 · 1× |
| golden | 3‡0†8* | line 15 · 1× |
| sand | )5*† | line 15 · 1× |
| how | 4‡W | line 16 · 2× |
| few | 18W | line 16 · 1× |
| they | ;48: | line 16 · 1× |
| creep | -(88. | line 16 · 1× |
| through | ;4(‡?34 | line 17 · 1× |
| fingers | 16*38() | line 17 · 1× |
| to | ;‡ | line 17 · 1× |
| deep | †88. | line 17 · 1× |
| while | W4608 | line 18 · 2× |
| weep | W88. | line 18 · 2× |
| O | ‡ | line 19 · 2× |
| God | 3‡† | line 19 · 2× |
| can | -5* | line 19 · 2× |
| grasp | 3(5). | line 19 · 1× |
| them | ;489 | line 20 · 1× |
| with | W6;4 | line 20 · 1× |
| tighter | ;634;8( | line 20 · 1× |
| clasp | -05). | line 20 · 1× |
| save | )5¶8 | line 21 · 1× |
| one | ‡*8 | line 22 · 1× |
| pitiless | .6;608)) | line 22 · 1× |
| wave | W5¶8 | line 22 · 1× |
Background
Poe and secret writing
The challenge
In 1839 and 1840 Poe invited readers of Alexander's Weekly Messenger to send him substitution ciphers, and claimed to have solved nearly all of them.
Secret writing
In 1841 he followed with “A Few Words on Secret Writing” in Graham's Magazine, explaining how such ciphers are broken. Legrand's method in the story is the same one.
The prize story
“The Gold-Bug” won a $100 prize from the Philadelphia Dollar Newspaper and was printed there in June 1843. It was one of the most widely read stories of Poe's lifetime.
Sources
Pages consulted
- Edgar Allan Poe, “The Gold-Bug,” Dollar Newspaper, Philadelphia, June 1843 (Project Gutenberg and the Edgar Allan Poe Society of Baltimore texts)
- Edgar Allan Poe, “A Few Words on Secret Writing,” Graham's Magazine, July 1841
- The Gold-Bug, Wikipedia
- Edgar Allan Poe's “The Gold-Bug” (1843), The Public Domain Review