Beaufort

Beaufort Cipher Guide: Self-Reciprocal Encryption & How It Differs from Vigenère

Master the Beaufort cipher with its self-reciprocal property. Learn the formula B(p,k) = (k - p) mod 26, step-by-step examples, and how it compares to the Vigenère cipher.

Published March 19, 2026
15 minute read
Cryptography Guide

Introduction

The Beaufort cipher is one of those historical curiosities that rewards close study. On the surface, it looks like a minor variation of the Vigenère cipher -- and indeed, the two systems are closely related. But the Beaufort cipher possesses a property that the Vigenère does not: it is self-reciprocal. Encryption and decryption are the same operation. This single distinction made the Beaufort cipher attractive for practical use, particularly in military and naval contexts where simplicity under pressure was essential.

Named after Sir Francis Beaufort, the Irish-born Royal Navy hydrographer better known for the Beaufort Wind Force Scale, this cipher uses the formula B(p, k) = (k - p) mod 26. That subtraction -- key minus plaintext, rather than key plus plaintext -- is the source of its reciprocal nature and the root of its differences from the Vigenère system.

Try our free Beaufort Cipher tool to encrypt and decrypt messages instantly.


Sir Francis Beaufort: The Man Behind the Cipher

A Life at Sea

Francis Beaufort was born in 1774 in Navan, County Meath, Ireland. His father, the Reverend Daniel Augustus Beaufort, was a clergyman and cartographer who produced one of the first detailed maps of Ireland. The young Beaufort went to sea at the age of thirteen, joining the East India Company before transferring to the Royal Navy. His early career was marked by both adventure and hardship: he was shipwrecked in the South China Sea at fourteen, survived combat during the Napoleonic Wars, and was seriously wounded during a survey mission off the coast of Turkey in 1812, taking a musket ball to the hip and a saber slash across the head.

The Beaufort Scale

Beaufort is best remembered for his wind force scale, which he developed beginning around 1805. Originally designed for use in his personal ship logs, the scale classified wind conditions from 0 (calm) to 12 (hurricane force) based on the observable effects on sea state and sailing conditions. The Admiralty adopted the Beaufort Scale officially in 1838, and it remains the international standard for reporting wind speed at sea today, with minor modifications.

What made the Beaufort Scale successful was not its originality -- earlier wind scales existed -- but its practicality. Instead of requiring instruments that might not be available or reliable on a pitching ship, Beaufort's scale relied on direct observation: the state of the sea surface, the behavior of waves, and the effects on rigging. This same pragmatic instinct -- favoring simplicity and reliability over theoretical elegance -- is reflected in the cipher that bears his name.

Hydrographer of the Navy

In 1829, Beaufort was appointed Hydrographer of the Navy, a position he held for 25 years. During this period, he oversaw a vast expansion of the Admiralty's charting program, dispatching survey expeditions around the world. It was Beaufort who arranged for Charles Darwin's appointment aboard HMS Beagle in 1831 -- a decision with consequences far beyond hydrography. Beaufort retired in 1855 and died in 1857, having transformed the science of naval cartography.

The Cipher Connection

The precise circumstances under which Beaufort developed or adopted the cipher that bears his name are less well documented than his meteorological and hydrographic achievements. The cipher appears to have circulated in British naval and military circles in the mid-nineteenth century, and Beaufort's association with it likely reflects his broader interest in practical communication systems for naval use. The cipher was popularized more widely after being described in various cryptographic reference works later in the century.


The Mathematics of the Beaufort Cipher

The Core Formula

The Beaufort cipher's encryption formula is:

C = (K - P) mod 26

Where:

  • C is the ciphertext letter (0-25, where A=0, B=1, ..., Z=25)
  • K is the key letter
  • P is the plaintext letter
  • mod 26 ensures the result wraps around within the alphabet

The decryption formula is:

P = (K - C) mod 26

Notice something remarkable: the decryption formula has exactly the same structure as the encryption formula. In both cases, the operation is "key minus message." This is the self-reciprocal property in action.

Why Subtraction Creates Reciprocity

