What is a Beale Cipher?
A Beale cipher (more precisely a book cipher) uses
a shared text as a codebook. Each word in the text is assigned a sequential
number starting at 1. To represent a letter, the sender picks any word whose
first letter matches and writes down that word's number.
Because many words can start with the same letter, the same plaintext letter
can produce different cipher numbers each time — making frequency analysis
much harder.
Historical note
The historical Beale Papers (1820s) used the
Declaration of Independence as their codebook.
Here we use Ray Bradbury's short story
"A Sound of Thunder" as a tribute to the
butterfly-effect theme of the saga.
To encode
- Type your message in the Encode tab (letters A–Z; spaces are preserved as dashes).
- Click Encode. For each letter the app picks one word number at random from all words starting with that letter.
- The output numbers are your cipher text. Share them — plus the key text — with your recipient.
To decode
- Paste the cipher numbers into the Decode tab.
- Click Decode. The app looks up each number in the key text and reads the first letter of that word.
- Numbers out of range or pointing to punctuation-only words show as
?.
Animation
After encoding or decoding, the result letters are loaded into the
SWCharacter canvas. Press Start to scatter and spin them,
then Assemble to call them home in formation.
Key-Text Index
The right panel shows which word numbers map to each letter.
Up to 20 samples are shown per letter; use the full list
to hand-craft ambiguous messages.