Elgamal Cryptosystem
17 Dec 2021
§ Motivation
We've already discussed how to securely exchange keys, but not a cryptosystem; i.e. a system that can be used to encrypt and decrypt messages. The Elgamal cryptosystem is very similar to Diffie-Hellman, but it can be used to encrypt messages.
§ Cryptosystem Discussion
Let denote the key space (all possible keys), the message space, and ciphertext space (encrypted message).
For a resonably secure public key cryptosystem, we would want the following properties
- For any key and message in , it must be easy to compute the ciphertext (encryption is fast).
- For any key and ciphertext in , it must be easy to compute (decryption is fast).
- Given one or more , all encrypted using the same , it must be very difficult to compute any of without knowledge of .
- Given one or many pairs of plaintexts and corresponding ciphertexts it must be very difficult to compute any ciphertext besides without knowing (khown plaintext attack resilience).
- For any message chosen by an adversarial eavesdropper, even with knowledge of ciphertexts , it is very difficult to decrypt any ciphertext that is not in the given list without knowing key (chosen plaintext attack resilience).
§ Elgamal Public Key Cryptosystem
Elgamal Cryptosystem
First, Alice and Bob agree on a common (large) prime , and an element . These values are communicated in public.
Alice chooses a private key , and makes her public key available to Bob.
Encryption: If Bob wants to send a message to Alice, he chooses a random value and computes the two values
and sends the pair to Alice.
Decryption: After receiving Bob's message, she uses the Euclidean algorithm to find the modular inverse of modulo . Then, she raises to the power of her private key , i.e. . Finally, she decodes the message by