Kumar-laxmi / Algorithms

A Repository for algorithms in C, C++, Python and Java
Apache License 2.0
322 stars 367 forks source link

adding of Elgamal algorithm #1556

Closed Aarsh30 closed 1 year ago

Aarsh30 commented 1 year ago

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

Kumar-laxmi commented 1 year ago

Assigned! @Aarsh30 : C, C++, Python and Java

Kumar-laxmi commented 1 year ago

What is your status on this issue?

Aarsh30 commented 1 year ago

by the end of the day i will make pr as i got litle busy due to travelling work so sorry for it