Like many
public key cryptosystems, this scheme works in the group (\mathbb{Z}/n\mathbb{Z})^*. This scheme is
homomorphic and hence
malleable.
Key generation A public/private key pair is generated as follows: • Generate two large primes p and q. • Compute n = p^2 q. • Choose a random integer g \in \{ 2 \dots n-1 \} such that g^{p-1} \not\equiv 1 \mod p^2. • Compute h = g^n \bmod n. The public key is then (n,g,h) and the private key is (p,q).
Encryption A message m can be encrypted with the public key (n,g,h) as follows. • Choose a random integer r \in \{ 1 \dots n-1 \}. • Compute c = g^m h^r \bmod n. The value c is the encryption of m.
Decryption An encrypted message c can be decrypted with the private key (p,q) as follows. • Compute a = L(c^{p-1} \bmod{p^2}). • Compute b = L(g^{p-1} \bmod{p^2}). a and b will be integers. • Using the
Extended Euclidean Algorithm, compute the inverse of b modulo p: • :b' = b^{-1} \bmod p. • Compute m = ab' \bmod p. The value m is the decryption of c. ==Example==