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