Cabinet Noir>Learn / Beaufort cipher

Not sure which cipher? Identify it
The Vigenère's mirror twin — same repeating key, subtraction the other way round, self-reciprocal.
Typepolyalphabetic substitution cipher
Breaking ithard to break by hand
EraRenaissance family, 19th-century name
NameRoyal Navy, named for Sir Francis Beaufort
Modesencrypt · decrypt · cryptoanalysis

Learn

Beaufort cipher

How the Beaufort cipher works

The idea in one sentence

The Beaufort cipher is the Vigenère's mirror twin: it uses the same repeating Key and the same Tabula recta idea, but subtracts the other way round. Where Vigenère computes cipher = plaintext + key, Beaufort computes cipher = key − plaintext. That one flipped sign makes the cipher self-reciprocal: the very same operation encrypts and decrypts.

The recipe

  1. Write your message and keep only the letters (the tool drops spaces and punctuation the same way).

  2. Write the key under the message, letter by letter, repeating it until both lines have the same length.

  3. For each pair, subtract the plaintext letter's position from the key letter's position: the key letter counts the rows, the plaintext letter counts the columns backwards.

  4. Read off the letters you landed on — that is the ciphertext.

A worked example

Step 1 of 12
Plaintext letter
Key letter
a·x + b (mod 26)
Result
A
L
11
L

Read the first row: under the key letter L, the plaintext letter A lands on L again (L − A = L). The second letter is subtracted from E, the third from M, and after the fifth letter the key starts over — exactly the Key length rhythm Vigenère has.

The formula

Numbering A=0 … Z=25, encryption subtracts and wraps around the Alphabet:

cipher = (key − plain) mod 26

Because the same formula with the operands swapped decrypts (plain = key − cipher), Beaufort is Reciprocal: one lookup serves both directions. The tool stays in one mode — encrypt a message with a key, then encrypt the result again with the same key and the plaintext comes back.

The variant

The variant Beaufort flips the subtraction the other way: cipher = plain − key. It decrypts with plain = cipher + key — the same arithmetic as Vigenère with every key letter negated. That has an important consequence for Cryptanalysis: statistically, the variant is indistinguishable from Vigenère, while classic Beaufort leaves its own fingerprint (the slices fit reflected frequency curves). The tool's variant selector switches between the two; the cracker follows along.

Where it sits in the family

Vigenère, Beaufort and variant Beaufort share the same engine: a short repeating key over a shifted or reflected Tabula recta. If you know one, you know all three — the difference is which way the subtraction points.

Step-by-step guides

Encrypt your first message

  1. Type your message into the message input.

  2. Pick any word as the secret and enter it in the Key field — longer keys are harder to break.

  3. Check the mode: the swap button the swap button toggles between encrypt and decrypt. The header shows the current mode.

  4. Choose the flavour in Choose between classic Beaufort and the variant.: classic Beaufort or the variant. Classic is self-reciprocal — the same mode both ways.

  5. Read the encrypted result in the output field. Only letters are encrypted; spaces and punctuation are dropped.

  6. Watch the Tabula recta under the controls: the highlighted cell is the exact row-and-column lookup your first letter performs.

Decrypt a message you received

  1. Paste the cryptogram into the message input.

  2. Enter the key the sender used in the Key field — you need the exact same key that encrypted the message.

  3. Classic Beaufort needs no mode change at all: encrypting the cryptogram with the same key is decrypting it. If the sender used the variant, press the swap button the swap button instead.

  4. Read the original message in the output field.

Break a message without the key

  1. Open the Cryptoanalysis tab. The guided cracker walks the same steps as the Vigenère one, with one twist: each slice is matched against a reflected frequency curve, because Beaufort subtracts the other way.

  2. Step 1 — the key length: repeated sequences in the text are highlighted; pick the most confident card from the key length cards. Wrong guess? Go back and try another.

  3. Step 2 — the key letters: for each slice in the slice tabs, rotate the chart with the chart arrows until the match score is highest. The letters collect in the key strip. Stuck? A guess in the crib input can reveal several letters at once.

  4. Step 3 — check the assembled key: fix any letter directly in the key strip, then press the "Use this key" button.

  5. The tool decrypts the message with your key.

Breaking the Beaufort cipher

The repeating Key is what makes the cipher breakable — and the attack is the Vigenère attack with one mirror turn. This page explains the attack; every step has a matching step in the tool's guided cracker, so you can follow along while reading.

Try it in the tool

The flaw: the key repeats

Encryption subtracts letter i of the plaintext from key letter i — but the key is short, so letter i+5 (with a 5-letter key) is subtracted from the same key letter again. The Ciphertext is periodic, and the periodicity leaks the Key length exactly as it does for Vigenère.

Step 1 — find the key length

Both classic signals work unchanged:

  • Repeated sequences — the Kasiski examination: find groups of letters that appear several times, measure the distances between them, and look for lengths that divide many of those distances.

  • The Index of coincidence — for a candidate length N, split the text into N slices (every Nth letter) and measure how English-like each slice looks. The measure is blind to the direction of the subtraction — it only sees how uneven the letter counts are — so it works for Beaufort as well as for Vigenère.

Step 2 — each slice is a mirrored Caesar cipher

Knowing the key length, every slice was enciphered by one fixed key letter — but the slice's letters were reflected before (or after) the shift. The practical difference: when the tool lays a slice's letter counts against the English frequency table, the tall bars line up with the reference bars running the other way. Rotate until the reversed curve fits, and the shown letter is that slice's key letter. A cryptanalyst who forgets the mirror ends up with alphabet soup; the cracker's chart simply draws the reflected curve.

(For the variant Beaufort there is no mirror at all — its slices behave exactly like Vigenère slices, which is why the two are statistically indistinguishable.)

A shortcut — cribs

A guessed word works here too, with the subtraction flipped: each ciphertext letter plus the guessed plaintext letter is a key letter (for the variant, ciphertext minus the guess). The tool's crib panel does the arithmetic for the variant you are cracking.

The limits

  • Short texts lie. With few letters per slice, frequency analysis becomes guesswork — that is why the cracker warns you and why a crib helps.

  • The variant hides in the crowd. Variant Beaufort ciphertexts are exactly Vigenère ciphertexts with a negated key, so an interceptor cannot even tell which of the two you used — little comfort, since both fall to the same attack.

  • Long keys hurt. A key as long as the text, used once, is the one-time pad ideal — Beaufort inherits that property from Vigenère.

Glossary

Plaintext — The original readable message before encryption.
Ciphertext — The scrambled message produced by encryption.
Key — The secret that controls how the text is scrambled.
Alphabet — The set of letters the cipher works with.
Tabula recta — The square table of all 26 shift alphabets used by Vigenère-family ciphers: one row per key letter, read as "row key letter, column plaintext letter".
Reciprocal — A cipher whose encryption operation is its own decryption: applying it twice with the same key restores the plaintext (Beaufort, Atbash, ROT13).
Key length — How many letters the key has before it starts repeating.
Slice — Every Nth letter of the text (N = key length). All letters of one slice are shifted by the same key letter.
Frequency analysis — Studying how often letters appear; comparing the counts with the language reveals the plaintext.
Index of coincidence — A number (about 0.067 for English) showing how likely two random letters of a text are equal.
Kasiski examination — Finding the key length from the distances between repeated sequences in the ciphertext.
Crib — A word you guess is in the plaintext; comparing it with the ciphertext reveals key letters.