# The Code Book – Cipher 7

I originally had planned to not write anything about the Code Book contest ciphers unless a few people asked for it, partly because I don’t really need to have yet another thing on my plate when I still haven’t finished writing up the Martin Gardner Colossal Book chapters, and partly because I don’t know if anyone really cares about breaking ciphers that are already documented and have been on the net for 17 years. But, I did want to at least try my hand at the first few, and with the help of the explanations of Almgren and the other Swedes that won the contest, I’ve been able to get the solutions for stages 1-6 pretty easily (1, 2 and 4 I did completely on my own). Keep in mind, though, that the Swedish team didn’t spell out all of the answers in full detail on any of the stages. They gave hints, and brief descriptions of the steps they followed, but they didn’t specify actual keys, and in the case of stage 7 they didn’t give the first 80% of the plaintext, which would have made my job that much easier. As I’ve mentioned before, I’m not that good at breaking ciphers, so I want all the help I can get.

And this time, there’s not much help… Stage 7 is an ADFGV-type cipher, which I’ve never worked with before. So, I’m going to write down my thoughts as I go through this, as much for begging for help from someone else, as it is for trying to ensure that I understand what it is I’m doing right or wrong. First off, the ADFGV was developed by Lt. Fritz Nebel and introduced in 1918 for use by the German army on the western front in WWI. It’s a combined transposition and substitution cipher designed to reduce errors when the messages are sent in Morse code via telegraph.

Initially, the idea was to make a 5×5 table with 25 letters of the alphabet randomly assigned, with the letters ADFGV at the top and left side of the table. These letters were chosen because they have very different Morse code symbols and are hard to mistake for each other. Because the table has 25 letters, I and J can be doubled up, or you can drop Q or X. Now, take your plaintext message:

Ex.) I EAT CODES

Strip out the spaces,

IEATCODES

And substitute each plaintext letter with the row and column characters from the table (ie. – “I” = “DG”, “E” = “AV”):

DG AV AA GG AF FG AG AV GF

If we sent this message right now, it could be broken through a frequency analysis (not likely, since it’s such a short message, but anything longer would be a cinch.)

AV – appears twice,
everything else, once each. But, most of the less common letters in the English alphabet don’t appear at all.  So, that’s something.

A very simple way of making the code harder is to make the table bigger. So, we go to an ADFGVX table, which also makes this thing more useful for sending messages, too, since we’ve added digits to the cipher.

Ok, I’m now about to get to the contest cipher. If you look at that page, you’ll see a REALLY LONG cipher text that starts with:

MCCMMCTRUOUUUREPUCCTC

Now, this obviously is missing all the parts that include ADFGV and or X. However, if you do a frequency count, you’ll see that what we have instead are the letters CEMOPRTU, which if you put them at the top and left side of the table will give you an 8×8 table, for 64 possible characters. The Swedish team assumed (correctly) that the table would include all 26 uppercase letters, all 26 lower case letters, the digits 0-9, a space and an end-of-sentence marker (which we can treat as “. “). So, this is going to make for a heavier-duty substitution code, because there are now two possible values for any given letter (i.e. – “a” and “A”), but if uppercase isn’t used that extensively, nor are the digits, the lowercase letters will still fall to frequency analysis.

Ok, frequency analysis for beginners.
All written phonetic languages are made up of letters or characters that can be called the “alphabet” for that language. But, no matter which language you look at, certain letters tend to be used more often than others in the words that are a part of that language. For English, the most common letter is “e” (just count all the letters in this blog entry and check for yourself), followed by “t” “a” “o” “i” and “n”, giving us the famed Lovecraft detective, Etaoin shrdlu.

There are charts on the net for most major languages. You can find one for English here at the Cornell.edu site.

Pretending, just for a moment, that we haven’t done the transposition step yet for the CEMOPRTU cipher, then running a frequency count on the Contest cipher is going to result in something of a surprise – at 7000+ characters, the letter percentages in the text don’t match the Cornell English chart (ignoring also that THE most common character is probably going to be the space character between words). In fact, the plaintext is in German, where the most common letters are ENIRST (you can see a chart here at the sttmedia.com site).

Anyway, here’s the important take away for step 1:
1) Make a 8×8 table with CEMOPRTU written along the top and the left side.
2) Fill the table randomly with all of the upper and lower case letters, the digits 0-9 and the space and period.
3) Write down your plaintext message.
4) Encipher your message with the row and column pairs for each character in your plain text.

Note that both you and the recipient of your message need to have copies of the table. And that your recipient deciphers the message simply by taking 2 characters at a time, with the left character being the row and the right being the column, and recording the matching character from the table to reconstruct the plaintext.

Using the simplified ADFGV table above,
DG = I
AV = E
AA = A
GG = T
AF = C
FG = O
AG = D
AV = E
GF = S

To be continued.

Previous Post

This site uses Akismet to reduce spam. Learn how your comment data is processed.

• ## Follow TSOJ in email

Join 84 other followers

• ## Blog Stats

• 64,993 hits