The self-reciprocal nature of the Beaufort cipher follows directly from the algebraic properties of subtraction in modular arithmetic. Here is the proof:

Claim: If C = (K - P) mod 26, then P = (K - C) mod 26.

Proof:

Start with the encryption equation: C = (K - P) mod 26

Substitute C into the decryption formula: (K - C) mod 26 = (K - (K - P)) mod 26 = (K - K + P) mod 26 = P mod 26 = P

Since 0 <= P < 26, the result is simply P. The original plaintext is recovered.

This proof reveals why the Beaufort cipher works while the Vigenère cipher does not share this property. The Vigenère encrypts with addition: C = (P + K) mod 26. Applying the same operation to decrypt would give (C + K) mod 26 = (P + 2K) mod 26, which is not equal to P unless K = 0 (or K = 13). The asymmetry of the Vigenère requires a different decryption formula: P = (C - K) mod 26.

Using the Tabula Recta

The Beaufort cipher can be performed using a standard tabula recta (the same 26x26 table used for the Vigenère cipher), but with a different lookup procedure:

  1. Find the plaintext letter along the top row of the tabula recta.
  2. Move down that column until you find the key letter.
  3. Read the row label on the left side. That is your ciphertext letter.

This is essentially the reverse of the Vigenère lookup, which finds the key row first and reads along it. The Beaufort lookup starts with the plaintext column and searches for the key within it.


Complete Encryption Example

Let us encrypt the message "WIND FROM NORTH" using the keyword "SAIL".

Step 1: Remove spaces and align the keyword.

Key:   S A I L S A I L S A I L S A
Plain: W I N D F R O M N O R T H W

Step 2: Convert to numbers.

PositionKey (K)Plain (P)K valueP value
1SW1822
2AI08
3IN813
4LD113
5SF185
6AR017
7IO814
8LM1112
9SN1813
10AO014
11IR817
12LT1119
13SH187
14AW022

Step 3: Apply the formula C = (K - P) mod 26.

Position(K - P)mod 26Cipher Letter
118-22 = -422W
20-8 = -818S
38-13 = -521V
411-3 = 88I
518-5 = 1313N
60-17 = -179J
78-14 = -620U
811-12 = -125Z
918-13 = 55F
100-14 = -1412M
118-17 = -917R
1211-19 = -818S
1318-7 = 1111L
140-22 = -224E

Result:

Plain:  W I N D F R O M N O R T H W
Key:    S A I L S A I L S A I L S A
Cipher: W S V I N J U Z F M R S L E

Step 4: Verify by decrypting. Apply C = (K - P) mod 26 to the ciphertext:

  • Position 1: (18 - 22) mod 26 = -4 mod 26 = 22 → W (correct)
  • Position 2: (0 - 18) mod 26 = -18 mod 26 = 8 → I (correct)

The same operation decrypts the message. No separate algorithm is needed.


Beaufort vs. Vigenère vs. Variant Beaufort

Three closely related ciphers are often confused. Understanding their differences clarifies the mathematical landscape of polyalphabetic substitution.

Vigenère Cipher

Encryption: C = (P + K) mod 26 Decryption: P = (C - K) mod 26

The Vigenère cipher adds the key to the plaintext. Decryption requires subtraction. It is not self-reciprocal.

Beaufort Cipher

Encryption: C = (K - P) mod 26 Decryption: P = (K - C) mod 26

The Beaufort cipher subtracts the plaintext from the key. The encryption and decryption formulas are structurally identical (both subtract the "message" from the key). It is self-reciprocal.

Variant Beaufort Cipher

Encryption: C = (P - K) mod 26 Decryption: P = (C + K) mod 26

The Variant Beaufort cipher subtracts the key from the plaintext. This is actually the same as Vigenère decryption used as an encryption step. It is not self-reciprocal. The Variant Beaufort is sometimes confused with the true Beaufort cipher, but the two are distinct systems.

Comparison Table

