Now that we have our key pair generated, the next step is to share our public key with the people that
we want to receive encrypted messages from so that they can encrypt messages using our public key so
that we will be the only people that can decrypt these messages because we have the private key.
So in order to do this, you need to go to Cleopatra.
As you can see, I have it already opened and I already selected my key pair, which I created in the
previous lecture.
Now in order to export the public key.
Now, keep in mind, we're exporting the public key, not the private key.
We never share the private key.
Hence the name Private key.
So we're going to go to file.
We're going to click on export and you need to select the location where you want to store your public
key in.
Now I'm going to select my Tor browser directory because I want to share this through email.
So I want to add it as an attachment.
And as we know, the Tor browser can only access the Tor browser directory in tales.
That's why I selected this directory, but you can store it anywhere you want.
I'm also going to set the name to John Wick.
This is not that important, but I'm just doing it so that the name is representative of the key.
So it's easier for me to find and track in the future.
And I'm going to click on Save to Save it.
So if I go to my home directory.
And go to Tor browser.
You can see we have a file called John Wick Dot ASC and this is my public key that I can share with
anybody so that they can encrypt data and send it to me.
Now you can literally attach this file the way it is.
You can upload it to a file sharing service like I showed you or use Onionshare.
You can use any method of sharing this file if you don't want to share it as a file, you can also right
click it select Open with other application select View all applications and select your text editor
to open it with a text editor.
If I click on Select here, you'll see we'll be able to read the file as normal text.
And this way you can literally copy all of this and paste it anywhere you want.
Like this you can share the key without having to upload the file or attach it anywhere.
You can copy this text, send it as an instant message, print it on a piece of paper and give it to
someone.
You can do anything you want with it.
So you have two ways of sharing it.
You can literally copy this text and send it to the person that you want to receive encrypted data from.
Or you can attach this file right here.
And like I said, you can use any method of communication.
It doesn't really matter how you send it.
Now, just as an example, I'm going to be sending this as an email, so I've already logged in into
my web mail, as you can see in here.
And what I want to do is send a message.
So I'm going to click on Compose.
I'm going to put the email of the person I want to send this to.
So I'm sending this to another email account that I own for David Smith at Elude Dot n.
I'm going to set the subject and I'm going to call this my PGP key.
And then you can write anything here if you want in the message.
So we're going to say, Please find my PGP key below and you can literally just paste all of the text
that you copied in here, like I said.
And then they'll be able to use this key as text to encrypt data to you, and we'll see how you can
do that.
This is the first method of sharing your key.
Like I said, you can also share the key file that we exported.
To do that, we're going to use an attachment.
So again, I'm going to click on Browse and select the key file that we have in here.
We're already in the Tor browser directory, so you just double click this and that's added to the attachment.
Now like I said, you don't need to send both.
I'm just showing you both here as an example, but only sending the key as a file or as text in here
is enough for the other person to start encrypting data for you.
Not only that, but you can even add this key to your signature.
So every time you communicate with someone, they will see your public key and if they wanted to, they
can encrypt the data that they're sending to you using your public key.
And this way nobody can read this data except you.
A lot of people even put this in their profile page in forums and even in markets.
So if you click on a certain account, you'll probably see their PGP key pasted like this so that when
you communicate with them, you would use this key to encrypt the data and that way they will be the
only people able to read the message because you encrypted it using their public key.
So the whole idea is you want to share this with anybody that might want to communicate with you so
that when they send you something, you will be the only person able to read what they sent you.
So we have the key here.
We have it attached.
We've already set the email and the subject, so I'm just going to click on send to send this email.
And I'm going to go to the other computer.
This is David's computer, the person that is supposed to send messages to John.
As you can see, I'm already logged in to the email account as well.
I'm going to refresh to see if I got anything in my inbox.
And as you can see, I have a new message.
We're going to go to the inbox.
And this message is coming from John Wick.
Perfect.
So we're going to click on it.
And again, as you can see, we have the key in both forms as an attachment and as text.
So now this is David.
And if we go back to our diagram, David is the person that wants to send an encrypted message to John.
So what John did is he created a key pair.
He sent John the key pair.
So we have the key right here.
What we need to do right now is download the key.
And in the next lecture I'll show you how we use it to encrypt the message.
So let's go ahead and download the key so we have it in here as an attachment.
All we have to do is click on download and as usual, if you click on Save, this will only allow you
to save it in the Tor browser directory and it's called John Wick dot ASC.
So I'm going to click on Save to save it there.
And if we go to our home directory.
Go to Tor browser.
You will see we have the key saved right here.
Now, I'm actually going to remove this because I also want to show you how to download the key.
If it was sent as plain text, if it was not sent as an attachment.
So we're going to assume that you just got the key like this as text, if you got it as an instant message
or if you saw it on a forum or on an account where the user was sharing their public key so that you
can encrypt messages for them.
In that case, if you want to start sending encrypted messages to this person using this key, you want
to make sure, first of all, you copy the whole key from the start here, all the way down to the end.
I'm going to right click and copy, and then you want to open a text editor.
So we're going to go to accessories.
We're going to open our text editor, We're going to paste everything that we copied in here.
We're going to save Ctrl s or click here and you want to store this in any location that you want.
Now you don't really have to put it into a browser.
I'm just going to put it there anyway, and we're just going to call this John Wick again, Dot ASC.
We're going to click on Save and again, we have the file.
Now if we go back to this directory, we have the file, the John Wick dot ASC and inside it it has
the content of the public key of John.
Now all we have to do is import this public key to our keyring.
To do that, we have to open Cleopatra here.
And we're going to go to file.
Import and select the key that we want to import.
If you couldn't see it here, then make sure you go to the location where you downloaded it.
So in my case it was in Tor browser.
And again, we have the key that we want to import in here.
Click on Open.
Now, before importing it, Cleopatra is telling us that we should verify this key using the fingerprint.
So usually you can do that using a phone call or if they had a business card or if they publicly share
their fingerprint.
And like I said, that's kind of similar to what we did when we were verifying the Tor browser.
We'll talk about that later on in the course.
So for now, we're going to say we don't want to do this because this step is optional anyway.
So as you can see now, we have the key imported at the bottom.
And as you can see right now, it is not written in bold.
It's actually similar to all of the other keys, because right here at this computer, we only have
the public key.
Whereas in the original computer in John's computer, this entry is listed in bold in there on Cleopatra,
because they have the full pair, the public key and the private key.
Now we have imported the public key of the person that we want to communicate with.
So right now, we can start encrypting data and send it to John.
And the only person that will be able to see the content of this data is John, because he is the only
person that has the private key.