ElGamal encryption is a public-key cryptosystem. It uses asymmetric key encryption for communicating between two parties and encrypting the message. This cryptosystem is based on the difficulty of finding discrete logarithm in a cyclic group that is even if we know ga and gk, it is extremely difficult to compute gak.
Idea of ElGamal cryptosystem:
Suppose Alice wants to communicate with Bob.
Bob generates public and private keys:
Bob chooses a very large number q and a cyclic group Fq.
From the cyclic group Fq, he choose any element g and
an element a such that gcd(a, q) = 1.
Then he computes h = ga.
Bob publishes F, h = ga, q, and g as his public key and retains a as private key.
Alice encrypts data using Bob’s public key :
Alice selects an element k from cyclic group F
such that gcd(k, q) = 1.
Then she computes p = gk and s = hk = gak.
She multiples s with M.
Then she sends (p, Ms) = (gk, Ms).
Bob decrypts the message :
Bob calculates s′ = pa = gak.
He divides M*s by s′ to obtain M as s = s′.
i would like to implement this algorithm can you assigned me @Kumar-laxmi
ElGamal encryption is a public-key cryptosystem. It uses asymmetric key encryption for communicating between two parties and encrypting the message. This cryptosystem is based on the difficulty of finding discrete logarithm in a cyclic group that is even if we know ga and gk, it is extremely difficult to compute gak.
Idea of ElGamal cryptosystem: Suppose Alice wants to communicate with Bob.
Bob generates public and private keys: Bob chooses a very large number q and a cyclic group Fq. From the cyclic group Fq, he choose any element g and an element a such that gcd(a, q) = 1. Then he computes h = ga. Bob publishes F, h = ga, q, and g as his public key and retains a as private key. Alice encrypts data using Bob’s public key : Alice selects an element k from cyclic group F such that gcd(k, q) = 1. Then she computes p = gk and s = hk = gak. She multiples s with M. Then she sends (p, Ms) = (gk, Ms). Bob decrypts the message : Bob calculates s′ = pa = gak. He divides M*s by s′ to obtain M as s = s′.
i would like to implement this algorithm can you assigned me @Kumar-laxmi