Cryptography

Three related topics: steganography, codes, and encryption. As always, the distinction between the three will be fuzzy at best with lots of overlap, and many systems are examples of all three. But basically:

Nobody really knows when encryption was invented; some book want to give credit to Egyptian funeral inscriptions in which non-standard heiroglyphs appear. To me, this seems to be stretching things a bit, since the intent doesn't appear to have been to conceal the message in any way.

Transposition Ciphers

One of the earliest examples of encryption was used by Lysander of Sparta in 404 BC. A messenger handed him his belt; a series of apparently random letters was written on the belt. By winding the belt around a wooden staff called a ``scytale,'' it was possible to recover the original message. In this case, the message was that Pharnabazus of Persia was planning an attack; due to the information provided in the message, Sparta was able to repulse the attack. This has been credited as the first-ever use of a military encryption device; it is an example of a ``transposition'' cipher, in which the order of the letters of the message is changed.

Substitution Ciphers

The classical alternative to the transposition cipher is the substitution cipher. Julius Caesar is credited with the invention of the substitution cipher; his best-known cipher replaced each letter of the message with the letter appearing three letters later in the alphabet. Clearly there are 25 possible ciphers (in English) that use the same technique; these are collectively referred to as ``Caesar'' ciphers in honor of Julius Caesar.

These ciphers are all easy to break based on the known characteristics of the language (I'll give a famous example of breaking one later). Another level of complexity can be added to the cipher by starting as if you were going to use a Caesar cipher, but changing the shift with each character in the message - use a shift of three letters for the first letter, four for the second, five for the third, and so forth. This is referred to as using a ``progressive key.''

We can get truly devious with this form of cipher by using a ``one-time-pad.'' Here, instead of using some sort of mathematical function to generate the shift for each character, we can do it by having a series of random characters on a piece of paper, like this:

AKCOENCFAHGOCAOCICMGF

(this probably isn't really very random, since I generated by hitting ``random'' characters on my keyboard). The particular string shown above would indicate that the first character should be shifted by one character; the second by 11, the third by 3, and so forth. If both the sender and the receiver have a pad of encryption keys, and each key is only used once, this code becomes very difficult to break.

Jefferson Cipher Machine

A simple, but very effective, cipher machine was developed by Thomas Jefferson. The Jefferson cipher machine had 25 wheels; each wheel had the letters of the alphabet on it in a different random order. The cipher key specified the order of the wheels. Once the wheels were set on a common axle, in the specified order, a message would be encrypted by rotating the wheels until the first 25 characters of the message would appear in a single row. Then you'd read any *other* row, and send that as the first 25 characters of the encrypted message. If the message was longer than 25 characters you'd rotate the wheels again for the next 25 characters, and so forth. the receiver would put his wheels in order, and put the first 25 characters of the encrypted message in a row, and look around the wheel for an intelligible row of text. And so on...

A nearly identical cipher machine (though developed independently) was used by the US Army from 1922 until some time around 1940; Karn's ``The Codebreakers'' (a fascinating book), written in 1967, stated that the US Navy still used it at that time.

Enigma

Enigma was the name of the encryption machine used by the Germans in WWII. It's a much more complicated combination of the multiple-rotor machines, like the Jefferson, and a progressive key.

This machine will work a bit differently from the other techniques we've seen up until now; it will use electrical connections to perform the encryption.

The basic idea is that we have a bag full of rotors to choose from each rotor has 26 electrical contacts on both sides, with a random interconnection between the sides. We select three rotors, and put them side by side, with each rotor in a specified position. Now, when we type a key on the keyboard, we send an electrical signal through the rotors; it follows a path determined by the connections in the rotors, and lights up a light. The light tells what character should be sent, instead of the character that was pressed.

After each character is pressed, the right-most rotor is shifted one position. After 26 characters, it ``carries'' to the next rotor, which moves one position as well.

The real Enigma had a couple of extra wrinkles on top of this, but this is the heart of the machine. The Enigma was actually developed for commercial use before WWII, and was even patented in the US (#1,657,411).

Breaking Ciphers

The noted late 19th and early 20th century consulting detective, Sherlock Holmes had three cases that I can remember that steganography and/or codes, and ciphers.

``The Gloria Scott''

Steganography figured in Holmes's very first case, which occurred in 1874 (dates are all according to Baring-Gould's chronology, not date of publication). A man received a letter, which said, ``The supply of game for London is going steadily up. Head-keeper Hudson, we believe, has been now told to receive all orders for fly-paper and for preservation of your hen-pheasant's life.'' This message so horrified its recipient that he immediate suffered a fatal stroke.

Holmes recognized by inspection that the message was actually conveyed in every third word - ``The supply of game for London is going steadily up. Head-keeper Hudson, we believe, has been now told to receive all orders for fly-paper and for preservation of your hen-pheasant's life.''

The Valley of Fear

This case took place in 1888. Holmes was sent a message by an informant in Professor Moriarty's organization, which read, ``534 C2 13 127 36 31 4 17 21 41 DOUGLAS 109 293 5 37 BIRLSTONE 26 BIRLSTONE 9 127 171.'' Unfortunately, no key was provided with the message, and the informant was frightened off before he could send a message containing the key.

Holmes and Watson discussed the message, and concluded that it was most likely ``534'' was a page number, and ``C2'' indicated the second column of a two-column page. The question remains, however, what book could be indicated...

It must be a large book (as it has 534 pages), which is likely to be in common circulation. The Bible was Watson's first suggestion; however, there are multiple translations and multiple editions of the translations, so this would not be a useful choice. After a few other possibilities were exhausted, Watson suggested an almanack; indeed, Whitaker's Almanack proved to be the correct book, and the message turned out to say, ``There is danger may come very soon one Douglas rich country no at Birlstone House Birlstone confidence is pressing.''

Sadly, unlike fictional detectives, Holmes was not infallible. Mr. Douglas of Birlstone Manor proved to have been murdered that very morning.

``The Adventure of the Dancing Men''

Another case involving both steganography and cryptography occurred in 1898. In this case, a series of childish drawings were left for Mrs. Elsie Cubitt (an American, with a mysterious past who had married a respectable Englishman) to find. Upon seeing them she became terribly frightened; with each message she appeared to become more distraught.The sequence of messages, in order, was:

First message

Second message

Third message

Fourth message
this message appeared to be drawn by a different artist

Fifth message

After receiving the fifth message, Holmes had enough information to decrypt all five using letter-frequency analysis (for instance, he observed immediately that the first message had four figures which were identical; he concluded these all represented the letter ``E''), and found that they were a series of threatening letters from a former fiance (an American criminal) who was stalking Mrs. Cubitt. The first and second letters said he had come to her (``AM HERE ABE SLANEY'', ``AT ELRIGES''), the third was a demand that she meet him (``COME ELSIE''), the fourth was her response (``NEVER''), and the fifth was an overt threat (``ELSIE PREPARE TO MIGHT THY GOD''). Sadly, once again, Holmes was too late; he received word that Mr. Cubitt had been shot to death, and that Elsie had attempted suicide.

Holmes wrote the following message (``COME HERE AT ONCE''), and had it delivered to the former fiance:

Holmes's reply

When the former fiance came in response to this message, he was arrested. Elsie recovered from her wounds, and devoted the remainder of her life to the poor and to administering her late husband's estate.


Last modified: Thu Oct 4 13:34:33 MDT 2001