Return to Video

Diffie-Hellman Key Exchange (part 2)

  • 0:00 - 0:02
    Now this is our solution.
  • 0:02 - 0:06
    First, Alice and Bob agree publicly on a prime modulus
  • 0:06 - 0:08
    and a generator.
  • 0:08 - 0:11
    In this case, 17 and 3.
  • 0:11 - 0:17
    Then, Alice selects a private random number, say 15, and calculates:
  • 0:17 - 0:23
    3 to the power 15 mod 17, and sends this result
  • 0:23 - 0:25
    publicly to Bob.
  • 0:25 - 0:32
    Then Bob selects his private random number, say 13, and calculates:
  • 0:32 - 0:37
    3 to the power 13 mod 17, and sends this result
  • 0:37 - 0:38
    publicly to Alice.
  • 0:38 - 0:41
    And now the hard of the trick.
  • 0:41 - 0:44
    Alice takes Bob's public result and raises
  • 0:44 - 0:47
    it to the power of her private number
  • 0:47 - 0:51
    to obtain the shared secret which in this case is 10.
  • 0:51 - 0:55
    Bob takes Alice's public result and raises
  • 0:55 - 0:58
    it to the power of his private number, resulting
  • 0:58 - 1:01
    in the same shared secret.
  • 1:01 - 1:06
    Notice they did the same calculation, though it may not look like it at first.
  • 1:06 - 1:14
    Consider Alice. The 12 she received from Bob was calculated as 3 to the power 13 mod 17.
  • 1:14 - 1:21
    So her calculation was the same as 3 to the power 13, to the power 15 mod 17.
  • 1:21 - 1:30
    Now consider Bob. The 6 he received from Alice was calculated as 3 to the power 15 mod 17.
  • 1:30 - 1:35
    So his calculation was the same as 3 to the power 15, to the power 13.
  • 1:35 - 1:39
    Notice they did the same calculation with the exponents in a different order.
  • 1:39 - 1:43
    When you flip the exponent the result doesn't change.
  • 1:43 - 1:48
    So they both calculated 3 raised to the power of their private numbers.
  • 1:48 - 1:52
    Without one of these private numbers, 15 or 13,
  • 1:52 - 1:56
    Eve will not be able to find a solution.
  • 1:56 - 1:58
    And this is how it's done.
  • 1:58 - 2:02
    While Eve is stuck grinding away at the discrete logarithm problem,
  • 2:02 - 2:04
    and with large enough numbers, we can say
  • 2:04 - 2:07
    it's practically impossible for her to break the encryption
  • 2:07 - 2:09
    in a reasonable amount of time.
  • 2:09 - 2:11
    This solves the key exchange problem.
  • 2:11 - 2:15
    It can be used in conjunction with a pseudorandom generator
  • 2:15 - 2:19
    to encrypt messages between people who have never met.
Title:
Diffie-Hellman Key Exchange (part 2)
Description:

Diffie-Hellman Key Exchange (part 2)

more » « less
Video Language:
English
Duration:
02:19

English subtitles

Revisions