View RSS Feed

UK Mike (miner2049er)

The Bi-Weekly British Backtrack - The Enigma Machine

Rate this Entry
This could well be the first time I’ve made a blog post on the back of a request, a request to cover some classic computers, and feedback from people suggests that they like to hear about the British computers of old that they may know nothing about or may not have even heard of, so in this segment I’m going to go right back to the dark ages of computers. To a time when games weren’t even thought of, we’re going back to the 1930s.

The word 'computer' before the 1940s would typically be used to refer to a single person using some kind of hand held calculating machine that would calculate one specific thing, normally wages, and advances in technology would usually mean that the specific machine doing a specific task would just do it a little bit more quickly and efficiently.

In the mid-1940s, the mindset changed and advancements were then aimed at making these calculating machines more universal and able to perform different tasks, mainly by them having a program fed into them and running that program. Obviously once you had a device that could do that, you could load different programs into it and it could perform yet more differing tasks according to the program you fed into it.

This idea though, wasn’t a particularly new one, it had first been floated by a man you may have heard of, Charles Babbage. Babbage was born in 1791, and between 1833 and 1837 he designed what was known as the Analytical Engine, a mechanical calculating machine that would have a memory for up to 1000 numbers, and that would be controlled by the medium of the time, paper punched cards. His design wasn’t without issue and he had severe technical difficulties, but his ideas and the premise of a stored program computer were pivotal in computer history. That’s not to say that he “invented” the computer, that argument will rage on forever like the chicken and the egg but he was certainly a key figure in computer history.

By the mid-1940s there were research groups in Britain, America and Germany who were all working on the concept of a stored-program digital computer, and the main issue they had was the development of suitable storage techniques. A few years later, they cracked it, at Manchester University, when they built a small computer based entirely on the stored-program principle in 1948.

Going back to the Pre-War years though, there were 3 types of calculating machine in common use. The mechanical and electro-mechanical hand calculator that could add, subtract, multiply and divide two numbers, and they were generally about the size of a typewriter.

Second were the electromechanical punched-card machines like sorters and tabulators that were used in commerce and statistics initially, and later for scientific calculations.

Third was the Differential Analyser which could solve complex differential equations. A prototype was actually built from a child’s Meccano set and in 1934 was used to solve equations related to atomic theory.
As we now know, the second world war brought along lots of opportunities for problem solving, and quick problem solving at that, such as gunnery control, flight simulation and aircrew training, radar processing and perhaps most famously of all secret code development and cracking.

As these requirements were quite specialised and limited, they didn’t really contribute too much directly to the development of the modern computer, but they did prove to be good breeding grounds for technology
and the principles of computing and programming.

We’re going to focus on one area in particular though, the code creation and cracking aspect. The full story of course is covered by the Official Secrets Act, but we do know a lot of the details, and can make some pretty good guesses at the rest, but what we do know is that most of the activity was focused on the Post Office Research Station for the Government Code and Cipher School at Bletchley Park, Buckinghamshire where they secretly produced a computer called Colossus, but more on Colossus later.
Germany used two classes of machine for encoding signals prior to transmission: the Enigma series and the Geheimschreiber system. Both machines 'scrambled' the letters of a message by a complicated and virtually non-repeating mechanism of stepping rotors that created a code that was extremely difficult to decipher, unless you also had a similar machine of course. The difference between the two systems was that the Enigma machines had a three-rotor system (four for the German Navy) and were portable, but the Geheimschreibers had ten rotors and used the standard 5-bit teleprinter code for transmission. Enigma codes were used for all day to day messages and Geheimschreibers were used for top secret strategic messages because they were thought to be unbreakable.

So, what exactly was an Enigma machine then? Well, Enigmas are a family of electro-mechanical rotor based machines used for encrypting and decrypting secret messages. The first Enigma was invented by German engineer Arthur Scherbius at the end of World War I, and they were used commercially from the early 1920s onwards before being adopted by the military and secret services. When people generally refer to the Enigma they mean the one used by Nazi Germany in the Second World War, a model known as the Wehrmacht Enigma.

The fact that British and American codebreakers were able to crack the codes that the German Enigma used is rumoured to have shortened the war by two years. Though the Enigma cipher did have some cryptographic weaknesses, the actual cracking was helped far more by external factors, such as procedural flaws, operator mistakes and stolen or captured hardware and key tables.

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 stepping components to turn one or more of the rotors with each key press. The stepping component varies slightly from model to model. Most often the right-hand rotor steps once with each key stroke and other rotors step occasionally. The continual movement of the rotors results in a different cryptographic substitution after each key press. The mechanical parts actually form a varying electrical circuit and the actual letter substitution is indicated electrically.

When a key is pressed, the circuit is completed, current flows through the various components in their current configuration and ultimately lights one of the display lamps, indicating the 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 and so on.

