Cryptography

The History and Mathematics of Codes and Code Breaking

Month: November 2012 Page 2 of 4

Computer Cryptography

In the chapter titled “Forays,” of Neal Stephenson’s Cryptonomicon, bit-key encryption is introduced as a method maintaining secrecy between the characters Randy and Avi. Unlike the other characters of the novel, Randy and Avi occupy the modern times and must resort to computer cryptography in order to protect Epiphyte, which is no more than “an idea, with some facts and data to back it up,” thus making it “eminently stealable.” They therefore employ a program referred to as “Ordo,” which converts their e-mails and data into streams of digital “noise,” or indistinguishable numerical nonsense. Interestingly enough, the function by which Ordo operates has recently been a topic of discussion in class.

by NIMATARADJI Photography

In the passage, Randy is directed to choose a key length of 4096 in order to communicate securely with Avi. This key length, as suggested by Randy, is entirely secure. However, because random generation of a larger key length requires tiresome effort on Randy’s behalf, he argues that even an inconceivably large super computer would have no hope of breaking a 4096-bit encryption key. Avi retorts with the implications of Moore’s Law, which argues that computing power doubles approximately every two years, and the prospect of quantum computers further validates the possibility for factoring large numbers with ease. The length of a key is thus of utmost importance, even if it is impervious to the efforts of current computing power.

A 4096-bit key, however, is notably secure, as this key length equates to  24096 possible keys. As mentioned in the novel, a key 2048 or 3072 bits in length would halt even the greatest cryptanalysts in their tracks, whereas a 768-bit key would provide security for years to come. This is because a key length does not directly signify the number of possible keys, provided that a key length of 400 generates double the number of possible keys as does 399-bit key.

This passage was captivating for me because my new found knowledge of computer cryptography and key length allowed me to appreciate its implications within the novel just that much more. Furthermore, the argument of Moore’s Law was quite noticeable to me, despite its lack of explicit mention in the passage. Most interesting to me, however, was the theoretical argument that a supercomputer composed of every particle in existence would take “longer than the lifespan of the universe” to crack a 4096-bit key encryption.

Turning Wheels

Cryptonomicon creates a fictional setting in which Neal Stephenson recreates the chaos of World War II cryptography. A passage of particular interest involved the relation of Turning’s bicycle wheel to the cipher machine. Waterhouse eyes the bent spoke and weak link in the chain of Turning’s bicycle and his mind immediately goes to the mathematical implications of the weak parts. By describing the math involved to figure out when the chain will entirely fall off – which only happens once the weak link of the chain and bent spoke come into contact with each other – and applying it to the mathematics involved in the rotors of an Enigma machine. Just as Turning’s bicycle wheel has a certain period of rotation until the chain will fall off and the bicycle will be useless, Stephenson explains that the rotors also have a period. With three rotors, the period, or the number of times until the nth letter is enciphered with the same letter as the first letter of the message, is 17,775;

This passage not only represents the complicated mathematics involved in solving the Enigma, but also the ingenuity on part of the Germans in adding another rotor to their cipher machine. Because the period of the machine increased by a factor of twenty-five, and messages sent are unlikely to reach a length of 456,976 characters, the Germans greatly increased the security of their cipher through the introduction of the fourth and fifth rotors, a concept we have previously discussed, but the mathematics presented in this passage helped me to further understand the exact implications of the addition. yet, with a fourth rotor added, this period increases to 456,976 letters.

Image: Yellow Bike, Flickr

Understanding the Enigma

Cryptonomicon by Neal Stephenson is an interesting and informative novel tying together different generations of cryptography.   A passage I found most interesting was in the chapter ‘Cycles’.  In this chapter, Stephenson expands on the fundamental mathematics behind the Enigma machine: modular arithmetic.

Stephenson compares modular arithmetic to Turing’s bike.  For some reason, Turing’s bike has a rear wheel with one bent spoke and a weak chain link.  When the spoke comes into contact with the chain at a certain position the chain will fall apart.  The mathematical take on this occurring utilizes a series of variables.  We assume that the spoke is at a degree of 0 (Θ=0) and the position of the chain (C) is at C=0, when the spoke can break the chain.  The weak link is numbered 0, and follows, with I equaling the total number of links in the chain. The sprocket has n teeth, and after one full revolution of the wheel C=n (after two revolutions Θ =0 but now C=2n).  With these variables, Stephenson draws an incredible connection to modular arithmetic.  While C increases infinitely, the number of links does not, and at C=I the chain returns to C=0.  According to Stephenson’s example, if there are 100 links (I=100) and 135 links have passed, C will equal 35 instead of 135.  To put this into mathematical terms, C = 135 mod 100.  In this way, Turing’s bicycle offers an interesting connection to the way an Enigma machine works.  According to the period of an individual cycle within the machine, the difficulty in cracking a code increases.  This period is similar to how Turing’s bicycle returns to Θ=0 and C=0.  How exactly does this help determine when the chain will fall apart? According to Stephenson, this will happen when a multiple of n is also a multiple of I.  This perspective provided me with a better understanding of modular arithmetic and showed how complex the Enigma machine can be when the period increases.

