Public Key Cryptography – Computerphile

Public Key Cryptography – Computerphile

The thing I wanted to talk about today, um… One of the things is a.. the coolness that is public-private key cryptography The basic idea of how it works I think is uh… is just cool and such clever idea that I want to explain it So everyone is familiar with the basic idea of crypto, where you umm You have a secret key You used that to encode some information which converts it from a readable format to garr garbage effectively ah.. it looks like a random noise You then transfer it to somebody else and they then able to decrypt it and get the message out and anyone who is listening here on your communication um… isn’t able to find out anything about the information that you are communicating the way you intuitively think about, especially if you doing these simple codes, something like caesar cypher that you might do when you are a kid there’s one there’s one secret that you both have, right, this…this is a symmetric system so you have got your message saying HELLO and then you do some process to it to convert it using a key that some secret piece of information which then converts this into nonsense and then you send this to the other person and they decrypt it with the process that kind of same process in reverse using the same key and then again HELLO backout at the other end and that’s nice and simple it works um… and it was once sort of only way people did this but it has a problem which is you both need to know what this key is so if it is you and me. And we want to communicate with one another privately we have to agree on a key that’s nobody else gonna guess and we have to share it with one anther um so we might meet in the park in secret and exchange envelopes or whatever this is the kind of things spy used to do, right and the problem with that is first its very inconvinient second, you sometimes can’t do it, might be physically separated or we want to do something over internet and we never met the problem is that how do I send this key to you without just sending the key in the clear, as it were unencrypted inorder for us to share the key safely we need a secure encrypted connection but we can’t establish a secure encrypted connection without a key there’s a way of solving this problem which is asymmetric encryption um…where what you do is generate two keys key a and key b let’s just call then and i m drawing a line asymmetric system you have two keys and then basically it’s same as before you have got your message says hello you encrypt it with key a to say whatever it was that I decided it was and then back out you get HELLO again and decryption in this case uses key b you can’t guess one key from other but they are linked in such a way that anything you encrypt with key a can only be decrypted with key b and anything you encrypt with key b can only be decrypted with key a so there’s two and what you do is you generate a pair of these keys, which is called key pair and you just pick one of them and say this is my public key right and your public key is public you publish it everywhere you put it you put it at the end of emails your forum posts you…you upload it to keyserver just specialized serve system designed for storing, securely storing people public keys basic idea is it’s everywhere out there in the world with your name on it the private key is the other key of this pair that one you keep absolutely secret you can do some cool things with this once you have system setup i have a key pair you have a key pair we both have one another public key so now if you want to send me a message i don’t have to share anything with you you just know my public key encrypt something with my public key send it to me you know i can decrypt it because i have my private key and then there’s another thing you can do with this which is if i encrypt something with my private key and then publish it now on the surface you may think what is the point of encrypting it with your private key because your public key is out there and anything can decrypt it so why bother encrypting but the fact that it can be decrypted with your public key means it must have been encrypted with your private key which it must have been you who made the message because only you have your private key cryptographically you can be certain that it’s an authentic message really from that person so the best thing is that when I do both where i encrypt something from my private key and then your public key and then send it to you and if we communicate like this i know that no body else gonna read the message you know that no body else can read the message you know that message is come from me, not an impostor you also know that the message hasn’t been modified because any modification to the message also require the keys that’s a great secure system and we didn’t have to meet up in the park in a secret way and exchange any information or anything we never have met i need to make clear here that I have oversimplified in various ways people who understands cryptography will be quiet upset probably by now but guys this is this is why people don’t use crypto because we make it to complicated core concept is simple and basic stuff isn’t it difficult to use and everyone should when you put envelope in the post you kind of assume you lick the things to seal it and if it’s been open people will know it’s been open and there is laws about this and we have to know these stuffs when you communicate in the clear you know anyone and his dog can know exactly what you’re sending to everyone and there’s no reason to allow that

Danny Hutson

