Applied Cryptography

Diffie–Hellman key exchange is checked with small numbers. Let p = 23 and g = 5; A chooses the secret value a = 6 and B the secret value b = 15. A sends A = g^a mod p and B sends B = g^b mod p. Which of the following is the shared secret the two obtain?

  1. A2
  2. B8
  3. C14
Show answer and explanation

Answer: A. 2

A = 5^6 mod 23 = 15625 mod 23 = 8 and B = 5^15 mod 23 = 19. A computes B^a = 19^6 mod 23 = 2 from B's value and B computes A^b = 8^15 mod 23 = 2 from A's value, and both get the same value 2. This is because both equal g^(ab) = 5^90 mod 23. An eavesdropper sees only p, g, A = 8 and B = 19, and to get 2 from these must find a or b.

  • A. Correct. 19^6 mod 23 = 8^15 mod 23 = 2.
  • B. 8 is A = 5^6 mod 23, the public value that A sends.
  • C. 14 is A × B mod 23 = 152 mod 23, the product of the public values. An eavesdropper can compute it too, so it cannot be the shared secret.
Practice this topic Back to topic

Books on Applied Cryptography Ad

As an Amazon Associate I earn from qualifying purchases.

More Applied Cryptography questions

  1. Which of the following is the correct combination of a weakness of Diffie–Hellman key exchange without authentication and its countermeasure?
  2. In the table of NIST SP 800-57, which of the following is the combination of RSA key length (the number of bits of n) and elliptic-curve key length given as the guideline for security comparable to a 128-bit symmetric-key cipher (AES-128)?
  3. In TLS, which of the following key exchange methods provides the property that previously recorded communications cannot be decrypted even if the private key of the server certificate leaks later (forward secrecy)?
  4. In ECDSA digital signatures, a secret random number k is used for each signature. Which of the following correctly describes how k must be handled?
  5. Which of the following correctly describes the certificate chain when a browser validates a web server's certificate?

Comparisons in this topic