Image: “Hydroelectric Turbine,” by Guy Mason, Flickr (CC)

Intuition

The part of Cryptonomicon that caught my attention was Lawrence Waterhouse’s attempt to solve the cipher, or “mathematical exercise” given to him and others by Commander Schoen. Schoen writes out the cipher, a list of 5 groups each with 5 numbers. The numbers are either 1 or 2 digits. Waterhouse instantly recognizes that the greatest number provided is 25, thus he assumes that the numbers must represent the letters in the alphabet. He then decides to run a frequency analysis test using the numbers on the board and realizes the number 18 occurs 6 times. Waterhouse then makes an assumption that the number 18 must be the letter E so he mentally substitutes the letter E into the cipher. Next, Waterhouse observes that the opening 4 numbers are ’19 17 17 19′. He then knows that if 19 is a vowel, 17 must be a consonant or vice versa, and since 19 is twice as common in the cipher, he assumes that 19 is a vowel (specifically A). Waterhouse then proceeds by using the context of the message as provided by Commander Schoen earlier. Schoen had said that the message was intended for a naval officer. Using this, Waterhouse was able to guess that the first word was ATTACK. Immediately, he saw the rest of the cipher decrypt before his eyes so he stood up and stated his findings emphatically. The message read: “Attack Pearl Harbor December Seven”

The methods Waterhouse used to solve the cipher reminded me of the discussion we had earlier than year about the use of intuition to solve puzzles. Waterhouse used problem solving techniques and pure logic to decrypt the cipher. By assuming the first word was ‘ATTACK’ and recognizing that the numbers represented individual letters in the first place, Waterhouse demonstrated the problem solving techniques we have all acquired through basic learning.

From Letters to Numbers

“Triple Locked” by Darwin Bell

Though Neal Stevenson’s novel Cryptonomicon is fictional, its story of cryptography geniuses Lawrence Waterhouse, Alan Turing and Rudy von Hacklheber during World War II gives a very accurate account of the processes and drama experienced by these experts in their field. World War II fueled one of the greatest transformations in cryptography, and these three men were at the head of the changes. Cipher analysis had always been based off of knowledge of language, pattern recognition and frequency analysis, but Waterhouse, Turing and von Hacklheber shifted the focus away from language analysis and toward mathematical analysis.

In one of the turning points of the novel and cryptography history, Waterhouse discovers non-Enigma messages in the German U-boat U-553 that have stumped his analysts. After further examination, Waterhouse discovers that the code is made of a 32 letter alphabet. This number is significant because it is a power of two, meaning that each letter in the alphabet was first substituted by a number and then by a five character binary sequence. This type of code is called the Baudot code and was used by the Germans on teletype machines. The teletype machines converted 32 characters into five number sequences of 1’s and 0’s. These could then be represented by either holes or no holes on a strip of paper or could be transmitted by wire or radio through changes in electrical voltages to represent the 1 or 0.

By encrypting the Baudot code again through one time pads, the Germans further increased their security. What the Germans failed to realize was that their “random” one time pads were generated through an algorithm and where therefore only “pseudo-random.” Though truly random one-time pads are impossible to crack, Turing and Waterhouse were able to design a precursor to the modern computer called Colossus that could find the weakness in the one-time pads.

Turing and Waterhouse’s transformation from using frequency analysis to using formulas and computers to decipher a message marks a sudden change in cryptography history. Turing’s first computers and the use of binary to encode messages would forever change the standard methods of cryptography. No longer was cryptography power based on weak letter based codes, but rather almost unbreakably powerful number based codes that would revolutionize cryptography less than a century later with public key encryption.

The Interference of Secrecy

 

 

 

 

 

 

 

 

The Cryptonomicon brings up an interesting idea when Sergeant Shaftoe, Corporal Benjamin and Lieutenant Monkberg get in an argument after they ram their ship into Normandy. The reader already knows the purpose of the mission because it is alluded to in earlier chapters, but only Lieutenant Monkberg knows the exact orders, which causes problems when he tells them to do something that seemed like treason. The purpose of the mission was to leave behind the Allies’ code book in order to have an excuse to change their codes, which they know the Germans have cracked, without alerting the Germans that they have cracked Enigma. Hiding the fact that they have cracked Enigma while still taking advantage of what they know  is basically the entire purpose of Detachment 2702. The concept of Detachment 2702 raises an interesting point because they have to deliberately hurt themselves in order to not reveal their resources. The concept behind 2702 is an answer to one of the things discussed in class, mainly the problem of revealing that a code has been cracked. Because of Detachment 2702, the Allies were able to fool the Axis into believing that Enigma was same and because of that, the Allies were able to keep a crucial advantage that was desperately needed in order to gain the upper hand in World War II. The Allies even had 2702 fooled, they couldn’t possibly comprehend why they would ever leave behind the code book, though this secrecy turned into a double sided sword. When Corporal Benjamin is told to leave behind the code book, the Corporal assumes that his commanding officer is a spy and it didn’t help that Lieutenant Monkberg was the only person that had received the orders. If they would have continue with taking the code book with them, they would have failed in their mission though they wouldn’t realize it and it would have ended up costing Allied lives because the Allies would have needed to come up with a new way in which to justify switching code books, and until then all Allied conveys would be at risk of being destroyed by German U-boats.

