Dancing Men, Unencrypted
As a teenager, I
was fascinated by the Sherlock Holmes story, The
Adventure of the Dancing Men. The story used a formula common to many
of Doyle’s stories: someone in the US or Australia with a past that he wants
buried returns to good old England, changes their name… until someone from
their past catches up with them. But what piqued my interest in an otherwise
formula story was the secret code used to send messages. Messages in the story
would read like this:
As you can see,
the code consisted of figures of dancing men, hence the name of the story. When
Holmes broke the code and sent a message in it to lure the culprit out, I
dismissed it as something that happens only in stories. How can anyone crack a
code based on just a few messages they’ve seen, I thought. Boy, I was so
ignorant about codes and code breaking…
Years later, I
read Simon Singh’s awesome book on codes and code breaking titled (what else?) The
Code Book. I was almost disappointed when I realized that the Holmes
story used the simplest possible encryption mechanism: substitution! In a
substitution code, each letter of the alphabet in the language has a
corresponding letter in the code alphabet.
Breaking a
substitution is the easiest thing in the world, as Simon Singh explained. You
make a listing of the frequency of all the symbols in all the coded messages
you can get hold of (Holmes got to see 5 messages in the dancing men alphabet).
The most frequent symbol is probably the letter “e” (for English messages); the
next one is “t” and so on. Simply put, you map the frequencies of the code to
the frequency of the letters of the English language. Sure, it won’t be
perfect, but you’d have solved most of the code by this simple technique.
Elementary, my dear Watson!
Of course, Doyle
had added a layer of smoke by using dancing men symbols as the “letters” of his
coding alphabet (instead of using letters, like “f” for “a”, “x” for “b” and so
on). Plus, he used flags on the figures as spaces, i.e., a symbol with a flag
stood for a particular letter followed by a space. But once you’d removed all
those bells and whistles, it was just a substitution code, the easiest kind of
code in the world to crack.
Not your greatest
case, Sherlock, but it led me to other things…
May not have been a great code to crack, you as the blog says about the Sherlock Holmes story. But that story became memorable because of the figures involved which was unusual. Also, the Holmes cracking the code was taken to be awesome because of the general innocence of the readers. Anyway, the overall story of what is going to happen would prevent readers from going the way the British intelligence cracked the German enigma code during World War II.
ReplyDeleteBy the way, I do believe that cracking the German code is among the fabulous achievements of mathematics. Nevertheless, I would always give the application of maths to physics as the crowning glory of mathematics.