OK so so far we learned how to use BGP to encrypt text and send it in a way so that the receiver is
the only person that's able to read the content of the text.
Not only that but we also learned how to sign the message to sign the text so that the receiver can
verify that this message was actually sent from us from the center.
So it's really really good because now when a message is sent we're sure that it can only be read by
the receiver and the receiver can be sure that it was actually sent from the sender and he can also
verify that the message did not get modified as it was sent.
So this is really really good.
The only problem is we can only do this for text so what if you wanted to send a document or an image.
Therefore in this lecture I'm going to show you how to encrypt sign verify and decrypt files.
So right here in John's computer I have the image that we already worked on and removed its metadata
before.
If you don't remember how to do that.
Please go back to that lecture.
And if I double click the image right now as you can see the image works it shows us a picture of a
car.
Now let's assume we want to send this message to David and we want to send it securely so that if anybody
intercepts this message or if anybody manages to read it they want be able to see the content of it.
They won't be able to see the image.
To do that we're going to right click it and we're going to click on encrypt now you'll get a message
that is very similar to what we used to get when we encrypt text.
You need to select the public keys of the people that will be able to see the contents of this file.
In my case I'm sending this to David.
So I'm going to take David from here.
And as we learned before you can also sign the message from here and select your own private key and
that way when the receiver receives the image they can verify that the message or the image was sent
from you by verifying it with your own public key.
So I'm going to click on OK this will ask me for my passphrase for my private key because I selected
design option if you did not select design option you will not see this and once I put the password
as you can see I will have a new image created and this image doesn't really display it doesn't really
work.
So if I double click it you actually won't see anything in here.
And the reason for that is because this image right now is encrypted and the only person that can see
it is David.
So we need David's private key in order to see the contents of this message.
Therefore like I said right now we're in John's computer.
So even John can't see the content of the image anymore and what we're going to do is we're going to
go ahead and send this as an attachment in an email to David Smith at a blue dot in I'm gonna scroll
down.
I'm going to select the image and keep in mind you want to make sure you select the encrypted image
not the normal image.
So right here we have the normal decrypted image as you can see we can see it in here and the preview
and right here we have the encrypted version of it that will not work unless we have the private key
of David so I'm going to click on open and just say test in here and the content and click on send perfect
now the message should be sent.
So let's go to David's computer with the refresh the inbox we have a new message.
Perfect.
Let's go ahead and open it and we're going to download the attachment savoured it's going to go in my
third browser directory that's fine.
Click on Save and that's go ahead and open the containing folder.
And as you can see we can't really see the contents of the image.
Now this is the same whether this was a PDA f or a Word document or any file really I'm just using the
image as an example.
Now in order to decrypt this message because this is David's computer and because this message was specifically
encrypted for David using David's public key we can actually decrypt it right here because because we
have David's private key and we'll be able to see the contents of it.
To do that we're going to right click the image we're going to click on open with decrypt file.
This will ask you for the passphrase for David's private key.
I'm going to input it
on perfect as you can see.
This will create a new file.
This is the image after decryption and as you can see in the middle it said that the signature has been
verified.
So we're sure that this image was actually sent from John.
Now I can double click the image to see its content.
And as you can see I'm able to see the contents of the message.
So the idea behind this is very similar to the idea of sending text we encrypted message with the receiver's
public key.
If anybody manages to get their hands on this file whether it's an image a PDA if a document doesn't
really matter.
They won't be able to read the content of the file unless they have the private key.
Now there is also one more feature that I want to cover in this lecture which we can use to sign the
file without encrypting it.
So if you remember when we downloaded the Tor browser we also downloaded a signature and we use that
signature to verify that the Tor browser did not get modified as we downloaded it.
So you can also do this to any file you send by generating a separate signature.
So again you can do this to any file you want whether it's software whether it's an image a PDA f a
Microsoft document.
It really doesn't matter.
I'm using the image here as an example.
John Wicks computer right now.
And all you have to do is click the file that you want to sign click on sign it will ask you which private
key you want to use to sign this file.
Like I said I mean John Wilkes computer the only private key that I have right now on this computer
is John Wick so the only entry I have in here is John Wick so I'm going to click on.
OK.
And as you can see with this will generate a new file with a dot Sig extension.
This is a signature that corresponds to this file that has been generated using John Wilkes private
key so people can use this file to make sure that the image did not get modified since this signature
file was created by John Wick and to do this verification.
They'll use John Wilkes Public Key so the private key is used to generate the signature the public key
gets used to verify that the signature did not get modified.
Now if you're doing this you will obviously have to send the signature file with the image file to the
receiver.
So let me do this really quick here again or send this to David Smith
and like I said you want to make sure you first select the file that you want to send which in my case
is the image and you also need to select the signature so I'm going to select the image first and then
click on attach.
And then I'm going to select the signature file as well like I said and we're gonna open and click on
a touch again.
And right now we have the two files added to the message.
I'm going to click on sent to send the message.
Now keep in mind right now we did not encrypt the image.
If someone manages to intercept this file they'll be able to see the contents of the image.
We only signed the image with the separate signature so the receiver can verify that the image did not
get modified as we sent it.
So go into the receiver's computer.
Let's go refresh the inbox and we'll go open it open the new message and let me actually delete what
I have in here for now and we're going to download the image
and then we'll download the signature
and go into the downloads directory as you can see straightaway we're able to see the contents of the
image.
So the image was not encrypted because all we did is we generated a signature for the image.
So the whole purpose of this is to allow the receiver to verify that this message was sent by John and
that the message did not get modified since John created the signature to do this.
You're right click the signature and we're going to click on open with verify signature and as you can
see it's telling us that this is a valid signature.
And like I said the untrusted warning can be ignored.
It literally just means that the key has not been set to trust it.
But the fact that it is saying a valid signature means that this image did not get modified since John
created this signature right here using his own private key so that's it for this lecture.
I just wanted to show you how we can use PDP to encrypt files sign them so that they can then be verified
and decrypted at the destination.
And this way we're able to send files securely because even if they get intercepted while they're being
transmitted whoever intercepts them they won't be able to read their content.
Not only that the receiver will also be able to verify that the file did not get modified as it was
sent and verify that it was sent from the right person not from a third party.