The Beaufort cipher's algorithm is based on tabula recta.
All letters in the plaintext are changed, one by one, according to the table. Both sides share a common secret key, which contains one or more words. Key letters are also taken for encryption one by one. Each key letter are used to encrypt one letter of the message. After the last letter of the key, algorithm goes back to the first letter of the key and continues its work.
The whole process is presented below:
- Find the currently encrypted letter in the top horizontal row.
- Travel down the column until to find the current key letter.
- The leftmost letter in the current row is the new letter of the ciphertext.
Decryption of the ciphertext uses exactly the same algorithm. After the second encryption of ciphertext, one receives the correct plaintext. Ciphers which have the property are referred to as reciprocal ciphers.
Ciphertexts created by the cipher can be very easily changed into ciphertexts of the Vigenère cipher. It can be achieved by changing every letter of the ciphertext to its opposite letter (the letter a becomes z, b becomes y and so on). After this modification, the ciphertext can be analyzed by using all the existing attacks on Vigenère cipher.