Page 2 of 2
Clearly the one time pad is an excellent code but for the twin requirements that it have a key as long as the message and one that has to be known in its entirety by the sender and the receiver. A simple modification is to replace the key tape by a pseudo random number generator and this is exactly what the German cryptographers did to encode their teletype messages. A system of mechanical disks were used to generate a complex binary sequence that looked complicated enough to look random. The sequence that was generated only depended on the setting of a number of in/out pegs on each wheel. You can think of this as a "seed" that specified the start of the pseudo random sequence. Of course this simplicity was bought at the expense of a less than perfect encryption. As the key sequence was only pseudo random there were still patterns and regularities in the encrypted text that a code breaker could make use of.
In this case the code breakers were part of the Bletchley Park operation who also broke the Enigma code. The Enigma code could be solved using manual and electro-mechanical methods but the teleprinter code needed something faster. The cryptologists had determined that, as a first step, a special key tape had to be tried against a received message in every possible starting position. At first the solution seemed obvious. All that was needed where two paper tape loops. One would consist of the message and the other the probe key. The two loops would be run together in sync and the mod 2 sum of each character formed by electronics. Each time round the two loops would shift by one character until all possible combinations had been tried out.
Easy? Well yes as long as you can figure out a way of running the tapes at high speed. This proved to be very difficult because of the need to use sprocket holes to keep the two tapes in sync. The top speed attainable by the first attempts - machines called Robinsons after Heath Robinson's ramshackle fantasy machine cartoons - were far too low.
At this point the Post Office and Dollis Hill enter the scene in the guise of Tommy Flowers. He was an engineer in the traditional mould. Not an academic in the sense of having a degree but a skilled practical man well in touch with the electronics of the time. He had proved to his own satisfaction that any electro-mechanical switching system can be replaced by valves. Tommy Flowers worked for the Post Office research station based at Dollis Hill and, in the days before BT, it was involved in all areas of communications including telephones and radio.
Tommy Flowers (1905-1998)
Bletchley Park asked the Post Office for help building its Robinson machines. By good luck they got Tommy Flowers and he had ideas. After some time though he realised that the whole problem of synchronisation of high speed tapes could be avoided by getting rid of one of the tapes! How? Simple just store the bit pattern in the probe key tape in a semi-permanent memory, add some fast electronic mod 2 addition hardware and there you have Colossus - a valve based computer built two or three years before ENIAC. (In fact the first Colossus was finished the year work started on ENIAC.)
Colossus in use
So was Colossus the first digital computer?
In most people's opinion it wasn't.
It was closer to a special purpose digital signal processor. Many of the logic units and principles of its operation are seminal computer techniques. It used synchronous clocked logic, had a memory, main control unit, branch logic and arithmetic units. At the time a bigger innovation was the simple faith needed to use so many unreliable valves. The trick was simply not to turn them off and weed out the early failures. After the initial burning in phase, valve failures were less of a problem than the electromechanical typewriters and the opto-paper tape readers.
The first Colossus used 1500 valves - a huge number for the time and hence the name. The production machines used over 2000 valves and a number of electromechanical relays. Given that it was also all direct coupled DC logic the whole thing was an amazing achievement.
Twelve Colossus machines were commissioned and eleven were built and each incorporated minor differences to cope with the demands of the cryptographers. There was a natural tendency to build special hardware to speed up operations rather than generalise the hardware and use software as a solution.
The Colossus team never made any attempt to formalise the stored program idea. In other words, its programs were built into it as part of the hardware and not stored along with the data. Mind you this is also true of ENIAC which is often cited as the first digital computer.
For the legacy of Colossus you have to look to Alan Turing and the ACE computer system and the Manchester machines and these mainly made use of the fact that Colossus had proved that huge valve machines were possible.
For more information about Colossus and the rebuilding efforts of Tony Sale see: The Colossus Rebuild Project. For more general information on the code breaking efforts during WW2 see Bletchley Park National Codes Centre.
Why was Enigma so easy to break?
In principle the task of breaking the Enigma code was next to impossible. To crack an encrypted message would involve trying over 200 million, million, million possible keys - assuming that you knew the way that the Enigma machine was wired up. In fact the wiring of the Enigma machine was known as the result of espionage but the problem still seemed to be impossible. Indeed if the Germans had not made mistakes in the use of the machine it would have been very difficult to make progress and even more difficult to prove to anyone that the resources should be dedicated to cracking the code - after all why attempt the impossible.
The mistakes made in using the Enigma are a catalogue of simple human errors. The first mistake was in always coding a three letter "discriminant" twice at the start of every message. This gave the code crackers an example of three letters and two of their possible codings. A similar mistake was to always use very standard and very long addresses within their messages. They also never varied the content of their common messages. For example remote stations would often send "Nothing to report" messages which provided perfect material for any attempt to find the key currently in use for these and more important messages. By using these known parts of encrypted messages, "cribs" in the jargon of the time, the problem of finding the key chosen for the day was possible and once you had the key you could read all of the other traffic.
One amazing lapse of good operating practice happened early on in the war. The clerk in charge of making up "random" keys to be used each day obviously got bored with the tedious task. Instead of generating new keys for each day he went back to the key book used for the previous year. Once the code breakers noticed this fact obtaining a single key for the day allowed them to look up the other keys used in conjunction with it the previous year. In other words, breaking a single key allowed them to read every message for the entire day!
As the war progressed the German's did tighten up on their procedures but the early lapses gave the British code breakers the information and the start they needed to keep up with the situation. Finally why did the secret remain secret for so long? Could it be anything to do with the fact that the British sold machines similar to the Enigma to its allies after the war?