ElGamal Signature

Introduction.

Before discussing the ElGamal signature scheme, let's first talk about the ElGamal public key scheme. ElGamal is based on the problem of Discrete Logarithms in the group (Zp*, ●). Let p be a prime and let α be a primitive element in Zp*. The set of all plaintexts P = Zp*, the set of all ciphertexts C = Zp* x Zp*, and the set of all keys K = {(p, α, a, β) : β ≡ αa mod p}. p, α, and β make up the public key and the private key is p, α, and a. Alice chooses a secret random number k in Zp-1, and given m as the plaintext to be encrypted we have:

Encryption

ek(m, k) = (y1, y2),  where

y1 = αk mod p and

y2 = (m * βk) mod p

Decryption

m = dk(y1, y2) = y2(y1a)-1 mod p,  for all y1, y2 in Zp* (notice the multiplicative inverse (y1a)-1)

Cryptosystem Example.

Let p = 7, α = 2, a = 5, m = 6 and k = 4. Alice computes the following:

β = 25 mod 7 = 4
y1 = 24 mod 7 = 2
y2 = [6(44)] mod 7 = 1536 mod 7 = 3

Alice then sends (2, 3) to Bob, and Bob decrypts the ciphertext as:

m = [3(25)-1] mod 7
  = [(3 mod 7)(32-1 mod 7)] mod 7
  = [3 * 2] mod 7 = 6

ElGamal Signature Scheme.

The ElGamal signature scheme is as follows: Again let p be a prime and let α be a primitive element in Zp*. The set of all plaintexts P = Zp-1, the set of all ciphertexts C = Zp-1 x Zp-1, and the set of all keys K = {(p, α, a, β) : β ≡ αa mod p}. p, α, and β make up the public key and the private key is p, α, and a. Alice chooses a secret random number k in Zp-1, and given m as the plaintext to be signed we have:

Signing

sigk(m, k) = (y1, y2),  where

y1 = αk mod p and

y2 = [(m - a * y1)(k-1)] mod (p - 1)

Verification

verk(m, (y1, y2)) ↔ y1y2 * βy1 = αm mod p

Signature Example.

Let p = 17, α = 2, a = 4, m = 6 and k = 3. Alice computes the following signature:

β = 24 mod 17 = 16
y1 = 23 mod 17 = 8
y2 = [(6 - 4 * 8)(11)] mod 16 = -286 mod 16 = -14 mod 16 = 2

Alice then sends (6, 8, 2) to Bob, and Bob verifies the signature as:

26 ≡ [(82)(168)] mod 17 26 mod 17 = [(82)(168)] mod 17 = 13 It checks.

Security.

If the attacker can compute the value a = logαβ, then ElGamal signatures can be forged. As long as p is chosen carefully and α is a primitive element modulo p, then solving the Discrete Logarithm problem in Zp* is infeasible. Additionally, k must be secret, only used once and random. As shown above, ElGamal can also be used for encryption as well, but the messages should be relatively small in size.

Links

http://home.ecn.ab.ca/~jsavard/crypto/pk050301.htm
http://www.hack.gr/users/dij/crypto/overview/otherpk.html