Now, before we wrap up this section, I want to spend one more lecture talking about another method
to exchange keys between the sender and the receiver.
So as we learned, we can use BGP in order to encrypt a message and make sure that this message will
only be readable by the receiver by encrypting the message with the receiver's public key.
Therefore, for this to work, for example, if David wanted to send a message to John, he would have
had to get John's public key.
Then same goes for John.
If John wanted to send something to David, he would have had to get David's public key and to exchange
the keys.
In the previous lectures, we used email to send the keys from one person to another.
Now you can use any method of communication.
And like I said, sometimes if you're using a market or if you're on a forum, you might even see the
user, including their public key in their signature or in their profile page.
That way you can use that key to encrypt messages and send them to that user, and you'll be sure that
the only person that will be able to read this message is the user.
Now there is another way of sharing the keys, which I want to cover in this lecture, and that way
relies on using key servers.
So you can think of this as a computer that's accessible on the Internet or on the darknet.
It contains a number of keys.
And then, for example, if David wanted to share his public key with John or with anyone else, they
can upload their key to the server.
Same goes for John.
If he wanted to share his public key with others, he can upload his key to the server as well.
And then if David wanted to communicate with John, he wouldn't need to ask John for the public key
directly.
And John won't need to communicate with David directly and send him the key.
All David has to do is query the server, the key server that is accessible, like I said, on the darknet
or on the internet and download John's public key.
Same goes for John.
If you wanted to get David's public key, he can query the server, download David's key, and that
way both David and John have each other's public keys and therefore they can start communicating and
encrypting messages to each other using each other's public keys.
The only thing that you want to keep in mind when doing this is when you upload your key to this public
server.
Anybody can get your public key.
Now, like I said, the public key cannot be used to decrypt your messages.
But as we've seen before, there is an identity tied up to the key.
Now we used fake information, but if you're using real information, the name will be visible on that
key and the email associated with that key.
Again, like we've seen before, when we create a key, we, we set an email address with that key.
So that email will also be publicly available.
So if you don't want to make this information available, then do not upload your keys to these key
servers.
Also, if the key is associated with other keys or part of a chain of trust, these keys will also become
available along with the information tied up to them.
So any contact associated with the key will also become available and public once you upload that key
to the key server.
So again, if you don't want this information to be public, then do not upload your key to the key
server and just send it directly to the people that you want to share your public key with.
But like I said, the main idea remains sound sharing.
The public key does not compromise the encryption.
The public key cannot be used to decrypt the messages.
It can only be used to encrypt them, hence the name public.
And that's why we can actually share it with anyone we want and we can just make it publicly available.
Now let's see how we can do this.
So first of all, I'm going to go to John's computer right here.
And let's say that I want to make my private key.
So this key right here available and I want to upload it to a key server.
Now, before uploading it to a key server, I need to enable this feature and to do that we're going
to go to edit preferences.
And in here when it says publish keys to I'm going to click on the dropdown menu and select the server
right here.
Now as you can see, this is an onion service.
Therefore, whoever is going to download this key needs to be connected to the Tor network.
Now I'm going to close this and the next thing that I'm going to do is upload this key to the key server.
So to do that, we're going to go to remote and sync and publish keys.
This is telling us that one key is selected and it's going to be synchronized and upload it to the key
server that we selected.
We're going to click on Sync and this will upload my key to the key server that we selected.
Now, anyone who wants to communicate with me with John Wick, they can query this key server and find
my public key and use that to encrypt messages for me.
So in our example, it's David that wants to communicate with John.
We have his computer right here and all he needs to do is open his passwords and keys from the utilities,
as we see before.
And he is going to first select the new PJ Keys.
Go to remote and click on Find Remote Keys.
So these are the steps that you need to use if you want to pull a key from a key server.
When you click on this, you'll get a search box, as you can see in here, which you can use to search
for your contact.
You can search using the name associated with the key.
As we know, that's John Wick.
You can also use the email or the ID.
I'm just going to use the e mail, which is jnck7 at elude dot n.
And I'm going to click on search.
Now, as you can see, I have the result right here.
Now you can right click and look up the properties of this contact and you can see this is for a person
named John Wick.
You can see the email.
You can see the key ID.
And if we click on details, you'll also be able to see the key fingerprint.
Now, ideally, you'd want to confirm the key ID and the fingerprint with your contact before adding
this key, because as we've seen, anyone can publish a key to the key server and claim to be anybody.
So we're not sure that this John Wick is actually the John Wick that we need to communicate with.
Therefore, you should communicate with your contact using another method of communication, for example,
by email, by phone, or by text message, and confirm the fingerprint and the idea that you're about
to add to make sure that this is the correct fingerprint and the correct ID for the key that you want
to add.
Now, obviously, John can get this information again by going to his passwords and keys, right click
his own key, click on properties and he can get his own fingerprint and use that to help you confirm
that this is the right contact.
Once you are sure this is the right contact, you can click it in here and click on import to add it
to your keys.
And as you can see, it got added in here into my key ring.
And then, as we've seen before, you can start typing messages and encrypt them from the applet in
here or encrypt files by right clicking the files and encrypting them.
So basically I just wanted to show you another method of key exchange, how you can upload a key to
a key server and how your contact can download it, or how you can download a key from the key server.
Now keep in mind, when you upload a key to the key server, it might not become immediately available.
I actually pause the video and resume the recording after several hours after uploading the John Key
because usually there are more than just one key server.
So when you upload your key to one of these servers, it actually takes some time for the key to be
shared with all of the servers and to become available for everybody to download.
So if you uploaded a key and your contact tried to download it within the same hour and couldn't find
it, then that's fine.
Just tell them to wait for a few hours and then they should be able to download it.