Cipher Code Book
Cipher Code Book
com
This work is licensed under a Creative Commons Attribution 4.0 International license (CC BY
4.0). This license allows you to share, copy, distribute and transmit the text; to adapt the text
and to make commercial use of the text providing attribution is made to the authors (but not
in any way that suggests that they endorse you or your use of the work).
Some of the material in this book has been reproduced according to the fair use principle which
allows use of copyrighted material for scholarly purposes.
© Stephen Robertson, B C, Before Computers: On Information Technology from Writing to the Age of
Digital Data. Cambridge, UK: Open Book Publishers, 2020, https://doi.org/10.11647/OBP.
0225
In order to access detailed and updated information on the license, please visit https://www.
openbookpublishers.com/product/1232#copyright
All external links were active at the time of publication unless otherwise stated and have been
archived via the Internet Archive Wayback Machine at https://archive.org/web
Cover image: Katsushika Hokusai (1760-1849), A merchant making up the account. Wikime-
dia https://commons.wikimedia.org/wiki/File:A_merchant_making_up_the_account.jpg
Public Domain.
Cover design: Anna Gatti.
12. Ciphers
Throughout history, people have felt the need to write messages (point-to-
point messages, in terms of our previous discussion) that would be unread-
able to anyone other than the intended recipient, specifically to anyone who
might intercept it en route. Military commands, intelligence reports, in-
structions to agents, love letters, arrangements for meetings, plans for any
kind of action or activity that could prompt counter-measures of any kind by
any third party—all these and many more might be deemed by the sender
to need encryption.
Since the word code is somewhat overloaded in present-day usage, I will
use the word encryption to indicate putting some message into code, in such
a way that it can only be read by someone who has the key to the code, and
cipher for the method or rules for doing so. The original message is plain
text and encryption results in the encrypted or cipher message. Recovering
the plain text (given the key) is decryption. Discovering the key, or even
the complete cipher system I may still refer to as code-breaking, in deference
to popular usage. The whole subject, of designing ciphers and of breaking
them, and of studying their properties (such as whether in principle they
are breakable) is cryptography.
A book with a marvellous account of the different kinds of ciphers that
have been used through history, and of the efforts of opponents to break
them, is Simon Singh’s The Code Book. Much of the rest of this chapter is
drawn from Singh’s book.
From the beginning and to this day there has been some use of word-based
coding systems. A report in a newspaper on my table today describes a
case in which some alleged terrorist plotters “used code words” for some
possibly suspicious-sounding words, like firearms. But such systems are
really intended to disguise or camouflage a coded message, rendering it less
suspicious and therefore less likely to attract attention. Another approach
is to hide the existence of a message altogether.
However, most of cryptography addresses the question of how to render
a message unreadable even when the adversary is in possession of what he
or she suspects or knows to be a cipher message. Once again, it is hard to
conceive of much of the history of encryption without the alphabet. Most
encryption systems throughout history have been alphabet-based. Ciphers
typically involve either or both of: re-arranging the letters of the message,
and/or substituting different characters for those in the message. Even in
Japan and China, we see evidence of the use of alphabets or alphabet-like
symbol sets for encryption. Japanese ciphers tend to be based on one of the
phonetic alphabets (kana), while a Chinese cipher might use, for example,
either a phonetic alphabet or the so-called Four Corner method of encod-
ing each character into four or five numbers, which is also used as a sort of
substitute for alphbetical order, for sorting and then looking up characters.
Given an alphabet, one of the simplest kinds of encryption is to substitute
for each letter in a message the letter three places further on in the alphabet
12. Ciphers 133
(this was a cipher used by Julius Caesar). If I do this with the heading of
this section, I get
The Vigenère cipher is much stronger than the simple substitution of the
alphabet shift, and was thought to be unbreakable. In the example, you
can see that the two As in alphabet are represented by different letters in
the cipher text. But it can be broken—the man who established this fact is
134 B C, Before Computers
Code breaking
Given that the processes of encryption and decryption are normally based
on well-defined rules, it’s a little surprising that the use of mechanical aids
was relatively slow to get going. Simple substitution ciphers require no
more than a two-row table: plain-text letters on the top row and substitutes
on the bottom. The Vigenère cipher requires a square table, with each of
the 26 possible alphabet shifts on its own row. Even the one-time pad is
essentially paper-based.
However, it is also possible to make a simple mechanical device to help
136 B C, Before Computers
Enigma
the offsets are one-third of the key width. Experienced touch-typists would
have noticed this!)
the complexity arose not so much from complex rules, as from a combina-
tion of many applications of simple rules. This is exactly the province of the
machinery of the time, and it is no surprise that encryption and decryption
should have succumbed to some such form of mechanisation, not long after
the typewriter and the comptometer.
Breaking Enigma
Post-war cryptography
Despite the fact that cryptography really entered the machine age only after
the First World War, the challenge of cryptanalysis and code-breaking must
really be credited with kick-starting the IT revolution of the second half of
the twentieth century. In the end, we did not invent computers in order to
control machinery, as Jacquard might have done; we did not invent comput-
ers in order to do repetitive numerical calculation, as Babbage tried to do.
We did not invent them to analyse censuses; nor to organise our accounts or
do payroll; nor to do weather forecasting; nor to do word processing; nor to
140 B C, Before Computers
facilitate telecommunications; nor to play our music or look after our pho-
tographs—though they are very useful for all of these things and more. We
invented computers in order to break codes.
The operation of Bletchley Park depended very heavily on people: col-
lecting, transcribing, analysing the intercepted cipher messages. Initially,
all analysis was entirely by people, using essentially pencil and paper, and
human effort remained central to the code-breaking task. However, early
in the war the great Alan Turing designed a machine called a bombe, which
greatly helped in eliminating many possible initial settings (given a crib, a
human guess as to the plaintext version of a particular section of the cipher
text). This invention allowed Bletchley Park, for much of the war, to discover
the day’s new key settings early in the day, enabling the decryption of any
further messages that day as soon as they were received.
Later in the war, the Bletchley Park effort had serious difficulties with
another German system, the Lorentz cipher. This was similar to Enigma
but more complex, and it typically took weeks to break one day’s messages.
Max Newman, another Bletchley Park mathematician, started developing
plans for a new machine that would be much more adaptable than the
bombe—in fact, it was what we now describe as programmable. This was
much more difficult to build than the bombe, but eventually in late 1943 the
engineer Tommy Flowers designed and constructed a working version, us-
ing thermionic valves (as used in early radios). It was called the Colossus,
and with its help, the keys for Lorentz-ciphered messages could be discov-
ered quickly.
Colossus was the clear forerunner of the modern computer. It was elec-
tronic, digital, and in some sense programmable, and used many of the ideas
and principles and methods that a modern computer scientist would regard
as essentially those of a computer.
An act of vandalism
Then, at the end of the war, the entirety of what had been the Bletchley
Park operation was eliminated. Winston Churchill, who had been the chief
backer of Bletchley Park, ensuring funding for it against opposition from
some quarters, demanded that all evidence of the UK’s cryptographic abil-
ities should be utterly erased. Not only was Colossus itself destroyed, but
12. Ciphers 141
all the blueprints for it were burnt. All Bletchley staff were required to keep
silent about anything at all that went on there.
Despite my heading, vandalism is a poor word to describe Churchill’s ac-
tion. It was a 2000-year throwback to the first emperor of China, in the sec-
ond century BCE—burning the library, in order to suppress the subversive
knowledge held therein.
But it’s hard to kill an idea like that. In the world of the 1940s, outside
Bletchley Park, some of the necessary ideas were already coming together.
A project between IBM and Harvard University, masterminded by Howard
Aiken, developed the Harvard Mark 1, a giant programmable calculator
with many computer-like features, which first ran in 1943. The destruction
of Bletchley Park left behind, in addition to the handful of eccentrics who
believed in the possibility of building a computer, another handful who had
actually seen one in operation. Within a year or two immediately following
the war, academics in the UK (at Manchester and Cambridge) and in the
US (in Pennsylvania and elsewhere) started building computers. Within a
very few years, the computer age had taken off.
But that’s another story.