6 minutes
Share the link to this page
You need to purchase the class to view this lesson.
One-time Purchase
List Price:  $139.99
You save:  $40
List Price:  د.إ514.18
You save:  د.إ146.92
List Price:  A$182.11
You save:  A$52.03
List Price:  ৳11,901.15
You save:  ৳3,400.57
List Price:  CA$177.84
You save:  CA$50.81
CHF 89.14
List Price:  CHF 124.80
You save:  CHF 35.66
List Price:  kr862.01
You save:  kr246.30
List Price:  €115.89
You save:  €33.11
List Price:  £103.02
You save:  £29.43
List Price:  HK$1,085.42
You save:  HK$310.14
List Price:  ₹10,242.01
You save:  ₹2,926.50
List Price:  RM565.06
You save:  RM161.46
List Price:  ₦55,462.88
You save:  ₦15,847.67
List Price:  kr1,199.74
You save:  kr342.80
List Price:  NZ$195.88
You save:  NZ$55.97
List Price:  ₱6,726.63
You save:  ₱1,922.03
List Price:  ₨22,557.45
You save:  ₨6,445.44
List Price:  S$186.18
You save:  S$53.20
List Price:  ฿4,211.81
You save:  ฿1,203.46
List Price:  ₺1,046.46
You save:  ₺299.01
List Price:  B$741.01
You save:  B$211.73
List Price:  R2,131.70
You save:  R609.10
List Price:  Лв226.90
You save:  Лв64.83
List Price:  ₩154,585.35
You save:  ₩44,170.40
List Price:  ₪460.36
You save:  ₪131.54
Already have an account? Log In


Asymmetric encryptions are incredibly powerful tools. Things like RSA are just absolutely amazing in terms of their power. However, asymmetric encryption generally requires a lot of overhead with RSA. We have all kinds of other tools to provide authentication and we cover this in other episodes. what it boils down to is that there's a lot of situations where you don't need a lot of authentication or anything like that. You just want to exchange a session key.

So you can kick a symmetric encryption into gear. And that's where something called diffie Hellman comes into play. diffie Hellman is an asymmetric algorithm. That's the first thing you need to understand. But the only thing diffie Hellman does is it doesn't really provide encryption per se. It only provides a methodology for two parties to come up with the same session key.

It's absolutely fascinating. diffie Hellman is incredibly powerful tool. But you got to be careful. It does use an asymmetric methodology. But it doesn't have a classic public private pre generated key that you'd see with like RSA. This is all kind of done on the fly using some fascinating integer mathematics.

In fact, the mathematics is so fascinating that it actually started to put me to sleep. And unless you're really into discrete logarithms and modular arithmetic, you may not want to go through all the details. The beautiful part is, is that when it comes to diffie Hellman, there's a wonderful analogy using your Eddie color. Allison Bob wants to send encrypted data to each other using some form of symmetric encryption. So to do this, they need the same key. But the problem here is that we have Eve a potential third party listening in and we don't want Eve to be able to determine what are symmetric keys going to be.

So somehow we've got to come up with a magic way. Both Bob and Alice can have the same symmetric key without that key actually ever be moved across the wire so that he could see it. Now to do this, we're going to use diffie Hellman. diffie Hellman is a key agreement protocol. Sometimes it's called a key exchange protocol. And the whole goal of diffie Hellman is to take advantage of what we call modular arithmetic.

So here's an example of modular arithmetic. Now, this particular formula, it's really, really hard to figure out what three you'll see three to this question mark power, they're given this type of value, it's very hard to figure out what we call the discrete logarithm of this particular type of equation now, so without going into any more detail than that, well, it makes it a lot more sense. If instead of using numbers like this, let's pretend that we want both Alice and Bob to have a unique color. So to do this, we actually do use a symmetric encryption here and that first of all, either Bob or Alice define a particular public key. Now this public key is a big long number, but in this case, let's just make it the color yellow. Because it's a little bit easier.

This is a unique color. Now, what we're going to do here is just as if we mix two different colors together to get a unique color. It is very easy to mix these two colors together, but it's extremely difficult to get the exact two original colors out of that just by annexing them. It's there's a million different potential colors. So with that idea in mind, let's go through a diffie Hellman exchange. Okay, so right now Alice and Bob each have a public key.

And we're going to call this public key that will be the color yellow in this particular case. Now he could see this public key to and you know what, we don't care now. Both Alice and Bob on their own, generate a random private value. In this case, we're going to say Alice is the color red, and Bob is the color blue. So what they're going to do is using this groovy mathematics, in essence, they're going to mix these colors together, creating this third color. Now, Eve could see these colors, but it's not going to do her any good because she doesn't know the private color by which they derive that value.

So she can't do anything with that. So they go ahead, and Alice and Bob exchange this mix. And now here's the cool part. Alice and Bob then add their own private colors to this mix, and it creates the exact same value. So this funny looking kind of brownish color is actually a unique number. And this is the number that we can go ahead and do symmetric encryption with and Eve we'll never know what that number is.

Is diffie Hellman has been around for a long time. And one of the challenges we run into with diffie Hellman is that because it uses big integers as the initial seed to generate the key exchange, some of these have shown themselves to be potentially crackable. So what we do over the years is that the diffie Hellman, people generate what we call diffie Hellman groups. So here's an example of some of these diffie Hellman groups and you'll see that they have a numerical value associated with them. These numbers are simply used by the Allison Bob's we want to do diffie Hellman to negotiate how big of a number that they might want to use. Now if you look at the bottom of this list, you'll see it says elliptical curve.

Let me explain what that is diffie Hellman because it uses large integers is subject potentially to cracking. So just as we've seen with other types of asymmetric encryption, the idea of using elliptic curve has become very, very popular. So there are now ways to use elliptic curve diffie Hellman in order to do the key exchange. The nice part for us is we don't have to worry about that. We just generate applications where the Alice and Bob's that are doing diffie Hellman can negotiate and they can ask for whatever group they want including elliptic curve

Sign Up


Share with friends, get 20% off
Invite your friends to TabletWise learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.