Skip to main content
Home/Tools/Security/Beaufort Cipher Tool

Beaufort Cipher Tool

Self-reciprocal polyalphabetic cipher. Same operation encrypts and decrypts with C = (K - P) mod 26.

100% Private - Runs Entirely in Your Browser
No data is sent to any server. All processing happens locally on your device.
Loading Beaufort Cipher Tool...
Loading interactive tool...

Deep Diving Into Ciphers?

Our security researchers stay current with cryptographic advances and implementation best practices.

Not sure which cipher you have? Use the Cipher Identifier to auto-detect cipher types from unknown ciphertext using frequency analysis and Index of Coincidence.

What Is the Beaufort Cipher?

Beaufort is a polyalphabetic substitution cipher closely related to Vigenère, with one important property: it is self-reciprocal. The same operation encrypts and decrypts, so sender and receiver use identical procedures with no separate "encrypt" and "decrypt" tables. This made it practical to implement on a reversible disk or slide.

How the Beaufort Cipher Works

Number the alphabet A=0, B=1, ..., Z=25. With key letter K and plaintext letter P:

C = (K − P) mod 26

This is reversed from Vigenère: Vigenère adds the key (C = P + K mod 26); Beaufort subtracts the plaintext from the key. Because subtraction modulo 26 is its own inverse, applying the same operation again recovers the plaintext:

P = (K − C) mod 26

A repeating keyword is used, just like Vigenère — the key cycles through its letters across the message.

Worked Example

Encrypt "HELLO" with the key "FORT" (repeating: F O R T F).

  • H(7), key F(5): (5 − 7) mod 26 = 24 → Y
  • E(4), key O(14): (14 − 4) mod 26 = 10 → K
  • L(11), key R(17): (17 − 11) mod 26 = 6 → G
  • L(11), key T(19): (19 − 11) mod 26 = 8 → I
  • O(14), key F(5): (5 − 14) mod 26 = 17 → R

Ciphertext: "YKGIR". Decrypt by applying the same operation: (5 − 24) mod 26 = 7 → H, and so on, recovering "HELLO". That symmetry is what "reciprocal" means in practice.

Beaufort vs. Vigenère vs. Variant Beaufort

  • Vigenère: C = (P + K) mod 26 — encrypt adds, decrypt subtracts.
  • Beaufort: C = (K − P) mod 26 — same operation both ways.
  • Variant Beaufort ("German Variant"): C = (P − K) mod 26 — Vigenère in reverse; not reciprocal.

History

The cipher is named after Sir Francis Beaufort, the Royal Navy admiral who also created the Beaufort wind scale. He proposed it around 1857. The British Royal Navy used Beaufort-style ciphers on disks and slide rules through the 19th and early 20th centuries because the reciprocal property simplified manual operation and reduced training error.

When to Use the Beaufort Cipher

Education and puzzles only. It is a good teaching example because small changes in algebraic structure (subtraction vs. addition) produce useful properties (self-inverse encryption) without improving security. It is also a favorite in CTF challenges that include it specifically because solvers try Vigenère first and fail. Do not use it for any real-world secrecy requirement.

Security and Cryptanalysis

Beaufort has the same security profile as Vigenère and is broken by the same techniques:

  • Kasiski examination — repeated ciphertext n-grams reveal the key length, since identical plaintext segments at the same key offset produce identical ciphertext.
  • Friedman / Index of Coincidence test — Beaufort ciphertext has IoC around 0.038–0.045 (flatter than English's 0.067), and analyzing IoC for assumed key lengths peaks at the correct length.
  • Per-column frequency analysis — once the key length is known, each column is a single key letter, reducing the problem to 26 independent Caesar cracks.

Modern solvers recover Beaufort keys of length 4–8 from a few hundred characters of ciphertext in under a second. Practical fingerprint: when a Vigenère key produces gibberish but reversing the direction produces sensible text, the cipher is often Beaufort.

Related Ciphers

  • Vigenère cipher — the closest relative; same statistical fingerprint, different algebraic form.
  • Caesar cipher — the degenerate case of a polyalphabetic cipher with key length 1.
  • Affine cipher — another linear-algebra cipher over modular arithmetic, but monoalphabetic.

If you have unknown ciphertext with a flat letter distribution and no readable words, it is likely polyalphabetic — start with the Cipher Identifier to rank Vigenère, Beaufort, and related candidates.

⚠️ Security Notice

This tool is provided for educational and authorized security testing purposes only. Always ensure you have proper authorization before testing any systems or networks you do not own. Unauthorized access or security testing may be illegal in your jurisdiction. All processing happens client-side in your browser - no data is sent to our servers.