The classical Beaufort cipher subtracts each message letter’s position from its key letter’s position. With A = 0 through Z = 25, the rule is C = (K − P) mod 26. The order matters: Beaufort is not the same calculation as Vigenère.
How the Beaufort key works
Enter an A–Z key and repeat it over the message letters. Spaces and punctuation stay in place without taking up a key letter. Using the same key again reverses the result, because K − (K − P) = P.
Subtract the message from the key
HELLOKey KEY; classical reciprocal Beaufort; A = 0DANZQ| Input | Key | K − P | Result |
|---|---|---|---|
| H (7) | K (10) | 10 − 7 = 3 | D |
| E (4) | E (4) | 4 − 4 = 0 | A |
| L (11) | Y (24) | 24 − 11 = 13 | N |
| L (11) | K (10) | 10 − 11 = −1 → 25 | Z |
| O (14) | E (4) | 4 − 14 = −10 → 16 | Q |
Decode with the same key
Enter DANZQ with key KEY. D has index 3, and the first key letter K has index 10: 10 − 3 = 7, or H. Continue with the repeated key to recover HELLO. If you are checking a result from another tool, confirm that it uses classical Beaufort too.
Try one yourself
What does ABC become with a one-letter key D?