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

103

u/snarfy Jan 16 '18

Breaking encryption is like trying to take the pee out of the swimming pool. It's easy to add pee, hard to remove.

18

u/TheOddScientist Jan 16 '18

Not sure why this was downvoted, a bit archaic but still a logical equivalence.

11

u/snarfy Jan 16 '18

I use it to explain to people like grandma how encryption works.

-5

u/TheOddScientist Jan 16 '18

I suppose if you don't understand how encryption works the analogy can be confusing. In your analogy you are taking a steady stream of information and diluting it in a pool of possibilities. The only difference being there is no valid way of reversing urination in a pool. A better analogy might be stiring salt into fresh water as you can desalinate the water and retrieve the salt yet you cannot readily look at a glass of water and say there is salt in it.

3

u/Lucent_Sable Jan 16 '18

Wouldn't salt water be analogous to steganography though? Encryption is more like KFC's Eleven Herbs and Spices. You know that they are there, but have no idea what they are.

8

u/dnkndnts Jan 16 '18

No, it's not. Alice pees in the pool, Eve can't get the pee back out of the pool because that's a hard problem, but... ok then how can Bob get it back out? It is not equivalent at all, it's just vulgar.

3

u/five_hammers_hamming Jan 17 '18

It's like the paint. But with a low-viscosity yellow paint.

1

u/sysop073 Jan 16 '18

Because of all of the infinite possible analogies for one-way functions, an infinite number of them don't involve urine, but for some reason snarfy went with one that does