CS FundamentalsVery hardGATE CS · Product company CS fundamentals

Diffie–Hellman uses p = 29 and g = 2. Alice's secret is a = 5 and Bob's is b = 11. What values do they send each other, and what shared key results?

  1. A. Alice sends 3, Bob sends 18, key 25
  2. B. Alice sends 10, Bob sends 22, key 23
  3. C. Alice sends 3, Bob sends 18, key 15
  4. D. Alice sends 3, Bob sends 18, key 19

Correct answer: C. Alice sends 3, Bob sends 18, key 15

A = 2⁵ mod 29 = 3, B = 2¹¹ mod 29 = 18. Alice computes B^a mod p and Bob A^b mod p, both equal to 2^(ab) = 2⁵⁵ mod 29 = 15. Multiplying the public values or using 2^(a+b) are common errors.

More Computer Networks questions

Exams that ask this topic