What the ADFGVX cipher is
ADFGVX is a cipher the German army used in the First World War, in 1918. It is named after the only six letters it uses: A, D, F, G, V, and X. Those letters were chosen because they sound very different from each other in Morse code, so a radio operator was less likely to mix them up when the message was sent by wireless.
The cipher works in two steps. First, each letter or digit is turned into a pair of those six letters, using a 6 by 6 square that holds all 26 letters and all 10 digits. Second, those pairs are shuffled by a columnar transposition, using a keyword to set the column order. The two steps together made ADFGVX one of the hardest ciphers of its time, and it took months of work by French codebreakers to crack it.
How to use the encoder
Type your message in the first box, using letters and digits only. Spaces and punctuation are skipped, because the cipher only handles the 36 characters in the square. Then type a keyword, like KEY, and press the button. The tool shows the 6 by 6 square it built from your keyword, and your ciphertext in groups of 5 letters, which is how the cipher was sent.
The square is built by writing your keyword first, with repeated letters removed, then filling in the rest of the alphabet and the digits in order. Change the keyword and the whole square changes, so the same message gives a different ciphertext. That is why the keyword is the secret: anyone who knows it can build the same square and read the message.
Worked example
Take the message HELLO with the keyword KEY. The square starts with K, E, Y, then the rest of the alphabet and digits in order. In that square, H is in row D and column G, so it becomes DG. E is in row A and column D, so it becomes AD. L is in row F and column A, so it becomes FA, twice. O is in row F and column G, so it becomes FG. The message becomes the pairs DGADFAFAFG.
Then the transposition writes those 10 letters into rows of 3 under the keyword KEY, pads the last row with X, and reads the columns in alphabetical keyword order: E, then K, then Y. The result is GFAXDDFGAAFX, shown in groups of 5 as GFAXD DFGAA FX. The same HELLO with a different keyword would give a completely different ciphertext.
Who uses this encoder
History fans use it most, because ADFGVX is a real piece of First World War history, and encoding a message by hand shows how soldiers kept secrets before computers. Teachers use it too, because the two steps, substitution and transposition, show the two basic ideas behind most classic ciphers in one tool.
It also helps anyone learning about codes, because it shows why a cipher needs both a square and a keyword. The square alone is easy to break, since each letter always becomes the same pair, but the transposition shuffles the pairs, so the same letter hides in different places. That combination is the lesson.
Honest limitations
This is a historic cipher for learning and fun, not real security. ADFGVX was broken in 1918, and a modern computer can break it in seconds. Never use it to protect real secrets, passwords, or private messages. Real security needs modern tools, not a cipher from a hundred years ago.
The tool also skips spaces and punctuation, and it only handles plain letters and digits. Accented letters, like E with an accent, are skipped too, so write your message in plain letters. And the keyword must be shared in person, never in the same message as the ciphertext, or anyone who reads it can decode the message.
Frequently asked questions
Why only six letters? Because A, D, F, G, V, and X sound very different in Morse code, so radio operators made fewer mistakes. Six letters also give 36 pairs, which is exactly the 26 letters plus the 10 digits.
What does the keyword do? Two things: it sets the order of the square, and it sets the order the columns are read in. Change the keyword and both change, so the ciphertext changes completely.
Can I decode a message with this tool? This tool only encodes. To decode, you need the same square and the same keyword, then you reverse the transposition and look up each pair in the square.
Is ADFGVX still used? No, only for learning and puzzles. Modern encryption is far stronger, and ADFGVX was broken by French codebreakers in the same year it was first used.
Tambien disponible en espanol: https://ilmhunt.com/codificador-de-cifrado-adfgvx/
