Most People know ElGamal as a Diffie-Hellman-based public key cryptosystem. But internally ElGamal uses a symetric cypher using multiprecision arithmetic. So why not using an efficient symetric cipher instead.
A=Ga mod p (G , p , A) b=random() B=Gb mod p K 1 =Ab mod p (B) K 1 =Ba mod p c=random() C=Gc mod p K 2 =Ac mod p (C) K 2 =Ca mod p DH can create multiple shared secrets using the same secret
need a symetric encryption function given(G , p) a=random() A=Ga mod p Pub=(G , p , A) Priv=( p ,a) And we need to define, what the public/private key is crypt(key ,message)=ciphertext
symetric cipher: The key-pair generation given(G , p) a=random() A=Ga mod p Pub=(G , p , A) Priv=( p ,a) (G , p , A)=Pub b=random() B=Gb mod p K=Ab mod p c=crypt(K ,m) C=(B ,c) The encryption algorithm encrypt(Pub,m)=C (B ,c)=C ( p ,a)=Priv K=Ba mod p m=decrypt(K ,c) The encryption algorithm decrypt(Priv,C)=m
A=Ga mod p Pub=(G , p , A) Priv=( p ,a) Pub=(G , p , A) b=random() B=Gb mod p K=Ab mod p c=crypt(K ,m) C=(B ,c) K=Ba mod p m=decrypt(K ,c) Alice Bob Priv=( p ,a)