The cipher is named after the six possible letters used in the ciphertext: A, D, F, G, V and X. The letters were chosen deliberately because they are very different from one another in the Morse code.
ADFGVX is the improved version of ADFGX cipher which was invented earlier. First cipher did not have numbers and I and J letters were merged. So later cipher included numbers and made I and J seperate.
To use ADFGVX cipher you need to create a secret mixed alphabet and fit into 6x6 Polybius Square, like in this example below:
A | D | F | G | V | X | |
---|---|---|---|---|---|---|
A | N | A | 1 | C | 3 | H |
D | 8 | T | B | 2 | O | M |
F | E | 5 | W | R | P | D |
G | 4 | F | 6 | G | 7 | I |
V | 9 | J | 0 | K | L | Q |
X | S | U | V | X | Y | Z |
If you would like to encrypt this message "attack at 1200" then you would get:
A | T | T | A | C | K | A | T | 1 | 2 | 0 | 0 |
---|---|---|---|---|---|---|---|---|---|---|---|
AD | DD | DD | AD | AG | VG | AD | DD | AF | DG | VF | DX |
Then, a new table is created with a key as a heading. Let's use "PRIVACY" as a key. ADDDDDADAGVGADDDAFDGVFDX is transformed to this:
P | R | I | V | A | C | Y |
---|---|---|---|---|---|---|
A | D | D | D | D | D | A |
D | A | G | V | G | A | D |
D | D | A | F | D | G | V |
F | D | X |
The columns are sorted alphabetically, based on the keyword, and the table changes to this:
A | C | I | P | R | V | Y |
---|---|---|---|---|---|---|
D | D | D | A | D | D | A |
G | A | G | D | A | V | D |
D | G | A | D | D | F | V |
X | F | D |
Then, appending the columns to each other results in this ciphertext:
DGDD AGDG AXAD DFDA DDDV FADV
With the known keyword, the columns can be reconstructed and placed in the correct order. When using the original table containing the secret alphabet, the text can be deciphered.