You are on page 1of 8

Cryptography and network security

ASSIGNMENT

Submitted by,

Cryptography and network security


ASSIGNMENT

Submitted by,

Rotor machine
In cryptography, a rotor machine is an electro-mechanical stream cipher device used for encrypting and decrypting secret messages. Rotor machines were the cryptographic state-of-theart for a prominent period of history; they were in widespread use in the 1920s1970s. The most famous example is the German Enigma machine, whose messages were deciphered by the Allies during World War II, producing intelligence code-named Ultra. The primary component is a set of rotors, also termed wheels or drums, which are rotating disks with an array of electrical contacts on either side. The wiring between the contacts implements a fixed substitution of letters, replacing them in some complex fashion. On its own, this would offer little security; however, after encrypting each letter, the rotors advance positions, changing the substitution. By this means, a rotor machine produces a complex polyalphabetic substitution cipher, which changes with every keypress.

Invention
The concept of a rotor machine occurred to a number of inventors independently at a similar time. In 2003, it emerged that the first inventors were two Dutch naval officers, Theo A. van Hengel (1875 1939) and R. P. C. Spengler (1875 1955) in 1915 (De Leeuw, 2003). Previously, the invention had been ascribed to four inventors working independently and at much the same time: Edward Hebern, Arvid Damm, Hugo Koch and Arthur Scherbius. In the United States Edward Hugh Hebern built a rotor machine using a single rotor in 1917. He became convinced he would get rich selling such a system to the military, the Hebern Rotor Machine, and produced a series of different machines with one to five rotors. His success was

limited, however, and he went bankrupt in the 1920s. He sold a small number of machines to the US Navy in 1931. In Hebern's machines the rotors could be opened up and the wiring changed in a few minutes, so a single mass-produced system could be sold to a number of users who would then produce their own rotor keying. Decryption consisted of taking out the rotor(s) and turning them around to reverse the circuitry. Unknown to Hebern, William F. Friedman of the US Army's SIS promptly demonstrated a flaw in the system that allowed the ciphers from it, and from any machine with similar design features, to be cracked with enough work.

Background
In classical cryptography, one of the earliest encryption methods was the simple substitution cipher, where letters in a message were systematically replaced using some secret scheme. Monoalphabetic substitution ciphers used only a single replacement scheme sometimes termed an "alphabet"; this could be easily broken, for example, by using frequency analysis. Somewhat more secure were schemes involving multiple alphabets, polyalphabetic ciphers. Because such schemes were implemented by hand, only a handful of different alphabets could be used; anything more complex would be impractical. However, using only a few alphabets left the ciphers vulnerable to attack. The invention of rotor machines mechanised polyalphabetic encryption, providing a practical way to use a much larger number of alphabets. Cipher designers tried to get users to use a different substitution for every letter, but this usually meant a very long key, which was a problem in several ways. A long key takes longer to convey (securely) to the parties who need it, and so mistakes are more likely in key distribution. Also, many users do not have the patience to carry out lengthy, letter perfect evolutions, and certainly not under time pressure or battlefield stress. The 'ultimate' cipher of this type would be one in which such a 'long' key could be generated from a simple pattern (ideally automatically), producing a cipher in which there are so many substitution alphabets that frequency counting and statistical attacks would be effectively impossible. Enigma, and the rotor machines generally, were just what was needed since they were seriously polyalphabetic, using a different substitution alphabet for each letter of plaintext, and automatic, requiring no extraordinary abilities from their users. Their messages were, generally, much harder to break than any previous ciphers.

Mechanization
It is relatively straightforward to create a machine for performing simple substitution. We can consider an electrical system with 26 switches attached to 26 light bulbs; when you turn on any one of the switches, one of the light bulbs is illuminated. If each switch is operated by a key on a typewriter, and the bulbs are labelled with letters, then such a system can be used for encryption by choosing the wiring between the keys and the bulb: for example, typing the letter A would make the bulb labelled Q light up. However, the wiring is fixed, providing little security.

Rotor machines build on this idea by, in effect, changing the wiring with each key stroke. The wiring is placed inside a rotor, and then rotated with a gear every time a letter was pressed. So while pressing A the first time might generate a Q, the next time it might generate a J. Every letter pressed on the keyboard would spin the rotor and get a new substitution, implementing a polyalphabetic substitution cipher. Depending on the size of the rotor, this may or may not be more secure than hand ciphers. If the rotor has only 26 positions on it, one for each letter, then all messages will have a (repeating) key 26 letters long. Although the key itself (mostly hidden in the wiring of the rotor) might not be known, the methods for attacking these types of ciphers don't need that information. So while such a single rotor machine is certainly easy to use, it's no more secure than any other partial polyalphabetic cipher system. But this is easy to correct. Simply stack more rotors next to each other, and gear them together. After the first rotor spins "all the way", make the rotor beside it spin one position. Now you would have to type 26 26 = 676 letters (for the Latin alphabet) before the key repeats, and yet it still only requires you to communicate a key of two letters/numbers to set things up. If a key of 676 length is not long enough, another rotor can be added, resulting in a period 17,576 letters long. In order to be as easy to decipher as encipher, some rotor machines, most notably the Enigma machine, were designed to be symmetrical, i.e., encrypting twice with the same settings recovers the original message (see involution).

Enigma machine
An Enigma machine was any of a family of related electro-mechanical rotor cipher machines used in the twentieth century for enciphering and deciphering secret messages. Enigma was invented by the German engineer Arthur Scherbius at the end of World War I.[1] Early models were used commercially from the early 1920s, and adopted by military and government services of several countries most notably by Nazi Germany before and during World War II.[2] Several different Enigma models were produced, but the German military models are the most commonly discussed.

