← Signals & codes

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

3‡0† 2?3

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.

463letters enciphered with Poe's key
85different words to practise
1843“The Gold-Bug” wins a $100 prize and is printed
23letters with no symbol in Poe's key: every w and k

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.

LineEnglish · sourceGold-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.

LetterSignLetterSign
A5M9
B2N*
C-O‡
D†P.
E8R(
F1S)
G3T;
H4U?
I6V
L0Y:

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.

Cipher → English

How to practise

  1. Start with the 8s: each one is an e.
  2. Look for ;48, the word the, and fill in t and h.
  3. Use the key for the rest, then reveal.
  4. 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;5K8line 1 · 1×
this;46)line 1 · 1×
kissK6))line 1 · 1×
upon?.‡*line 1 · 1×
the;48line 1 · 6×
brow2(‡Wline 1 · 1×
and5*†line 2 · 2×
in6*line 2 · 5×
parting.5(;6*3line 2 · 1×
from1(‡9line 2 · 2×
you:‡?line 2 · 2×
now*‡Wline 2 · 1×
thus;4?)line 3 · 1×
much9?-4line 3 · 1×
let08;line 3 · 1×
me98line 3 · 1×
avow5¶‡Wline 3 · 1×
are5(8line 4 · 1×
not*‡;line 4 · 3×
wrongW(‡*3line 4 · 1×
whoW4‡line 4 · 1×
deem†889line 4 · 1×
that;45;line 5 · 3×
my9:line 5 · 3×
days†5:)line 5 · 1×
have45¶8line 5 · 1×
been288*line 5 · 1×
a5line 5 · 10×
dream†(859line 5 · 5×
yet:8;line 6 · 2×
if61line 6 · 1×
hope4‡.8line 6 · 1×
has45)line 6 · 1×
flown10‡W*line 6 · 1×
away5W5:line 6 · 1×
night*634;line 7 · 1×
or‡(line 7 · 4×
day†5:line 7 · 1×
vision¶6)6‡*line 8 · 1×
none*‡*8line 8 · 1×
is6)line 9 · 3×
it6;line 9 · 1×
therefore;48(81‡(8line 9 · 1×
less08))line 9 · 1×
gone3‡*8line 9 · 1×
all500line 10 · 2×
weW8line 10 · 2×
see)88line 10 · 2×
seem)889line 10 · 2×
but2?;line 11 · 2×
withinW6;46*line 11 · 3×
I6line 12 · 6×
stand);5*†line 12 · 1×
amid596†line 12 · 1×
roar(‡5(line 12 · 1×
of‡1line 13 · 2×
surf-tormented)?(1 ;‡(98*;8†line 13 · 1×
shore)4‡(8line 13 · 1×
hold4‡0†line 14 · 1×
hand45*†line 14 · 1×
grains3(56*)line 15 · 1×
golden3‡0†8*line 15 · 1×
sand)5*†line 15 · 1×
how4‡Wline 16 · 2×
few18Wline 16 · 1×
they;48:line 16 · 1×
creep-(88.line 16 · 1×
through;4(‡?34line 17 · 1×
fingers16*38()line 17 · 1×
to;‡line 17 · 1×
deep†88.line 17 · 1×
whileW4608line 18 · 2×
weepW88.line 18 · 2×
O‡line 19 · 2×
God3‡†line 19 · 2×
can-5*line 19 · 2×
grasp3(5).line 19 · 1×
them;489line 20 · 1×
withW6;4line 20 · 1×
tighter;634;8(line 20 · 1×
clasp-05).line 20 · 1×
save)5¶8line 21 · 1×
one‡*8line 22 · 1×
pitiless.6;608))line 22 · 1×
waveW5¶8line 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