We begin our discussion of public-key cryptography (PKC) applications by reviewing several topics that were mentioned in the introduction to Section 3.2. We then progress to a discussion of authentication, digital signatures, and message digests (Section 3.3.2).
The topic of message integrity leads naturally into a discussion of digital signatures (DSs, Section 3.3.2). It is desirable that DSs have the following attributes:
Additionally, it is useful for hash functions (where the hash size is smaller than the message) to have collision freedom, which can be specified as follows:
'
such that y = h(x'
).
This property is especially
desirable in systems where a hash is sent instead of sending the
actual message.
'
such that h(x) =
h(x'
) .
We next progress to the description of digital signatures and message digests.
Note: We especially want to obviate cut-and-paste attacks, which can be done with chaining or reduction. With chaining, messages that the sender signs are joined and sent as one message. Reduction hashes a long message into blocks that the sender signs. This achieves integrity and authentication of the sender.
One approach to achieve integrity via chaining is to use DES with a Cipher Block Chaining (CBC) residue. Recall (from Section 3.1) that there are three modes of DES usage, namely, Electronic Code Book (ECB), Cipher Feedback Mode (CFM, which facilitates stream ciphers), and CBC.
Figure 3.3.1. DES cipher-block chaining mode.
Disadvantages. The sender(s) and receiver(s) share a secret key. This leads to quadratic complexity of key distribution over a network, which we discussed in Section 3.2.
Thus, it is preferable to employ an PKC/RSA based solution. An instance of this method is called Public Signatures, which we discuss as follows.
Algorithm. If the preceding assumption holds, then
Advantages. Since only Alice can read e(a,kA), we have secrecy. Since only Alice can produce e(a,kA-1), some degree of authenticity can be implemented.
Disadvantages. Unfortunately, if one encrypts with a public key, one does not have verifiability via examination of the encryption by a third party.
Observation. For two-party RSA (e.g., Alice and Bob), we have keys (kA,kA-1) and (kB,kB-1). The order of encryption is important. That is, if Bob is sending a message a to Alice, should we encrypt with kB then kA-1, or vice versa? The latter method is preferred (i.e., {{a}kA-1}kB), since
Remark. Signature schemes have the following desirable properties, which are symmetric to those enumerated at the end of Section 3.3.1. Namely, it should be hard to
'
for any given x, such that
sigk(x'
) =
sigk(x). This helps avoid forgery.
'
such that
sigk(x'
) =
sigk(x).
We next overview Lamport's One-time Signature Scheme (LSS), a variation of the preceding signature scheme.
Algorithm. Given the foregoing assumption, Lamport's signature scheme involves the following steps:
Step 2. Compute 2n elements yi,j = f(xi,j), for i = 1..n, and j {0,1}.
Step 3. Let a message a P be partitioned bitwise as (a1, a2, ..., an). The sig function is given by
sigk(a1, a2, ..., an) = (x1,a1, x2,a2, ..., xn,an) .
Step 4. Given a signature s A = P partitioned bitwise as (s1, s2, ..., sn), the ver function is given byverk(a1, a2, ..., an, s1, s2, ..., sn) = 1 ,
if and only if for all i {1,2,...,n}, f(si) = yi,ai .Observation. The spaces X and Y must be large, such that guessing the function f incurs a prohibitively large search cost.
Step 2. A DES-like encryption scheme is applied to text input and kDES, where the expansion permutation is modified by a 12-bit mask. The modified expansion permutation converts 32 bits into 48 bits. Additionally, the mask is randomly reset whenever the user's password is changed.
Step 3. The DES output is an encrypted password that is assigned to storage as the user's password.
Assumption. Let p be a prime number such that log(p)
Zp is hard to compute. Additionally, let
Zp* be a primitive element. Using the
cryptosystem formalism developed in the preceding section, let
plaintext P = Zp* and let
authentication codes
A = Zp*
× Zp-1.
Observation. Given the preceding assumption, let the keyspace
K = {(, , a, ) : = a mod p }.
Since a is secret and the discrete logarithm is a hard problem, it is hard to guess a.
Definition. Let k
(Zp-1)*
and let =
k mod p.
Denote the plaintext
xP
and let
= (x -
) · k-1 mod (p - 1).
Definition. Given the preceding definition, let
sigk(x,k) = (, )
andverk(x, , ) = 1 <=> · ~ x mod p. (I)
Remark. The preceding definition is valid because
a · k = (a)(k) ~
x mod p
= a · k(x - ) · k-1 mod (p-1) ~
x mod p
= a + x- = x .
Observation. Possible attacks on the El Gamal cryptosystem include:
where j-1 is taken modulo p-1. Now, observe that
~ (ij)
~ (ij)
~ i(- j-1) mod p-1j(- j-1) mod p-1
~ - i j-1-
~ - i j-1
~ x .
Observation. If the unique, randomly-chosen k = (, , , ) is compromised, it is possible that knowledge of k will reveal the secret value a. If k is revealed for (x, , ), then
a = (x - k) -1 mod (p-1)
and= (x - a) k-1 mod (p-1) .
Because k = x - a,a = (x - k) -1 mod (p-1) .
Since there is no exponentiation, it is easy to decode a from k.Remark. Implementationally, every reuse of k reinforces an adversary's trial of previous attacks. When Oscar finds two messages that yield to the same attack, he can compute k and then obtain the desired signature.
The Digital Signature System (DSS) is another method of digitally signing messages that features small signatures and a large modulus (to make the discrete key hard to guess). DSS has reduction in the exponent that allows (for example) a 160-bit message, which implies a 320-bit signature by a 512-bit modulus.
The following changes to the El Gamal cryptosystem are encountered in DSS:
Note: If gcd(x + a, p-1) = 1, then -1 mod p-1 exists and the preceding equation becomes
x-1 -1 = mod p .
A key implementational issue is the probability of successful attack. We begin by discussing the Birthday Attack, which provides information about a lower bound on digest size.
Q = N(N-1)/2M ,
and hence is of order N2.Example. For a birthday attack where M = 365, we have that
Q = N(N-1)/730 and 730 N(N-1) < N2 .
As a result, N > (730)1/2. Thus, if you use N bits, you need an average of 2N/2 attempts to compromise the hash.Remark. Finding one-way functions that perform the appropriate reduction is a difficult goal, since there are many unresolved questions associated with hash functions. For example, the use of trapdoors, trick constants, etc. that permit Government agencies to access encrypted data.
An early message digest implementation called MD2 employed (a) 8-bit arithmetic; (b) few intermediate values, thereby yielding low space complexity; and (c) one-pass computation.
Step 2. Pad the concatenation of the partitions obtained in Step 1 to the nearest multiple of 16 bytes.
Step 3. Add a 16-byte checksum.
Step 4. Perform digest computation on 16-byte blocks.
Step 3 - Checksum: Assume that there exists a -substitution, which is customarily based on digits of taken in 8-bit partitions, where repeated results are discarded. The -substitution is employed as shown in the following schematic diagram:
The following equation presents the formulation associated with Step 3:
checksum(a[n mod 16]) =
checksum(a[n mod 16])
XOR
(checksum(a[n-1 mod 16],
msk[n]) ,
Step 4 - Digest Computation: The message digest is computed via the following architecture:
As time progressed, the development of integrated-circuit CPUs soon rendered MD2's byte-oriented algorithm obsolete. Thus, MD4 was introduced, which implemented the following advances:
A schematic block diagram of the message digest computation follows:
Similar to MD2, the MD4 digest computation implements diffusion through application of the output of DFi to DFi+1, where i = 1..n-1.
For example, secret sharing between two parties (Alice and Bob) employs the following procedure:
MIC = MD(KAB · a) ,
where the digest function DF is applied recursively as follows:and the end-of-message (EOM) code is appended to define the message end.
In practice, one partitions a message as a = (a1, a2, ..., an) and employs keys k1, k2, ..., kn. The encryption function e is then applied as:
If the key is made public (private), then a MD (MIC) is produced.
Here, xi, i = 1..3, denote the stream keys. The preceding method has several features of interest:
Disadvantages: This system is vulnerable for at least two reasons:
Here, the initial vector ensures a different stream each time that v is changed. Additional features are:
Disadvantage: Cut-and-paste attacks are possible, but can be avoided by concatenating K with ciphertext partition ci instead of xi.
By replacing the encryption with a message digest computation, we obtain the following symmetric scenario:
Unfortunately, replay attacks are still possible, but could be obviated by appending timestamps to the challenge texts (e.g., KAB · rA). Additional prevention against replay attacks can be obtained by naming of principals, i.e., appending Alice's or Bob's name or signature to the messages they respectively send.
This concludes our overview of public-key cryptosystem applications. We next dicuss implementational aspects of PKC.