HomeОбразованиеRelated VideosMore From: Art of the Problem

Public key cryptography - Diffie-Hellman Key Exchange (full version)

9733 ratings | 601755 views
The history behind public key cryptography & the Diffie-Hellman key exchange algorithm. We also have a video on RSA here: https://www.youtube.com/watch?v=wXB-V_Keiu8
Html code for embedding videos on your blog
Text Comments (463)
Uplifting Spirit (13 days ago)
I seriously love this video.
gardnoir (22 days ago)
I think you've done something wrong around 8:00. 6^13 isn't the same as 3^15^13.
Chris Mrozowski (1 month ago)
1:38 Illuminati confirmed
Danilo Mendonça (1 month ago)
Thheeee soluuuuution wooooooks aaassss foooooollooooows (I loved the pace, so that retarded people like myself can understand it)
Hou Yao (1 month ago)
Amazing!!!! This is the best explanation that i've ever seen.
Mropticalgreen (1 month ago)
I finally almost understand it :)
Julien Wickramatunga (2 months ago)
Damn good video!
radiumlofi (2 months ago)
What a fantastic video!
vivek daramwal (2 months ago)
Amazing video...
Jason Corrigan (3 months ago)
My background in advanced math concepts is somewhat limited, and so it's always been difficult for me to intuitively grasp how DH worked. After years of struggling, this is the one video that really drove the point home for me. Thank you!
David Franco Jr (3 months ago)
I tried to use this equation with the generator 5 and modulus 3 and it didn't work right. I used the numbers 3 and 2 as my powers. When you try to come up with the shared mod at the it doesn't come out with the same shared secret
Shashank Rustagi (3 months ago)
IT IS AMAZING
science blossom (4 months ago)
Can't thank you enough. Awesome video. I wish you also explained how the digital signature works in order to avoid Eve pretending to be either Bob or Alice.
Ruben (4 months ago)
1:31 Clearly summoning the Internet's demons.
Thomas Pribitzer (4 months ago)
that colour analogy was mind blowing. made my day!
Netbilly (4 months ago)
Awesome video. Thanks.
Inga Mgavu (5 months ago)
cool
Ishan Modi (5 months ago)
STOP....!!! If you want to Learn How DH works, THIS is the VIDEO you need to watch. Excellent explanation.
Philipe A (6 months ago)
Considering that Eve knows the public color (yellow) and then catches the color result from the mixture of yellow + Alice private color ("color X"), wouldn't it be easy to Eve to try different combinations of yellow + other colors until he gets the same result as yellow + color X, and just like that, find out what's the Alice's private color?
Penguinnootnoot p (6 months ago)
My informatics book brought me here
Penguinnootnoot p (6 months ago)
this one (it's in German): https://isbnsearch.org/isbn/9783140371278 tbh I expected them to link to a video on their channel or so. I was surprised as well this wasn't the case
Art of the Problem (6 months ago)
interesting, which book exactly?
Frank Koppenol (6 months ago)
Great video, clear explanation. Thanks
eirikrl (6 months ago)
Wait...If the eavesdropper knows the starting color yellow, and also the mixture color, say, orange, can't he derive the private color red?
kebman (7 months ago)
Isn't this the sign you're really looking for? ≅
theloniousMac (7 months ago)
Best explanation ever.
František Fuka (7 months ago)
The analogy with colors seems to be deeply flawed. Let's say I am an attacker. I see a color X and I know that it was mixed from exactly two colors, A and B, and I also know what color A was (yelllow). In this case, it's trivial for me to deduce the B color and crack everything.
maranda piekarski (7 months ago)
but what is modular arithmetic i cant grasp that concept
LaurV (8 months ago)
Very nice! Hat off! One of the best explanations I have seen, and nice put into the story. however, when you swap those powers, you should use parenthesis, that is because generally, powering is not commutative. That is, a^b^c is not equal to a^c^b, modular or non modular powering. Powering is right-associative. But (a^b)^c=a^b*a^b*...a^b (c times) which is a^(b*c)=a^(c*b)=a*a*a*a.... (b*c times), which is (a^c)^b always, modular or not. This is due to the commutativity of the _multiplication_ operation. Not the powers.
el famoso (8 months ago)
I finally understand (thanks to colors lol) ty for the video ! I was starting feeling stupid
Haoran Liu (8 months ago)
I’m still confused that what is this formula used for?
Kulasangar Gowrisangar (8 months ago)
Love the background sound.
Zheng Cheng (9 months ago)
great video! thank you!
Pavan Katepalli (9 months ago)
brilliant color analogy!!
AnythingWithWheels (9 months ago)
First video to really explain it
Ai Ayumi (9 months ago)
Amazing you fully explained this using paint!
Terence Azarov (9 months ago)
This version good work updating version download here-> https://yadi.sk/d/Uo9ZU5GU3NGtDC
Turbo Jones (9 months ago)
I think I got it on the 8th viewing
MrMyutubechannel (9 months ago)
Although I can see that they all come out to 10, it is not even remotely self-evident to me that ((3^13 mod 17)^15 mod 17) is the same calculation as (3^13^15 mod 17), (as is suggested at 7:36); it's not self-evident that ((3^15 mod 17)^13 mod 17) is the same calculation (3^15^13 mod 7), either - at least, not to me.
Xetron Chan (9 months ago)
Most amazing and simple and clean explanation of Diffie-Hellman algorithm I've came across. Great!!!
Aakash Preetam (9 months ago)
WOW
Morten Brodersen (10 months ago)
Best explanation I have ever seen. Well done!
kuba2ve (10 months ago)
So, if I and my friend want to agree on a secret surprise color, I would tell him, use public_color1 and public_color2, mix that with your secret color his_color_secret, and send the bucket back to me. I receive: public_color1+public_color2+his_color_secret Then I will send him my bucket: He receives: public_color1+public_color2+my_color_secret Both would then mix the bucket we got with our secret colors, both are going to get these buckets: His: public_color1+public_color2+my_color_secret+his_color_secret Mine: public_color1+public_color2+his_color_secret+my_color_secret Both get the same mix! Then we meet on Saturday to verify the results and MAGIC! We got the same color!
Koulter Mattice (10 months ago)
you guys like hentai
Nejc Novak (10 months ago)
what if g^a is smaller then p? then the result is g^a. Should g^a be always higher of p?
Roger Zeng (10 months ago)
Amazing explanation! How can I give 2 thumbs up?
Alexander L (10 months ago)
The are maybe some "reading" mistake for whom is not familiar with math notations: X^a^b should be read as (X^a)^b and not as X^(a^b). And it is simply to prove using induction, that (X^a)^b is the same as (X^(a*b)). So, because (X^b)^a = (X^(b*a)), the full solution results in (X^a)^b = (X^b)^a.
Chetan Rane (10 months ago)
fantastic explanation. loved it
legaata (10 months ago)
The problem with this presentation is that, as far as I can tell, no data is transferred.
Jack Drost (10 months ago)
Excellent explanation of a hard thing to understand. Thank you! (Cool background music too!)
wirito (11 months ago)
This is great but...I thought I had seen this exact same video from this user "Art of the problem" explained by a female. Am I going insane???
wirito (10 months ago)
Can't find it :( Could you link it please??? I mean, your explanation is just as great but I like her voice. It's one of those "I prefer the original version" type of thing!
Art of the Problem (11 months ago)
both are still up, had to make a 2nd version when i joined KA at the time
wirito (11 months ago)
Ahh so there was a different voice to it. Unless you're lying lol What happened to her? Why was the video taken down?
Art of the Problem (11 months ago)
no you're sane :)
Raghav Sharma (11 months ago)
Can an algorithm video be more theatrical....
Arthur Vieira (11 months ago)
Is Diffie-Hellman "Public key cryptography"? I thought public key cryptography meant having a pair of keys. One is made public and the other remains private. Or Diffie-Hellman is a type of public key cryptography.
aswan korula (11 months ago)
Super tutorial. Thanks so much for making this so easy to understand
Ramakrishna reddy (11 months ago)
obviously,this is an amazing video
Sarah Weaver (1 year ago)
Ok but blue and yellow make green. Kind of a weak color factor.
Kendo121 (1 year ago)
ok, watching this on 0.75x speed
Madra Dubh (10 months ago)
Yawn. Booorrrrrrring!
samyu yuktha (1 year ago)
Amazing... Easily understood... 😀
Sukhrob Kurbonov (1 year ago)
Just a amazing explanation
ma271 (1 year ago)
Dude thank you. Really a great video
Ivan Topalov (1 year ago)
I'm sorry, I stopped your video as soon as I heard "nucular". Learn to speak your own language, dammit.
User4096 (1 year ago)
In this case r=3; p=17; A is his private key; B is her private key; ((r^A mod p)^B) mod p = ((r^B mod p)^A) mod p; Why is this identity true? They talk like it's easy to understand. Not for me though. I seem to be missing something, or perhaps even worse. Please, help.
Jeff L (1 year ago)
Thank you so much !!!!!
Mk Km (1 year ago)
Me: This just seems impossible! How can two guys who never met, speaking publicly establish a key?! Math: *SHUT UP*
Snow White (1 year ago)
EVE! That Bitch! Always listening! :P
Abhishek Upadhyay (1 year ago)
Amazingly explained...I think it is bestest explanation ...thanks for sharing..
Björn A. (1 year ago)
Is the whats app end-to-end encoding working with the same method?
Ahmed Khaled (1 year ago)
WoooooooooooooooooooooooooooooooOOOOOW
AdvancingPanther (1 year ago)
this doesnt explain the purpose of the "shared secret", which is "10". Is this "10" is the purpose of the transmission? Then who sends "10" to whom? And how the "x"es of both Alice and Bob correalte with each other, so they can result in 10 on purpose? I mean Alice and Bob do not know the x-es of each other.. What is the point then? (i understand the point of the video, though the video does not explain how the f#ck one find "the simple root of the prime number" - cuz it is a rabbit hole on its own)
Mropticalgreen (1 month ago)
they use their secret number to encrypt the messages and the 10 to decrypt them
Ano Nim (1 year ago)
What`s the name of the intro music?
Jamo Taylor (1 year ago)
Best explanation I've found - beats the one in the Pluralsight course I did ;P
Adam Fahie (1 year ago)
To echo everyone else's comments, a fantastic video! This mitigates against "Eve' passively observing messages. However, I assume this is still vulnerable to man-in-the-middle attacks? So if Alice authenticates with Eve, Eve then authenticated with Bob. Alice<-->Eve<-->Bob, Eve could still read the messages and neither Bob nor Alice would be any the wiser?
Bergluft (1 year ago)
The color analogy is good but imprecise, because the "private colors" seemed arbitrary but were not. You need to know beforehand which color to use for decryption. Am I right?
Nefariouspat (1 year ago)
I've watched a few videos on public key cryptography, but never really understood how it worked until I heard this colour analogy. Absolutely phenomenal video!
Ali Piriyaie (1 year ago)
AWESOME!!!! Please keep on teaching... You did a great job!!!
henry hache (1 year ago)
A bit confused... so 3^x mod 17 = y y = shared key, 10 above correct? Well, there are only 17 "keys", 1 to 17. Can't eve brute force guess 17 times?
David Franco Jr (3 months ago)
There are virtually infinity/17 ways to arrive at whatever number that y is.
Michael Sills (1 year ago)
in a real encryption, the number "17" would actually be a prime number in the trillions or further.
Garimeli (1 year ago)
Best explanation !
John Godfrey (1 year ago)
Thanks, best I've seen on this. :-)
Planctoon (1 year ago)
maybe its my stupidity but why do they only show 16 values if the actual mod is 17...? I think mod 17 should have 17 values (from 0 to 16) right...? They didnt represent the 0
Princy E P (1 year ago)
The articulation is excellent! Great read
Notmatt (1 year ago)
Is there really no way for Eve to crack the solution? I'm sure there's a method somehow.
Michael Sills (1 year ago)
yes, brute force aka thousands of years.
Nan N (1 year ago)
Since Eve knows the initial agreed color, will it easy for Eve to know the secrete color of Alice and Bob after Eve received A's mix color? I am a bit confused.
blouman176 (1 year ago)
love it! Amazing !
Glenn (1 year ago)
It takes a very smart person to explain a complex subject so clearly and intuitively. 👍
Peter (1 year ago)
I love the clock mod example
Pio Alonday (1 year ago)
7:41. Placing the exponent there was wrong. Perhaps it would've been better if 3^13 was placed in parentheses first; otherwise it would look like it's just the exponent 13 that's being raised to 15. And perhaps it should've been explained how [(3^13 mod 17)^15]mod17=[(3^13)^15]mod17
Ivan Engler (1 year ago)
finally i understand 😃
infinitybiff (1 year ago)
well this was an incredible video. such a good explanation. well done!
This is so beautiful theory. Really amazing!! Thank you for showing:)
Mister Voldemort (1 year ago)
I think he forgot the brackets, beacuse the expressions here prioritize he last powers first. So in this case the answers are different.
MrDoboz (1 year ago)
Cool, thanks for the information!
Yash Gupta (1 year ago)
This video is so awesome! Had been looking for the answer to this problem.
Fubonte (1 year ago)
why can't i like this video more than once? thank you for an excellent explanation
Prajith v.p. (1 year ago)
thanks a loooooooott
BirdValiant (1 year ago)
@8:01 "When you flip the exponent the result doesn't change" is simply an incorrect statement as written without brackets. a^b^c ≠ a^c^b when evaluated right-to-left, as is the norm in mathematics. This is because exponentiation is not associative. In the video, which does not include brackets at all, the expression 3^13^15 mod 17 ≠ 3^15^13 mod 17, because 3^13^15 mod 17 = 5 and 3^15^13 mod 17 = 6, and 5 ≠ 6. The omission of brackets is an error and should be corrected. This error ruined the whole video for me.
friedchicken (1 year ago)
0:18 Ah, the good ol' nukular xD
Bruno Ferreira (1 year ago)
What if Eve pretends to be Bob?
Mr PimmoZ (8 months ago)
Haha was thinking the same ting. Works agains intercepting information, still got to trust you're sharing to the right party and you probably still got to trust a third party (the middle man).
Raghav Sharma (11 months ago)
That's called a masquerade attack...and yeah haven't you heard about signed data
Daniel Tan (1 year ago)
That's why digital signature kicks in
Jake Goykia (1 year ago)
could it be 5 instead of 3?
GemYellow (1 year ago)
this is so good
Sagar Bajaj (1 year ago)
yeah. fuck you eve !
Limeh (1 year ago)
This is such a good explanation, it makes so much sense logically to me now.
Suman Dutta (1 year ago)
Thanks for your great information. I want to more idea with examples

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.