Beaufort Cipher Online — Encrypt & Decrypt With the Beaufort Cipher

CodexFuse Team · 2026-10-13T15:35:43.911Z · 6 min read min read

Learn the Beaufort cipher: the reciprocal C = K - P formula, hand encryption, Vigenere differences, and a free online tool.

The Beaufort cipher is a classical cipher that encrypts a message with a keyword, like the Vigenere cipher, but it subtracts instead of adding. Each plaintext letter is subtracted from a keyword letter, which gives Beaufort its unusual property: encryption and decryption use the same steps.

This guide explains the Beaufort formula, shows how to encrypt and decrypt by hand, and compares Beaufort with Vigenere and Caesar. You can follow along with the free Beaufort cipher tool and test each example as you read.

What Is the Beaufort Cipher?

The Beaufort cipher is a polyalphabetic substitution cipher that encrypts each letter by subtracting the plaintext letter from a keyword letter, using the formula C equals K minus P, with all values taken modulo 26. The keyword repeats to match the message length, and because subtraction is reciprocal, the same formula both encrypts and decrypts the message.

Beaufort is named after Sir Francis Beaufort, and it belongs to the same family as the Vigenere cipher. Both use a repeating keyword, and both give each position a different shift. The difference is the direction of the arithmetic: Vigenere adds the keyword letter, while Beaufort subtracts the plaintext letter from the keyword letter.

The reciprocal property is the part students remember. With most ciphers, encryption and decryption are opposite operations. With Beaufort, you run the same subtraction twice: once to scramble the message, and once to restore it. That symmetry makes the cipher easy to use by hand, once the formula clicks.

SymbolMeaningValues
PPlaintext letterA is 0 through Z is 25
KKeyword letterA is 0 through Z is 25
CCiphertext letterK minus P, modulo 26

How Do You Encrypt a Message With the Beaufort Cipher?

To encrypt with the Beaufort cipher, write the plaintext, repeat the keyword beneath it to match the message length, and subtract each plaintext letter from the keyword letter above it, adding 26 when the result goes below zero. The resulting letters are the ciphertext, and the same steps with the same keyword will decrypt it.

  1. Write the plaintext in capitals and remove spaces for the hand calculation.
  2. Repeat the keyword beneath it until it matches the message length.
  3. Convert each pair of letters to numbers, with A equal to 0 and Z equal to 25.
  4. Subtract the plaintext number from the keyword number, adding 26 if the result is negative.

A fictional worked example with the keyword KEY

The following example is fictional and is included only to show the steps. Take the fictional plaintext HELLO and the fictional keyword KEY. Repeat the keyword beneath the message to get KEYKE. Pair the letters and subtract: K minus H gives D, E minus E gives A, Y minus L gives N, K minus L gives Z, and E minus O gives Q. The ciphertext is DANZQ. To decrypt, repeat the same subtraction with the same keyword, and HELLO returns.

Check each subtraction as you go. The most common mistake is subtracting in the wrong direction, which gives the variant Beaufort result instead. If your decryption does not return the original message, recheck the direction of the first pair before redoing the whole message.

How Do You Decrypt a Beaufort Cipher Message?

To decrypt a Beaufort cipher message, repeat the keyword beneath the ciphertext and subtract each ciphertext letter from the keyword letter above it, adding 26 when the result goes below zero. The formula is the same as encryption, because the cipher is reciprocal. The keyword must be the same one used to encrypt the message.

That symmetry is worth pausing on. With the Vigenere cipher, decryption reverses the addition. With Beaufort, there is nothing to reverse. The same table, the same steps, and the same keyword undo the encryption.

If you do not know the keyword, Beaufort is as hard to break by hand as Vigenere with the same keyword length. An analyst can look for repeated sequences to estimate the keyword length, then solve each group separately. For a puzzle, a short keyword keeps the challenge fair.

Why Is the Beaufort Cipher Not Secure for Real Secrets?

The Beaufort cipher is not secure for real secrets because its keyword repeats, its arithmetic is fixed and public, and its ciphertext keeps patterns that analysts can study. A repeated keyword leaks its length through repeated sequences, and each group then behaves like a simple shift cipher. Real data needs modern encryption such as AES-256 over TLS.

Beaufort is fine for puzzles, lessons, and games built from your own content. It shows how a small change in the formula changes the whole cipher, which is a useful lesson. It is not a way to hide passwords, customer records, or business messages. Keep practice messages fictional, and keep real secrets behind modern encryption.

Beaufort is a teaching cipher. If the message matters, use modern encryption, not a keyword subtraction.

Keep puzzles fun and real data properly protected

Use the Beaufort tool to learn how keyword ciphers work, and let CodexFuse handle real protection with fully managed hosting, security, and backups on credits.

Get Started with CodexFuse

How Can You Practise the Beaufort Cipher With an Online Tool?

You can practise the Beaufort cipher with an online tool by opening the tool, choosing encrypt or decrypt, typing a message of your own, and entering a keyword. The tool applies the subtraction to every letter at once, so you can test keywords and compare results quickly. Use fictional messages for practice.

Open the Beaufort cipher tool and try the HELLO example with the keyword KEY. If the tool returns DANZQ, your hand calculation matches. Then encrypt the result again with the same keyword and watch HELLO return, which shows the reciprocal property in action.

For more puzzle practice, compare Beaufort with the Vigenere cipher, which adds the keyword instead of subtracting, the Caesar cipher, which uses one fixed shift, and the Atbash cipher, which reverses the alphabet. Each one teaches a different lesson about keys.

Frequently Asked Questions

What is the Beaufort cipher?

The Beaufort cipher is a keyword cipher that encrypts each letter by subtracting the plaintext letter from a keyword letter, using the formula C equals K minus P.

How is Beaufort different from Vigenere?

Vigenere adds the keyword letter to the plaintext letter, while Beaufort subtracts the plaintext letter from the keyword letter. Beaufort is reciprocal, so encryption and decryption use the same steps.

Can the Beaufort cipher protect a password?

No. The Beaufort cipher cannot protect a password or any real secret. Its keyword repeats and its method is public, so analysts can break it. Use AES-256.

What is variant Beaufort?

Variant Beaufort is a related cipher that subtracts the keyword letter from the plaintext letter, C equals P minus K. It is not reciprocal, so decryption reverses the subtraction.

What keyword should I use for a puzzle?

Use a keyword that is long, not a common word, and known only to the people solving the puzzle. A longer keyword repeats less often, which makes the puzzle harder.

Learn the formula, enjoy the puzzle, and keep real secrets behind modern encryption.

Featured on Twelve Tools Hunt for Tools Featured on LaunchBuff Launch Llama Tools Launch your MCP Top Web Development Companies in the US - OnToplist.com Designer Listings Listed on SeeWhatNewAI Featured on SubmitMySaas Featured on AI Agents Directory Product Wing SaaS Wheel Featured on Stremit Featured on Thank John We Are Founders SubmitMySaas ShinyLaunch SaaS Tools Dir Featured on SaasHunt Product List Dir Featured on ShowMeBestAI Listed on Best-AI.org Featured on SaaSCity Listed on LaunchPact CodexFuse Solution on goodSaaS Featured on IndieLaunch Featured on BestAIApps AI X Collection Featured on SemiLaunch Listed on AlterBase We Like Tools codexfuse.dev LaunchClash Featured on Next Launch