Blum–Goldwasser cryptosystem

From testwiki
Jump to navigation Jump to search

Template:Short description The Blum–Goldwasser (BG) cryptosystem is an asymmetric key encryption algorithm proposed by Manuel Blum and Shafi Goldwasser in 1984. Blum–Goldwasser is a probabilistic, semantically secure cryptosystem with a constant-size ciphertext expansion. The encryption algorithm implements an XOR-based stream cipher using the Blum-Blum-Shub (BBS) pseudo-random number generator to generate the keystream. Decryption is accomplished by manipulating the final state of the BBS generator using the private key, in order to find the initial seed and reconstruct the keystream.

The BG cryptosystem is semantically secure based on the assumed intractability of integer factorization; specifically, factoring a composite value N=pq where p,q are large primes. BG has multiple advantages over earlier probabilistic encryption schemes such as the Goldwasser–Micali cryptosystem. First, its semantic security reduces solely to integer factorization, without requiring any additional assumptions (e.g., hardness of the quadratic residuosity problem or the RSA problem). Secondly, BG is efficient in terms of storage, inducing a constant-size ciphertext expansion regardless of message length. BG is also relatively efficient in terms of computation, and fares well even in comparison with cryptosystems such as RSA (depending on message length and exponent choices). However, BG is highly vulnerable to adaptive chosen ciphertext attacks (see below).

Because encryption is performed using a probabilistic algorithm, a given plaintext may produce very different ciphertexts each time it is encrypted. This has significant advantages, as it prevents an adversary from recognizing intercepted messages by comparing them to a dictionary of known ciphertexts.

Operation

The Blum–Goldwasser cryptosystem consists of three algorithms: a probabilistic key generation algorithm which produces a public and a private key, a probabilistic encryption algorithm, and a deterministic decryption algorithm.

Key generation

The public and private keys are generated as follows:

  1. Choose two large distinct prime numbers p and q such that p3mod4 and q3mod4.
  2. Compute n=pq.[1]

Then n is the public key and the pair (p,q) is the private key.

Encryption

A message M is encrypted with the public key n as follows:

  1. Compute the block size in bits, h=log2(log2(n)).
  2. Convert M to a sequence of t blocks m1,m2,,mt, where each block is h bits in length.
  3. Select a random integer r<n.
  4. Compute x0=r2modn.
  5. For i from 1 to t
    1. Compute xi=xi12modn.
    2. Compute pi= the least significant h bits of xi.
    3. Compute ci=mipi.
  6. Finally, compute xt+1=xt2modn.

The encryption of the message M is then all the ci values plus the final xt+1 value: (c1,c2,,ct,xt+1).

Decryption

An encrypted message (c1,c2,,ct,x) can be decrypted with the private key (p,q) as follows:

  1. Compute dp=((p+1)/4)t+1mod(p1).
  2. Compute dq=((q+1)/4)t+1mod(q1).
  3. Compute up=xdpmodp.
  4. Compute uq=xdqmodq.
  5. Using the Extended Euclidean Algorithm, compute rp and rq such that rpp+rqq=1.
  6. Compute x0=uqrpp+uprqqmodn. This will be the same value which was used in encryption (see proof below). x0 can then used to compute the same sequence of xi values as were used in encryption to decrypt the message, as follows.
  7. For i from 1 to t
    1. Compute xi=xi12modn.
    2. Compute pi= the least significant h bits of xi.
    3. Compute mi=cipi.
  8. Finally, reassemble the values (m1,m2,,mt) into the message M.

Example

Let p=19 and q=7. Then n=133 and h=log2(log2(133))=3. To encrypt the six-bit message 1010012, we break it into two 3-bit blocks m1=1012,m2=0012, so t=2. We select a random r=36 and compute x0=362mod133=99. Now we compute the ci values as follows:

x1=992mod133=92=10111002;p1=1002;c1=10121002=0012x2=922mod133=85=10101012;p2=1012;c2=00121012=1002x3=852mod133=43

So the encryption is (c1=0012,c2=1002,x3=43).

To decrypt, we compute

dp=53mod18=17dq=23mod6=2up=4317mod19=4uq=432mod7=1(rp,rq)=(3,8) since 319+(8)7=1x0=1319+4(8)7mod133=99

It can be seen that x0 has the same value as in the encryption algorithm. Decryption therefore proceeds the same as encryption:

x1=992mod133=92=10111002;p1=1002;m1=00121002=1012x2=922mod133=85=10101012;p2=1012;m2=10021012=0012

Proof of correctness

We must show that the value x0 computed in step 6 of the decryption algorithm is equal to the value computed in step 4 of the encryption algorithm.

In the encryption algorithm, by construction x0 is a quadratic residue modulo n. It is therefore also a quadratic residue modulo p, as are all the other xi values obtained from it by squaring. Therefore, by Euler's criterion, xi(p1)/21modp. Then

xt+1(p+1)/4(xt2)(p+1)/4)xt(p+1)/2xt(xt(p1)/2)xtmodp

Similarly,

xt(p+1)/4xt1modp

Raising the first equation to the power (p+1)/4 we get

xt+1((p+1)/4)2xt(p+1)/4xt1modp

Repeating this t times, we have

xt+1(p+1)/4)t+1x0modp
xt+1dpupx0modp

And by a similar argument we can show that xt+1dquqx0modq.

Finally, since rpp+rqq=1, we can multiply by x0 and get

x0rpp+x0rqq=x0

from which uqrpp+uprqqx0, modulo both p and q, and therefore uqrpp+uprqqx0modn.

Security and efficiency

The Blum–Goldwasser scheme is semantically-secure based on the hardness of predicting the keystream bits given only the final BBS state y and the public key N. However, ciphertexts of the form c,y are vulnerable to an adaptive chosen ciphertext attack in which the adversary requests the decryption m of a chosen ciphertext a,y. The decryption m of the original ciphertext can be computed as amc.

Depending on plaintext size, BG may be more or less computationally expensive than RSA. Because most RSA deployments use a fixed encryption exponent optimized to minimize encryption time, RSA encryption will typically outperform BG for all but the shortest messages. However, as the RSA decryption exponent is randomly distributed, modular exponentiation may require a comparable number of squarings/multiplications to BG decryption for a ciphertext of the same length. BG has the advantage of scaling more efficiently to longer ciphertexts, where RSA requires multiple separate encryptions. In these cases, BG may be significantly more efficient.

References

Template:Reflist

  1. M. Blum, S. Goldwasser, "An Efficient Probabilistic Public Key Encryption Scheme which Hides All Partial Information", Proceedings of Advances in Cryptology – CRYPTO '84, pp. 289–299, Springer Verlag, 1985.
  2. Menezes, Alfred; van Oorschot, Paul C.; and Vanstone, Scott A. Handbook of Applied Cryptography. CRC Press, October 1996. Template:ISBN

Template:Cryptography navbox

  1. Template:IETF RFC section "6.2.2. The Blum Blum Shub Sequence Generator"