The Jacquard Mechanism: Legacy

Code Breaking and Computing

Do you use a computer or rely on any digital technology? Yes, thank those holes in card again! This is the enduring legacy of the Jacquard mechanism and punch cards.
Codebreaking during the Second World War played a key role in furthering the development of modern computing. Punch cards and punched paper tape were invaluable to the code breaking process at Bletchley Park.

Bletchley Park Mansion, Source: DeFacto, Wikimedia Commons

A Tale Of Two Ciphers

There were two cipher systems used by the Germans during the Second World War. The famous Enigma machines were compact and portable. They required operators at each end to use the machine. At one end messages had to be written, encrypted on the machine, converted into Morse code and then transmitted. At the other end operators had to receive the Morse code message, decode it and decipher it on the machine.
As well as Enigma there was also the less well known and far more advanced Lorenz cipher machines. These were much more efficient and easier to use as the machine automatically enciphered the text entered by the operator. It was essentially an attachment to a teleprinter which used the 5-bit Baudot code of telegraphy teleprinters (see part 3 of this series for information about the Baudot telegraphy code and the influence of the Jacquard mechanism on telegraphy). Lorenz cipher machines were far more secure and were used by German high command to send the highest security messages.

Enigma
An Enigma Cipher Machine, Wikimedia Commons
The Enigma machine was invented by Arthur Scherbius (1878 – 1929) in 1918. Scherbius was co-founder of the German firm Scherbius & Ritter and their cipher machines were manufactured and marketed commercially from about 1924 under the brand name of Enigma. Enigma machines were used by the Government and military of several countries and various models were produced. From the mid 1930’s the German military was preparing for war and began ordering new Enigma machines.

Enigma machines use three rotors with a standard 26 letter alphabet to encipher messages using a shift substitution method for each letter. Press a letter key on the keyboard and a different letter will light up. The order of the rotors can also be chosen. The starting position of the rotors is the key to the cipher. There are many possible permutations.
Some maths: In a basic Enigma machine there are 6 different possible orders for the 3 wheel rotors (3 x 2 = 6) and 17,576 rotor states (26 x 26 x 26). This gives 105,456 possible paths for a letter when it is enciphered (6 x 17,576 = 105,456).

The German military grade models were more complex. They included a plugboard, which could connect 10 pairs of letters, to increase the number of possible settings. The user also had a choice of which 3 rotor wheels to use out of a set of 5.

Some more maths! There are now 60 possible rota position choices, 5 choices for first rotor, 4 choices for second rotor and 3 choices for third rotor (5 x 4 x 3 = 60). There are 17,576 rotor wheel states (26 x 26 x 26 = 17,576). This gives 1,054,560 possibilities (60 x 17,576 = 1,054,560). Add in the 150,738,274,937,250 different combinations of connecting the plugboard. This then gives a total number of possible ways a letter can be enciphered as 158,962,555,217,826,360,000.


How do you then find the one correct setting to crack the code? Mistakes, whether careless or lazy, on the part of the Enigma operators are very helpful. Also Enigma could not encipher a letter as the same letter. Some educated guesswork about phrases or letters that might be contained in messages is necessary. Above all, it is a process of elimination. This is where punched holes can help.

Polish Cipher Bureau Mathematicians that deciphered the Enigma code. Wikimedia Commons

Enigma machine ciphers were actually being broken from 1932 by the Polish Cipher Bureau. Three mathematicians in particular contributed an astonishing amount to the Enigma solving process. Marian Rejewski (1905 – 1980) and his colleagues Jerzy Różycki (1909 – 1942) and Henryk Zygalski (1908 – 1978). “Zygalski Sheets” were sets of perforated sheets that could work out the key positions of the rotas in the Enigma machine. The sheets were originally cut by the mathematicians themselves using razor blades. Painstaking work!

The Polish team also created and built a machine they named the Bomba to find the Enigma key settings. It was essentially several Enigma machines linked together. Rejewski had been able to reverse engineer a military grade Enigma machine after working out though pure mathematics how it operated. An extraordinary achievement!


A Zygalski Sheet, Wikimedia Commons

When the Enigma machine was made more complex, with the additional of extra rotors, the small department needed more resources. The Polish provided their intelligence to the French and British in 1939 just before the start of the Second World War. This gave the Bletchley Park team a critical advantage and head start in the Enigma code breaking process to follow.

Zygalski sheet sets were also made in Bletchley Park from the end of September 1939. It was John R. F. Jeffreys (1916 – 1944) that was put in charge of the small group at Bletchley Park to manufacture these perforated sheets. Jeffreys was part of the now famous codebreaking team at Bletchley Park headed by Alfred Dillwyn “Dilly” Knox (1884 – 1943), which included Gordon Welchman (1906 – 1985), Alan Turing (1912 – 1954) and Peter Twinn (1916 – 2004).

Jeffreys developed his own perforated sheets known as “Jeffreys sheets”. Accurately cutting sets of these perforated sheets took over three months, with more than 3000 sheets in total. The painstaking accuracy required is incredible! In mid December 1939 the ceremonial punching of the “two-millionth hole” was performed by Commander Alastair Denniston (1881 – 1961), the operational head of GC&CS (Government Code & Cypher School). Alan Turing took the finished set of perforated sheets to the Polish team in France, where the first breaking of the wartime Enigma code took place on 17 January 1940.


