Cryptography and Computer Security

« nazaj

Cryptography and computer security - Tutorial 8.12.2020


ElGamal encryption system

Key generation:

Encryption of $m \in \mathbb{Z}_p^*$:

Decryption of $c = (\gamma, \delta) \in (\mathbb{Z}_p^*)^2$:


Exercise 1

Show that the ElGamal encryption and decryption functions are indeed each other’s inverses.


\[\gamma^{-a} \delta \equiv (\alpha^k)^{-a} m \beta^k \equiv m \alpha^{-ka} \alpha^{ak} \equiv m \alpha^{ak - ak} \equiv m \pmod{p}\]

Exercise 2

Let $p = 101$, $\alpha = 2$, $\beta = 14$ be the public key for the ElGamal cryptosystem, with $a = 10$ being the private key. Encrypt the plaintext $m = 10$ using $k = 7$ as the random number, and then decrypt the resulting ciphertext.


Encryption:

Decryption:

$k$ $a$ $s$
  101 0
  27 1
3 20 -3
1 7 4
2 6 -11
1 1 15

Exercise 3

Suppose that we use the same random number $k$ to encrypt two distinct plaintexts $m_1$ and $m_2$. Can you reveal $m_2$ if you know $m_1$ and both ciphertexts?



Exercise 4

Show that distinguishing ElGamal encryptions is equivalent to solving the decision Diffie-Hellman problem.