Diffie-hellman key exchange | Journey into cryptography | Computer Science | Khan Academy

Walkthrough of Diffie-Hellman Key Exchange
Watch the next lesson: www.khanacademy.org/computing...
Missed the previous lesson? www.khanacademy.org/computing...
Computer Science on Khan Academy: Learn select topics from computer science - algorithms (how we solve common problems in computer science and measure the efficiency of our solutions), cryptography (how we protect secret information), and information theory (how we encode and compress information).
About Khan Academy: Khan Academy is a nonprofit with a mission to provide a free, world-class education for anyone, anywhere. We believe learners of all ages should have unlimited access to free educational content they can master at their own pace. We use intelligent software, deep data analytics and intuitive user interfaces to help students and teachers around the world. Our resources cover preschool through early college education, including math, biology, chemistry, physics, economics, finance, history, grammar and more. We offer free personalized SAT test prep in partnership with the test developer, the College Board. Khan Academy has been translated into dozens of languages, and 100 million people use our platform worldwide every year. For more information, visit www.khanacademy.org, join us on Facebook or follow us on Twitter at @khanacademy. And remember, you can learn anything.
For free. For everyone. Forever. #YouCanLearnAnything
Subscribe to Khan Academy’s Computer Science channel: / channel
Subscribe to Khan Academy: kzread.info_...