PropertyVigenèreBeaufortVariant Beaufort
Encrypt formulaP + KK - PP - K
Decrypt formulaC - KK - CC + K
Self-reciprocalNoYesNo
Equivalent to--Vigenère encrypt then reverse alphabetVigenère decrypt

The Relationship Between Them

There is an elegant mathematical relationship connecting all three ciphers. The Beaufort cipher can be expressed as a composition of two simpler operations:

  1. Apply Vigenère encryption: V = (P + K) mod 26
  2. Apply the Atbash (reverse alphabet) substitution: C = (25 - V) mod 26

Combining: C = 25 - (P + K) mod 26 = (25 - P - K) mod 26.

Wait -- that does not quite equal (K - P) mod 26. Let us be more careful. The relationship is actually:

C_beaufort = (K - P) mod 26 = (-(P - K)) mod 26

And C_variant_beaufort = (P - K) mod 26.

So the Beaufort ciphertext is the "complement" of the Variant Beaufort ciphertext: C_beaufort = (-C_variant_beaufort) mod 26 = (26 - C_variant_beaufort) mod 26.

This means the Beaufort cipher can be performed by applying Variant Beaufort encryption (which is the same as Vigenère decryption) and then reversing the alphabet (applying A=Z, B=Y, C=X, ... substitution). Alternatively, apply Atbash to the plaintext first, then apply Vigenère encryption.


Cryptanalysis of the Beaufort Cipher

Kasiski Examination

Like all polyalphabetic ciphers with repeating keywords, the Beaufort cipher is vulnerable to the Kasiski examination. When the same plaintext segment aligns with the same keyword segment at different points in the message, identical ciphertext sequences result. The distances between these repeated sequences are multiples of the keyword length. By finding the greatest common divisor of several such distances, a cryptanalyst can determine (or narrow down) the keyword length.

Index of Coincidence

Once the keyword length n is hypothesized, the ciphertext can be split into n streams, each encrypted with a single key letter. For each stream, the index of coincidence (IC) can be calculated. If the IC approximates the expected IC for English text (approximately 0.0667), the hypothesized keyword length is likely correct. If the IC is closer to the random baseline (approximately 0.0385), the hypothesized length is probably wrong.

Frequency Analysis per Stream

After determining the keyword length and splitting the ciphertext into single-key streams, each stream is effectively a simple substitution cipher (specifically, a "reversed Caesar" shift). Frequency analysis can then be applied to each stream individually.

For a Beaufort stream encrypted with key letter K, the ciphertext letter C maps to plaintext letter P = (K - C) mod 26. The most frequent ciphertext letter in a stream likely corresponds to E (the most common English letter), so if the most frequent ciphertext letter is, say, C_max, then K = (C_max + 4) mod 26 (since E = 4). Testing a few candidates for K and evaluating whether the decrypted text resembles English quickly identifies the correct key letter.

Comparison with Vigenère Cryptanalysis

The cryptanalysis of the Beaufort cipher follows almost exactly the same procedure as Vigenère cryptanalysis. The key determination step differs slightly because the Beaufort formula involves subtraction rather than addition, but the overall approach -- determine keyword length via Kasiski or IC, then solve each stream individually -- is identical. In terms of security, the Beaufort cipher offers no advantage over the Vigenère. Its self-reciprocal property is an operational convenience, not a cryptographic strength.


The Beaufort Cipher in the Porta Context

The Beaufort cipher and the Porta cipher are both self-reciprocal polyalphabetic ciphers, but they achieve reciprocity through entirely different mechanisms. The Porta cipher uses 13 tables that swap the first and second halves of the alphabet. The Beaufort cipher uses the algebraic property of subtraction in modular arithmetic. The Porta cipher constrains ciphertext so that first-half plaintext always produces second-half ciphertext (and vice versa), while the Beaufort cipher has no such constraint.

Both ciphers reflect a desire among historical cryptographers for systems that simplified operational use. The Porta cipher accomplished this through tableau design; the Beaufort cipher accomplished it through the mathematical properties of its formula. Both approaches have merit, and both ultimately fall to the same cryptanalytic techniques.


