Diffie-Hellman

The Diffie-Hellman key exchange: public parameters, exchanged values, the shared secret, what an eavesdropper sees, the discrete logarithm that protects the exchange, and the man-in-the-middle attack.

  • 23 cards
  • 6 topics
  • Free

The outline, topic by topic

Each topic is weighted the way the exam weighs it.

  1. Concepts
  2. Questions
  3. Sort and link
  4. The numbers
  5. On the diagram
  6. Scenarios

A few cards from the deck

  • Key exchange: what is it?

    Show the answer

    A protocol by which two parties converge on the same secret while exchanging only messages that anyone can read.

    The resulting secret then serves as the key of a fast symmetric cipher: the parties never had to meet to agree on a key.

  • Bob has chosen b = 15 and receives A = 8 (p = 23). What does this program print?

    ```python
    p = 23
    b = 15
    A = 8
    print(pow(A, b, p))
    `

    • 2
    • 19
    • 120
    • 8
    Show the answer

    2

    Bob computes A^b mod p = 8¹⁵ mod 23 = 2, the shared secret. 19 is his own public value 5¹⁵ mod 23, and 120 comes from A × b.

  • Alice sends A = … and Bob sends B = …; each then obtains the same secret g^(ab) mod p.

    Show the answer

    Alice sends A = g^a mod p and Bob sends B = g^b mod p; each then obtains the same secret g^(ab) mod p.

    Alice computes B^a = g^(ba) and Bob computes A^b = g^(ab): the two exponents multiply in either order, so the result is the same.