1001Ferramentas
🔐Security

Beaufort Cipher

Enciphers letters with the Beaufort cipher, a reciprocal Vigenere variant where each output letter is key minus plaintext mod 26, so the key also decodes.

Cifrado

The classical cipher that undoes itself

Anyone working through classical ciphers hits the same wall: Vigenere, Beaufort and the Beaufort variant share one tabula recta, have nearly identical formulas, and give different answers. When your exercise disagrees with the answer key you cannot tell whether you botched the arithmetic or picked the wrong convention. Watching the subtraction happen letter by letter settles it faster than rereading the definition.

Beaufort computes C = (K − P) mod 26, with the key repeating cyclically across the text. Flipping the subtraction has one elegant consequence: the cipher is an involution. Encrypting the ciphertext with the same key gives the plaintext back. HELLO under the key KEY becomes DANZQ; DANZQ under KEY returns HELLO. Vigenere, which adds (P + K), does not behave that way, and the Beaufort variant (P − K) is not an involution either.

The text field upper-cases your input and drops everything outside A-Z, accents included, so transliterate before pasting. The key is taken as typed, and non-letter characters in it produce meaningless shifts rather than an error message; an empty key yields blank output. Fine for coursework, CTFs and geocaching puzzles, useless for real secrecy: a few dozen letters of ciphertext are enough for the index of coincidence to expose the key length. Everything is computed in your browser, with no data sent anywhere.

Frequently asked questions

How do I decrypt?
Paste the ciphertext into the same field with the same key. Beaufort is an involution, so decryption is literally the same operation as encryption.
How is it different from Vigenere?
Vigenere adds plaintext and key (P + K); Beaufort subtracts the plaintext from the key (K − P). Same table, reversed reading, different output for the same key.
Can I use digits, spaces or accents?
In the text they are stripped before the calculation. In the key it is worse: nothing errors out, but characters outside A-Z create arbitrary shifts and a result nobody can reproduce.

Related Tools