In cryptography, the ElGamal encryption system is an asymmetric key encryption algorithm for public-key cryptography which is based on the Diffie–Hellman key exchange. It was described by Taher Elgamal in 1985. ElGamal encryption is used in the free GNU Privacy Guard software, recent versions of PGP, and other cryptosystems. The Digital Signature Algorithm (DSA) is a variant of the ElGamal signature scheme, which should not be confused with ElGamal encryption.
ElGamal encryption can be defined over any cyclic group
, like multiplicative group of integers modulo n. Its security depends upon the difficulty of a certain problem in
related to computing discrete logarithms.
ElGamal encryption consists of three components: the key generator, the encryption algorithm, and the decryption algorithm.
The first party, Alice, generates a key pair as follows:
- Generate an efficient description of a cyclic group
of order with generator . Let represent the unit element of .
- Choose an integer
randomly from .
- The public key consists of the values
. Alice publishes this public key and retains as her private key, which must be kept secret.