GlobalConfig.net header image 2

The Diffie-Hellman Process

May 7th, 2008 · No Comments

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

I wanted to cover in this post the process of diffie-hellman, related to you in part from wikipedia.org.

The Coolest thing to me is that you can actually use a scientific calculator to work through it using your own numbers. One thing to remember is that this is a simple example. Cisco routers can use DH group 1 (768 bit) DH-2 (1024 bit) and DH-5 (1536 bit).

The simplest, and original, implementation of the protocol uses the Multiplicative group of integers modulo p, where p is prime and g is primitive root mod p. To illustrate we can use the example of Bob and Alice. The process is as follows:

  • Alice and Bob agree to use a prime number p=23 and base g=5.
  • Alice chooses a secret integer a=6, then sends Bob (ga mod p)
  • 56 mod 23 = 8.

  • Bob chooses a secret integer b=15, then sends Alice (gb mod p)
  • 515 mod 23 = 19.

  • Alice computes (gb mod p)a mod p
  • 196 mod 23 = 2.

  • Bob computes (ga mod p)b mod p
  • 815 mod 23 = 2.

    Both Alice and Bob have arrived at the same value, because gab and gba are equal. Note that only a, b and gab = gba are kept secret. All the other values are sent in the clear. Once Alice and Bob compute the shared secret they can use it as an encryption key, known only to them, for sending messages across the same open communications channel. Of course, much larger values of a, b, and p would be needed to make this example secure, since it is easy to try all the possible values of gab mod 23 (there will be, at most, 22 such values, even if a and b are large). If p were a prime of at least 300 digits, and a and b were at least 100 digits long, then even the best algorithms known today could not find a given only g, p, and ga mod p, even using all of mankind’s computing power. The problem is known as the discrete logarithm problem. Note that g need not be large at all, and in practice is usually either 2 or 5.

    No related posts.

    Related posts brought to you by Yet Another Related Posts Plugin.

    Tags: CCIE Security

    0 responses so far ↓

    • There are no comments yet...Kick things off by filling out the form below.

    Leave a Comment