Introduction To
Cryptography
Public Key Cryptography
Elgamal Encryption System
• The ElGamal encryption system is a public key encryption
algorithm by Taher Elgamal in 1985.
• It is based on the Diffie-Hellman key exchange.
• Prime Number generation
• Primitive root relationship
• Key Size ranging from 256 to 2048
Step 1: Key Generation (Receiver)
Step 2: Encryption ( Sender)
Example
Key Generation (R)
+ Chosen p = 19.
+ It has primitive roots {2, 3, 10, 13, 14, 15}, g = 10.
+ Random number b=5
+ Public Key PR = 105 mod 19 = 3
+ R publishes in the directory {19, 10, 3}
Step 3: Decryption (Receiver)
Example
Encryption (S)
+ Message M must be lesser than p value.
+ Chosen M =17 < q=19
+ Sender gets {19, 10, 3} of Receiver from PKD.
+ Sender choses a random value a = 6.
+ Computes shared secret key Sk = 36 mod 19 = 7
+ Sender public key PS = 106 mod 19 = 11
+ Sender encrypts message C = 7*11 mod 19 = 5
+ Sender Transmits data {11,5}
Example
Decryption (R)
+ Receiver obtains info {11,5}
+ Receiver has {19,10,3,5}
+ R computes secret shared key Rk=115 mod 19 = 7.
+ R computes inverse of 7 in 19 = 11.
+ R decrypts the ciphertext M = 5*11 mod 19 = 17.
Applications of Elgamal
+ GNU Privacy Guard software
+ PGP.
+ Internet Voting