The ADFGVX Cipher was a field cipher used by the German Army on the Western Front during World War I. ADFGVX was in fact an extension of an earlier cipher called ADFGX. Invented by Colonel Fritz Nebel and introduced in March 1918, the cipher was a fractionating transposition cipher which combined a modified Polybius square with a single columnar transposition. The cipher is named after the six possible letters used in the ciphertext: A, D, F, G, V and X. These letters were chosen deliberately because they sound very different from each other when transmitted via Morse code. The intention was to reduce the possibility of operator error.
Let's examine the way cipher works using an example. Our message is "I am going." First we must clean and process the message: "iamgoing". It should contain only digits and latin letters in lowercase. All other characters (such as punctuation) are skipped. Then we fill the "adfgvx" table with our secret alphabet "dhxmu4p3j6aoibzv9w1n70qkfslyc8tr5e2g".
\ A D F G V X \------------ A| d h x m u 4 D| p 3 j 6 a o F| i b z v 9 w G| 1 n 7 0 q k V| f s l y c 8 X| t r 5 e 2 g
Using this square, the message is converted to fractionated form (row-column):
i a m g o i n g FA DV AG XX DX FA GD XX
Then, a new table is created with a key as the heading. Let's use 'cipher'... So, "checkio" becomes "chekio".