Practical Applications and Historical Use

The Beaufort cipher found natural application in naval communications, where Beaufort's name already carried authority. The self-reciprocal property was particularly valuable at sea, where codebooks and cipher tables might be damaged by water, lost in action, or difficult to consult in rough weather. A cipher that required only one procedure rather than two was materially easier to use under adverse conditions.

Field Ciphers

More broadly, self-reciprocal ciphers were attractive for any military or diplomatic context where operators worked under pressure. The Beaufort cipher could be taught quickly, performed with minimal reference materials, and verified easily (encrypt the ciphertext to recover the plaintext). These qualities made it a reasonable choice for tactical communications where speed mattered more than absolute security.

The Cipher Slide Rule

In the nineteenth and early twentieth centuries, physical cipher devices called "cipher slides" or "cipher rulers" were sometimes constructed for the Beaufort cipher. These devices consisted of two alphabet strips that could be slid against each other, allowing rapid lookup of ciphertext values. The self-reciprocal property meant that a single device orientation worked for both encryption and decryption, unlike Vigenère slide rules, which required different procedures for each direction.


Frequently Asked Questions

What does "self-reciprocal" mean in the context of the Beaufort cipher?

A self-reciprocal cipher is one where the encryption process and the decryption process are identical. For the Beaufort cipher, if you encrypt a plaintext letter P with key letter K using the formula C = (K - P) mod 26, you can decrypt the ciphertext letter C using exactly the same formula: P = (K - C) mod 26. The structure of the formula is the same in both directions -- you always subtract the "message" from the key. This means a single procedure, a single table, and a single set of instructions covers both operations.

How does the Beaufort cipher differ from the Vigenère cipher?

The Vigenère cipher uses addition: C = (P + K) mod 26 for encryption and P = (C - K) mod 26 for decryption. The Beaufort cipher uses subtraction from the key: C = (K - P) mod 26 for both encryption and decryption. The key practical difference is that the Vigenère requires two different procedures (one for encryption, one for decryption), while the Beaufort requires only one. In terms of security, however, the two ciphers are equivalent -- they have the same key space, the same vulnerability to Kasiski examination and frequency analysis, and the same effective strength.

Is the Beaufort cipher more secure than the Vigenère cipher?

No. The Beaufort cipher and the Vigenère cipher have equivalent security. Both use a repeating keyword to select from 26 possible substitution alphabets, both are vulnerable to the Kasiski examination and index of coincidence analysis, and both can be broken by frequency analysis once the keyword length is determined. The Beaufort cipher's self-reciprocal property is a convenience for the user, not a security advantage. An attacker who can break the Vigenère can break the Beaufort with trivially minor adjustments to the same techniques.

What is the "Variant Beaufort" cipher?

The Variant Beaufort cipher uses the formula C = (P - K) mod 26 -- note that this subtracts the key from the plaintext, rather than the plaintext from the key. This is mathematically equivalent to the Vigenère decryption formula used as an encryption step. The Variant Beaufort is not self-reciprocal: its decryption formula is P = (C + K) mod 26, which is the Vigenère encryption formula. The Variant Beaufort is sometimes confused with the true Beaufort cipher, but they produce different ciphertexts from the same plaintext and key.

Who was Sir Francis Beaufort?

Sir Francis Beaufort (1774-1857) was an Irish-born officer in the Royal Navy who served as Hydrographer of the Navy from 1829 to 1855. He is best known for the Beaufort Wind Force Scale, which standardized the classification of wind speeds and remains in international use today. Beaufort also oversaw the appointment of Charles Darwin to HMS Beagle and directed a massive expansion of the Admiralty's global charting program. The Beaufort cipher, which bears his name, appears to have circulated in British naval and military circles in the mid-nineteenth century.

About This Article

This article is part of our comprehensive beaufort cipher tutorial series. Learn more about classical cryptography and explore our interactive cipher tools.

Try Beaufort Cipher Cipher Tool

Put your knowledge into practice with our interactive beaufort cipherencryption and decryption tool.

Try Beaufort Cipher Tool