Enigma - Mechanization of Secrecy
Enigma - Mechanization of Secrecy
- –– German Enigma Cypher – The Mechanization of Secrecy ––
- Intro
- Mechanics
- The Possibilties
- The Challenge
- Cracking Enigma
- Personal Cracking
- Conclusion
–– German Enigma Cypher – The Mechanization of Secrecy ––
Intro
Well as there is such a small amount of articles on encryption I decided to write one about the Enigma machine. Before I start
off I want to mention that most of the information I will use in this article came from an excellent Cryptography book "The Code
Book" by Simon Singh. I will start off with the mechanics of the Enigma, or how it is built and implemented, I will add links to
picture to help with the illustrations, as it is hard to describe a 3-dimensional scrambler in text, and I will then give a very
brief overview of how the Enigma was used up to and within WWII. I will then follow with how its code was broken, and how to
break such codes. With that said, let's get cracking! (pun intended :P)
Mechanics
An Enigma encoder is a complex machine compromised of Scramblers, a Reflector, a Plugboard, and a set of 26 Buttons and
lightbulbs, representing each letter of the alphabet. Depending on the specific model of the Enigma machine, the amount of
scramblers used varies(between 3 and 5), however I will concentrate on the more common 3-rotered Enigmas used by Germans prior to
and in the beginning of WWII. Heres a picture of a typical Enigma machine http://www.linkparis.com/images/slideshow/A15.jpg
The scramblers will be set up much like an old analog clock. Each Scrambler has 26 connections, again, each representing a letter
of the english alphabet. Each individual Scrambler will also have a distinct internal wiring, Scrambling the letter differently
then the other two Scramblers. When a key is entered the first scrambler will rotate 1/26th of a rotation, or one letter,
essentially changing the way the next letter is encoded. Once the first scrambler reaches a full rotation, it will "tumble" the
second scrambler 1/26th of a rotation. This pattern will continue for 26x26x26 keys entered, then begin all over again. The
Scrambler order may be changed; one day, it might follow 123 pattern, while the next the day, they may be oriented as 312.
The Reflector adds to the scramblers by passing the signal back through the Scramblers in a reverse order. To attempt to
simplify: A user enters a key, it will move into the first Scrambler, that Scrambler will rotate, then the signal will enter the
second Scrambler, and move to the third Scrambler. Once it reaches the end of the third scrambler, it will enter the Reflector,
which will redirect it back into a different slot of the third scrambler, and continue the process back through to the first
scrambler where it will then light up the corresponding cypher letter. An example of how this process works can be seen here
http://www.ellsbury.com/enigma/fig_1-1_enigma.gif .
Lastly, we come to the Plugboard. The plugboard is simply a series of plugs that will switch letters. Plugging B and G for
example will switch every B for a G, and vice versa. In the standard Enigma machine the user would be supplied with 6 cables to
create 6 sets of swaps.
The Possibilties
With all these possible settings, the amount of initial setups rose remarkably. With 3 Scramblers, 6 Different Scrambler
orientations(123,132,213,231,312,321), there came out to be 26x26x26x6 = 105456 Unique combinations. Adding a plugboard with the
ability to swap 6 sets of letters out of 26 increments this number to upwards 10,000,000,000,000,000. As you can see it would be
practically impossible to decode a message not knowing those initial settings.
The Challenge
Now that the machines were up and running, the German government had to find a way to implement their capabilities. If the
receiver of an encoded message didn't know the initial settings the sender used, they could never decrypt the message in time for
the meaning to be useful. To counter this, the German government created a monthly book of "Daily settings". Each day the sender
would arrange the Scramblers and plugboard the way the book said, and when sent, the receiver would set his Enigma with the same
settings before decrypting. What would happen if the Allies got a copy of the book you ask? Well the Germans also thought of that
and created another measure of security(with good reason, hundreds of code manueals were intercepted in the duration of the war).
What the Germans did was that at the beginning of the sent message they would use a unique "message code", such as APB. They
would then encrypt the "message code" twice(APBAPB) for security and acuracy's sake, using that day's code from the book of
"Daily settings", Then after those 6 characters, they would reset the Scramblers to the "Message code" setting, in our case APB
and encode the rest of the message. Thus, when an encoded message would be received, the decoders would decode the first 6
characters using that day's "Daily Settings", then change the Scramblers to the designated state, and decrypt the rest of the
message. If an Ally were to come into possession of the "Daily Setting" key, yet did not know about the message key swap, one
would attempt to decode it only using the "Daily Setting" key, and the resulting message would be gibberish.
Cracking Enigma
Unfortunatly for the Germans, they believed their system to be completely uncrackable. As most of you know by now, every
encryption/encoding system will eventually be broken. The demise of the Enigma came at the hands of the Polish Mathematician
Marian Rejewski. Working out of the Biuro Szyfrow, the Polish Cypher bureau, Rejewski was handed hundreds of encoded messages a
day. Through espionage and captured documents, Rejewski knew about the "Daily Settings" and "Message Settings" and thefore
theorized that the repeated use of a "Daily Setting" would create a weakness in the encoding process. Rejewski then began to
catalog messages that he received each day. For example, on a certain day, he would receive 4 messages, each with the first 6
Letters as follows:
Message 1: L-O-K-R-G-M Message 2: M-V-T-X-Z-E Message 3: J-K-T-M-P-E Message 4: D-V-Y-P-Z-X
In each message, we know they repeated the Message Setting twice. Therefor L and R are intimately related, using the "Daily
Setting". O & G, and K & M are also correlatively related. Given enough messages a day, Rejewski made a catalog of what letter
corresponded to which other letter. A completed example:
A-B-C-D-E-F-G-H-I-J-K-L-M-N-O-P-Q-R-S-T-U-V-W-X-Y-Z F-Q-H-P-L-W-O-G-B-M-V-R-X-U-Y-C-Z-I-T-N-J-E-A-S-D-K
He then made a crucial observation. That certain Chains would be created. That is, A > F > W > A. Given the example above, 4
chains of length 3, 9, 7, 7 would be created. The genius behind this observation is that these chains are INDEPENDENT of the
plugboard settings. Even if you switched letters around, the chains would be the same. This greatly reduces the task of finding
the "Daily Setting" from 10,000,000,000,000,000 to simply 105,456. This is much more realistic and therefore practically doable.
Rejewski then set off to catalog every possibility of those 105,456 settings and mark down the amount, and lenght of the Chains.
With this information, at the start of the day when Rejewski received messages, he would make a comparison chart as above, write
down the chains and their lenght, then check his catalog to find the exact Scrambler settings.
Although he had the Scrambler settings, there was still the Plugboard settings to deal with. However, compared with the Scrambler
settings this was relatively easy to break. One would simply set the Scramblers to the appropriate settings, and leave all of the
Plugs UNPLUGGED. Then, most of the message would probably be gibberish, however, occasionally we would come upon a string such as
"HEBBLOUND" in which we would assume B and L are swapped. We would set that Plug and continue the process until the message is
completely decoded!
Personal Cracking
To personally crack an Enigma cyphered message would be complicated to say the least. If your encoded message did not contain the
6 standard German Message Setting characters at the beginning of the message, then the only possible way would be to manually
check all 105,456 scrambler settings and check to see if there is at least some legible writting, all taking into consideration
we have not set any plugs on our Plugboard. The ideal situation is if we could acquire a copy of the "Catalog of Settings" that
Rejewski made (an aside, if anyone can find a copy somewhere, please let me know, and I'll add a link here), as well as having
multiple messages to write down a list of chains created by the settings.
Conclusion
Considering the initial success of the Enigma machine and the trouble that the Allies had in breaking tells us that this is a
somewhat good encoding system. The ultimate failure on the German side was the use of repeated settings and keys. Had they used
another way of distributing these keys, or simply found a way around that, the system would have been much more complex to crack,
and who knows, maybe the outcome of the war would not have turned out how it did? After all…"The pen is mightier then the
sword".
–A side note, this is mostly general information regarding Enigma, there were several variations of Enigma put to use, and which
each came a new set codes to be broken.
–A downloadable version of the Enigma machine is available at http://users.telenet.be/d.rijmenants/en/enigmasim.htm so by all
means download it and play around with how the Enigma works
–Thank you all for reading this article, hopefully I've cleared up a few areas about how the Enigma machine works, and how the
encoding works. Please feel free to let me know what you all think of this. Good night/morning/afternoon all!
ghost 16 years ago
Awesome article. Shame about the formatting. I disagree however when you say that it would be very difficult to crack an enigma encoded message in this day and age. One would simply need to make educated guesses about the plaintext. This article is an excellent example of how using a set protocol inside the message allows an attacker to determine plaintext, thus weakening any cryptosystem.