Author(s): Bruce Schneier

ISBN: 0471128457

Publication Date: 01/01/96

Previous | Table of Contents | Next |

*Patents*

The Pohlig-Hellman algorithm is patented in the United States [722] and also in Canada. PKP licenses the patent, along with other public-key cryptography patents (see Section 25.5).

Rabin’s scheme [1283,1601] gets its security from the difficulty of finding square roots modulo a composite number. This problem is equivalent to factoring. Here is one implementation of this scheme.

First choose two primes, *p* and *q*, both congruent to 3 mod 4. These primes are the private key; the product *n* = *pq* is the public key.

To encrypt a message, *M* (*M* must be less than *n*), simply compute

*C*=*M*^{2}mod*n*

Decrypting the message is just as easy, but slightly more annoying. Since the receiver knows *p* and *q*, he can solve the two congruences using the Chinese remainder theorem. Compute

*m*_{1}=*C*^{(p + 1)/4}mod*p**m*_{2}= (*p*-*C*^{(p+ 1)/4}) mod*p**m*_{3}=*C*^{(q + 1)/4}mod*q**m*_{4}= (*q*-*C*^{(q + 1)/4}) mod*q*

Then choose an integer *a* = *q*(*q*^{-1} mod *p*) and a integer *b* = *p*(*p*^{-1} mod *q*). The four possible solutions are:

*M*_{1}= (*am*_{1}+*bm*_{3}) mod*n**M*_{2}= (*am*_{1}+*bm*_{4}) mod*n**M*_{3}= (*am*_{2}+*bm*_{3}) mod*n**M*_{4}= (*am*_{2}+*bm*_{4}) mod*n*

One of those four results, *M*_{1}, *M*_{2}, *M*_{3}, or *M*_{4}, equals *M*. If the message is English text, it should be easy to choose the correct *M*_{i}. On the other hand, if the message is a random-bit stream (say, for key generation or a digital signature), there is no way to determine which *M*_{i} is correct. One way to solve this problem is to add a known header to the message before encrypting.

*Williams*

Hugh Williams redefined Rabin’s schemes to eliminate these shortcomings [1601]. In his scheme, *p* and *q* are selected such that

*p*≡ 3 mod 8*q*≡ 7 mod 8

and

*N*=*pq*

Also, there is a small integer, *S*, such that J(*S,N*) = -1. (J is the Jacobi symbol—see Section 11.3). *N* and *S* are public. The secret key is *k*, such that

*k*= 1/2 * (1/4 * (*p*- 1) * (*q*- 1) + 1)

To encrypt a message *M*, compute *c*_{1} such that J(*M,N*) = (-1)* ^{c}*1. Then, compute

- (
*C, c*_{1},*c*_{2})

To decrypt *C*, the receiver computes *M*" using

*C*≡ ±^{k}*M*" (mod*N*)

The proper sign of *M*" is given by *c*_{2}. Finally,

*M*= (*S*1 * (-1)^{c}^{c1}**M*") mod*N*

Williams refined this scheme further in [1603, 1604, 1605]. Instead of squaring the plaintext message, cube it. The large primes must be congruent to 1 mod 3; otherwise the public and private keys are the same. Even better, there is only one unique decryption for each encryption.

Both Rabin and Williams have an advantage over RSA in that they are provably as secure as factoring. However, they are completely insecure against a chosen-ciphertext attack. If you are going to use these schemes in instances where an attacker can mount this attack (for example, as a digital signature algorithm where an attacker can choose messages to be signed), be sure to use a one-way hash function before signing. Rabin suggested another way of defeating this attack: Append a different random string to each message before hashing and signing. Unfortunately, once you add a one-way hash function to the system it is no longer provably as secure as factoring [628], although adding hashing cannot weaken the system in any practical sense.

Other Rabin variants are [972, 909, 696, 697, 1439, 989]. A two-dimensional variant is in [866, 889].

The ElGamal scheme [518,519] can be used for both digital signatures and encryption; it gets its security from the difficulty of calculating discrete logarithms in a finite field.

To generate a key pair, first choose a prime, *p*, and two random numbers, *g* and *x*, such that both *g* and *x* are less than *p*. Then calculate

*y*=*g*mod^{x}*p*

The public key is *y, g*, and *p*. Both *g* and *p* can be shared among a group of users. The private key is *x*.

*ElGamal Signatures*

To sign a message, *M*, first choose a random number, *k*, such that *k* is relatively prime to *p* - 1. Then compute

*a*=*g*mod^{k}*p*

and use the extended Euclidean algorithm to solve for *b* in the following equation:

*M*= (*xa*+*kb*) mod (*p*- 1)

The signature is the pair: *a* and *b*. The random value, *k*, must be kept secret.

To verify a signature, confirm that

*y*mod^{a}a^{b}*p*=*g*mod^{M}*p*

Each ElGamal signature or encryption requires a new value of *k*, and that value must be chosen randomly. If Eve ever recovers a *k* that Alice used, she can recover Alice’s private key, *x*. If Eve ever gets two messages signed or encrypted using the same *k*, even if she doesn’t know what it is, she can recover *x*.

This is summarized in Table 19.5.

For example, choose *p* = 11 and *g* = 2. Choose private key *x* = 8. Calculate

*y*=*g*mod^{x}*p*= 2^{8}mod 11 = 3

The public key is *y* = 3, *g* = 2, and *p* = 11.

To authenticate *M* = 5, first choose a random number *k* = 9. Confirm that gcd(9, 10) = 1. Compute

*a*=*g*mod^{k}*p*= 2^{9}mod 11 = 6

and use the extended Euclidean algorithm to solve for *b:*

*M*= (*ax*+*kb*) mod (*p*- 1)- 5 = (8 * 6 + 9 * b) mod 10

Previous | Table of Contents | Next |