Blum–Goldwasser cryptosystem

Asymmetric key encryption algorithm

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 = p q {\displaystyle N=pq} where p , q {\displaystyle 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 {\displaystyle p} and q {\displaystyle q} such that p 3 mod 4 {\displaystyle p\equiv 3{\bmod {4}}} and q 3 mod 4 {\displaystyle q\equiv 3{\bmod {4}}} .
  2. Compute n = p q {\displaystyle n=pq} .[1]

Then n {\displaystyle n} is the public key and the pair ( p , q ) {\displaystyle (p,q)} is the private key.

Encryption

A message M {\displaystyle M} is encrypted with the public key n {\displaystyle n} as follows:

  1. Compute the block size in bits, h = l o g 2 ( l o g 2 ( n ) ) {\displaystyle h=\lfloor log_{2}(log_{2}(n))\rfloor } .
  2. Convert M {\displaystyle M} to a sequence of t {\displaystyle t} blocks m 1 , m 2 , , m t {\displaystyle m_{1},m_{2},\dots ,m_{t}} , where each block is h {\displaystyle h} bits in length.
  3. Select a random integer r < n {\displaystyle r<n} .
  4. Compute x 0 = r 2 mod n {\displaystyle x_{0}=r^{2}{\bmod {n}}} .
  5. For i {\displaystyle i} from 1 to t {\displaystyle t}
    1. Compute x i = x i 1 2 mod n {\displaystyle x_{i}=x_{i-1}^{2}{\bmod {n}}} .
    2. Compute p i = {\displaystyle p_{i}=} the least significant h {\displaystyle h} bits of x i {\displaystyle x_{i}} .
    3. Compute c i = m i p i {\displaystyle c_{i}=m_{i}\oplus p_{i}} .
  6. Finally, compute x t + 1 = x t 2 mod n {\displaystyle x_{t+1}=x_{t}^{2}{\bmod {n}}} .

The encryption of the message M {\displaystyle M} is then all the c i {\displaystyle c_{i}} values plus the final x t + 1 {\displaystyle x_{t+1}} value: ( c 1 , c 2 , , c t , x t + 1 ) {\displaystyle (c_{1},c_{2},\dots ,c_{t},x_{t+1})} .

Decryption

An encrypted message ( c 1 , c 2 , , c t , x ) {\displaystyle (c_{1},c_{2},\dots ,c_{t},x)} can be decrypted with the private key ( p , q ) {\displaystyle (p,q)} as follows:

  1. Compute d p = ( ( p + 1 ) / 4 ) t + 1 mod ( p 1 ) {\displaystyle d_{p}=((p+1)/4)^{t+1}{\bmod {(p-1)}}} .
  2. Compute d q = ( ( q + 1 ) / 4 ) t + 1 mod ( q 1 ) {\displaystyle d_{q}=((q+1)/4)^{t+1}{\bmod {(q-1)}}} .
  3. Compute u p = x d p mod p {\displaystyle u_{p}=x^{d_{p}}{\bmod {p}}} .
  4. Compute u q = x d q mod q {\displaystyle u_{q}=x^{d_{q}}{\bmod {q}}} .
  5. Using the Extended Euclidean Algorithm, compute r p {\displaystyle r_{p}} and r q {\displaystyle r_{q}} such that r p p + r q q = 1 {\displaystyle r_{p}p+r_{q}q=1} .
  6. Compute x 0 = u q r p p + u p r q q mod n {\displaystyle x_{0}=u_{q}r_{p}p+u_{p}r_{q}q{\bmod {n}}} . This will be the same value which was used in encryption (see proof below). x 0 {\displaystyle x_{0}} can then used to compute the same sequence of x i {\displaystyle x_{i}} values as were used in encryption to decrypt the message, as follows.
  7. For i {\displaystyle i} from 1 to t {\displaystyle t}
    1. Compute x i = x i 1 2 mod n {\displaystyle x_{i}=x_{i-1}^{2}{\bmod {n}}} .
    2. Compute p i = {\displaystyle p_{i}=} the least significant h {\displaystyle h} bits of x i {\displaystyle x_{i}} .
    3. Compute m i = c i p i {\displaystyle m_{i}=c_{i}\oplus p_{i}} .
  8. Finally, reassemble the values ( m 1 , m 2 , , m t ) {\displaystyle (m_{1},m_{2},\dots ,m_{t})} into the message M {\displaystyle M} .

Example

Let p = 19 {\displaystyle p=19} and q = 7 {\displaystyle q=7} . Then n = 133 {\displaystyle n=133} and h = l o g 2 ( l o g 2 ( 133 ) ) = 3 {\displaystyle h=\lfloor log_{2}(log_{2}(133))\rfloor =3} . To encrypt the six-bit message 101001 2 {\displaystyle 101001_{2}} , we break it into two 3-bit blocks m 1 = 101 2 , m 2 = 001 2 {\displaystyle m_{1}=101_{2},m_{2}=001_{2}} , so t = 2 {\displaystyle t=2} . We select a random r = 36 {\displaystyle r=36} and compute x 0 = 36 2 mod 1 33 = 99 {\displaystyle x_{0}=36^{2}{\bmod {1}}33=99} . Now we compute the c i {\displaystyle c_{i}} values as follows:

x 1 = 99 2 mod 1 33 = 92 = 1011100 2 ; p 1 = 100 2 ; c 1 = 101 2 100 2 = 001 2 x 2 = 92 2 mod 1 33 = 85 = 1010101 2 ; p 2 = 101 2 ; c 2 = 001 2 101 2 = 100 2 x 3 = 85 2 mod 1 33 = 43 {\displaystyle {\begin{aligned}x_{1}&=99^{2}{\bmod {1}}33=92=1011100_{2};\quad p_{1}=100_{2};\quad c_{1}=101_{2}\oplus 100_{2}=001_{2}\\x_{2}&=92^{2}{\bmod {1}}33=85=1010101_{2};\quad p_{2}=101_{2};\quad c_{2}=001_{2}\oplus 101_{2}=100_{2}\\x_{3}&=85^{2}{\bmod {1}}33=43\end{aligned}}}

So the encryption is ( c 1 = 001 2 , c 2 = 100 2 , x 3 = 43 ) {\displaystyle (c_{1}=001_{2},c_{2}=100_{2},x_{3}=43)} .

To decrypt, we compute

d p = 5 3 mod 1 8 = 17 d q = 2 3 mod 6 = 2 u p = 43 17 mod 1 9 = 4 u q = 43 2 mod 7 = 1 ( r p , r q ) = ( 3 , 8 )  since  3 19 + ( 8 ) 7 = 1 x 0 = 1 3 19 + 4 ( 8 ) 7 mod 1 33 = 99 {\displaystyle {\begin{aligned}d_{p}&=5^{3}{\bmod {1}}8=17\\d_{q}&=2^{3}{\bmod {6}}=2\\u_{p}&=43^{17}{\bmod {1}}9=4\\u_{q}&=43^{2}{\bmod {7}}=1\\(r_{p},r_{q})&=(3,-8){\text{ since }}3\cdot 19+(-8)\cdot 7=1\\x_{0}&=1\cdot 3\cdot 19+4\cdot (-8)\cdot 7{\bmod {1}}33=99\\\end{aligned}}}

It can be seen that x 0 {\displaystyle x_{0}} has the same value as in the encryption algorithm. Decryption therefore proceeds the same as encryption:

x 1 = 99 2 mod 1 33 = 92 = 1011100 2 ; p 1 = 100 2 ; m 1 = 001 2 100 2 = 101 2 x 2 = 92 2 mod 1 33 = 85 = 1010101 2 ; p 2 = 101 2 ; m 2 = 100 2 101 2 = 001 2 {\displaystyle {\begin{aligned}x_{1}&=99^{2}{\bmod {1}}33=92=1011100_{2};\quad p_{1}=100_{2};\quad m_{1}=001_{2}\oplus 100_{2}=101_{2}\\x_{2}&=92^{2}{\bmod {1}}33=85=1010101_{2};\quad p_{2}=101_{2};\quad m_{2}=100_{2}\oplus 101_{2}=001_{2}\end{aligned}}}

Proof of correctness

We must show that the value x 0 {\displaystyle x_{0}} 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 x 0 {\displaystyle x_{0}} is a quadratic residue modulo n {\displaystyle n} . It is therefore also a quadratic residue modulo p {\displaystyle p} , as are all the other x i {\displaystyle x_{i}} values obtained from it by squaring. Therefore, by Euler's criterion, x i ( p 1 ) / 2 1 mod p {\displaystyle x_{i}^{(p-1)/2}\equiv 1\mod {p}} . Then

x t + 1 ( p + 1 ) / 4 ( x t 2 ) ( p + 1 ) / 4 ) x t ( p + 1 ) / 2 x t ( x t ( p 1 ) / 2 ) x t mod p {\displaystyle x_{t+1}^{(p+1)/4}\equiv (x_{t}^{2})^{(p+1)/4)}\equiv x_{t}^{(p+1)/2}\equiv x_{t}(x_{t}^{(p-1)/2})\equiv x_{t}\mod {p}}

