ElGamal

ElGamal schemes are based on the difficulty of computing the discrete logarithm in cyclic groups. It was described by Taher Elgamal in 1985.

The ElGamal scheme is applicable for encryption and digital signature.

Key generation

M -- Modulo for calculating
Y = GX (mod M) -- Generating formula

X -- Secret exponent
G -- Primitive root (mod M)
Y -- Public point

(Y,G,M) -- public Key triplet
(X) -- secret Key

(1) A prime number should be chosen as the modulus.
(2) To simplify computational procedures, it is recommended to choose a Safe prime number as the modulus.

M Modulo (big Prime) * G Base Point (must be a primitive root modulo M) X Secret Key -- calculate Public Key
Y Public Key

To simplify the search for the base point G, a Safe Prime number can be chosen as the modulus. In this case, the number is guaranteed to be factorable into 2 and a prime number (Sophie Germain).

Cipher mode

Encryption

Msg* Message -- number derived from the message
Ciphertext

An asymmetric cipher only encrypts short messages. To encrypt messages (files, texts, images, etc.), it is necessary to use symmetric systems. The symmetric encryption key is selected randomly. The symmetric key is encrypted using an asymmetric algorithm. The encrypted message and the encrypted key are sent to the recipient. The recipient first decrypts the symmetric key using his private key. The decrypted symmetric key is then used to decrypt the message.

Decryption

Incoming ciphertext

Signature mode

Signing

Msg -- Number* obtained by hashing a message

On this page, only decimal notation is used in the form fields. To convert hexadecimal (hash result) numbers to decimal, use the number system converter.

Verification

Subskribita.net