Пікірлер: 110

  • @unknown8088928
    @unknown80889286 жыл бұрын

    Thanks. Perfectly explained in 2mins.

  • @zes3813

    @zes3813

    3 жыл бұрын

    wrr

  • @johnprice4847

    @johnprice4847

    2 жыл бұрын

    yeah, cus they just cut out a part of someone else's video

  • @sanjay01376

    @sanjay01376

    5 ай бұрын

    @@johnprice4847 whose video

  • @DaBoi808D
    @DaBoi808D2 жыл бұрын

    the music in the background is very ominous, sounds like I'm exploring a cave in Minecraft.

  • @waynelee891
    @waynelee8912 жыл бұрын

    Best video on Diffie Hellman, quick, to the point.

  • @WiiHack
    @WiiHack Жыл бұрын

    WOW! So clear in such little time. Thank you a lot!

  • @18ShotErnie
    @18ShotErnie6 жыл бұрын

    Khan Academy is the one. Teaches this better than anybody

  • @goldenpiece7087
    @goldenpiece70872 ай бұрын

    damn that was too easy this way. I've been studying this for the past 20-30 minutes without any clue.

  • @jlxip
    @jlxip6 жыл бұрын

    Really good explained!!! Thanks!

  • @mi6le10b15
    @mi6le10b152 жыл бұрын

    so easy to understand! thank you!

  • @rubiskelter
    @rubiskelter6 жыл бұрын

    Would be nice to talk about finite fields, and Galois field.

  • @adonisgarrido2258
    @adonisgarrido22588 жыл бұрын

    Excellent!

  • @ricp
    @ricp Жыл бұрын

    Great explanation, thanks!

  • @sudarrshang8922
    @sudarrshang89222 жыл бұрын

    Precise and perfectly made

  • @TheSilentDen
    @TheSilentDen5 жыл бұрын

    excellent calculations. wow 👌

  • @smithjanth120
    @smithjanth1203 жыл бұрын

    The way you explained is excellent. Thanks a lot.

  • @zes3813

    @zes3813

    3 жыл бұрын

    wrg

  • @dinhomhm
    @dinhomhm Жыл бұрын

    Thank you. my question is if Eve intercept this connection as man-in-the-middle, and he build a connection with bob and alice separately, so it means he generate his own keys and numbers and share it. will this work?

  • @imadmb154
    @imadmb1542 ай бұрын

    what a good and simple explanation, thanks

  • @mkkkkkkkkkk
    @mkkkkkkkkkk2 жыл бұрын

    Right now i understand this, thanks

  • @sanjay01376
    @sanjay013765 ай бұрын

    great whole concept in 2 minutes

  • @fouadhellal5346
    @fouadhellal53467 ай бұрын

    Thanks for this clear explanation

  • @muhannadak8087
    @muhannadak80873 жыл бұрын

    Loved the explanation! But what's the name of the music in the background?

  • @user-um7tw6kx4r6
    @user-um7tw6kx4r62 жыл бұрын

    Fantastic video

  • @ExplorerSpace
    @ExplorerSpace2 жыл бұрын

    awesome good job

  • @PatricSepulveda-vb2xg
    @PatricSepulveda-vb2xg Жыл бұрын

    I have been reading about this for hours, and you just made it make perfect sense in 2 minutes... fml

  • @newkool100
    @newkool1009 жыл бұрын

    Thanks

  • @Gyringag
    @Gyringag3 жыл бұрын

    The best and most laconic explanation!

  • @zes3813

    @zes3813

    3 жыл бұрын

    wrr, no such thign as more or few or loconx, doesn mtatter

  • @nightquest52
    @nightquest527 жыл бұрын

    Beautiful

  • @AliZain-d6l
    @AliZain-d6lАй бұрын

    thanks

  • @jacobkanyi5046
    @jacobkanyi5046 Жыл бұрын

    Iove the dramatic music

  • @UhOohSpaghettiOs
    @UhOohSpaghettiOs9 жыл бұрын

    Amazing video!!

  • @Milavid123

    @Milavid123

    9 жыл бұрын

    I agree for sure!

  • @meGusta2878
    @meGusta28788 жыл бұрын

    can i know what software is this?

  • @squakwa2888
    @squakwa2888 Жыл бұрын

    this is the most understandable explanation of an asymmetric cryptography.

  • @slinkpot8798
    @slinkpot87988 ай бұрын

    Dude we had a whole lecture on this the professor tried explaining with colors and what not and u blew it out the water in 2 minutes

  • @guyguifo504
    @guyguifo5042 жыл бұрын

    Please assist to give key length & block size of following Asymmetric Encryption Algorithms: RSA - ECC- ELGANAL - DSA -Diffie-Hellman. Thank you

  • @ramalshebl60
    @ramalshebl604 ай бұрын

    ok but what if i can only relay my messages through eve and there's no way for me to verify that who im talking to is actually bob (assuming im alice) then what? because that's basically me sending msgs through my isp and the isp doing a dh key exchange with me as well as bob so now my isp and the gov can easily eavesdrop on my msgs

  • @jawadul-haque2052
    @jawadul-haque20524 жыл бұрын

    Would you know how to implement this into Python code?

  • @zhegemingzigouchang
    @zhegemingzigouchang7 жыл бұрын

    That background music creeps me out...

  • @mica122213

    @mica122213

    4 жыл бұрын

    wuhan?

  • @xSolBadguy

    @xSolBadguy

    2 жыл бұрын

    Really? I actually like it. Reminds me of the Minecraft OST, personally.

  • @fynn_svw1196
    @fynn_svw11962 жыл бұрын

    Where is this method used nowadays?

  • @skrmnghrd4520
    @skrmnghrd45202 жыл бұрын

    Wow

  • @harshvarshney9414
    @harshvarshney9414 Жыл бұрын

    We'll explained

  • @MJKarkoska
    @MJKarkoska5 жыл бұрын

    I'm having a hard time understanding part of this, but then again I am not very familiar with the ideas themselves. If A and B publicly agree to the formula, then wouldn't their private number, and thus the ciphertext itself, be vulnerable since the attacker knows both the equation and the result of the variable that is the private number? If I am correct on this point then does the security come from the fact that very big numbers are used? I just looked up that part and it seems that these problems are harder to work backwards than they are forwards. With that said however, my next question regards the vulnerability of the device doing the actual calculations. There must be special software to manage the calculations and do the other things necessary since it cannot be done by hand, and therefore the actual encryption may not be vulnerable but the software itself could be right? And software vulnerabilities seem much easier than trying to break encryption in general. And does this hold true for public-key cryptography in general? The last thing I wanted to touch upon is the fact that it seems dangerous to base the cipher on the difficulty in working an equation backwards on the computer's part, because computing power is increasing at a relatively steady rate. If quantum computers ever reach the point of being more like the personal computers of today, it is hard to imagine that, eventually, such algorithms will remain secure. I suppose that there could be multiple possible solutions in some cases, but this should not be a problem for figuring out the plaintext. If that day ever comes, are there other practical ways that provide message security? I know that the one-time pad system is quite inefficient and harder to implement in a digital manner, while by hand it is relatively easy, and thus it is hard to imagine this system ever gaining popularity despite its perfect encryption with proper use. Then there is the fact that if there needs to be a secure channel to exchange a secret key or password, then why not just transfer the message via that secure channel?

  • @singingirand7925

    @singingirand7925

    4 жыл бұрын

    1. Yes the secret is that very large numbers are used. Any form of security in computer science is breakable and brute forceable, but the amount of time it would take even on a supercomputer is so much longer than how long humans can live. 2. The software cannot have a mistake in it. If the software did, then there will be instances where the shared secret would be different and thus the process fails. Securing software is a whole other problem in computer science. 3. Again, back to the first point, it takes millions or hundreds of millions of years to brute force it. We won't be alive for that long even if computing power increases exponentially. If it does, we just make the number even larger, as we can work with bigger numbers to make the keys safer.

  • @ramseywalid2715
    @ramseywalid27158 күн бұрын

    goated

  • @theonlyrobg
    @theonlyrobg9 жыл бұрын

    What's keeping an intercepting hacker to get the public key and simply act as a negotiating peer?

  • @thepumpkingking8339

    @thepumpkingking8339

    9 жыл бұрын

    theonlyrobg Nothing.. Downgrading to a 512bit Crypto .. Does the job.

  • @virajdhila
    @virajdhila Жыл бұрын

    is 1 considered a primitive root of 2?

  • @Ruhgtfo
    @Ruhgtfo4 жыл бұрын

    I still not get the 3 pow mod 17 how comes? sos

  • @enriquegabriel7708

    @enriquegabriel7708

    4 жыл бұрын

    The mod is a math technique to get a value. You can determine easily the final number.. But it is impossible to get the originating numbers because it could be tons of combinations. They agree to send a generator and a prime mod. In this case 3 and 17. It could be any pair of numbers.

  • @nedkostefanovnedkov8643
    @nedkostefanovnedkov86438 жыл бұрын

    Great video! Noticed a couple of mistakes though. In 1:18 it falsely shows 3^(13^15) mod 17. It should be (3^13)^15 mod 17 = 3^(13*15) mod 17 = 3^(15*13) mod 17 = (3^15)^13 mod 17.

  • @Chriscx

    @Chriscx

    6 жыл бұрын

    I wasted 45 minutes on this. Honestly, this error makes it NOT a great video. A key element has crippling error for someone learning this for the first time.

  • @baatar

    @baatar

    5 жыл бұрын

    What happens to the second [mod 17]? I see that 12 is replaced by (3^13), for example, but do we just throw away the [mod 17] that was used in the calculation of that 12??

  • @user-nw7pm2lw7i

    @user-nw7pm2lw7i

    5 жыл бұрын

    Well. I think (3^13)^15 = 3^(13*15). For example (2^2)^3 = 4^3 = 64 2^(2*3) = 2^6 = 64 Another Example (3^3)^4 = 27^4 = 3^12 3^(3*4) = 3^12 I think there is no error...?

  • @zes3813

    @zes3813

    3 жыл бұрын

    wrr

  • @xeobit2781

    @xeobit2781

    Жыл бұрын

    @@baatar its called the modular exponentiation property sorry for 4 year late reply

  • @slymanyonga7226
    @slymanyonga72264 жыл бұрын

    x^2^3 != x^3^2 , you made a mistake there its not 3 raised to the 13 raised to the 15 its 3 raised to 13*15, of which multiplication is commutative thus equivalent to 3 raised to the 15*13

  • @hahagroup4892

    @hahagroup4892

    4 жыл бұрын

    True that!

  • @itjoe7344
    @itjoe73445 ай бұрын

    I had to study what mod is to understand this video.

  • @VitorFThome
    @VitorFThome10 ай бұрын

    Guys is it just me or anyone else noticed in the beginning of the video that he stated that both Alice and Bob agreed publicly agreed on the " 3 mod 17"... and he did not include THIS information on the diagram, only the number 6 and number 12.... Is this a flaw on the Diffie-hellman security???

  • @RubenLeyva-uw4lf

    @RubenLeyva-uw4lf

    9 ай бұрын

    They never share the private keys And they are needed to get the final result So no

  • @Fabian-ff4cq

    @Fabian-ff4cq

    5 ай бұрын

    no, as everyone can know the public key. In fact, it would be good for them to have everyone know their public keys, because the only way to actually interfere as a MIDM at the DHE would be to listen the conversation from t=0. Because then the MIDM could give fake key information to the two parties each. By having the Public key literally public, they can ask for a third party, that a safe connection can be established to by both parties, to sign the public key and therefore prevent MIDM / detect an Intruder that interferes even from t=0 on.

  • @magicmike1122
    @magicmike1122 Жыл бұрын

    Yeah until the Discrete log problem is solved!

  • @virajmurab1473
    @virajmurab14732 жыл бұрын

    what must be going on in the person's mind who made the algo while making this lol

  • @5000cz
    @5000cz3 жыл бұрын

    can someone please explain what mod 17 is?

  • @rohanmaurya1008

    @rohanmaurya1008

    2 жыл бұрын

    modulus is a remainder like if you want '50 mod 12' answer will be 2 ..and there is nothing like 'mod 17' but if you consider it is same as like ' 1 mod 17' which is 1

  • @johnprice4847

    @johnprice4847

    2 жыл бұрын

    it's explained in the full video they took this from, which they didn't mention in the description: kzread.info/dash/bejne/ZYWippScZLvVps4.html&ab_channel=ArtoftheProblem

  • @splinter1817

    @splinter1817

    2 жыл бұрын

    engineering yaako madtaidiya loude

  • @barax9462
    @barax94622 жыл бұрын

    what if Eve interrupted Bobs value and sent her own ??

  • @96production23

    @96production23

    2 жыл бұрын

    Then Eve can read whatever she want, but that's actually not a problem of this algorithm. DH is used for encryption, you kinda have to trust who is on the other side. For that, there are signing algorithms (like RSA), that are used to determine whether the person on the other side is the one who he's pretending to be or not. Basically: DH - you can be sure, that the communication can be read only by the person on the other side, but you don't know anything about the actual other side RSA - if you use it in combination with DH, you can be sure about who is on the other side, and that no one except you two can read the communication.

  • @rohanmaurya1008
    @rohanmaurya10082 жыл бұрын

    This is a Copy content from "Art of the Problem" channel you can check it out by yourself. And the credit also not given in description

  • @DaBoi808D

    @DaBoi808D

    2 жыл бұрын

    they really did tho

  • @johnprice4847

    @johnprice4847

    2 жыл бұрын

    @@DaBoi808D where?

  • @exxodas
    @exxodas9 жыл бұрын

    can someone explain why the initial modulus and the generator are prime?

  • @exxodas

    @exxodas

    9 жыл бұрын

    +exxodas I'm guessing it's to guarantee that secret does not end up to be zero, but I'm not sure :/

  • @binrar

    @binrar

    8 жыл бұрын

    +exxodas The shortened version: In order to make sure that a hacker cannot break this key, the numbers have to be extremely large. Extremely large numbers will take a computer a very long time to calculate. But there are certain mathematical principles that you can apply to reduce the computation time for the modulus. This is a very quick explanation. Look up Little Fermat's Theorem, Euler's Theorem, and Square Modulo Rule, and theres one more theorem that is important, but I cant seem to remember the name.

  • @Ali009Ahmed

    @Ali009Ahmed

    8 жыл бұрын

    The generator is not prime, it's a primitive root of the modulus. Making the modulus prime ensures that this generator produces a uniformal distribution of all the numbers from 0 to "modulus-1" (as said in the video, it's from 0 to 16 for a modulus 17).

  • @rubiskelter

    @rubiskelter

    6 жыл бұрын

    Not quite true, you are mixing RSA (prime factorization) with discrete logarithm problem. This has to do with some mathematical stuff he didn't explain in the video. +exxodas Go read about finite fields, specifically, Galois Field .

  • @johnprice4847

    @johnprice4847

    2 жыл бұрын

    to anyone else wondering, it's explained in the full video they got this from (which they forgot to mention): kzread.info/dash/bejne/ZYWippScZLvVps4.html&ab_channel=ArtoftheProblem

  • @pinguluis7533
    @pinguluis75336 жыл бұрын

    At 1:53; Eve can only get 3 as 12^6 mod 17 or get 13 as 6^12 mod 17. We know that 13 - 3 = 10, and 10 is the shared secret. Is this just a coincidence?

  • @hattrickster33

    @hattrickster33

    6 жыл бұрын

    Yes this is just coincidence. Also remember that in real life, this example could be decrypted very easily. We would be using much larger numbers. Currently, the standard key size for Diffie-Hellman key exchange is 2048 bits which gives a maximum key size of something like 3.23 x 10^616, which is a number that is 617 digits long!

  • @studentoflife3140
    @studentoflife3140 Жыл бұрын

    So do the secret keys not need to be prime? In this example Alice's secret key is 15 = 3*5

  • @mohammednayeem3608
    @mohammednayeem36083 жыл бұрын

    For sure you are a student of Dr.Chuck, aren't you?

  • @ENGosama-qs1oh
    @ENGosama-qs1oh3 жыл бұрын

    aaaa what?!

  • @colab5884
    @colab58842 жыл бұрын

    L

  • @qq2262
    @qq22626 жыл бұрын

    'Art of the problem' v=3QnD2c4Xovk He is, as far as I know the owner of this material. You have hereby been reported to 'Art of the problem.'

  • @laurencetu941
    @laurencetu9412 жыл бұрын

    短小精干,牛逼!୧(๑•̀◡•́๑)૭

  • @fromscratch7583
    @fromscratch75834 жыл бұрын

    I think in this case it would have been alot clearer if you explained everything in terms of variables instead of using an example

  • @seabiscuitthechallenger6899
    @seabiscuitthechallenger6899 Жыл бұрын

    With all four public number and some algebra the password can be uncovered 😈

  • @seabiscuitthechallenger6899

    @seabiscuitthechallenger6899

    Жыл бұрын

    kzread.info/dash/bejne/nICZsLprmrzbhdY.html

  • @Anonymous-vh6kp
    @Anonymous-vh6kp2 жыл бұрын

    The words spoken in this video do not match the animation.

  • @jorjiang1
    @jorjiang16 жыл бұрын

    Here is one way for eve to hack it, he can pretend to be Bob and send Alice a message sighed by her secret number, in this example, alice does not have a way to identify the coming message is signed by Bob or Even, if she was tricked it was Bob and signed with her secrete number and send to public, eve can then use her secrete number to crack the information, while bob can not.

  • @BeastyBundy

    @BeastyBundy

    4 ай бұрын

    No, there are many ways that Alice would be able to verify the source of the information.

  • @lwazisibindi5129
    @lwazisibindi5129 Жыл бұрын

    what in the Western sorcery is this.

  • @theempath508
    @theempath508 Жыл бұрын

    This video is misleading. Eve can find the solution by pursuing the prime and the primitive root. Disliked. Obfuscating the attack.

  • @kelvinchong1736

    @kelvinchong1736

    Ай бұрын

    Good luck doing that

  • @xyz3188
    @xyz31889 ай бұрын

    hi , can i contact you pls ?