Similarly,

x t ( p + 1 ) / 4 x t 1 mod p {\displaystyle x_{t}^{(p+1)/4}\equiv x_{t-1}\mod {p}}

Raising the first equation to the power ( p + 1 ) / 4 {\displaystyle (p+1)/4} we get

x t + 1 ( ( p + 1 ) / 4 ) 2 x t ( p + 1 ) / 4 x t 1 mod p {\displaystyle x_{t+1}^{((p+1)/4)^{2}}\equiv x_{t}^{(p+1)/4}\equiv x_{t-1}\mod {p}}

Repeating this t {\displaystyle t} times, we have

x t + 1 ( p + 1 ) / 4 ) t + 1 x 0 mod p {\displaystyle x_{t+1}^{(p+1)/4)^{t+1}}\equiv x_{0}\mod {p}}
x t + 1 d p u p x 0 mod p {\displaystyle x_{t+1}^{d_{p}}\equiv u_{p}\equiv x_{0}\mod {p}}

And by a similar argument we can show that x t + 1 d q u q x 0 mod q {\displaystyle x_{t+1}^{d_{q}}\equiv u_{q}\equiv x_{0}\mod {q}} .

Finally, since r p p + r q q = 1 {\displaystyle r_{p}p+r_{q}q=1} , we can multiply by x 0 {\displaystyle x_{0}} and get