The repeated changes of electrical paths through the Enigma scrambler implemented a polyalphabetic substitution encryption that gave the Enigma's very high security and the electrical pathway changed with each key press and in turn caused rotation of at least the right hand rotor. Current is passed into the set of rotors, into and back out of the reflector, and out through the rotors again, so the letter A encrypts differently with each consecutive key press, so pressing A twice would give you 2 different outputted letters. This is because the right hand rotor has stepped, sending the signal on a completely different route, and eventually other rotors will also step with a key press and make more possible electrical paths through the system.

So clearly the rotors formed the heart of an Enigma machine, and each rotor was a disc approximately 10 cm in diameter, made from hard rubber or bakelite with brass spring-loaded pins on one face arranged in a circle, and on the other side are a corresponding number of circular electrical contacts. The pins and contacts represent the alphabet and when the rotors were mounted side-by-side on the spindle, the pins of one rotor rest 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 other rotor Is.

By itself a single 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 in a fixed pattern. The Enigma's complexity, and cryptographic security, came from using several rotors in series and the regular stepping movement of the rotors that created this poly-alphabetic substitution cipher.

When placed in the machine each rotor can be set to one of 26 possible positions, and once inserted it can be turned by hand to a certain starting position marked by letters around the edge of a ring. In early models this ring was fixed to the rotor disk but in later models it was adjustable to further encrypt the messages, and this initial positioning and setting of the rotors and rings was known as the “ring setting” or Ringstellung in German.

Historically, messages were limited to a few hundred letters, and so there was no chance of repeating any combined rotor position during a single message session, and so cryptoanalysts were denied a valuable clue to the letter substitution used. However, one flaw of the Enigma was that it would never encrypt a letter to itself, so an E could never encrypt and become an E, and this conceptual flaw was exploited by Allied codebreakers.

The Enigma had a list of daily key settings and codebooks, and the Navy codebooks were printed in red water-soluble ink on pink paper so that they could easily be destroyed if they were at risk of being seized by the enemy, but the Allies did manage to capture some. These codebooks contained all of the starting positions for the rotors and connections because both the sender and receiver had to use identical equipment and settings to encrypt and decrypt the same message.

So, one of the keys to the Enigma’s encryption of messages was the wiring inside each rotor, and this was kept secret and was unique to different models of machine, but even if this wiring layout was discovered, the total number of possible configurations has been calculated to be around 10²³ so it wasn’t possible for somebody to attempt a brute force attack by trying every possible configuration. So despite most of the encryption settings only being used for a day, and the initial rotor positions being changed for every message, a large number of messages were encrypted with near-identical settings, and the starting position for the rotors was transmitted just before the ciphertext which was a weakness and that meant that breaking Enigma messages was possible.

Before the war, Polish crypto-analysts had already designed an electro-mechanical machine to test Enigma rotor settings called a ‘Bomba’, but in December 1938 the German military changed their system slightly which meant that the Poles couldn’t decrypt their messages, so they passed all of their work on to Britain and France, and in particular two mathematicians working at Bletchley Park, Alan Turing and Gordon Welchman, who were able to build on this research and exploited the fact that the German messages often contained common words or phrases, such as general’s names or weather reports and were able to guess short parts of the original message. These guesses were called ‘cribs’, and the fact that no letter could be encrypted as itself made guessing small parts of the message easier which reduced the potential number of settings that the Enigma could be in on that day.

It’s estimated that over 100,000 Enigma machines were built, and after the end of World War II, the Allies sold some of their captured Enigma machines to developing countries because they were still considered secure. Not sure I would have bought one and used it, but then, I wasn’t at War with the Allies, not then anyway.

So, because of the Official Secrets Act, the breaking of the Enigma wasn’t disclosed until the 1970s, but since then there has been lots of interest in it and there are several machines on display in museums, including a working model in the NSA's National Cryptologic Museum at Fort Meade, Maryland, where visitors can encrypt and decrypt their own messages.

On April Fool’s Day 2000 a rare model called the Abwehr was stolen from the Bletchley Park museum, and the following September a man who called himself "The Master" sent a ransom note demanding £25,000 and threatened to destroy the machine if the ransom wasn’t paid. In early October the museum said that they would pay the ransom but the deadline passed with no word from “The Master.” Shortly afterwards the machine was sent anonymously to BBC journalist Jeremy Paxman, but three rotors were missing, then in November an antique dealer called Dennis Yates was arrested after phoning The Sunday Times to arrange the return of the missing parts. The Enigma machine was returned to Bletchley Park and a year later “The Master” was sentenced to 10 months in prison after admitting handling the stolen machine and demanding a ransom for its safe return, although he swore that he did not steal it and had been acting for a third party.

