1 00:00:01,380 --> 00:00:10,530 OK so so far we learned how to use BGP to encrypt text and send it in a way so that the receiver is 2 00:00:10,530 --> 00:00:15,030 the only person that's able to read the content of the text. 3 00:00:15,030 --> 00:00:21,840 Not only that but we also learned how to sign the message to sign the text so that the receiver can 4 00:00:21,840 --> 00:00:26,320 verify that this message was actually sent from us from the center. 5 00:00:26,340 --> 00:00:32,010 So it's really really good because now when a message is sent we're sure that it can only be read by 6 00:00:32,010 --> 00:00:38,550 the receiver and the receiver can be sure that it was actually sent from the sender and he can also 7 00:00:38,550 --> 00:00:42,960 verify that the message did not get modified as it was sent. 8 00:00:42,960 --> 00:00:45,390 So this is really really good. 9 00:00:45,390 --> 00:00:52,860 The only problem is we can only do this for text so what if you wanted to send a document or an image. 10 00:00:52,860 --> 00:01:01,070 Therefore in this lecture I'm going to show you how to encrypt sign verify and decrypt files. 11 00:01:01,230 --> 00:01:09,180 So right here in John's computer I have the image that we already worked on and removed its metadata 12 00:01:09,210 --> 00:01:09,960 before. 13 00:01:09,990 --> 00:01:11,670 If you don't remember how to do that. 14 00:01:11,670 --> 00:01:13,570 Please go back to that lecture. 15 00:01:13,740 --> 00:01:18,780 And if I double click the image right now as you can see the image works it shows us a picture of a 16 00:01:18,780 --> 00:01:20,200 car. 17 00:01:20,220 --> 00:01:27,110 Now let's assume we want to send this message to David and we want to send it securely so that if anybody 18 00:01:27,120 --> 00:01:33,480 intercepts this message or if anybody manages to read it they want be able to see the content of it. 19 00:01:33,480 --> 00:01:36,240 They won't be able to see the image. 20 00:01:36,240 --> 00:01:43,580 To do that we're going to right click it and we're going to click on encrypt now you'll get a message 21 00:01:43,580 --> 00:01:47,360 that is very similar to what we used to get when we encrypt text. 22 00:01:47,510 --> 00:01:54,200 You need to select the public keys of the people that will be able to see the contents of this file. 23 00:01:54,470 --> 00:01:56,620 In my case I'm sending this to David. 24 00:01:56,720 --> 00:01:58,700 So I'm going to take David from here. 25 00:01:59,090 --> 00:02:06,560 And as we learned before you can also sign the message from here and select your own private key and 26 00:02:06,560 --> 00:02:13,010 that way when the receiver receives the image they can verify that the message or the image was sent 27 00:02:13,010 --> 00:02:17,790 from you by verifying it with your own public key. 28 00:02:17,810 --> 00:02:26,280 So I'm going to click on OK this will ask me for my passphrase for my private key because I selected 29 00:02:26,340 --> 00:02:34,060 design option if you did not select design option you will not see this and once I put the password 30 00:02:34,420 --> 00:02:41,470 as you can see I will have a new image created and this image doesn't really display it doesn't really 31 00:02:41,470 --> 00:02:41,830 work. 32 00:02:41,830 --> 00:02:46,510 So if I double click it you actually won't see anything in here. 33 00:02:46,510 --> 00:02:53,380 And the reason for that is because this image right now is encrypted and the only person that can see 34 00:02:53,380 --> 00:02:54,580 it is David. 35 00:02:54,580 --> 00:02:59,800 So we need David's private key in order to see the contents of this message. 36 00:03:00,340 --> 00:03:03,510 Therefore like I said right now we're in John's computer. 37 00:03:03,520 --> 00:03:08,740 So even John can't see the content of the image anymore and what we're going to do is we're going to 38 00:03:08,740 --> 00:03:19,650 go ahead and send this as an attachment in an email to David Smith at a blue dot in I'm gonna scroll 39 00:03:19,650 --> 00:03:20,270 down. 40 00:03:20,310 --> 00:03:26,760 I'm going to select the image and keep in mind you want to make sure you select the encrypted image 41 00:03:27,060 --> 00:03:28,860 not the normal image. 42 00:03:28,860 --> 00:03:33,930 So right here we have the normal decrypted image as you can see we can see it in here and the preview 43 00:03:34,320 --> 00:03:40,740 and right here we have the encrypted version of it that will not work unless we have the private key 44 00:03:40,950 --> 00:03:51,990 of David so I'm going to click on open and just say test in here and the content and click on send perfect 45 00:03:51,990 --> 00:03:53,490 now the message should be sent. 46 00:03:53,490 --> 00:04:00,160 So let's go to David's computer with the refresh the inbox we have a new message. 47 00:04:00,170 --> 00:04:00,800 Perfect. 48 00:04:00,830 --> 00:04:10,910 Let's go ahead and open it and we're going to download the attachment savoured it's going to go in my 49 00:04:10,910 --> 00:04:12,920 third browser directory that's fine. 50 00:04:12,920 --> 00:04:18,220 Click on Save and that's go ahead and open the containing folder. 51 00:04:18,620 --> 00:04:22,670 And as you can see we can't really see the contents of the image. 52 00:04:22,820 --> 00:04:29,030 Now this is the same whether this was a PDA f or a Word document or any file really I'm just using the 53 00:04:29,030 --> 00:04:31,330 image as an example. 54 00:04:31,370 --> 00:04:39,020 Now in order to decrypt this message because this is David's computer and because this message was specifically 55 00:04:39,020 --> 00:04:45,290 encrypted for David using David's public key we can actually decrypt it right here because because we 56 00:04:45,290 --> 00:04:49,760 have David's private key and we'll be able to see the contents of it. 57 00:04:50,180 --> 00:04:57,010 To do that we're going to right click the image we're going to click on open with decrypt file. 58 00:04:57,230 --> 00:05:01,380 This will ask you for the passphrase for David's private key. 59 00:05:01,700 --> 00:05:02,630 I'm going to input it 60 00:05:06,670 --> 00:05:08,180 on perfect as you can see. 61 00:05:08,180 --> 00:05:10,250 This will create a new file. 62 00:05:10,280 --> 00:05:17,690 This is the image after decryption and as you can see in the middle it said that the signature has been 63 00:05:17,690 --> 00:05:18,490 verified. 64 00:05:18,560 --> 00:05:23,410 So we're sure that this image was actually sent from John. 65 00:05:23,450 --> 00:05:26,520 Now I can double click the image to see its content. 66 00:05:26,690 --> 00:05:31,070 And as you can see I'm able to see the contents of the message. 67 00:05:31,070 --> 00:05:37,630 So the idea behind this is very similar to the idea of sending text we encrypted message with the receiver's 68 00:05:37,640 --> 00:05:38,600 public key. 69 00:05:38,930 --> 00:05:44,990 If anybody manages to get their hands on this file whether it's an image a PDA if a document doesn't 70 00:05:44,990 --> 00:05:45,890 really matter. 71 00:05:45,890 --> 00:05:52,310 They won't be able to read the content of the file unless they have the private key. 72 00:05:52,310 --> 00:05:58,520 Now there is also one more feature that I want to cover in this lecture which we can use to sign the 73 00:05:58,520 --> 00:06:01,160 file without encrypting it. 74 00:06:01,190 --> 00:06:07,640 So if you remember when we downloaded the Tor browser we also downloaded a signature and we use that 75 00:06:07,640 --> 00:06:13,720 signature to verify that the Tor browser did not get modified as we downloaded it. 76 00:06:13,910 --> 00:06:19,760 So you can also do this to any file you send by generating a separate signature. 77 00:06:19,790 --> 00:06:25,940 So again you can do this to any file you want whether it's software whether it's an image a PDA f a 78 00:06:25,940 --> 00:06:27,500 Microsoft document. 79 00:06:27,500 --> 00:06:28,760 It really doesn't matter. 80 00:06:29,090 --> 00:06:31,780 I'm using the image here as an example. 81 00:06:31,850 --> 00:06:33,880 John Wicks computer right now. 82 00:06:34,040 --> 00:06:42,270 And all you have to do is click the file that you want to sign click on sign it will ask you which private 83 00:06:42,270 --> 00:06:45,110 key you want to use to sign this file. 84 00:06:45,150 --> 00:06:50,670 Like I said I mean John Wilkes computer the only private key that I have right now on this computer 85 00:06:50,670 --> 00:06:55,860 is John Wick so the only entry I have in here is John Wick so I'm going to click on. 86 00:06:55,860 --> 00:06:57,430 OK. 87 00:06:57,480 --> 00:07:04,570 And as you can see with this will generate a new file with a dot Sig extension. 88 00:07:04,680 --> 00:07:11,760 This is a signature that corresponds to this file that has been generated using John Wilkes private 89 00:07:11,760 --> 00:07:19,920 key so people can use this file to make sure that the image did not get modified since this signature 90 00:07:19,920 --> 00:07:24,420 file was created by John Wick and to do this verification. 91 00:07:24,420 --> 00:07:30,840 They'll use John Wilkes Public Key so the private key is used to generate the signature the public key 92 00:07:30,840 --> 00:07:36,070 gets used to verify that the signature did not get modified. 93 00:07:36,090 --> 00:07:42,990 Now if you're doing this you will obviously have to send the signature file with the image file to the 94 00:07:42,990 --> 00:07:43,950 receiver. 95 00:07:43,950 --> 00:07:49,500 So let me do this really quick here again or send this to David Smith 96 00:07:53,320 --> 00:07:59,230 and like I said you want to make sure you first select the file that you want to send which in my case 97 00:07:59,290 --> 00:08:08,410 is the image and you also need to select the signature so I'm going to select the image first and then 98 00:08:08,500 --> 00:08:10,620 click on attach. 99 00:08:10,840 --> 00:08:19,390 And then I'm going to select the signature file as well like I said and we're gonna open and click on 100 00:08:19,390 --> 00:08:20,680 a touch again. 101 00:08:22,240 --> 00:08:25,430 And right now we have the two files added to the message. 102 00:08:25,480 --> 00:08:28,650 I'm going to click on sent to send the message. 103 00:08:28,660 --> 00:08:32,390 Now keep in mind right now we did not encrypt the image. 104 00:08:32,410 --> 00:08:38,260 If someone manages to intercept this file they'll be able to see the contents of the image. 105 00:08:38,290 --> 00:08:44,680 We only signed the image with the separate signature so the receiver can verify that the image did not 106 00:08:44,680 --> 00:08:46,750 get modified as we sent it. 107 00:08:47,890 --> 00:08:50,850 So go into the receiver's computer. 108 00:08:50,860 --> 00:09:02,300 Let's go refresh the inbox and we'll go open it open the new message and let me actually delete what 109 00:09:02,300 --> 00:09:07,790 I have in here for now and we're going to download the image 110 00:09:12,030 --> 00:09:13,800 and then we'll download the signature 111 00:09:18,480 --> 00:09:23,760 and go into the downloads directory as you can see straightaway we're able to see the contents of the 112 00:09:23,760 --> 00:09:24,320 image. 113 00:09:24,390 --> 00:09:30,240 So the image was not encrypted because all we did is we generated a signature for the image. 114 00:09:30,720 --> 00:09:37,980 So the whole purpose of this is to allow the receiver to verify that this message was sent by John and 115 00:09:37,980 --> 00:09:44,100 that the message did not get modified since John created the signature to do this. 116 00:09:44,280 --> 00:09:51,790 You're right click the signature and we're going to click on open with verify signature and as you can 117 00:09:51,790 --> 00:09:54,700 see it's telling us that this is a valid signature. 118 00:09:55,060 --> 00:09:58,670 And like I said the untrusted warning can be ignored. 119 00:09:58,750 --> 00:10:03,340 It literally just means that the key has not been set to trust it. 120 00:10:03,400 --> 00:10:10,120 But the fact that it is saying a valid signature means that this image did not get modified since John 121 00:10:10,270 --> 00:10:17,960 created this signature right here using his own private key so that's it for this lecture. 122 00:10:17,970 --> 00:10:26,430 I just wanted to show you how we can use PDP to encrypt files sign them so that they can then be verified 123 00:10:26,520 --> 00:10:28,770 and decrypted at the destination. 124 00:10:28,830 --> 00:10:35,970 And this way we're able to send files securely because even if they get intercepted while they're being 125 00:10:35,970 --> 00:10:41,110 transmitted whoever intercepts them they won't be able to read their content. 126 00:10:41,190 --> 00:10:47,520 Not only that the receiver will also be able to verify that the file did not get modified as it was 127 00:10:47,520 --> 00:10:53,310 sent and verify that it was sent from the right person not from a third party.