CYS406 · Annotated SlidesChapter 8 — Diffie–Hellman Key Exchange
Chapter 8 · Annotated slides

Diffie–Hellman Key Exchange

Primitive roots, Diffie–Hellman setup and the key exchange with a worked example, key-exchange protocols, and the man-in-the-middle attack on unauthenticated Diffie–Hellman.

Slide text Study notes Highlight: key words Tips, tricks & traps Seen again elsewhere How it can come up
Slide 1: Slide 1
Exam weight Low

    Diffie-Hellman Key Exchange

    • first public-key type scheme proposed
    • by Diffie & Hellman in 1976 along with the exposition of public key concepts Williamson
      • note: now know that (UK CESG) secretly proposed the concept in 1970
    • is a practical method for public exchange of a secret key
    • used in a number of commercial products
    2
    Exam weight High
    1. Diffie–Hellman lets two parties agree on a shared secret over an insecure channel. It exchanges a KEY; it doesn’t encrypt messages.
    🎯 How this can come up · 1 question
    MCQ

    Diffie–Hellman is used for:

    Diffie-Hellman Key Exchange

    • a public-key distribution scheme
      • cannot be used to exchange an arbitrary message
      • rather it can establish a common key
      • known only to the two participants
    • value of key depends on the participants (and their private and public key information)
    • based on exponentiation in a finite (Galois) field (modulo a prime or a polynomial) - easy
    • security relies on the difficulty of computing discrete logarithms (similar to factoring) – hard
    3
    Exam weight Low
      Slide 4: Primitive Root
      Exam weight Low
      1. A primitive root g of prime q: its powers g¹ … g^(q−1) mod q produce every number 1 … q−1.
      Slide 5: Diffie-Hellman Setup
      Exam weight Low
        Slide 6: Diffie-Hellman Key Exchange
        Exam weight High
        1. Alice: private a, sends A = gᵃ mod q. Bob: private b, sends B = gᵇ mod q. Shared K = Bᵃ = Aᵇ = gᵃᵇ mod q.
        🎯 How this can come up · 1 question
        Written

        q = 23, g = 5, a = 6, b = 15. Find A, B and the shared key.

        Slide 7: Diffie-Hellman Key Exchange
        Exam weight Low
          Slide 8: Diffie-Hellman Example
          Exam weight Low
          1. Security rests on the discrete logarithm problem: from gᵃ mod q it is infeasible to find a.
          Slide 9: Slide 9
          Exam weight Low

            Key Exchange Protocols

            • users could create random private/public D-H keys each time they communicate
            • users could create a known private/public D-H key and publish in a directory, then consulted and used to securely communicate with them
            • both of these are vulnerable to a meet-in-the-Middle Attack
            • authentication of the keys is needed
            10
            Exam weight Low
              Slide 11: Man-in-the-Middle Attack
              Exam weight High
              1. MITM: Darth swaps in his own values and shares one key with Alice and another with Bob. Plain DH has no authentication; fix with signatures or certificates.
              Exam trapDiffie–Hellman alone is vulnerable to man-in-the-middle because the public values are not authenticated.
              🎯 How this can come up · 1 question
              MCQ

              Unauthenticated Diffie–Hellman is vulnerable to:

              Man-in-the-Middle Attack

              1. Darth prepares by creating two private / public keys
              2. Alice transmits her public key to Bob
              3. Darth intercepts this and transmits his first public key to Bob. Darth also calculates a shared key with Alice
              4. Bob receives the public key and calculates the shared key (with Darth instead of Alice)
              5. Bob transmits his public key to Alice
              6. Darth intercepts this and transmits his second public key to Alice. Darth calculates a shared key with Bob
              7. Alice receives the key and calculates the shared key (with Darth instead of Bob)
              • Darth can then intercept, decrypt, re-encrypt, forward all messages between Alice & Bob
              12
              Exam weight Low