How to use the Beaufort cipher tool
- Enter the Key. The default is FORTIFICATION, the key used in a well-known textbook example.
- Type or paste your message into Your text.
- Read the Result. That is the ciphertext if you entered plain text, or the plain text if you entered ciphertext.
- Share the key separately with the person who will read the message.
What it does and when to use it
The Beaufort cipher is named after Sir Francis Beaufort, the admiral best known for the wind force scale. It uses a keyword like the Vigenère cipher, but its arithmetic is reversed, so the operation that encrypts also decrypts. That reciprocal property made it convenient for hand use, and the same idea was later built into some mechanical cipher machines.
Today it is a puzzle and teaching cipher. It does not protect data against anyone who knows classical cryptanalysis. To compare it with its close relatives, try the Vigenère cipher, the autokey Vigenère cipher, which avoids a repeating key, and the Gronsfeld cipher, which uses digits as the key.
How it works
Number the letters A = 0 to Z = 25. The key is repeated along the letters of the message, and for each letter:
C = (K − P) mod 26
Take the first letter of the textbook example: the key letter F is 5 and the plain letter D is 3, so 5 − 3 = 2, which is C. Next, key O (14) and plain E (4) give 10, which is K.
Only the letters A to Z and a to z are changed, and each keeps its case. Spaces, digits, punctuation and accented letters pass through and do not use up a key letter. The key is cleaned the same way: everything except its letters is ignored. The calculation runs in your browser.
Worked examples
Results from the tool:
DEFENDTHEEASTWALLOFTHECASTLE key FORTIFICATION → CKMPVCPVWPIWUJOGIUAPVWRIWUUK
Meet at 6, Bob! key Key → Yaur ef 6, Jqx!
Yaur ef 6, Jqx! key Key → Meet at 6, Bob!
HELLO key Z → SVOOL
The first is the classic test case. The second and third show the same operation going both ways, with the 6, the comma and the spaces untouched. With the one-letter key Z, Beaufort becomes Atbash, the mirror alphabet, so HELLO turns into SVOOL just as it would in the Atbash cipher.
Limits and tips
- Longer keys that are not English words are harder to break by hand, though still not secure.
- Because spaces are kept, word lengths show. Remove spaces before encrypting if that matters for your puzzle.
- Letters outside A to Z, such as é or ß, are not encrypted. Replace them with plain letters if they would give the message away.
Frequently asked questions
Where is the decrypt button?
How is Beaufort different from Vigenère?
What does the key accept?
Is the Beaufort cipher safe for real secrets?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.