Friday, 28 September 2012

Codes and Ciphers - ADFGVX

I was in W.H. Smiths in Chemsford and I noticed one of these collection series things. Y'know, build a scale model of H.M.S. Victory in 3,000 weekly parts, that kind of thing. This is a book series published through the Times newspaper called "Everything is Mathematical". This week, the subject is one close to my heart: codes and ciphers.


I've written earlier about ciphers and there's rather a good one which illustrates the main principals of most ciphers, both manual and electronic. It's called the ADFGVX cipher and was invented by the Germans during WW1. First you create a grid of letters, 6 * 6, with the letters ADFGVX representing the rows and columns:

ADFGVX
AZTNL5F
DE4KMSY
FXR9J3D
GC2I8QW
VVP7H1B
XA0G6OU

Each letter or number is then represented by a letter pair, row/column. For example, the message "Send 3 and 4 pence" would come out as "AV DA AF FF FV XA AF FX DD VD DA AF GA DA". This is the substitution part of the cipher. To further strengthen the cipher, a transposition was then used to shuffle the letters around. You have a key word with unique letter, say ANDREW, and lay out the message letters in a grid (padded out to 30 characters):
ANDREW
AVDAAF
FFFVXA
AFFXDD
VDDAAF
GADAFF
ADENRW
ADAVAF
FFXFVA
AFDFXD
VDADAF
GDFAAF
Then re-arrange the columns in alphabetical order. This gives you six five letter "words", "AFAVG DFFDD AXDAF VFFDA AVXAA FADFF".

The cipher was eventually broken by the French army and contributed to the final successful Allied offensive on the Western Front in 1918.

No comments:

Post a Comment