A common home-made scheme: take your twelve words and run them through a cipher you learned as a child. Shift every letter three places. Use a Vigenère keyword. Or skip the letters and shift the word numbers: "add 100 to every word, wrap at 2048." Each one turns the list into something you can't read at a glance. This page counts the keys each scheme has and shows how an attacker gets through them.
Hiding is not encrypting. The ciphers are public and a seed phrase carries its own checksum, so a list someone recognises as a seed can be tried against every cipher in minutes. Add a BIP-39 passphrase to the wallet and keep it somewhere else.
Two facts the attacker starts with
The first is the word list. BIP-39 English has 2,048 words of three to eight letters. Whatever you did to them, the answer has to be twelve or twenty-four words from that list. That fact alone breaks most letter ciphers, as the sections below show.
The second is the checksum. BIP-39 takes the first ENT/32 bits of a SHA-256 hash of the entropy and puts them at the end of the phrase: 4 bits for 12 words, 8 bits for 24. A wrong guess that still lands on real words passes about 1 time in 16 for a 12-word phrase and 1 time in 256 for a 24-word phrase. Testing one guess costs one SHA-256 hash. In plain Python on one core we ran 100,000 of these checks in 1.1 seconds.
Whatever survives both filters goes to the last test: derive the wallet and see whether its addresses have ever been used. That step is what tells the right key from the lucky wrong ones (how the full search works).
We use the public example phrase throughout:
pizza educate fat kiss domain venue kingdom raise split step copper tree (this phrase is public: never use it for real funds)
Caesar shift: 25 keys
Suetonius records that Julius Caesar wrote private letters "by so changing the order of the letters of the alphabet, that not a word could be made out": D for A, and so on. Shift the example by three and you get:
slccd hgxfdwh idw nlvv grpdlq yhqxh nlqjgrp udlvh vsolw vwhs frsshu wuhh
The alphabet can be lined up 26 ways, and one of them is no shift at all, so there are 25 keys. The Army's 1990 field manual on basic cryptanalysis says of exactly this case that "it does not take very long to try all 26 settings."
The scheme also announces itself. We shifted all 2,048 BIP-39 words by each of the 25 keys. No key turned more than 3 of the 2,048 words into other words on the list. So a Caesar-shifted seed is twelve strings of three to eight letters that are almost all non-words. Anyone who knows what a seed looks like counts the groups, sees 12 or 24, and tries 25 shifts. The right one is the only one that gives back real words. The checksum isn't even needed.
Vigenère: 26 to the power k keys
A Vigenère cipher shifts each letter by the next letter of a repeating keyword. A key of k letters gives 26k keys:
| Key length | Keys |
|---|---|
| 4 | 456,976 |
| 6 | 308,915,776 |
| 8 | about 209 billion |
Those numbers assume the attacker tries every key blind. They don't have to. If you kept the gaps between words, as almost everyone does, each word can be solved on its own. We enciphered the example with a six-letter key and attacked it word by word. The first word is five letters, and only 555 BIP-39 words have five letters, so the first five key letters had 555 possibilities. The second word, seven letters long, cut that to one. The whole key fell in 0.6 seconds of Python, two words in. Not knowing the key length costs the attacker one run per length they try: twenty runs covers keys up to twenty letters.
Vigenère output has the same tell as Caesar: twelve groups of non-words in seed-sized pieces.
Playfair: a big square with a small secret
Playfair enciphers pairs of letters using a 5 by 5 square. The square holds 25 letters, so two of the 26
share a cell (usually I and J). A doubled letter inside a pair has no rule, so you break it up with a
filler such as X. "pizza" becomes pi zx za, and the gaps between words stop meaning anything.
A random square has 25! arrangements, about 1.55 × 1025. You won't memorise a random square. Build it from a keyword you can remember and the secret shrinks to that keyword. The field manual gives Playfair a section on how to break it by hand, and its pen-and-paper attacks work from guessed words. On a seed the attacker knows every possible word in advance, all 2,048 of them.
Playfair output is also easy to spot. The field manual notes that Playfair text comes in two-letter units, so its length is even, that it has no doubled letter inside a pair, and that it often leaves out either I or J.
Shifting word numbers: 2,047 keys
The cleverest home-made version works on the index. Each word is a number from 0 to 2047. Add 100 to each and wrap at 2048, and every result is a real word. The example becomes:
rate fantasy garment mansion estate year mango sad team tiger detect virtual
This is a list of real BIP-39 words, so the non-word tell is gone. Two other tells take its place:
- The shifted list almost always fails the checksum. Ours does. A shift keeps a valid checksum only 1 time in 16 (12 words) or 1 in 256 (24 words), and BIP-39 tells wallet software to warn when the checksum is invalid. So the attacker's first restore attempt tells them something was done to the list.
- Once they suspect a shift, there are 2,047 keys to try. That's 2,047 checksum tests, a few hundredths of a second.
We tried every shift on our enciphered example. 135 passed the checksum, the right one and 134 wrong ones, close to the 128 you'd expect from 2,047 ÷ 16. On twenty random 24-word phrases the average was 9.1 wrong shifts passing, against an expected 8. A few hundred wallet derivations and address lookups finish the job.
Adding a different number to each word is a Vigenère on the index: k numbers of 2,048 choices each, and 2,048k keys. That can be large, but you have to store it, and once the key is as long as the phrase you have built a one-time pad with all of its costs. Splitting a seed into shares is better done with a scheme built for it (XOR, SLIP-39 and Codex32).
The numbers side by side
| Scheme | Keys | Tell on sight |
|---|---|---|
| Caesar on letters | 25 | non-words in seed-sized groups |
| Vigenère, 6 letters | 308,915,776 (solved word by word) | non-words |
| Index shift mod 2048 | 2,047 | fails the checksum |
| This site's vault ciphers | 9,132 | numbers from 5432 to 7479 |
Our own ciphers are in that table on purpose. A vault cipher is a public lookup table, and choosing one of 9,132 days gives you about 13 bits. That is more than an index shift (11 bits) and a Caesar shift (under 5 bits), and still nothing an attacker would notice spending. We publish them to make a list look like something else, and they don't lock anything. Hiding is not encrypting sets out what that buys and what it doesn't.
What locks the wallet
A BIP-39 passphrase. Wallet software feeds the words and the passphrase together into PBKDF2 with 2,048 rounds of HMAC-SHA512. The passphrase can be any string, it has no checksum, and BIP-39 notes that "every passphrase generates a valid seed." A wrong guess gives the attacker an empty wallet and no hint how close they came. Each guess costs the full key derivation, which is where the time goes.
So use the cipher, if you use one, to keep the words from being recognised. Use a passphrase to keep recognised words from being spent. The 25th word covers choosing one and storing it apart from the seed. If you want the words themselves unreadable, a real password-based cipher is a different tool with different risks (encrypting a seed with a password).
- Don't treat a letter shift or an index shift as protection. Count its keys first.
- Add a passphrase, store it apart from the words, and test the restore with a small amount before you fund the wallet.
- Do every cipher step on paper. Never type a seed into a website or an online cipher tool to "encrypt" it.
We will never ask for a seed word or a passphrase. Never type one into this site or any tool it links to.
Sources
- BIP-39: Mnemonic code for generating deterministic keys: CS = ENT/32 (4 bits for 12 words, 8 for 24), 11-bit word indexes 0 to 2047, the warning on an invalid checksum, PBKDF2 with 2,048 iterations of HMAC-SHA512, and "every passphrase generates a valid seed."
- BIP-39 English word list: 2,048 words of 3 to 8 letters, 555 of them five letters long.
- Suetonius, The Life of Julius Caesar, section 56, LacusCurtius English text: the D-for-A substitution.
- Headquarters, Department of the Army, FM 34-40-2 Basic Cryptanalysis, 13 September 1990: 26 alignments of a standard alphabet (paragraph 3-7), the Vigenère square (figure 8-1), I and J sharing a cell in a 5 by 5 matrix (chapter 5), the Playfair rules and the X filler for doubled letters (paragraph 6-6), even-length Playfair text with I or J left out (chapter 6), and the security of Playfair (paragraph 7-5).
- Our own tests, Python 3 on one core: all 25 Caesar shifts over the full word list; a six-letter Vigenère key recovered word by word from the example; all 2,048 index shifts of the example (+100) checked against the checksum; twenty random 24-word phrases; 100,000 checksum tests timed.