ElGamal signature scheme
The ElGamal signature scheme is a digital signature scheme which is based on the difficulty of computing discrete logarithms. It was described by Taher Elgamal in 1985.[1]
The ElGamal signature algorithm is rarely used in practice. A variant developed at the NSA and known as the Digital Signature Algorithm is much more widely used. There are several other variants.[2] The ElGamal signature scheme must not be confused with ElGamal encryption which was also invented by Taher Elgamal.
Overview
The ElGamal signature scheme is a digital signature scheme based on the algebraic properties of modular exponentiation, together with the discrete logarithm problem. The algorithm uses a key pair consisting of a public key and a private key. The private key is used to generate a digital signature for a message, and such a signature can be verified by using the signer's corresponding public key. The digital signature provides message authentication (the receiver can verify the origin of the message), integrity (the receiver can verify that the message has not been modified since it was signed) and non-repudiation (the sender cannot falsely claim that they have not signed the message).
History
The ElGamal signature scheme was described by Taher Elgamal in 1985.[1]
Operation
The scheme involves four operations: key generation (which creates the key pair), key distribution, signing and signature verification.
Key generation
Key generation has two phases. The first phase is a choice of algorithm parameters which may be shared between different users of the system, while the second phase computes a single key pair for one user.
Parameter generation
- Choose a key length [math]\displaystyle{ N }[/math].
- Choose a [math]\displaystyle{ N }[/math]-bit prime number [math]\displaystyle{ p }[/math]
- Choose a cryptographic hash function [math]\displaystyle{ H }[/math] with output length [math]\displaystyle{ L }[/math] bits. If [math]\displaystyle{ L \gt N }[/math], only the leftmost [math]\displaystyle{ N }[/math] bits of the hash output are used.
- Choose a generator [math]\displaystyle{ g \lt p }[/math] of the multiplicative group of integers modulo p, [math]\displaystyle{ Z_p^* }[/math].
The algorithm parameters are [math]\displaystyle{ (p, g) }[/math]. These parameters may be shared between users of the system.
Per-user keys
Given a set of parameters, the second phase computes the key pair for a single user:
- Choose an integer [math]\displaystyle{ x }[/math] randomly from [math]\displaystyle{ \{ 1 \ldots p-2 \} }[/math].
- Compute [math]\displaystyle{ y := g^x \bmod p }[/math].
[math]\displaystyle{ x }[/math] is the private key and [math]\displaystyle{ y }[/math] is the public key.
Key distribution
The signer should send the public key [math]\displaystyle{ y }[/math] to the receiver via a reliable, but not necessarily secret, mechanism. The signer should keep the private key [math]\displaystyle{ x }[/math] secret.
Signing
A message [math]\displaystyle{ m }[/math] is signed as follows:
- Choose an integer [math]\displaystyle{ k }[/math] randomly from [math]\displaystyle{ \{ 2 \ldots p-2 \} }[/math] with [math]\displaystyle{ k }[/math] relatively prime to [math]\displaystyle{ p-1 }[/math].
- Compute [math]\displaystyle{ r := g^k \bmod p }[/math].
- Compute [math]\displaystyle{ s := (H(m)-x r)k^{-1} \bmod (p-1) }[/math].
- In the unlikely event that [math]\displaystyle{ s=0 }[/math] start again with a different random [math]\displaystyle{ k }[/math].
The signature is [math]\displaystyle{ (r,s) }[/math].
Verifying a signature
One can verify that a signature [math]\displaystyle{ (r,s) }[/math] is a valid signature for a message [math]\displaystyle{ m }[/math] as follows:
- Verify that [math]\displaystyle{ 0\lt r\lt p }[/math] and [math]\displaystyle{ 0\lt s\lt p-1 }[/math].
- The signature is valid if and only if [math]\displaystyle{ g^{H(m)} \equiv y^r r^s \pmod p. }[/math]
Correctness
The algorithm is correct in the sense that a signature generated with the signing algorithm will always be accepted by the verifier.
The computation of [math]\displaystyle{ s }[/math] during signature generation implies
- [math]\displaystyle{ H(m) \, \equiv \, x r + s k \pmod{p-1}. }[/math]
Since [math]\displaystyle{ g }[/math] is relatively prime to [math]\displaystyle{ p }[/math],
- [math]\displaystyle{ \begin{align} g^{H(m)} & \equiv g^{xr+sk} \pmod p\\ & \equiv (g^{x})^r (g^{k})^s \pmod p\\ & \equiv (y)^r (r)^s \pmod p.\\ \end{align} }[/math]
Security
A third party can forge signatures either by finding the signer's secret key x or by finding collisions in the hash function [math]\displaystyle{ H(m) \equiv H(M) \pmod{p-1} }[/math]. Both problems are believed to be difficult. However, as of 2011 no tight reduction to a computational hardness assumption is known.
The signer must be careful to choose a different k uniformly at random for each signature and to be certain that k, or even partial information about k, is not leaked. Otherwise, an attacker may be able to deduce the secret key x with reduced difficulty, perhaps enough to allow a practical attack. In particular, if two messages are sent using the same value of k and the same key, then an attacker can compute x directly.[1]
Existential forgery
The original paper[1] did not include a hash function as a system parameter. The message m was used directly in the algorithm instead of H(m). This enables an attack called existential forgery, as described in section IV of the paper. Pointcheval and Stern generalized that case and described two levels of forgeries:[3]
- The one-parameter forgery. Select an [math]\displaystyle{ e }[/math] such that [math]\displaystyle{ 1 \lt e \lt p-1 }[/math]. Set [math]\displaystyle{ r := g^e y \bmod{p} }[/math] and [math]\displaystyle{ s := -r \bmod{(p-1)} }[/math]. Then the tuple [math]\displaystyle{ (r,s) }[/math] is a valid signature for the message [math]\displaystyle{ m = es \bmod{(p-1)} }[/math].
- The two-parameters forgery. Select [math]\displaystyle{ 1 \lt e,v \lt p-1 }[/math], and [math]\displaystyle{ \gcd (v,p-1)=1 }[/math]. Set [math]\displaystyle{ r := g^e y^v \bmod{p} }[/math] and [math]\displaystyle{ s := -rv^{-1} \bmod{(p-1)} }[/math]. Then the tuple [math]\displaystyle{ (r,s) }[/math] is a valid signature for the message [math]\displaystyle{ m = es \bmod{(p-1)} }[/math]. The one-parameter forgery is a special case of the two-parameter forgery, when [math]\displaystyle{ v = 1 }[/math].
See also
- Modular arithmetic
- Digital Signature Algorithm
- Elliptic Curve Digital Signature Algorithm
- ElGamal encryption
- Schnorr signature
- Pointcheval–Stern signature algorithm
References
- ↑ 1.0 1.1 1.2 1.3 Taher ElGamal (1985). "A Public-Key Cryptosystem and a Signature Scheme Based on Discrete Logarithms". IEEE Transactions on Information Theory 31 (4): 469–472. doi:10.1109/TIT.1985.1057074. https://caislab.kaist.ac.kr/lecture/2010/spring/cs548/basic/B02.pdf. (conference version appeared in CRYPTO'84, pp. 10–18)
- ↑ K. Nyberg, R. A. Rueppel (1996). "Message recovery for signature schemes based on the discrete logarithm problem". Designs, Codes and Cryptography 7 (1–2): 61–81. doi:10.1007/BF00125076. https://link.springer.com/chapter/10.1007/BFb0053434.
- ↑ Pointcheval, David; Stern, Jacques (2000). "Security Arguments for Digital Signatures and Blind Signatures". J Cryptology 13 (3): 361–396. doi:10.1007/s001450010003. https://www.math.uni-frankfurt.de/~dmst/teaching/SS2012/Vorlesung/Point.Stern.pdf. Retrieved 2019-08-17.
Original source: https://en.wikipedia.org/wiki/ElGamal signature scheme.
Read more |