Picture: U-Boat Surrender by Wessex Andy (Flickr)

 

 

 

The Onetime Pad

In “The Castle,” Lawrence Waterhouse arrives at the Castle in Outer Qwghlm, serving as the advance party to Detachment 2702. He is responsible for surveying the Castle and setting up appropriate accommodation away from the prying eyes of the servants. He finds a place that can adequately serve the purposes of Detachment 2702 and requests the required materials using a onetime pad to encrypt his message.

The onetime pad has been proved to be the only unbreakable method of encryption and its security lies in the randomness of its keys. Sheets of paper, or pads, containing these random keys are distributed to men in the field, and messages are enciphered accordingly. To increase the strength of its security, Waterhouse discards the letter ‘J’ and replaces it with ‘I’ in his messages. He also only uses every third line of the onetime pad. In addition, instead of simply enciphering his message using the conventional Vigenere square, he uses modular arithmetic to convert the letters into numbers and then back to letters again.

One of the impracticalities of the onetime pad is guaranteeing that everyone is using the correct sheet of keys. To overcome this obstacle, serial numbers that are unique to each sheet are typed across the top to indicate which sheet is being used. Another problem facing people who use the onetime pad is the generation of truly random keys. The men in Detachment 2702 get around this issue by using a device used in bingo parlors to produce random letters. The device containing 25 balls, to represent the 25 letters of the alphabet exclusing ‘J’, is rotated and a random ball is selected. The letter on the ball is then typed onto the sheet and so on.

In conclusion, Cryptonomicon has enhanced my understanding of onetime pads by suggesting several ways of strengthening this encryption technique as well as offering methods of overcoming the obstacles associated with its use.

 

Blindly Building

The most interesting passage from Cryptonomicon that relates to a discussion earlier in the course is found on page 89. Here, Lawrence describes the most intriguing machine found at Station Hypo: at machine built by Commander Schoen and designed to break Japan’s INDIGO cipher. According to the book’s description, INDIGO was similar to ENIGMA, in that it was enciphered using a machine. However, unlike ENIGMA, none of the cryptanalysts had seen the INDIGO machine, so they had no idea how to tackle it. Amazingly, Schoen was able to reverse-engineer the cipher machine simply by analyzing the encoded messages and finding patterns in the numbers.

Of course, this section directly relates to our discussion of ENIGMA and its downfall. The main difference between the two, though, seems to be where the bulk of the security was. With ENIGMA, cryptanalysts struggled to break the code, even with the machine in front of them. According to the book, the major breakthrough with INDIGO was creating a copy of the machine.

After reading the passage, I was convinced that Stephenson had fabricated this part of the story. I found it highly unlikely that any person could reverse-engineer an elaborate mechanism by simply searching for patterns in encrypted knowledge. However, after a quick Wikipedia search, I found that this instance was actually based off of a real-life occurrence.

The actual cipher was named PURPLE (INDIGO was a great name for Stephenson to pick) and the main storyline remains the same: a machine was being used to encipher messages and no one knew what it looked like. The biggest difference between reality and the fictionalized story is that multiple people worked together to create the PURPLE machine, compared to the lone Commander Schoen in Cryptonomicon. Nevertheless, creating a complex machine by analyzing the numbers it output is still genius.

Image: “COBOL Rube Goldberg” by Phil Manker

Turning’s Bicycle and Modular Arithmetic

 

A passage that I found especially intriguing in Neal Stephenson’s Cryptonomicon, is when Waterhouse and Turning are on a bike ride in the English countryside. In these few complex mathematical pages, we are taught about modular arithmetic, which helps us understand how the Germans used the Enigma machine during the war. The part of this passage that I grasped, is when they are describing modular arithmetic through the cycles of Turning’s bike, which has one bent spoke on the back wheel. Turning knows that when the link and the spoke come in contact with each other, the chain will break and the bike will be useless. However, he figures out a way around this malfunction as it only occurs when the wheel and the chain happen to coincide.

Stephenson incorporates math when he proceeds to introduce variables.  He lets l stand for the number of links in the chain, n for the number of spokes, and C for the position of the chain. In order to calculate the value of C, you must do modular arithmetic. Stephenson explains the steps by saying “if the chain has a hundred links (l=100) and the total number of links that have moved by is 135, then the value of C is not 135, but 35” (166). The values of C, each time the wheel spins one full rotation, is n mod l, 2n mod l, etc. Ultimately this tells us that the chain will fall off his bike, when some multiple of n happens to match up with a multiple of l as well. This passage is a clever way to describe modular arithmetic, which we have covered in class.

 

Problem Set #5

Here’s your fifth and final problem set, available in both Word and PDF formats. It’s due at the start of class on Thursday, November 15th.

Update: To make question 4 a little more straightforward, I’ve added a “Theorem 4” that you can use in your answer to that question. It’s still a tough question, but this should give you all the tools you need to answer it.

Page 2 of 4

Powered by WordPress & Theme by Anders Norén