The Beaufort cipher is a polyalphabetic replacement cipher similar to the Vigenère cipher, except that it encrypts characters in a slightly different way. The name of the cipher comes from the name of the English admiral Francis Beaufort, although it was created not by him, but (in 1710) by the Italian Giovanni Sestri.
It uses the substitution:
$$ \phi (a)=(ki-a)\mod n\ $$
The Beaufort cipher reverses the order of the letters in the alphabet then shifts them to the right by (ki + 1) positions. This is evidenced by the following transformation:
$$ \phi (a)=[(n-1)-a+(ki+1)]\mod n\ $$
The encryption uses a key and a table:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
---------------------------------------------------
A A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
B B C D E F G H I J K L M N O P Q R S T U V W X Y Z A
C C D E F G H I J K L M N O P Q R S T U V W X Y Z A B
D D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
E E F G H I J K L M N O P Q R S T U V W X Y Z A B C D
F F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
G G H I J K L M N O P Q R S T U V W X Y Z A B C D E F
H H I J K L M N O P Q R S T U V W X Y Z A B C D E F G
I I J K L M N O P Q R S T U V W X Y Z A B C D E F G H
J J K L M N O P Q R S T U V W X Y Z A B C D E F G H I
K K L M N O P Q R S T U V W X Y Z A B C D E F G H I J
L L M N O P Q R S T U V W X Y Z A B C D E F G H I J K
M M N O P Q R S T U V W X Y Z A B C D E F G H I J K L
N N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
O O P Q R S T U V W X Y Z A B C D E F G H I J K L M N
P P Q R S T U V W X Y Z A B C D E F G H I J K L M N O
Q Q R S T U V W X Y Z A B C D E F G H I J K L M N O P
R R S T U V W X Y Z A B C D E F G H I J K L M N O P Q
S S T U V W X Y Z A B C D E F G H I J K L M N O P Q R
T T U V W X Y Z A B C D E F G H I J K L M N O P Q R S
U U V W X Y Z A B C D E F G H I J K L M N O P Q R S T
V V W X Y Z A B C D E F G H I J K L M N O P Q R S T U
W W X Y Z A B C D E F G H I J K L M N O P Q R S T U V
X X Y Z A B C D E F G H I J K L M N O P Q R S T U V W
Y Y Z A B C D E F G H I J K L M N O P Q R S T U V W X
Z Z A B C D E F G H I J K L M N O P Q R S T U V W X Y
For example, for the keyword KEY , to encrypt the sentence "Secret message" , we put a key letter above each letter:
KEYKEY KEYKEYKE
SECRET MESSSAGE
To encode single letters, look in the table for the column with the first letter of the message it is S. In this column we are looking for the first letter of the key which is K. The encoded letter will have the result S. Then we look for the second letter of the key in the E column, i.e. E and we get A. Then we look for the letter Y in the C column, which will give W etc. As a result of encoding, we will get a code SAWTAFYAGSMYEA
KEYKEYKEYKEYKE
SECRETMESSSAGE
SAWTAFYAGSMYEA
More on: Wikipedia - Beaufort cipher