Beaufort Cipher Encryption and Decryption
Plaintext
Ciphertext
What is the Beaufort Cipher?
The Beaufort Cipher is a classic symmetric-key encryption algorithm that uses a principle similar to the Vigenère Cipher. The key difference, however, is that the encryption and decryption processes are identical. This means the same steps are used for both encryption and decryption, making it highly suitable for both encrypting and decrypting ciphertext.
The Beaufort Cipher is based on an alphabet and a key. During encryption, the position of the plaintext letter is located in the alphabet's columns, and then the corresponding key letter is used to identify the row. The letter at the intersection of the row and column becomes the ciphertext letter. Unlike the Vigenère Cipher, the Beaufort Cipher uses a reverse lookup in the alphabet for the ciphertext letters, based on the key letter.
How Does the Beaufort Cipher Encrypt and Decrypt?
- Prepare the Content and Key: Process the content by removing non-alphabetic characters. If the key is shorter than the content, repeat the key until it matches the length of the content.
- Generate the Alphabet: The default alphabet is A-Z, but it can be adjusted or customized as needed.
- Encryption or Decryption Process: For each letter of the plaintext or ciphertext, locate its column in the alphabet. Then, find the corresponding row for the key letter. The letter at the intersection of the row and column is the ciphertext or plaintext letter. Repeat this process until the entire message is encrypted or decrypted.
Example
Let's assume we are using the default alphabet (A-Z) and the key "KEY" to encrypt the plaintext "HELLO".
First letter H: Find H in the alphabet's column. Then, move along the column to find the key letter K. The row corresponding to K is D, so the first ciphertext letter is D.
By analogy, find out other encrypted letters of the plaintext, as shown below:

- H + K → D
- E + E → A
- L + Y → N
- L + K → Z
- O + E → Q
So, the ciphertext for "HELLO" is DANZQ.