Rebuilt Bombe at Bletchley Park, Wikimedia Commons

Turing was also instructed by the Polish team on the workings of their Bomba machine. Turing was then able to design his own version of the machine, called the Bombe. It allowed for a more general principle, which assumed the likely presence of a piece of text (known as a crib) at a defined point in the message. This technique is referred to as “known plaintext attack”. The machine essentially sorted through the possible starting positions of the Enigma rotas. Gordon Welchman added an improvement to the machine in the form of a diagonal board that improved efficiency. The company that engineered and built the Turing-Welchman Bombe was the British Tabulating Company that also made the Hollerith equipment.

Harold “Doc” Keen (1894 – 1973) was the engineer responsible for building the Bombe. He has worked for the British Tabulating Company since 1912 and from 1923 was head of the Experimental Department at the company. In the 1930’s he had become Chief Engineer and he was regarded as the leading British innovator of punch card technology. His nickname “Doc” comes from the case like a doctor’s bag in which he carried around all his tools and paperwork.


British Tabulating Company Rolling Total Tabulator Source: bombe.co.uk/punched-cards-at-bletchley-park

Bletchley Park also used lots of Hollerith machines. They were essential to the code breaking process. Housed in Hut 7 at Bletchley Park, the Hollerith machines would tabulate, sort and compile the vast amounts of data coming from the deciphered Enigma messages. This created an invaluable index of information that was used as a reference source for the cryptographers.
A staggering 6 tonnes of card stock, around 2 million individual punch cards, were used each week!

In the early stages, much of the card punching process was done by hand. One Bletchley Park veteran recalled how she was bored to tears while learning how to punch the information onto the cards. Each day the Enigma messages being processed could involve around 80,000 characters, which then had to be punched onto the cards.

As with Jacquard card cutting an incredible level of concentration and attention to detail was required. Not easy in a repetitive process. And of course, any mistakes would ruin the work of the codebreakers (just as Jacquard card cutting errors would ruin the work of the weaver). Accuracy was essential.


Lorenz
A Lorenz SZ42 cipher machine with its covers removed at The National Museum Of Computing on Bletchley Park, Source: Ted Coles, Wikimedia Commons

Lorenz cipher machines SZ40 and SZ42 were designed and built by C. Lorenz AG, a German electrical and electronics firm that developed and made products for telegraphy along with other communications like radio and radar. It was essentially an attachment that went onto a teleprinter. The Lorenz cipher was even more problematic to crack. There were 12 rotors and it enciphered messages using the Vernam cipher method.

The Vernam cipher, named after Gilbert Vernam (1890 – 1960), is a stream cipher where the plaintext (message you want to send) is combined with a keystream (random stream of data) to produce the ciphertext (encrypted message). The encrypting (adding the plaintext and keystream) is done using a logical “exclusive or” function (XOR), which means the outcome is only a 1 when the two inputs differ. If the inputs are the same the outcome is a 0. The mathematical term is “modulo 2 addition”. This means the encryption process can be undone using the same XOR function to reveal the plaintext. Plaintext + Keystream = Ciphertext so Ciphertext + Keystream = Plaintext.

In theory the Vernam cipher is technically unbreakable as long as the keystream is truly random and is used only once. For a more detailed explanation of the Vernam cipher with Baudot code look here: https://www.cryptomuseum.com/crypto/vernam.htm


Baudot-Murray ITA2 Paper Tape Source: Ricardo Ferreira de Oliveira, Wikimedia Commons

Enciphered messages were sent via teleprinter using the 5-bit Baudot alphabet on punched paper tape. A message would often contain thousands of characters which could include letters, spaces and punctuation. Enigma messages were generally no longer than 250 to 300 characters long. The process was also not helped by the fact that, unlike Enigma, no one had any idea of the actual workings of the Lorenz cipher machine.

Incredibly, the cipher was successfully broken. In August 1941 German Lorenz cipher operators made a critical error when two versions of the same message were transmitted using identical settings. They had broken the golden rule of the Vernam cipher: only use a keystream once.

This was a big breakthrough for the two departments at Bletchley Park working on the Lorenz cipher, the Testery (headed by Ralph Tester 1902 – 1998) and the Newmanry (headed by Max Newman 1897 – 1994). They now had a way in. It was William Tutte (1917 – 2002) that established the workings of the Lorenz cipher machine through mathematical analysis of intercepted encrypted messages. This is remarkable considering no-one had ever seen one of these cipher machines.

Again, punched paper tape proved invaluable to the entire process from interception to deciphering.

The cipher was first noticed in mid 1941 when British radio operators at the listening stations began hearing a fast musical rhythm very different from the usual transmissions. This non Morse radio traffic was given the name “Fish” and different fish names were given to different networks. The messages encrypted using the Lorenz cipher machines were known as Tuna or “Tunny”.
These transmissions were mostly intercepted at the Radio Intercept Station at Knockholt in Kent. Given excellent reception, intercepted signals could be recorded in three versions: via Undulator Tape, via Teleprinter Tape and via Perforated Tape. Undulator Tape, known as “slip” was always the most reliable even when faster teleprinters and perforating machine for recording were later introduced. It records the intercepted signal as a continuous wavy line drawn in ink. The peaks were dots or 0’s (no hole in the paper tape) and troughs were crosses or 1’s (hole in the paper tape).

