The ADFGX / ADFVGX cipher is a simple substitution cipher used by German troops during the First World War for communication on the battlefield. In fact, this cipher was a development of the ADFGX cipher. Its operation is based on a modified Polybius chessboard and a single transposition. As a result of encrypting the plaintext, we obtain a ciphertext containing the letters A, D, F, G, V and X. They were selected in such a way that they differ significantly from each other when transmitting them using the Morse code. This was to reduce the risk of errors when sending or receiving messages.
It was invented by Colonel Frtiz Nebel, and put into service in March 1918.
Let's assume that we want to encrypt the message "Secret message" (the original version of the cipher allowed to encrypt letters of the English alphabet, but the letters I and J were not distinguished). At the beginning, we fill the 5x5 Polyibius checkerboards with the alphabet with the changed order of letters (which is known only to the sender and recipient of the message).
Using this table, we convert the plaintext to the corresponding ciphertext:
S e c r e t M e s s a g e
FG XF GF XD XF AD XA XF FG FG AF GA XF
Then we choose the key that will be used for further encryption and write under it, in lines, we will get the ciphertext earlier. Remember not to repeat letters in this word (possibly you can omit the repeated letters).
K E Y W O R D
F G X F G F X
D X F A D X A
X F F G A F G
A X F G X G X
The last four letters have been added so that all lines have the same number of letters. GX is "X" after encryption with the Polibius checkerboard shown earlier. The letter X at the end of our message certainly doesn't change its meaning.
In the next step, rearrange the columns with the letters above them in such a way that the latter are arranged alphabetically:
D E K O R W Y
X G F G F F X
A X D D X A F
G F X A F G F
X X A X G G F
Reading the columns, we get the ciphertext: XAGXGXFXFDXAGDAXFXFGFAGGXFFF.
In June 1918, the letter V was added, which enabled the encryption of 26 characters - the entire alphabet (I and J were separate letters) and numbers from 0 to 9.
More on: Wikipedia - ADFGVX cipher