After the Enigma, the Germans used another, more complex machine made by the Lorenz company which was used exclusively for the most important messages between the German Army Field marshals and their Commanders in Berlin. The Lorenz used the ‘International Teleprinter Code’ where each letter is represented by five electrical impulses, and messages were encrypted by adding apparently randomly letters to the original text. These obscuring letters were generated by 12 rotors, so cracking these codes again relied on determining the starting position of the rotors.

John Tiltman broke the first Lorenz messages at Bletchley in 1941 using hand based methods that relied on statistics, but by 1944 the Germans started to use more complex methods that meant hand cracking was no longer possible, so they had to build computers to help them with the leg work. I said this would tie in to retro computers didn’t I? Well now it just has.

The first of these computers was called ‘Heath Robinson’ after a cartoonist who designed fantastic machines, and although Heath Robinson worked well enough in proving the concepts, it was slow and unreliable.

So up stepped an engineer called Tommy Atkins, sorry, Tommy Flowers, who designed and built a computer called ‘Colossus’, a much faster and more reliable machine that used 1,500 thermionic valves (vacuum tubes) and was the world’s first practical electronic digital information processing machine - a forerunner of today’s computers, proving that large numbers of electronic circuits could be made to do reliable calculations at high speed.

Lorenz codes had to be cracked by carrying out complex statistical analyses on the intercepted messages, and Colossus worked by using a system of pulleys to feed in the punched paper tape with the message on it through a photo-electric sensing unit. It would attempt to decipher it and feed the results out of an electric typewriter, reading paper tape at 5,000 characters per second and the paper tape in its wheels travelled at 30 miles per hour. This meant that the huge amount of mathematical work that needed to be done could be carried out in hours, rather than weeks. It was said that the hardened steel guide-pins had to be replaced frequently because paper tape travelling at such a high speed soon wore grooves in them!
Mark I Colossus was upgraded to a Mark II in June 1944, and was working in time for Eisenhower and Montgomery to be sure that Hitler had swallowed the deception campaigns prior to D-Day on June 6th 1944. There were eventually 10 working Colossus machines at Bletchley Park.

One or two of the very early stored-program computers were electromechanical and based on relays. A relay being a switch that can be opened or closed automatically by electrical signals and an electro-magnet which can 'pull' the switch contacts together. Relays were a fairly cheap way of implementing computing and control equipment but they weren’t suitable for making storage units. The main disadvantage was their unreliability because of wear and tear and a sensitivity to dust. Also, they weren’t that fast in switching from one state to another. A relay takes a few milliseconds (thousandths of a second) to 'switch', whereas a thermionic valve circuit can 'switch' in less than a microsecond (less than one millionth of a second). In the late 1940s computing speed, much as it is now, was regarded as one of the main advantages of the 'new' type of computer.

In the period from 1948-55 most computers used vacuum tubes in their processors, and there were many types of them, but the main disadvantages of using them is their cathode heaters that use lots of power and are very inefficient both in electronic efficiency and heat dissipation. The heating elements deteriorated over time particularly if the computer was being turned on and off rather than being left running and reliability was a big concern.

In 1947 the basic properties of a transistor were discovered at the Bell Telephone Laboratories in America. The earliest experimental use of transistors in a computer was in 1953, but they weren’t commercially available until 1956, and it wasn’t until the mid-1960s that valves finally became obsolete.
The early transistors used point-contact germanium but they were replaced by the more reliable surface-barrier and junction transistors which were in turn replaced by silicon transistors, and by the end of the 1960s the planar silicon integrated circuit or 'chip' had truly arrived, and each one of these developments brought reductions in cost and an increase in efficiency.

Colossus 2 is believed to have contained all the elements of a modern computer except an internal program store, but the nature of the problem it was built to solve and the requirement for high computing speeds meant that program store would have been an expensive and unnecessary luxury. The Bletchley Park machines were built for a specific purpose and their success in breaking the so called 'unbreakable' German Geheimschreiber ciphers completely justified their design and build. On a more general level, they proved that high-speed digital computing could be carried out reliably using thermionic valve circuits, and there is some evidence to suggest that the Colossus did have a huge effect on the official thinking towards digital computers.

So, these code breaking computers were perhaps the start of the computer as we know it today, and although we perhaps won’t travel so far back in time in future, we’ll look at some of the early computers and see if we can’t find some parallels to the computers we had in our homes in the late 1970s and early 1980s, when computers really were computers.

Submit "The Bi-Weekly British Backtrack - The Enigma Machine" to Digg Submit "The Bi-Weekly British Backtrack - The Enigma Machine" to Submit "The Bi-Weekly British Backtrack - The Enigma Machine" to StumbleUpon Submit "The Bi-Weekly British Backtrack - The Enigma Machine" to Google

Tags: None Add / Edit Tags


Retro Gaming RoundUp