🔄 Beaufort Cipher
Encrypt and decrypt text with the Beaufort cipher. A reciprocal polyalphabetic cipher: Ci = (Ki - Pi) mod 26.
About the Beaufort Cipher
The Beaufort cipher, named after Sir Francis Beaufort (creator of the Beaufort wind scale), is a polyalphabetic cipher closely related to the Vigenère cipher. Its key feature is that it is reciprocal: encryption and decryption use the identical operation, so the same tool with the same key reverses itself. This tool runs entirely in your browser — nothing is uploaded.
How it works
- Each plaintext letter Pi is combined with a key letter Ki using the formula Ci = (Ki − Pi) mod 26.
- The key repeats cyclically to match the length of the message.
- Because decryption is Pi = (Ki − Ci) mod 26, applying the same operation again with the same key recovers the original text — the cipher is self-reciprocal.
- Letter case is preserved; non-letter characters (digits, punctuation, spaces) pass through unchanged.
Use cases
- Studying polyalphabetic ciphers and the Vigenère family.
- Building puzzles where the same operation encrypts and decrypts.
- Understanding reciprocal ciphers used in mechanical rotor machines.
- Comparing the Beaufort and Vigenère variants side by side.
Frequently asked questions
What is the difference between Beaufort and Vigenère? Vigenère adds the key to the plaintext (Ci = Pi + Ki), while Beaufort subtracts the plaintext from the key (Ci = Ki − Pi). Beaufort is also reciprocal; Vigenère is not.
Is the Beaufort cipher secure? No. Like Vigenère, it is vulnerable to frequency analysis and Kasiski examination when the key is shorter than the message.
Why does the mode not matter? Because Beaufort is reciprocal, encrypt and decrypt perform the same math. The mode option is provided for clarity but produces identical results.
Does this tool upload my text? No. All processing happens locally in your browser.