Skip to content
TextArray
100% local

Beaufort cipher

Encrypt and decrypt text with the Beaufort cipher, a self-reciprocal variant of the Vigenère cipher.

Input
Output

Beaufort cipher

The Beaufort cipher is a variation of the Vigenère cipher where the encryption and decryption operations are identical — apply the same key to ciphertext and you get the plaintext back. Type a keyword, paste your message, and every letter shifts by a formula based on the key, which repeats for as long as the text runs. The magic of the Beaufort cipher is its reciprocal nature: encryption and decryption are one operation, so you never have to choose a direction.

The cipher works with the formula C = (K − P) mod 26, where each plaintext letter is subtracted from the corresponding key letter modulo 26. Unlike the Vigenère cipher which adds the key, Beaufort subtracts it, creating a self-inverse transformation. The key must contain at least one letter — all non-letters are ignored when extracting the key. As the cipher processes your text, the key repeats over letters only, skipping punctuation, numbers and emoji so they stay in their original places.

Capitalization is preserved so the result still reads naturally. Non-letter characters pass through untouched, which means accented letters, digits, symbols and emoji are never encrypted. This makes the Beaufort cipher useful in puzzles, cryptography lessons, CTF challenges and geocaching mystery caches where you need reversible encryption without a separate decryption step. Everything runs in your browser and your text never leaves your device — paste, encrypt or decrypt, and copy the result with confidence.

FAQ

How is Beaufort different from Vigenère?
Both use a repeating key, but Vigenère adds the key to plaintext (C = P + K mod 26) while Beaufort subtracts it (C = K − P mod 26). This makes Beaufort self-reciprocal: applying the cipher twice returns the original message.
Why is it self-reciprocal?
Because subtraction is involved, applying the same operation twice inverts the effect. Encrypt a message with Beaufort and a key, then encrypt the result with the same key, and you get the original back. No separate decryption is needed.
How does the key repeat?
The key repeats over letters in the plaintext only. Punctuation, numbers, emoji and accented characters are never encrypted and do not advance the key position, so they remain in place.
Is my text uploaded anywhere?
No. The encryption runs entirely in your browser and your text never leaves your device.