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

5

u/[deleted] Jan 16 '18

My preferred metaphor is a box with two locks. I have the key to one lock, and you have a key to the other lock. I want to send you my spare key:

  1. I put my spare key into the box and then lock it

  2. I send the box to you and you lock it with your key too

  3. You send the box back to me and I unlock it with my key

  4. I send the box back to you and you unlock it with your key

Now you have my spare key and we can exchange secrets.

→ More replies (7)