HomeОбразованиеRelated VideosMore From: Computerphile

Public Key Cryptography - Computerphile

9288 ratings | 405563 views
Spies used to meet in the park to exchange code words, now things have moved on - Robert Miles explains the principle of Public/Private Key Cryptography note1: Yes, it should have been 'Obi Wan' not 'Obi One' :) note2: The string of 'garbage' text in the two examples should have been different to illustrate more clearly that there are two different systems in use. http://www.facebook.com/computerphile https://twitter.com/computer_phile This video was filmed and edited by Sean Riley. Computer Science at the University of Nottingham: http://bit.ly/nottscomputer Computerphile is a sister project to Brady Haran's Numberphile. See the full list of Brady's video projects at: http://bit.ly/bradychannels
Html code for embedding videos on your blog
Text Comments (883)
Andy E (8 days ago)
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.
ShamanMafia (8 days ago)
4:08 can someone explain to me why or how the double encryption is used?
Anonymous (26 days ago)
Can I just say, I am not OK with using markers on paper, it's just not right to do that.
gowo (29 days ago)
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
Stephan Onisick (1 month ago)
Good Explanation. I now understand two pairs are involved.
SkinnyCow (1 month ago)
jeez if this guy was my maths teacher i'd know more than basic arithmetic!
Korin Clemens (1 month ago)
THIS MAKES SO MUCH MORE SENSE THAN HOW I WAS TAUGHT
Peter Suwara (1 month ago)
I know cryptography, your explanation is wonderful. No need to go into technical details of the algorithms involved. Well done!!
coppersandwich (1 month ago)
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?
Ingólfur Valsson (8 days ago)
If he encrypts with the private key, you can decrypt with the public key, which is public. The reason for encrypting with a private is authentication, not secrecy.
Benjamin McLean (1 month ago)
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.
Ajeet Gary (1 month ago)
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?
Ingólfur Valsson (8 days ago)
There are multiple standards that use a keypair. RSA is well known for example and plenty of programs out there that can help you generate such a pair.
drrider100 (2 months ago)
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?
Chris Savage (2 months ago)
Fantastic video -- I've not seen this explained so clearly anywhere.
John Dalecki (2 months ago)
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!!!!
Panos Hountis (2 months ago)
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.
goedeck1 (2 months ago)
Thank you
Apoorv Singh (3 months ago)
I think you can make a separate playlist of videos to explain other cryptography techniques in simple words.
Jk Sharma (3 months ago)
My Friend .... You made the mystery very simple.... Thanks
Crypto C Trade (4 months ago)
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?
Alfredo Eduardo (4 months ago)
hello, si he calculado (R1,R2), (S1,S2) Y (z1,z2), COMO OBTENGO LA CLAVE PRIVADA EN ECDSA BITCOIN
Janac Meena (4 months ago)
You can tell this guy is a gangsta
Rogi Solorzano (5 months ago)
GREAT EXPLANATION
Ikram Khan (5 months ago)
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.
kishor das (5 months ago)
Wolverine 😂😂😂
rambo arnold (5 months ago)
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.
Ingólfur Valsson (8 days ago)
I think he means, you pick which one you want to be the private one. As in it doesn't really matter, either one can be the private. But once you've picked you never share that one. You might have seen a keypair where the private key is longer than the public one, I think its just that some additional data about the keygeneration method is added in after the fact to speed up decryption. Perhaps you can derive the public key from the private one IF you have that additional data, I'm not sure. But when generating the two keyes initially it doesn't really matter which is which.
minrax mx (5 months ago)
An awesome explanation, tx!
A M (5 months ago)
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
Jannis Adamek (5 months ago)
this is such a clear explanation, well done!
Daniel Pleuß (5 months ago)
LL from hello are different crypted?
Colin Allcars (6 months ago)
Just watched a dozen videos on this....this is BY FAR the best explanation. Thanks.
Gustavo Naranjo (6 months ago)
Yeeesssssss. Finally understood it...
larax222 (6 months ago)
I want the complicated version :D
Eazy E Awake (6 months ago)
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..
newton kumar (6 months ago)
Explained in a very simple way ..thanks ...keep making more videos
Andries Van Tonder (7 months ago)
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....
Kornstalx (7 months ago)
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.
Skulltruck08 (7 months ago)
What if we share keys through vpn end to end connection?
Kenan (7 months ago)
Thank you so much that you oversimplyfied, finally i understood the magic behind :)
christophmaerz91 (7 months ago)
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.
Computerphile (7 months ago)
Encrypting with a private key so that the public can decrypt with a public key confirms that the only person who could have encrypted the message is the owner of the private key - key B is the private key in this case - for authentication rather than to keep something private. HTH >Sean
Reyner Godoy (7 months ago)
Computerphile, could you give me directions on an encryption algorithm that features just one key to encrypt and decrypt insteado of two?
Katie Graham (7 months ago)
Toward the end I realized I had my head tilted to match the angle of the camera lol
the diamond Minecraft (8 months ago)
your to smart fot me
Umang Gupta (8 months ago)
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.
Pharaoh on LFS (8 months ago)
Ahh the good ol days.. Now “crypto(s)” is short for crypto currency..just a few years later.
Kulasangar Gowrisangar (8 months ago)
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
Rami Baik (9 months ago)
You are just amazing
Amrisha Kumar (9 months ago)
this is something amazing to see and fear
Max Harrison (9 months ago)
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.
Lisandro L. Resto (9 months ago)
Studying for Security Fundamentals for Cisco's CyberOps and this video explained things very clearly. Thank you!
Sypher866 (9 months ago)
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.
Billy Ray Valentine (9 months ago)
This was the clearest and most excellent explanation I've seen. Nice video!
ChromesClips (9 months ago)
Jean Ralphio??
Ellen Josephine (9 months ago)
Perfectly explained!
Mirza Farrukh Ali (10 months ago)
very nice ,you oversimplified ....great
Jackson (10 months ago)
Wow I was just taught cryptography by Jean-Ralphio
RIPxBlackHawk (10 months ago)
I have an IQ of 125 roughly and I have understood your explanation. Now I have no background in Cryptography though I think any more detailed explanation would overwhelm me so much that my eyes would go cross-eyed during the speech and I'd stopped paying attention as I usually do.
James (10 months ago)
Best explanation ever! Really helped clarified the key point. One question: how do we know which public keys to use given that there must be millions of public keys out there? Do we know which public key is associated with the sender of the message?
Arosh Wijepala (10 months ago)
Love this channel. Thanks guys!
CaseyCJL (10 months ago)
bitcoin uses this asymmetrical encryption correct?
Marian Palko (10 months ago)
Obi One. 😂👍
Nicolás Coppo (10 months ago)
Thank you!!
Y Stroli (11 months ago)
I don't understand the last example of sender encrypting with both keys if the receiver only has the public key message will stay encrypted, as the sender's private key is needed to decrypt.?
SoS (11 months ago)
I was searching for any *Cryptography Community* to join but I could'd find one. So I've created a *Telegram* Group all about "Cryptography" , if you are a Cryptography enthusiast , You can join community here: https://t.me/joinchat/E6oALUYaubzaKIMvAmnR9Q  We love ♥️ Cryptography
Jim Gerth (11 months ago)
So how do these keys typically encrypt the message then? Obviously not the Cesar cypher...
Louie Mott (11 months ago)
"look down in my trousers, where there's a lot of commenters" xD
S508029 (11 months ago)
mr davies put this youtube video such noob
S508029 (11 months ago)
l + c pls
S508029 (11 months ago)
pls like
SPeed_FANat1c (11 months ago)
You are awesome. Thats how things should be explained. I hate so much that people explain sometihng to me and blame me for not understanding and not themselves for not explaining clearly. Best ever explaination so far I have found. I studied informatics at univercity and we were encrypting, decrypting things, done tasks in detail, but I did not even understood from a basic abstract point, which I first had to. Btw I still had to watch this video 2 times and write notes in notepad, until I fully understood but that still is awesome.
DVD playerz (11 months ago)
But if the private key can be unlocked by the public key then anyone listening to the conversation (a middle man) can just use the key and decrypt whatever im recieving no?
Double Orts (7 months ago)
You Encrypt the message with your private key, and then layer another encryption on top of the first one using the other guy's public key. So, your middle man cannot decrypt the message because he does not have the other guy's private key, but the other guy will receive the message, remove the second encryption layer with his private key, and then remove the first encryption layer using your public key, therefore ensuring that the message was genuine (your public key only works for decrypting your private key).
Brian Ferreira (11 months ago)
Okay, so how are the keys made?
Dan Kelly (5 months ago)
Big numbers created by multiplying two big prime numbers. It takes advantage of the fact that there is no known quick method to find the factors of the number that was created by multiplying the big primes. That's the concept but of course there are more details.
tiago pires (11 months ago)
Subbed!
Graham Richardson (11 months ago)
THANK YOU. So so so so so well described as opposed to other attempts on the internet.
The Up There (11 months ago)
I visualize 256 bit encryption like 2^256 railroads arranged in a circle so that they all point towards the middle (sort of like a clock with 2^256 positions), and they are also stacked 2^256 high. There is a rotatable platform in the middle that has a straight piece of railroad that can only connect two railroad-pieces at a time, to make a connection from one side to the other. At which position your track is on "the clock" is your public key. At which level your track is (height wise) is the private key. Combine them and you get the only possible way to connect the railroad for passage.
Croft-Tom (11 months ago)
I finally understood Shared Key encryption. Thank you.
Phil Keyouz (1 year ago)
Factoring N is difficult but discover the totient of N is simple , use a modify collatz algorithm. Start with x=N-1 and count=0, if x is even x=x/2 and count = count +1, if x is odd x=N-x do this until x=1. At the end 'count' is a divisor of phi(N). It's why NSA love RSA.
Vineet Pandya (1 year ago)
Pl explain with crayons fam.
Vignesh palanisamy (1 year ago)
Thankyou for the explanation... now i am crystal clear✌
Sowmay Jain (1 year ago)
Why the message which is encrypted from public can't be decrypted with that same public key? So if a message which is excrypted by private (sender) and public (receiver) key then why can't it be decrypted by both public key? Because the example he gave in the video is working both sided that is: - Encrypted by private key and decrypted by public key. - Encrypted by public key and decrypted by private key. Any explanation?
BigDataKid (1 year ago)
This is an awesome video!!
Super 02 (1 year ago)
1:06
Biouda VV (1 year ago)
Awesome! Thank you
sophie m (1 year ago)
so at 4:43 you talk about encrypting with both private and public keys I wish you could elaborate. Why double encrypt the out going message with secret key and then with public key? how would this then be decrypted by the receiver if he only has a public key that decrypts the message with the secret key?
BenIsANerd (1 year ago)
In simple terms, PGP or Pretty Good Privacy
zenix cybercube (1 year ago)
i have a question... if i encrypt a message with my private key and then the public key and then send it to my friend... how can my friend really read the message ???? he only has the public key but not the private key
Bruno (1 year ago)
You encrypt with your private key and your friends public key. Your friend can then decrypt with his private key and your public key. Things encrypted with your private key can only be decrypted with your public key. Things encrypted with your public key can only be decrypted with your private key. That's why you switch between your private and your friends public key to encrypt.
Wade Butts (1 year ago)
Hands down, THE BEST, lay man's explanation of asymmetric encryption. WOW Professor!!!! Very Impressive. Could you provide viewers (me) a high level (distilled) timing diagram and supporting flow chart that allows visualization of the life of a Single Bitcoin Transaction. Note: Bitcoin's biggest challenge is the GET FACTOR. I would like to contribute but can't get it from my head to paper/words like you just did for cryptography. 1. Wallet - High Level (HL) Sub categories/functions (SCF) between source destination (Bob, Alice-yes one of viewers comments wanted Bob, Alice mentioned) timing diagram exchange states. 2. Mining - HL SCF. 3. Blockchain - HL SCF Assumption: Transaction on a full Bitcoin user node. My e-mail address is [email protected] for questions.
Miraj Asghar (1 year ago)
For the very first I clearly understood what actually public key cryptography is... Thank you!!
Knitting Workshops (1 year ago)
Thanks. I get it now.
Anton Nym (1 year ago)
I came up with an idea to send a private message from Alice to Bob without having to send a key (or combination) in either direction. I guess this would be called no-key cryptography.
Astrorobics (1 year ago)
One part I don't understand at the end when he says you can encrypt with the private key and then the public key is how does the recipient double decrypt again with just the public key. Or can they?
Manuel (1 year ago)
Damn good explanation
J.J. Shank (1 year ago)
obi one
mjwal00 (1 year ago)
thanks for the video. Very interesting and clearly explained.
cinemosophy (1 year ago)
Where do i go to set up public and private keys? I'm super new to cryptography
Andrew V (1 year ago)
I didn't understand the last bit of dual encryption. How can someone else decrypt something encrypted with your private key by using your public key? Wouldn't that defeat the purpose of public-private keys? I understand the relationship of public and private key as a one way street. Only you can decrypt the message encrypted with your public key with your private key.
Paroxine (1 year ago)
But if you encrypt something with a public key, why can't anyone decrypt it using that public key ?
Jay Park (1 year ago)
I love this channel, thank you thank you
Gaston Juigner (1 year ago)
Anyone here for an encrypted conversation ? -----BEGIN PGP PUBLIC KEY BLOCK----- mQENBFl4ohwBCAC7+32ExadtldhDWnsr/LnPmnUoHoIjP1c3t/yVbJ5X2EryakR7 pRJ1Vcog1olAdtvVSIev0l7JJxtYryahQC37z+FYPAw/mYDrfytOEUkJtF2H8gVF vK0LyxhYrZ63qHc2ilLkRU7IfuRjT5s8aIWxlafWROSkC6Zvovyw9BL5Cs9C/+r3 sCMqQlROGmD8Uw9TgDbM9U4xpkmQfoAxvmf8wIfj23xWGku3yHOagB2IN/U8OVi4 /tRPafqUTBZNBpPUpl0Ih7qCa5ye15nNGBYlShW6tgMmnjBOdDyL9IgOCO/+nDGS 112ZuVxZdrG9Y09IGNgzpNdLaKQQRAfTnKiFABEBAAG0I0dhc3RvbiBKdWlnbmVy IDxnanVpZ25lckBnbWFpbC5jb20+iQFUBBMBCAA+FiEEoKciZyWEWmMmmi7WtX01 dCheK0kFAll4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CnSV1mQ4F3O4M86jJs+OX4wbZGIgoqYK9VTJEwS/qJ1abIHfxd1mcj4m sWof9k3n+vWnzx+crSn5DhYaw41f9/I4UHwZ+E4MAdwt4AC/cqT9/sXLKA== =0hG9 -----END PGP PUBLIC KEY BLOCK-----
xoppa09 (1 year ago)
Finally an explanation that makes sense.
gudenau (1 year ago)
Was the camera man drunk? The camera is rotated in most of that.
Martín DL (1 year ago)
Is Public Key Cryptography impossible to decrypt it??
Taylor Gulf (1 year ago)
Or you might have too many messages where exchanging physical keys is too much.

Would you like to comment?

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