x 0 r p p + x 0 r q q = x 0 {\displaystyle x_{0}r_{p}p+x_{0}r_{q}q=x_{0}}

from which u q r p p + u p r q q x 0 {\displaystyle u_{q}r_{p}p+u_{p}r_{q}q\equiv x_{0}} , modulo both p {\displaystyle p} and q {\displaystyle q} , and therefore u q r p p + u p r q q x 0 mod n {\displaystyle u_{q}r_{p}p+u_{p}r_{q}q\equiv x_{0}\mod {n}} .

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 {\displaystyle y} and the public key N {\displaystyle N} . However, ciphertexts of the form c , y {\displaystyle {\vec {c}},y} are vulnerable to an adaptive chosen ciphertext attack in which the adversary requests the decryption m {\displaystyle m^{\prime }} of a chosen ciphertext a , y {\displaystyle {\vec {a}},y} . The decryption m {\displaystyle m} of the original ciphertext can be computed as a m c {\displaystyle {\vec {a}}\oplus m^{\prime }\oplus {\vec {c}}} .

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

  1. ^ RFC 4086 section "6.2.2. The Blum Blum Shub Sequence Generator"
  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. ISBN 0-8493-8523-7

External links

  • Menezes, Oorschot, Vanstone, Scott: Handbook of Applied Cryptography (free PDF downloads), see Chapter 8
  • v
  • t
  • e
Algorithms
Integer factorization
Discrete logarithm
Lattice/SVP/CVP/LWE/SIS
Others
Theory
Standardization
Topics
  • v
  • t
  • e
General
Mathematics
  • Category