25.1 Message encryption, decryption, and code breaking 525
that code breaking should not be confused with the nobler, academic notion of code
cracking.
1
In any case, the task of trying either to “break” or “crack” a code is referred
to as an attack, giving a military flavor. Codes may be attacked either by sophisti-
cated cryptanalysis algorithms or, more directly, by sheer “brute force” (hence the name
brute-force attack in crypto jargon). This latter approach refers to various techniques of
guessing keys at random, exploring what is referred to as the keyspace. For an N -bit
key size, the keyspace corresponds to 2
N
possibilities. In code breaking, rapidity of
execution is essential, because the plaintext is generally not only content-sensitive but
also time-sensitive. This is the reason why successive generations of cryptosystems and
key sizes have been designed to make it virtually impossible to a third party, even a
state with powerful cryptanalysis and computing means, to break them. With a key size
of N = 64 bits, the keyspace is 2
64
= 10
64 log 2/ log 10
= 1.8 × 10
19
. At a rate of trying
out one billion keys per second, a brute-force attack would, thus, require 1.8 ×10
10
seconds, or some 570 years to explore the full keyspace! Clearly, each extra bit of key
size doubles the number of key possibilities. Nowadays, some cryptosystems may use
key sizes as large as N = 512 bits or N = 1024 bits, corresponding to huge keyspaces
of 10
154
and 10
308
, respectively. However, one should not conclude that cryptosystems
become absolutely safe against attacks when the key size is sufficiently large. This sub-
ject being beyond the scope of this chapter, suffice it to state here that one should not
underestimate the power of cryptanalysis, and also that the generation of truly random
keys is not technically simple. If a code breaker can guess the algorithm used to generate
the random keys, his or her task is simplified. But the most straightforward approach
is to intercept the key itself, at the time the communicating parties are doing what is
referred to as the key exchange.
Indeed, the weakness of cryptography lies in the fact that, in order to work, the secret
key must be communicated one way or another to the recipient. Such an exchange is
not without risk of interception, no matter how rapid and periodically changing. Clearly,
the worst situation is to be confident in the safety of a cryptosystem, while the channel
used to exchange the keys is in fact being wired! As a matter of fact, cryptography faces
a double security problem: transmitting the secret key without any measurable risk of
interception, and remaining virtually invulnerable to cryptanalysis.
The history of cryptography, or cryptology, represents a succession of increasingly
sophisticated cryptoalgorithms, which have invariably been broken at some point by
sheer cryptanalysis.
2
Most ancient and pre-computer-era algorithms have been based
1
Theconceptofcode cracking is somewhat different. It could be defined as breaking a code for the first
time. Put simply, code crackers are “champion” code breakers. The goal of code crackers is not so much
to retrieve secret messages (for which they usually cannot care less) as to prove to history that they have
been able to “crack” a previously reputed “invulnerable” or “unbreakable” cipher. Code cracking may be
viewed as a noble academic attempt to explore the limits of cryptosystem security, with a view to improve
the algorithms, or just as an engineering challenge to test security and standards.
2
For fascinating accounts of cryptology, from ancient to modern times, see, for instance: D. Kahn, The
Code Breakers (New York: Scribner, 1967); S. Singh, The Code Book (New York: Anchor Books, 1999);
S. Levy, Crypto, (New York: Penguin Books, 2001).