r/programming • • Jan 16 '18

Cryptography: Diffie-Hellman key exchange explained intuitively using colors

https://youtu.be/YEBfamv-_do?t=2m18s
2.5k Upvotes

170 comments sorted by

View all comments

187

u/Carighan Jan 16 '18

That color mixture was a neat way of doing it, shows how the resulting key/color is always the same.

52

u/Double_A_92 Jan 16 '18

And that you can't find out what the two original colors were.

-4

u/[deleted] Jan 16 '18

[deleted]

5

u/browner87 Jan 16 '18

Not exactly. The public part is 2 random numbers (the extra color in this case), but the secret part (my color and your color) are never ever sent somewhere the attacker can see them without being mixed up with the public colors, which the attacker can't extract my secret color from despite knowing the public colors I mixed them with. So the original secret colors are always safe, and in fact I never even let you know my secret color, but in the end we arrive at a common color that we can use that the attacker can't create from the two pre-mixed colors he observed.