Today, we're going to be talking about cryptography! More specifically, we're going to be talking about the Diffie–Hellman key exchange!
Let's start with a hypothetical situation. In this situation, we have three people: Alice, Eve, and Bob.
Alice and Bob are trying to communicate, but Eve (a hacker) is listening in and trying to intercept the message.
So Bob and Alice must disguise their cryptographic keys.
All three people have access to a public key. In this representation, the public key is yellow paint.
So, we paint a yellow circle beneath each person's name.
Now here comes the fun part: Alice and Bob each have their own private key.
Alice's private key will be represented by blue paint.
Let's blend those two colors together!
Mixing the two colors makes a new color: GREEN!
Bob's private key will be represented by red paint.
Let's mix those two colors together!
Mixing the two colors makes a new color: ORANGE!
Now Bob publicly transports his mixed color to Alice. And Alice publicly transports her mixed color to Bob.
It's important to note that because both mixed colors are public, Eve can access both of them.
However, unless she has paint separator liquid, she can't figure out what colors were added to yellow to get the mixed colors.
The next step for Alice is to take the mixture Bob gave her and add her private key.
The next step for Bob is to take the mixture Alice gave him and add his private key.
Alice and Bob end up with the same color, so they generated a common key!
But Eve, who only has the public key (yellow) and the two publicly transported mixed colors (green and orange) has no idea what the key is.