Undulator Tape, Source: Ted Coles, Wikimedia Commons

It was the job of the “slip readers”, (who were always women) to read the undulator tape and then transfer the message onto the punched paper tape. A skilled slip reader could read the letters on the undulator tape at a rate of thirty words per minute! This was a skilled job and it required more than just extreme accuracy, it required perfection. Two months training was needed before a slip reader was even allowed into the Slip Room. Two hundred people were eventually working at Knockholt by the end of 1944 reading, checking and transcribing slip.


Knockholt Receiver Control Bay, Source: GCHQ, Crown Copyright

Once the slip had been transcribed to the punch paper tape in the Perforation Room it was checked and confirmed to be accurate before it was transmitted twice to Bletchley Park via teleprinter using the punched paper tape. The two received copies at Bletchley were compared. If they were not the same it showed an error in transmission so they would have to be sent again. Only if they were the same could it be safe to assume they were error free. Copies of the punch tape from Knockholt were then also sent to Bletchley by motorcycle dispatch rider in case further checking and confirmation was required. Irving John “Jack” Good (1916 – 2009), who worked with both Turing on the Enigma cipher and in the Newmanry on the Lorenz cipher, coined the phrase, “If it’s not checked it’s wrong”.

This amount of care was absolutely necessary. If a single character was wrong or missed out anywhere along the chain, from message interception to transmission to Bletchley, it would prevent the codebreakers from finding the wheel settings for the Lorenz cipher machine. A total of 27,631 messages were sent from Knockholt to Bletchley Park. 13,508 of these were successfully deciphered, a total of 63,431,000 letters. That is a lot of punched paper tape!


Tommy Flowers, Wikimedia Commons

Tommy Flowers (1905 – 1998) was an engineer for the British General Post Office. He engineered and built the machines to find the keystream for the Lorenz ciphers. The first of these was called Heath Robinson, which used electro mechanical switches and relied on two punched paper tapes, one for the encrypted message and one to represent part of the keystream. The tapes, however, must be kept exactly in sync for it to work. This was not very practical.


A Colossus computer being operated by WRENS at Bletchley Park. The slanted control panel on the left was used to set the “pin” (or “cam”) patterns of the Lorenz. The “bedstead” paper tape transport is on the right. Public Domain, Wikimedia Commons

Tommy Flowers then built Colossus and this is now considered to be the first electronic programmable computer. It used thermionic valves (vacuum tubes) and one punched paper tape, instead of two, so there was no problem of the tapes getting out of sync. The data input from the punched paper tapes was read by light sensitive cells that converted the pattern of punched holes to electrical pulses. Colossus could read the punched paper tape at a rate of 5000 characters per minute and the paper tape would be moving at around 30 miles per hour! It is a phenomenal achievement. The replica Lorenz cipher teleprinter machines called “Tunny Machines”, could then decipher the plaintext message.

For more detailed information about all aspects of the whole codebreaking process at Bletchley Park visit this website created by Tony Sale. He led the project to rebuild a working Colossus. https://www.codesandciphers.org.uk/


Modern Computing

After the war Max Newman was appointed Fielden Chair of Pure Mathematics at Manchester University and secured funding from the Royal Society for a new computer project. Some of his team that worked on Colossus at Bletchley Park, including Jack Good, joined him to develop a new electronic programmable computer – the Manchester Baby.


Alan Turing, Wikimedia Commons

Alan Turing was of course hugely influential in modern computer science. His 1950 paper “Computing Machinery and Intelligence” is a discourse about Artificial Intelligence and the question of whether machines can think – the famous Turing Test. In the paper he presents nine possible objections to the question. One is these is “Lady Lovelace’s Objection” and quotes her writings on Charles Babbage’s Analytical Engine “The Analytical Engine has no pretensions whatever to originate anything. It can do whatever we know how to order it to perform.”


A deck of punched cards comprising a computer program, Source: Arnold Reinhold, Wikimedia Commons

Punched cards continued to be used in computers for programming using languages such as FORTRAN. In the mid 1980’s, when magnetic discs and computer hardware became a more affordable and text editors and terminals developed, punched cards started to become obsolete. Modern Jacquard mechanisms are also controlled by computers. The modern digital age and the processing power available, even in the most basic computer or smartphone, would have astounded Charles Babbage and Ada Lovelace.

A Lasting Legacy

Holes in card and punched paper tape have truly changed the world. They revolutionised the textile industry heralding in the First Industrial Revolution and they have played a critical role in developing what is often referred to as the Third Industrial Revolution – the digital revolution. Computers and digital technology now play an increasingly integral part in everyday life from data and communication to work and entertainment.

And it can all be traced back to the development of the punch card system for automating the weaving process and the incredible influence of the Jacquard mechanism.