100 thoughts on “Public Key Cryptography – Computerphile

  1. Hey I am trying to create that exact systems to decrypt the key I could do en algorithm to make it and that reversed code to decrypt it right, my system doesn't need to be that thought.
    This is so new to me I am doing resserch for a video game online protection to prevent other players to steal some codes I'm making online, the game is gmod.

  2. I really love this explanation. But does RSA encryption work in this same way. When looking at RSA encryption online I came across key generators online, but the public keys and private keys were different lengths. One website also had a little encrypted and decrypt function but it did not work backwards like how you explained but just spat out an error when entering plain text into the 'decrypt' field.
    Can anyone shed some light on where I am getting confused.

  3. This is an absolute peach, and kudos to the explainer. This is the only vid which explains, what happens when you encrypt a message with a sender's private key and the receiver's public key. +1

  4. Short simple and precise. Thanks Robert for explaining yet so complicated system in a simple way. You have widened my horizon much more than it was 6 minutes ago.

  5. Computerphile, could you give me directions on an encryption algorithm that features just one key to encrypt and decrypt insteado of two?

  6. What I don´t understand is, at 3:00 he says:
    everything you encrypt with key A you can decrypt with key B, and everything you encrypt with key B you can decrypt with key A. But key A is public, and if you encrypt with key B and everyone got key A (Because its public), everyone can read the information?! can someone explain this to me please.

  7. The quick-zoom jumps in this clip is so freaking distracting and annoying. Trying to use trendy cinematography methods totally ruined your otherwise great content.

  8. Help, I don't understand. If your key is public. Anyone can know ''how'' your message is encrypted. Thus they can just make a key that opens all of your messages….

  9. wait so, what happens if I was hacked by a MITM and I encrypt my message with my private key and via his public key. He could just decrypt it with his private key and decrypt my authentic message with my public key and just re-encrypts it again with his private key and encrypts it again with the recipient's public key? This doesn't make asymmetric encryption authentic..

  10. Guys, here's my public key. Please use this to encrypt all your messages before sending to me. Thank you.

    ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQD47AFuqpLnD5t0zujxyeIr3gGSoc/QuQtfoVS1q0eKMv3fxntAF91bsY4+Qa61GRAKBZxgiezSrlyk8gGmjwClawHjV87TLdWoY0T7SuTUkcg2T/G8PQeEsnZt5k6EArC03ngwZ7AANR9dMgD34xQaomMwmaMFfOsr+7kSYL5vEIqEkVY6nei6kiFMGzGnxhCiq+mntgP5Dlf7I2zKE9+9ZiIQtwvUxPgOwvin2+lJtInUXhl8Leh8F9oGQa5V9lc0JJ5hWADzuPtLb6atXba9u+RCQ/jIhIAPfqPpaipPh+BpOmn8D+azCu3E9dtgU/ohqIr7/e7tPIMfgIEUc5gdAH+HLRNliDfMu3uHn1Q7dMkOR54L3fHGQvqm/WGdxgb4lAyauR0Et8fG0yszznRNmwY55Gwr0ytQC9OFvN42yj8WEOfTY/0KzkerXzadizLIJZimcvM1pMiGfYZo6Ljvc3okaUHZAFTN9nQnav7spFJXsslxB2vUTP/ATmBXKJwFo9ME5YBhiwBPMFoHDTyKGb/jaldatyA09dkzpUQ+9uzLvMpZgURlLMdTt9aVKMcg9yV9UJnFJKIvwn6qqWdjoJZZQWqXUi6bg0Ria/F7eWysxfTmUvL6xfxhLUL17OoUKByvb5v8cdtjq9VoQnAh3PbrSN0o1pXAH8SQ+tRCNQ

  11. He said 'you pick one of the keys'!
    As far as my understanding goes, private keys are named private not because you picked them to be private. They're named private because you can *derive* the public key from them, which breaks your whole crypto system.

  12. Nice, Sir could you explain it, how the public key and private keys encrypt and decrypt the data? if you make a video on it in the case of Ipsec Vpn, i shall be very thankful to you.

  13. hello, si he calculado (R1,R2), (S1,S2) Y (z1,z2), COMO OBTENGO LA CLAVE PRIVADA EN ECDSA BITCOIN

  14. Man, I have been thinking about the identity problem for a while, either with RCA or ECDSA.

    I have come to a conclusion that both are good ALGOs to assure the possession of a Privite Key. HOWEVER, both algos are insufficient to prove identity prove identy, and unless I have a way to confirm the identity of my peer, I am still exposed to someone in the middle of the channel.

    In this case, we cannot be sure whether a possesor of a Private Key who wants to communicate with BOB is ALICE or SEAN. Unless I have a way to confirm their identity.

    Can you comment on this?

  15. Thank you so much for this. I have watched multiple clips but never really got to understand that simple thing. Techies on purpose use complicated lingo to confuse rather explain.

  16. I dropped all of my computer science classes and changed majors because I could not grasp this basic concept!!! This guy explained it in 5 minutes!!!!

  17. So I still don't quite understand. If I encrypt a message with my private key and and everyone has my public key, can't some still read my message?

  18. An example would have been nice – it's not clear to me what the distinction is between two keys for which one encrypts and the other decrypts. What is the system to make that work?

  19. Sometimes just knowing the size of a message, when it was sent, from where and to where is enough to effectively guess the significance of an encrypted message. One encrypted message in a sea of unencrypted messages stands out. I guess the only solution is for everyone to be sending lots of encrypted garbage to each other all the time.

  20. But if you encrypted message with your private key, how it can be decrypted on other side, if nobody else knows your private key, but you?

  21. I know cryptography, your explanation is wonderful. No need to go into technical details of the algorithms involved. Well done!!

  22. But how are Key A and B inextricably linked??? This seems the central innovation of PGP but I still don't understand why it works

  23. At 4:37, when he encrypts his message with both his private key and the intended recipient's public key, I understand he's signing his message that only the recipient can read. I get that the recipient can then decrypt the message using his private key, and then decrypt the message again using the original sender's public key to ensure the message's authenticity.

    My wonder is whether blockchain transactions work this way or not. My understanding is that it does not work like this. While everyone may have my public key and address, my private key is only known to me. So, I would sign my transaction with my private key that can then be validated by anyone on the network with my public key and address. Actually, Robert's original explanation is strictly between two parties that exchanged public keys with each other whereas my blockchain example, the exchange of public keys is strictly one way: me to the world.

    It makes more sense when I write it out but it would be nice if others could take a look at my explanation to see if I've made a mistake somewhere.

  24. I don't really get how a key can be private. What if someone was to look at the assembly of a program. Couldn't they recover the key?

  25. You could make a video about how we can use GPG/PGP in real life, to encrypt e-mails or sign something we distribute. How to generate a keypair, how to distribute the publickey, what are good practices, how secure is it (encryption algorithm choices).

  26. Would one be able to encrypt and decrypt using the same key (e.g. public key?) Because if so, doesn't that mean that if I wanted to pretend to be something else, I could encrypt something using that person's public key, then encrypt it with the receiver's public key and the receiver would decrypt using their private and the other person's public key, but it is actually from me.

  27. in the case you encrypt a message with both keys, the receiver needs to have both keys to read the content? right.. so what's the point in encrypting with both keys since it can't decrypt the message without both keys

  28. One of worst names is "public key" .. wtf? Why it's called key? It's more like "public opened trezor" .. once u put something in and close it, it can be opened only by it's owner with his private key …

  29. Can we transfer private ssh key from one windows machine to another window machine to connect to sFTP server???

  30. It is nice video, but private key and public key is not equal and you should only send the public key to other, can't be the other way around, because, the public key can de deduced from from private key

  31. Question here!
    I can encrypt my message with server public key and send it to a server. But how can I be sure that this public key is actually from this server and not from man in the middle?

  32. The trouble with this system is that you can never hide your email address 1024D/ECEDF753 2000-03-07 Robert Miles <[email protected]> and everybody knows you are hiding something in cryptography.

  33. What if the sender is someone who mimics the real one, lets say that the message is: "Hey I'm your friend, Mike". How the receiver knows that the sender is indeed his friend Mike and not someone who sends the exact same message at the same time ?

  34. When you encrypt with your private key and the second party public key, there no risk of exposing your private key to the second party?

  35. I don't get this part 4:20.

    Setting up the scenario for public/private key encryption, let's say person A has private key A and public key A and likewise person B has private key B and public key B. How does it establish secure communication…

    If person A encrypts a message with his private key is that message coming from A in the first place? If person B has the message in the first place how does it ever get encrypted with the private key of person A? The only way this whole process would make sense to me is to use this only for handshaking purposes but then.

    OR! Person A encrypts a secret so-called secret A and then sends it to B for him to sign messages with by appending it on to his own message and then he encrypts with public key A and sends it back. Is this what he's referring to at this part?

  36. Thanks for the explanation. Am I the only to suffer from that marker-writing scraping sound? =)

  37. I didn't find this clear. I didn't understand how keys are generated, how they can be changed when needed.

  38. it's weird how easy it is to get lost when listening to these private and public key explanations. I think this may be first time I actually got it, and I had to use pen and paper to keep track of what he was saying.

  39. It's crazy how after class and so many videos, only one of them finally makes sense (this one) and now when I start watching the other stuff it starts making sense. Every time I search for stuff now I hope I find a video from you guys with an explanation.

  40. I wondered on how GitHub and GitLab can ensure that it is from me, by only knowing my public key!! Thanks for the concept, I am clear now!!

  41. It is safe to store information encrypted by this method as no one can decrypt without both of the keys. I think you said that anyone with access to the public key would be able to decrypt but this is not so. That is the reason why it is safe to publicly share your public key so that others can use it to encrypt data that only you will be able to decrypt with the corresponding private key.

Leave a Reply

Your email address will not be published. Required fields are marked *