1 00:00:00,000 --> 00:00:08,000 So far we learned how to use BGP to encrypt messages so that only the receiver can read the content 2 00:00:08,000 --> 00:00:09,000 of the message. 3 00:00:09,000 --> 00:00:15,000 To do that, the sender, David, in our example, uses the public key of the receiver. 4 00:00:15,000 --> 00:00:19,000 So the receiver makes their public key public as the name suggests. 5 00:00:19,000 --> 00:00:23,000 That's fine because the public key cannot be used to decrypt messages. 6 00:00:23,000 --> 00:00:26,000 It can only be used to encrypt messages. 7 00:00:26,000 --> 00:00:31,000 So David encrypts the message with the receiver's Johns public key. 8 00:00:31,000 --> 00:00:38,000 The message is sent, and when John receives it, he uses his own private key that he never shares with 9 00:00:38,000 --> 00:00:40,000 anybody to decrypt the message. 10 00:00:41,000 --> 00:00:46,000 Therefore, David can send the message to John in any way he wants. 11 00:00:46,000 --> 00:00:53,000 He can send it as a text message, as an instant message, or even using an insecure service. 12 00:00:53,000 --> 00:00:57,000 That's fine, because if anybody reads the message, they will see gibberish. 13 00:00:57,000 --> 00:01:01,000 They won't be able to see the content unless they have the private key. 14 00:01:01,000 --> 00:01:06,000 And as long as John doesn't share the private key, there is no need for him to share it. 15 00:01:06,000 --> 00:01:10,000 Then nobody will be able to read this message except for John. 16 00:01:10,000 --> 00:01:12,000 So that's really, really good. 17 00:01:12,000 --> 00:01:20,000 The only problem here is that there is no way for John to verify that the message that they received 18 00:01:20,000 --> 00:01:23,000 has actually been sent from David. 19 00:01:23,000 --> 00:01:29,000 So, like I said, for this to work, John needs to make their public key public. 20 00:01:29,000 --> 00:01:32,000 So getting the public key of John is easy. 21 00:01:32,000 --> 00:01:36,000 Therefore John could have it in his signature and his email. 22 00:01:36,000 --> 00:01:38,000 He can have it in his signature in a forum. 23 00:01:38,000 --> 00:01:43,000 He might have it publicly shared because he wants people to send him encrypted messages. 24 00:01:43,000 --> 00:01:47,000 So there is nothing wrong with making your public key public. 25 00:01:47,000 --> 00:01:54,000 The only problem is someone can come in, pretend to be David, use John's public key to encrypt a message 26 00:01:54,000 --> 00:01:56,000 and send it to John. 27 00:01:56,000 --> 00:02:03,000 And that way, John has no way of knowing whether this message did actually come from David or not. 28 00:02:04,000 --> 00:02:08,000 To solve this problem, David will have to sign the message. 29 00:02:08,000 --> 00:02:11,000 This can actually be done with Pjp. 30 00:02:11,000 --> 00:02:14,000 So let me show you how this will work with this example. 31 00:02:15,000 --> 00:02:16,000 So again, we have David. 32 00:02:16,000 --> 00:02:20,000 He wants to send a secret message to John. 33 00:02:20,000 --> 00:02:27,000 And as we learned before, the first thing that David will do, he will use John's public key in order 34 00:02:27,000 --> 00:02:29,000 to encrypt the message. 35 00:02:29,000 --> 00:02:31,000 The message will change into gibberish. 36 00:02:31,000 --> 00:02:38,000 Now, at this stage in the previous lecture, we sent the message, but this time David is going to 37 00:02:38,000 --> 00:02:42,000 sign the message with his own private key. 38 00:02:42,000 --> 00:02:44,000 So he still hasn't sent the private key. 39 00:02:44,000 --> 00:02:46,000 The message is still at David's end. 40 00:02:46,000 --> 00:02:51,000 And what he's going to do is he's going to create a signature for this message. 41 00:02:51,000 --> 00:02:53,000 This signature corresponds to this message. 42 00:02:53,000 --> 00:02:59,000 And if anything gets modified within the message, if one letter gets modified, the signature will 43 00:02:59,000 --> 00:03:00,000 change. 44 00:03:00,000 --> 00:03:07,000 Therefore, this signature can be used to verify that the message has not been modified since it got 45 00:03:07,000 --> 00:03:10,000 signed by David's private key. 46 00:03:10,000 --> 00:03:13,000 Now, keep in mind, David is still keeping his own private key. 47 00:03:13,000 --> 00:03:17,000 He did not send it through any method of communication. 48 00:03:18,000 --> 00:03:24,000 So now we have a message with an encrypted content and with a signature that corresponds to David Private 49 00:03:24,000 --> 00:03:25,000 Key. 50 00:03:25,000 --> 00:03:29,000 Then the message is sent using any method of communication. 51 00:03:29,000 --> 00:03:33,000 Like we said, you can even use an insecure method of communication. 52 00:03:33,000 --> 00:03:41,000 John is going to receive the message along with its signature, and before decrypting this message with 53 00:03:41,000 --> 00:03:49,000 his own private key, what he's going to do is he's going to use David's public key in order to verify 54 00:03:49,000 --> 00:03:50,000 the signature. 55 00:03:51,000 --> 00:03:54,000 So like I said, the signature was created with David's private key. 56 00:03:54,000 --> 00:04:01,000 And then John doesn't have David's private key, but he's going to use David's public key to verify 57 00:04:01,000 --> 00:04:02,000 the signature. 58 00:04:02,000 --> 00:04:07,000 If the message was not modified, the verification will be successful. 59 00:04:07,000 --> 00:04:15,000 And this way John will know that this message was actually sent by David and was not modified by anybody. 60 00:04:15,000 --> 00:04:22,000 Because, like I said, if one letter gets modified, the public key, David's public key will not verify 61 00:04:22,000 --> 00:04:23,000 the signature. 62 00:04:24,000 --> 00:04:29,000 So when the signature is verified, we know that David was the actual sender of the message, and the 63 00:04:29,000 --> 00:04:35,000 message was not modified as it was sent, whether it was sent over the Internet as a text message or 64 00:04:35,000 --> 00:04:37,000 using any other method of communication. 65 00:04:37,000 --> 00:04:41,000 The next step is very similar to what happened in the previous lecture. 66 00:04:41,000 --> 00:04:49,000 John will use his own private key in order to decrypt the message and read its content, which is just 67 00:04:49,000 --> 00:04:50,000 a secret message. 68 00:04:51,000 --> 00:04:57,000 So as you can see, as a result of this, each party still kept their own private key. 69 00:04:57,000 --> 00:05:00,000 Nobody sent their private key to the other party. 70 00:05:00,000 --> 00:05:07,000 So the sender encrypts the message with the receiver's public key and signs the message with his own 71 00:05:07,000 --> 00:05:08,000 private key. 72 00:05:08,000 --> 00:05:10,000 The message is sent. 73 00:05:10,000 --> 00:05:17,000 The receiver verifies the signature with the sender's public key and decrypts it with his own private 74 00:05:17,000 --> 00:05:17,000 key. 75 00:05:18,000 --> 00:05:23,000 This way he can verify that this message came from the sender. 76 00:05:23,000 --> 00:05:27,000 He can verify that the message did not get modified as it was sent. 77 00:05:27,000 --> 00:05:29,000 And the message is encrypted. 78 00:05:29,000 --> 00:05:35,000 And the only person that can read it is the receiver, because he kept his own private key private and 79 00:05:35,000 --> 00:05:37,000 it was not shared with anybody. 80 00:05:38,000 --> 00:05:45,000 Now all of this should become clearer in the next lecture as I'm going to show you how to encrypt messages 81 00:05:45,000 --> 00:05:48,000 and sign them as a sender. 82 00:05:48,000 --> 00:05:55,000 And I'm also going to show you how to verify the signature and decrypt the messages as a receiver.