Cryptography and Computer Security

« nazaj

Cryptography and computer security - Tutorial 22.12.2020


Digital signatures

“Textbook” RSA signature

ElGamal signature

DSA signature


Attacks on digital signatures

Attack models


Exercise 1

Show that the textbook RSA signature scheme is existentially forgeable under a key-only attack and a known-message attack, and universally forgeable under a chosen-message attack. Describe the easiest way to prevent these attacks.



Exercise 2 - the reblocking problem

Suppose that Alice wants to send Bob a signed and encrypted message $m$. She will use RSA for both signing and encrypting. She first uses her private key $(n_A, d_A)$ to obtain the signature $s = m^{d_A} \bmod{n_A}$, and then uses Bob’s public key $(n_B, e_B)$ to obtain the ciphertext $c = s^{e_B} \bmod{n_B}$. She sends $c$ to Bob, who then decrypts it with his private key $(n_B, d_B)$ to obtain $s’ = c^{d_B} \bmod{n_B}$, and finally recovers the message $m’ = s’^{e_A} \bmod{n_A}$ using Alice’s public key $(n_A, e_A)$.

Assuming that $m$ has been chosen uniformly at random from $\mathbb{Z}_{n_A}$, what is the probability that $m \ne m’$ - i.e., that Bob does not decrypt the message correctly? Compute the probability for $n_A = 62894113$ and $n_B = 55465219$. How could this problem be mitigated?


\[\begin{aligned} m' &= s'^{e_A} \bmod{n_A} \\ &= (c^{d_B} \bmod{n_B})^{e_A} \bmod{n_A} \\ &= ((s^{e_B} \bmod{n_B})^{d_B} \bmod{n_B})^{e_A} \bmod{n_A} \\ &= (((m^{d_A} \bmod{n_A})^{e_B} \bmod{n_B})^{d_B} \bmod{n_B})^{e_A} \bmod{n_A} \\ &= ((m^{d_A} \bmod{n_A}) \bmod{n_B})^{e_A} \bmod{n_A} \end{aligned}\]

Revised protocol:

  1. Alice produces a signature $\sigma$ of $m$.
  2. Alice encrypts $m | \sigma$ to produce a ciphertext $c$ and sends it to Bob.
  3. Bob decrypts the ciphertext $c$ to obtain the message $m’$ and signature $\sigma’$.
  4. Bob verifies that $\sigma’$ is Alice’s signature of $m’$.

Exercise 3

Describe why the value $\gamma \bmod{p-1}$ in the ElGamal signature scheme should not be $0$.



Exercise 4

Compare the ElGamal and DSA signature schemes. Does the difference in efficiency affect the security of DSA?


Assume $p$ is a 1024-bit prime, $q$ is 160-bit prime.