El Gamal

El Gamal Cryptosystem #

El Gamal is a public key cryptosystem that behaves like Diffie Hellman but also allows us to encrypt and decrypt messages.

Furthermore unlike Diffie Hellman, both parties do not need to participate for El Gamal to work.

Procedure #

The sender only has access to the receivers Public Key. in form:

\[ B = g^{b} \ mod \ p \]

Encryption #

Generate a random number r.

\[ r \in \mathbb{Z}^{+} \]

Compute key R.

\[ R = g^{r} \ mod \ p \]

Encrypt the message with the random number r and key B.

\[ C = M \times B^{r} \ mod \ p \]

Transmit the encrypted message C and key R.

Decryption #

\[ M = R^{-b} \times C \]