Design
Like other rotor machines, the Enigma machine is a combination of mechanical and electrical subsystems. The mechanical subsystem consists of a keyboard; a set of rotating disks called rotors arranged adjacently along a spindle; and one of various stepping components to turn one or more rotor with each key press.

Rotors
The rotors (alternatively wheels or drums, Walzen in German) formed the heart of an Enigma machine. Each rotor was a disc approximately 10 cm (3.9 in) in diameter made from hard rubber or bakelite with brass spring-loaded pins on one face arranged in a circle; on the other side are a corresponding number of circular electrical contacts. The pins and contacts represent the alphabet typically the 26 letters AZ (this will be assumed for the rest of this description). When the rotors were mounted side-by-side on the spindle, the pins of one rotor rested against the contacts of the neighbouring rotor, forming an electrical connection. Inside the body of the rotor, 26 wires connected each pin on one side to a contact on the other in a complex pattern. Most of the rotors were identified by Roman numerals, and each issued copy of rotor I was wired identically to all others. The same was true for the special thin beta and gamma rotors used in the M4 naval variant.

By itself, a rotor performs only a very simple type of encryption a simple substitution cipher. For example, the pin corresponding to the letter E might be wired to the contact for letter T on the opposite face, and so on. Enigma's security came from using several rotors in series (usually three or four) and the regular stepping movement of the rotors, thus implementing a polyalphabetic substitution cipher. When placed in an Enigma, each rotor can be set to one of 26 possible positions. When inserted, it can be turned by hand using the grooved finger-wheel, which protrudes from the internal Enigma cover when closed. So that the operator can know the rotor's position, each had an alphabet tyre (or letter ring) attached to the outside of the rotor disk, with 26 characters (typically letters); one of these could be seen through the window, thus indicating the rotational position of the rotor. In early models, the alphabet ring was fixed to the rotor disk.

Operation
In use, the Enigma required a list of daily key settings and auxiliary documents. The procedures for German Naval Enigma were more elaborate and more secure than those in other services. Navy codebooks were printed in red, water-soluble ink on pink paper so that they could easily be destroyed if they were endangered. In German military practice, communications were divided into separate networks, each using different settings. These communication nets were termed keys at Bletchley Park, and were assigned code names, such as Red, Chaffinch, and Shark. Each unit operating in a network was assigned a settings list for its Enigma for a period of time. For a message to be correctly encrypted and decrypted both sender and receiver had to configure their Enigma in the same way; rotor selection and order, starting position and plugboard connections must be identical. All these settings (together the key in modern terms) were established beforehand, distributed in codebooks. An Enigma machine's initial state, the cryptographic key, has several aspects:

Wheel order (Walzenlage) the choice of rotors and the order in which they are fitted. Initial position of the rotors chosen by the operator, different for each message. Ring settings (Ringstellung) the position of the alphabet ring relative to the rotor wiring. Plug connections (Steckerverbindungen) the connections of the plugs in the plugboard. In very late versions, the wiring of the reconfigurable reflector.

Indicator
Most of the key was kept constant for a set time period, typically a day. However, a different initial rotor position was used for each message, a concept similar to an initialization vector in modern cryptography. The reason is that encrypting many messages with identical or nearidentical settings (termed in cryptanalysis as being in depth), would enable an attack using a statistical procedure such as Friedman's coincidence. The starting position for the rotors was transmitted just before the cipher text, usually after having been enciphered. The exact method used was termed the indicator procedure. Design weakness and operator sloppiness in these indicator procedures were two of the main weakness that made cracking Enigma possible.

Electrical pathway

The mechanical parts act in such a way as to form a varying electrical circuit. When a key is pressed, a circuit is completed. Current flows through various components in their current configuration, ultimately lighting one display lamp, revealing an output letter. For example,

when encrypting a message starting ANX..., the operator would first press the A key, and the Z lamp might light, so Z would be the first letter of the ciphertext. The operator would next press N, and then X in the same fashion, and so on. The detailed operation of Enigma is shown in the wiring diagram to the left. To simplify the example, only four components of a complete Enigma machine are shown. In reality, there are 26 lamps and keys, rotor wirings inside the rotors (of which there are either three or four) and between six and ten plug leads. The scrambling action of Enigma's rotors is shown for two consecutive letters with the righthand rotor moving one position between them. Current flowed from the battery (1) through a depressed bi-directional keyboard switch (2) to the plugboard (3). Next, it passed through the (unused in this instance, so shown closed) plug "A" (3) via the entry wheel (4), through the wiring of the three (Wehrmacht Enigma) or four (Kriegsmarine M4 and Abwehr variants) installed rotors (5), and entered the reflector (6). The reflector returned the current, via an entirely different path, back through the rotors (5) and entry wheel (4), proceeding through plug "S" (7) connected with a cable (8) to plug "D", and another bi-directional switch (9) to light the appropriate lamp.

Additional details
The Army Enigma machine used only the 26 alphabet characters. Signs were replaced with rare character combinations. A space was omitted or replaced with an X. The X was generally used as point or full-stop. Some signs were different in other parts of the armed forces. The Wehrmacht replaced a comma with ZZ and the question sign with FRAGE or FRAQ. The Kriegsmarine replaced the comma with Y and the question sign with UD. The combination CH, as in "Acht" (eight) or "Richtung" (direction), was replaced with Q (AQT, RIQTUNG). Two, three and four zeros were replaced with CENTA, MILLE and MYRIA.

You might also like