Welcome Guest [Log In] [Register]
Viewing Single Post From: Brute Forcing The Adfgvx Cipher
osric
Advanced Member
[ *  *  * ]
I have now developed a program to solve an ADFGVX-enciphered 120-letter plaintext with a transposition key of 5 columns & a substitution key of 36 characters made up of mixed letters of the alphabet and integers 0 to 9. Following ACA practice 1 follows A, 2 follows B....and 0 follows J. No crib was used. In the first stage the program finds the transposition key. This is done either by brute force, hillcimbing and scoring with log tetragraphs each key; or alternatively by hillclimbing both keys. This takes 20 seconds for the 120 perms of a 5-transposition and in that time the hillclimbing route also settles on the correct key. In neither case is the solution found, just the correct transposition key. Then in the second stage, using the correct transposition key, the substitution key is churned to give the solution. This takes 10 seconds or so.

I tried the same approach with a cipheretxt resulting from a 6x6 square and an 8-wide transposition key, as below:


GXDDXGVGXXADAGXAAADAAAGDXDXADDXAFFFAFAAXXADDFFVDFFFADDFDGVDDXADAFXDFVDAAFXFAADF
DAFADAADAVFXFDDAGXGGDXAAVXXXXDDVAGDGXGDAGVGXDGDADDDGGDDDDGGAXXAADDGGAGXXGXDX
GFDDGAAADFVAGDVAFXFXXAGFXFDADAFGXXGDADAGDXADVXGDDGXDGGGDXAGXAFDADAFGDAGGFAADD
AAAGAFDADDDAVF.

In the first attempt to find the transposition key, again not using a crib (which took 2 hours to consider the 8! perms involved) the program came up with the wrong key but a number of recognisable words in the plaintext. Actually this incorrect transposition key has the digrams reversed. Common letters in the recognisable words quickly lead to finding the correct transposition key.

In a second run the correct transposition key was found and again in a third run.

Recovering the plaintext using the transposition key is a matter of 10 seconds for my Churn algorithm.

I am going to look for a faster algorithm than brute force to find the transposition key.

Does anyone have access to actual ADFGVK keys used by the German Army in the 1st World War?
Edited by osric, Mar 19 2009, 01:13 PM.
Offline Profile Quote Post
Brute Forcing The Adfgvx Cipher · General