ADFGVX Cipher


The ADFGVX Cipher is a very difficult cipher to encode and decode because of its multiple steps. It was used during World War I by the Imperial German Army.

Encoding

The first thing to do when encoding is to have a key.

For this example, I will use the key:

Hi Mom, I love you!

Now, we put this key starting from the first row and wrapping it down into the next row into a 6*6 Polybius square with the ADFGVX as the outside rows and columns. (DO NOT REPEAT LETTERS!)

ADFGVX cipher grid 1

Then, you add in the rest of the alphabet and the numbers 1-9, filling out the Polybius square (26 letters + 9 numbers = 36 = 6*6)

ADFGVX cipher grid 2

Now, you are provided a column key, a necessary tool to encode and decode the message.

This column key will consist of numbers in a certain order. You will see why in a bit.

In this example we will use a 6-number column key:

513264

You might be asking yourself, Don’t I need something to decode? Yes! Now we will input the plaintext message to encode it!

The plaintext message in this example is: You see, but you do not observe.

Now we write it to encode:

  • YOUSEEBUTYOUDONOTOBSERVE

Then, we use the polybius square to encode it! In this encoding process, we go column first. Not from the top, but from the left side. For example:

Y = DD and O = AG

The whole message when encoded reads:

  • DD AG DF GG DA DA DV DF GV DD AG DF FA AG FX AG GV AG DV GG DA GF AX DA

That is the first part of the encoding. Now it would be too simple to decode this, we need to spice it up a little.

Now we take the 6 number column key from earlier and transpose the first part of the encoded message onto it, kind of like how we did it for the Polybius square.

It should look something like this:

ADFGVX cipher grid 3

In this case, we have 8 FULL rows. It could be different for other encodings and decodings. It depends on how long the message is. The rows do not have to be full.

Now we read off in the columns (up and down) from number 1 to number 6 to get the FINAL encoded message!

  • DGVDAGVFGAFGGVGXADDAAGGAFAVFXGAADGDDFADGDDGDFADD

Decoding

In order to decode a message you must have:

The Polybius Square key: Hi Mom, I love you!

The Column Key: 513264

And The Ciphertext: DGVDAGVFGAFGGVGXADDAAGGAFAVFXGAADGDDFADGDDGDFADD

Now that we have learned how to encode it, how do we decode it? Well, this process can be a bit tricky.

First, we must see how long our Column key is and based on that, divide the encoded message into sections. In this case, there are 6 numbers in the column key, therefore, there will be 6 sections.

Now, you will replace the split-up sections back into the ORDER from 1-6 of the column key. Make sure to do this properly to get the correct result!

Then, we read off the text in the column key from left to right wrapped around, just like we wrote it out before.

Now, we write it out as we did in the first encoding step.

Then, we take the Polybius square key and make the Polybius square to decode the message! Remember, do it as we did above to ensure that you do it right! This should leave us with a complete Polybius square ready to decode the encoded message!

Now, take the first encoded step we did earlier and put it into plain text!

Happy Decoding!