Cryptography: Essay 15
Cryptography: Essay 15
Cryptography: Essay 15
Cryptography
Marshall D. Abrams and Harold J. Podell
History. Since the time of Julius Caesar and even before, people have
protected the privacy of their communications by cryptography. Things
are still that way, and yet everything is quite different. People continu e
to use cryptography, though far more sophisticated than Caesar’s, to
protect their vital information as it passes through possibly hostile envi-
ronments. Rather than crossing a few hills on its way to Rome, their
data is moving from one point in the space-time continuum to another.
Messages and documents created at one place are delivered at a later
time at some distant place. When transmission of messages and docu-
ments is by electronic means, delivery is at essentially the same time
but at a different place. A file created on a computer can be recovered at
the same place but at a later time or, if it is copied onto a diskette, at
some other place and at some later time.
Historically, cryptography has been used chiefly in communications. Its
application in data retrieval is a far more recent occurrence. We shall
tend to use the language of communications in describing cryptographic
mechanisms, but the reader should keep the other examples in mind as
well. The physical security and/or the access control mechanisms,
whether they are on communications links, on network nodes and
switches, on mainframes, file servers, and PCs, or on diskettes in transit,
may not be sufficient to assure the confidentiality and the integrity of the
data that passes through them. Cryptographic mechanisms are available
that go far in establishing assurance in all these environments.
The word cryptography and the associated word cryptology have very
similar etymological origins. They are derived from the Greek words krip-
tos, which means “hidden”; graphos, which translates to “writing”; and
Cryptography 351
logos, which is “word” or “speech.” In current usage, however, they have
slightly different meanings. Cryptography is the science of hiding infor-
mation. Encryption, sometimes called encipherment, is the act of con-
cealing the meaning of a message. Decryption or decipherment is the
inverse process of returning it to its original form. Any other, unauthor-
ized method of recovering the original message is known as cryptanaly-
sis or “breaking” the message. Cryptanalysis is the combination of
science, art, and luck used to break messages or entire systems. The
word cryptology nowadays refers to the study of both cryptography and
cryptanalysis. When designing a strong cryptographic system, it is neces-
sary to consider all possible attacks. In this essay, however, we discuss
cryptography only. We include only such references to cryptanalysis that
aid the reader in better understanding the strength of a particular cryp-
tosystem.
What is a cryptosystem?
Cryptography 353
placed the most frequently used letters of the Russian alphabet by sin-
gle digits and all others by pairs of digits. It was done in such a way that
there was no ambiguity on decryption how to divide the sequence of dig-
its into single and double digit letters. The sequence of digits produced
by the substitution was shuffled using a rectangular-array permutation
cipher, as we have described.
The result was modified again by another rectangular-array permuta-
tion cipher. The dimensions of the second array were different from the
first. The second cipher also featured triangular perturbations of the
array. A letter written in this cipher was instrumental in the conviction
of Abel. However, the cipher itself was so strong that it was never bro-
ken. Its workings were described to the authorities by Abel’s assistant
Reino Hayhanen when he defected.
The Data Encryption Standard (DES), about which we speak further
on, is another example of a product cipher. We generally include prod-
uct ciphers in a category referred to as conventional or symmetric key
cryptography, because the sender and receiver share the same secret
key.
Let
Then
C = E (E k , M)
Cryptography 355
phers, these cryptosystems are called symmetric key or conventional
systems.
Unintuitive as it may seem at first reading, there are schemes in which
it is computationally infeasible to derive the decryption key from the en-
cryption key. Such cryptosystems are called asymmetric, and we present
the most popular example, RSA (Rivest, Shamir, and Adleman), later in
this essay. Asymmetric systems have a useful property. One can make
the encryption key (E k ) public without fear of disclosing the decryption
key (D k ). Then anyone can encrypt a message, but only the single
holder of the decryption key can decrypt it. For this reason, asymmetric
cryptosystems are also called public key systems. The published key is
known as the public key, while the other is the private key. For certain
public key digital signature systems, encryption and decryption are inverse
functions. For these systems, it makes no difference which is performed
first. However, this symmetry does not apply to other public key digital sig-
nature systems such as ElGamal, the associated Schnorr algorithm, and
the proposed US Federal Digital Signature Standard (DSS). We use the
notation of DA for Alice’s private key and EA for her public key.
If the encryption and decryption functions of a public key cryptosystem
commute, that is M (message) = E (E A , D(D A , M) ), even though decrypt-
ing first seems to make no sense, we have another useful characteristic.
Alice, who is the holder of her private key (D A ), can send information
that is modified by applying her decryption algorithm using her private
key. If the recipient, Bob, knows her corresponding public key (E A ), ap-
plying the encryption function to the modified information will give him
assurance of the identity of Alice. In essence, Alice has “signed” the in-
formation by first using her secret or private key, which she alone pos-
sesses. This is an example of a digital signature, of which we speak again
below. Figure 2 illustrates the process.
Types of attacks
Cryptography 357
• Authenticity attack. Doubt of source and delivery to intended des-
tination of a message; doubt of origin of the file or message.
• Integrity attack. Modifies information content.
• Ordering attack. Changes sequence of information arrival at des-
tination; changes order of records in file.
Cryptography 359
Essay 17, uses two algorithms, RSA and DES, and a variation of CCITT
X.509.
CCITT X.509 is one of several CCITT standards that pertain to secure
international networking. For example, CCITT X.400 pertains to Mes-
sage Handling Services and does not assume the directory service.
CCITT X.500 defines the use of certificates for Directory Service, and
X.509 defines Secure Directory Service.
In addition to the standardization of encryption functions, there are
international requirements for the registration of cryptographic algo-
rithms. For example, the organizations that use nonpublic algorithms
for secret messages may wish to identify these algorithms by neutral
identifiers. Certain evolving protocols could be used to support this type
of communication need. The Secure Protocol (SP) 4 at the Transport
Layer is such a protocol, and it is being considered by ISO (International
Organization for Standardization). ISO is also working to facilitate the
registration of cryptographic algorithms.
The strength of DES. The DES algorithm is well publicized and has
withstood intensive attempts of many people the world over, who have
tried and are trying to break it. Even though none of these efforts has
yet succeeded, considerable insight into the inner workings of this and
similar algorithms has been developed. At the time of writing, NIST has
reaffirmed DES in hardware and certified software implementation of
DES.
From the beginning, a major criticism of the DES has been the fact
that each key has only 56 bits. That makes a key space of only 256 or
about 7.2 × 1016 different keys. The first attack ever suggested against
DES was an exhaustive, known plaintext-ciphertext search. It exploited
the size of the key space as well as the relation between EXCLUSIVE OR
and bitwise complementation. Through a clever trade of time and mem-
ory, it searched for the key that encrypted a stolen DES cryptogram. At
the time, it was estimated that within 10 years a special-purpose device
could be built to do all the needed encryptions in a reasonable time and
at a reasonable cost. No such machine has been announced, but it be-
Cryptography 361
comes more feasible with every improvement of microchip efficiency and
price.
As mentioned, recent attacks on DES by Biham and Shamir [BIHA90]
have shed new light on the inherent strength of DES. Their analysis is a
variation on the chosen plaintext theme. Their approach, which they
call Differential Cryptanalysis, collects many different plaintexts and
their ciphertexts. It catalogs differences in the plaintexts and collects
statistics on the differences in the corresponding ciphertexts. Then,
given a known plaintext-ciphertext pair, they find the most likely key
used in encrypting that pair. The known plaintext-ciphertext pair is
conceptually similar to the pairs on the Rosetta stone. They have
gradually developed their attack that now it threatens a full 16-round
DES. However, the time currently required to complete a successful at-
tack is, at this writing, no better than exhaustive search.
The volume of data that must first be collected and the time needed
to complete an actual attack against a single DES key do not yet seem
to justify the death knell that has been sounded for the standard in re-
cent newspaper articles. Currently, Differential Cryptanalysis is an at-
tack only against Electronic Code Book, the simplest mode of use
included in the standard. It is possible that similar approaches are pos-
sible and will be developed for the other three modes (described below).
It is also likely that the authors of this attack will push its development
further in the hope of making it a meaningful threat.
Modes of operation
The Data Encryption Standard includes a set of standard modes of op-
eration [NIST80]. These and one or two others are appropriate for use
with any block cipher — that is, with any encryption algorithm that acts
on a fixed-size plaintext block. Each mode possesses different character-
istics that are important in different situations. We describe them
briefly.
Electronic Code Book (ECB). The Electronic Code Book mode in-
volves simple block encryption of a message or a file. The process is il-
lustrated in Figure 3. The data is broken into blocks of a standard size.
Each block in turn is the input to the encryption algorithm. The output
blocks comprise the ciphertext message or file. For decryption, that mes-
sage or file is again divided into blocks, and each block is decrypted indi-
vidually. The resulting output blocks are concatenated to reconstruct
the plaintext message or file. If an error occurs in a single ciphertext
block, the decryption of only that block will be corrupted.
Electronic Code Book has a major disadvantage. A single block that
appears several times in the plaintext stream will be encrypted in the
same way each time. Suppose the plaintext is a file of sensitive informa-
Cryptography 363
Cipher Block Chaining (CBC). Cipher Block Chaining (CBC) is one
way to change the encryption of plaintext blocks that repeat. CBC in-
volves the EXCLUSIVE OR (XOR) of every plaintext block with the pre-
ceding ciphertext block. The first plaintext block must be treated
differently. It is XORed with a publicly known initialization vector (IV) or
with a secret initialization vector that is distributed with the key. For
each block, the result of the XOR is the input to the encryption algo-
rithm. The output of that algorithm becomes the next block in the ci-
phertext message or file. It is also XORed with the next plaintext block
before that block is input to the algorithm. Figure 4 shows the process.
Output and cipher feedback modes (OFB and CFB). Output and ci-
pher feedback modes (OFB and CFB) can be illustrated by the US De-
partment of Defense (DoD) Key Auto-Key or KAK and Ciphertext Auto-
Key or CTAK, respectively. Before introducing these examples, we intro-
duce applicable issues pertaining to stream ciphers, length of keys, and
initialization vectors (IVs).
Stream ciphers all have the property that they attempt to integrate
context into the encryption. The key is a long bit stream that is to be
combined, through an XOR or some other operation, with the plaintext
Cryptography 365
stream. What position a particular data segment takes in the plaintext
stream determines with which segment of the key stream it will be com-
bined. If the data segment repeats itself, its different occurrences will
most likely be encrypted with different key stream segments. They will
be encrypted differently.
The key can be either a long, completely random bit stream that must
be delivered to both the encrypting and the decrypting stations, or a
pseudorandom bit stream that is generated as needed. In the latter
case, the authors prefer to reserve the word “key” for the pseudorandom
seed and to refer to the pseudorandom bit stream that is generated as
the “key stream.” It should be noted that, if a pseudorandom generator
is used, it must be cryptographically strong. That means it must not be
possible predict the rest of the key stream even if some keys are discov-
ered or guessed, as it might occur in a known plaintext-ciphertext at-
tack.
One way to create cryptographically strong, pseudorandom bit streams
is to use a block cipher like DES. Some fixed number of bits from the
output block are added to the key stream on each iteration. The input
to the block encryption algorithm is a shift register or a counter. In the
latter case, the register is loaded with an initial value and incremented
once after each encryption. The decryptor must start his or her counter
at the same initial value. As long as he or she stays in synchronization,
he or she will decrypt correctly.
If the input is a shift register, it must be loaded with an initialization
vector. After each iteration, the register contents are shifted the same
number of bits that are added to the key stream from the block encryp-
tor output. The same number of bits are shifted in to fill the empty
space in the register. They can be the same bits taken from block en-
cryptor output. In that case, we have Output Feed Back (OFB) mode,
which is used in the US DoD Key Auto-Key (KAK). Alternatively, they
can be the last bits encrypted. This is Cipher Feed Back (CFB) mode,
which is known in DoD as Ciphertext Auto-Key (CTAK). At the decryp-
tor, exactly the same procedure is followed with the block algorithm
used to encrypt. Now the key stream is combined with the ciphertext
stream to recover the plaintext stream, and the ciphertext bits must be
saved for use as feedback.
The reader is encouraged to consider what happens if errors occur in
the ciphertext stream. Both OFB and CFB are self-synchronizing. There
are, however, situations in which this property is undesirable. If it is
most important to flag where a ciphertext stream has been tampered
with, it is better to feed back plaintext bits. Then errors introduced into
the ciphertext stream cause errors in the plaintext, which are shifted
into the input register of the block encryptor. This causes an erroneous
output which, in turn, yields an incorrect decryption. The wrong plain-
text bits are again fed into the shift register and all decryption is incor-
Perfect confidentiality
Perfect confidentiality can be achieved with a completely random key
stream. For such an encryption mechanism, our distinction between key
and key stream disappears. The key stream is the key. It must be as long
as the message it is to encrypt. Although a courier with a large magnetic
tape containing the random bit stream forms a communication channel
with a large capacity, this encryption scheme seems somewhat un-
wieldy. Nonetheless, it does have a very important characteristic to rec-
ommend it for use in certain situations.
Because the keys are completely random, it is possible to find a candi-
date key stream that decrypts a given intercepted ciphertext message
into any plaintext message of the same length. A cryptanalyst has no
way of determining which is the right key and which is the right plain-
text. Thus, there is one key that decrypts IPOOEHWLRCR as
ILOVEMOTHER; another that yields IHATEMOTHER; a third that pro-
duces ATTACKATTWO; and one more that generates DONOTATTACK.
The cryptanalyst has no way of determining which is the correct decryp-
tion. Stated another way, all decryptions are equally likely. In general, it
is impossible for anyone who captures the ciphertext stream to deter-
mine statistically that one plaintext stream is more likely than any
other. Even if he or she can guess a likely word in the plaintext, he or
she cannot determine where to place it or what the remainder of the
message might be. Perfect confidentiality occurs because no amount of
analysis, and not even an exhaustive search were he or she to try it,
will help the intruder guess the plaintext. This cryptosystem is un-
breakable.
A stream cipher with a completely random key stream is called a one-
time pad. It derives its name from the keypad that its users once em-
ployed and from the fact that any use of a key stream more than once
can be disastrous. If the key stream is reused, the difference between
the two ciphertext streams is the same as the difference between the
two plaintext streams, the key stream canceling. Now an analyst who
looks at the differences between the statistically most common letters
in the alphabet will yield a breaking of both plaintexts. The one-time
pad is the only kind of cryptosystem that exhibits perfect confidentiality.
As such, it is often used for the most important of diplomatic correspon-
dences. For everyday transmissions of lower priority between the many
users of a communications network or the many files to be protected on
sensitive databases, something less demanding in key handling is re-
quired. A block cipher, such as DES, in one of the feedback modes or a
Cryptography 367
key stream with some other cryptographically strong pseudorandom bit
stream generator is an approximation to a stream cipher with a com-
pletely random key stream.
All strive to achieve some form of computational security. This means
that, given the computing resources available to a prospective intruder,
it is very unlikely that he or she will be able to break a single crypto-
gram. In evaluating the computational security of a system, we must ex-
amine the computational time and resources required for each possible
attack compared with legitimate decryption. This is the work factor as-
sociated with each attack.
Some estimate of the intruder’s computing power and technology is
also necessary. An intruder can compare his or her capability for attack
with the potential value of the sensitive data he or she is trying to steal.
That value can be measured in dollars, in time, or in intelligence. Unfor-
tunately, the last metric is somewhat difficult to quantify. If, given the
size of the work factor, the cost of the computational power needed to
mount each attack exceeds the value of the information we are protect-
ing, our system is computationally secure.
n = Arithmetic modulus
e = Public exponent
d = Secret exponent
Y = Xe mod n (0 < X < n)
X = Yd mod n (0 < Y < n)
X, Y = Data blocks that are arithmetically less than the modulus
e × d = 1 mod (p − 1)(q − 1)
Cryptography 369
decryption of the ciphertext C = E ( M), which yields the plaintext mes-
sage M. The ciphertext is created by E ( M) or encrypting the plaintext M.
We designate the sender A as Alice and the receiver B as Bob.
For example, if Alice (A ) wishes to send a secure or private message M
to Bob (B), then Alice must have access to EB (Bob’s public key). We de-
note the common encryption algorithm using Bob’s public key as EB and
the common decryption algorithm with his private key as DB . The nota-
tion for this discussion of public key cryptography uses subscripts to refer
to the sender (Alice) and the receiver (Bob) rather than keys. For exam-
ple, we say that Alice encrypts the message M with Bob’s public key
(EB ). In other words, Alice encrypts M (the message) by creating cipher-
text C = EB( M) and sends C to Bob. Bob reverses the process when he
receives C by using his private transformation DB (Bob’s private key) for
decryption. This process requires that Bob computes DB(C) =
DB(EB( M)) = M. We also generally refer to this process as Bob uses his
private key (DB ) to “read” the encrypted message or ciphertext C.
If Alice’s transmission is intercepted, the attacker or intruder cannot
decrypt C (the ciphertext) since Bob’s DB (Bob’s private key) is only
known by Bob. This process provides for confidentiality. We assume that
any entity in the network can access EB (Bob’s public key), because Bob
has no means of identifying the sender. Also, Alice’s transmission could
have been changed. Therefore, authenticity and integrity are not assured
in this example. However, authenticity and integrity can be provided.
Authentication of the sender (Alice) and integrity of the message (M) can
readily be satisfied by using certain public key processes. The mathe-
matical transformations in a public key system can be achieved in a vari-
ety of ways. In general, where Alice wishes to send an authenticated
message M to Bob, he is able to verify that the message was sent by Al-
ice and was not changed. Alice could use DA (Alice’s private key) to com-
pute S (signature or signed text) = DA ( M) and send S to Bob. We
generally refer to this process as Alice signing her message. The signed
message is also referred to as a digital signature. Bob can use EA (Alice’s
public key) to find E A (S) = EA (D A ( M)) = M. Assuming M (message) is valid
plaintext, Bob can verify that S was actually sent by Alice, and was not
changed in transit. Verification follows from the one-way nature of EA
(Alice’s public key). If a cryptanalyst or an intruder could start with a mes-
sage M, he or she could find S′ such that EA (S′) = M. The implication is
that the intruder can invert or reverse EA . However, inversion is not
computationally feasible in this public key process.
Verifying the sender’s (Alice’s) identity could be difficult if M (the mes-
sage) or any portion of M is a random string. For example, it may be diffi-
cult for Bob to determine that S is authentic and unchanged based only
on review of EA (S).
In practice, a slightly more complex procedure is generally used. Vari-
able-length long messages are uniquely reduced to fixed-length repre-
Cryptography 371
Figure 5 illustrates a method of achieving confidentiality and authentic-
ity in a public key process. The message M is placed in a digital envelope
which is sealed with Bob’s public key (EB ).
The public key process in Figure 5 is a simplified version of a process for
confidentiality and authenticity. Certain issues, such as the question of
domains, are not considered in the figure. The illustrated public key sys-
tem complies with a hash function H. This system works with any en-
cryption and any signature. They need not be related. However, the
verification for the DSS is slightly different.
Digital signature
Authentication, nonrepudiation, and integrity checks can be supported with
a digital signature. A digital signature is similar to a written signature, how-
ever, it is stronger. For example, detection will result from any attempt
to change the message content or to forge the signature. We note that a
Message Authentication Code (MAC), as defined in ANSI X 9.9, provides
integrity protection against alteration, but does not provide nonrepudiation
because of the sharing of the conventional secret DES key. (Another
term for a MAC is a manipulation detection code, or MDC.)
A digital signature must be a function of the entire document. Changing
even a single bit should produce a different signature. A signed message
cannot be changed without detection.
Cryptography 373
Public key digital signatures. The use of public key digital signatures
and supporting hash functions can provide both authentication and verifi-
cation of message integrity. Hash functions, which have been briefly in-
troduced, will be discussed further. They can also serve as cryptographic
checksums used for validating the contents of a message. Public key
schemes supporting authentication permit generation of digital signatures
algorithmically from the same key repeatedly, although the actual signa-
tures are different. Digital signatures are a function of the message and a
long-term key. Therefore, key material can be reused many times before
replacement. Hash functions also reduce the impact of the computa-
tionally intensive nature of public key algorithms.
Public key digital signatures are generally preferred for electronic com-
merce because
Cryptography 375
Hash functions should produce unique message digests. However, it is
theoretically possible that two distinct messages could be reduced to an
identical same message digest and cause a collision. Collisions cannot
be avoided completely because there are generally more potential mes-
sages than the number of possible message digests. In practice, the
probability of collisions should be very low. For hash functions with ran-
dom or near random output, the probability of collisions is a function of
the size of the message digest and the number of bit sequences that are
meaningful messages.
In public key cryptography, the minimum requirements for a hash func-
tion include the ability to adequately support the authentication process.
For example, if we have a message M and a message digest MD, it must
not be computationally feasible to find another message M′ that also
reduces to MD. Therefore, forgery can be avoided because appending
the signed MD to M′ would not verify as a valid signature.
Public key digital signature sequence. A public key digital signature proc-
ess is briefly highlighted:
Cryptography 377
of a public key could eliminate its usefulness. Therefore, error detection
is desirable.
A central authority, such as the Certification Authority (CA) that we
introduced, is generally required for electronic commerce. However,
there are situations where the CA may not have to be on-line. For ex-
ample, Alice could retain Bob’s public key for future use.
Cryptography 379
• ANSI X9.9-1982, 1986: Financial Institution Message Authentica-
tion (Wholesale).
• ANSI X9.17-1985, 1991 (Extension): Financial Institution Key
Management (Wholesale).
Cryptography 381
Manual key distribution must occur at least once for conventional
cryptographic key management, after which automated distribution can
occur. Master keys or key-encrypting conventional keys (KEKs) are the
manually distributed keys. These keys are used only to encrypt other
conventional keys called “working keys.” Other terms for “working key”
include “data-encrypting keys” (DEKs).
Cryptography 383
tions, such as encryption at the top of layer 3 (SP3, Secure Protocol 3) or
the bottom of layer 4 (SP4).
Encryption must be generalized to protect the protocol data units
(PDUs) at a given layer. Extending encryption into higher protocol layers
increases the number of entities protected, at the cost of interfacing
and the overhead associated with additional hardware and/or software.
Higher layer encryption and the accompanying protocols can be intru-
sive. However, substantial hardware and software advances are being
made. Therefore, there is a gradual international trend to higher layer
encryption and encryption in commercial application software packages.
Cryptography 385