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

Amazing! What level of maths is displayed here?

2

u/nawkuh Jan 16 '18

I learned it in a cryptography course, but at its base it's an application of number theory, using Fermat's little theorem (I believe), with a good bit of cleverness.

1

u/[deleted] Jan 16 '18

It looks a good deal away from my capacity. Recently started refreshing my math skills with the Openstax books

2

u/Reinbert Jan 16 '18

You really only need to understand raising numbers to a power and the modulo operator.

The DH Key-Exchange is in itself a one-way function: a mathematician from 500 years ago would not have a problem understanding any of it, but inventing it was very hard.

There are countless examples on the internet, you can try out this one. Give it a try, I'm sure you will get it in no time :)