Now that we understand how Pjp works in this lecture and the next few lectures, I'm going to show you
how to use it to encrypt all kinds of data, verify integrity and so on.
Now, as I explained in the previous lecture for this to work, the receiver, which is John in this
case, has to first generate a key pair, a public key and a private key.
He will share the public key with the person who he wants to receive data from.
That person who is David in this example will use the public key to encrypt the message.
Send the message to John.
The message will be unreadable unless the private key is used to decrypt it.
And as you can see throughout this whole scenario, the private key never left John.
So John never shares the private key, and it is the only key that can be used to decrypt the data.
Therefore, this implementation is very, very secure.
So like I said, the first step for this is the receiver needs to generate a key pair, a public key
and a private key.
So in this lecture, I'm going to show you how we can create our own key pair so that we can share our
public key with the people that we want to receive data from.
And then they can use this public key to encrypt data and send it to us so that we are the only ones
that can decrypt this data because we have the private key so entails.
This is actually very, very easy.
You can do it using the clipboard applet that we have in here on the top, right?
So you can click on it and go to manage keys.
Now, in the recent versions of Tails, they've been moving this all over the place.
So if you can't find it here, we can go to applications, utilities and click on passwords and keys.
This will open a program that can be used to manage all your passwords entails.
But what we're interested in is managing our new PG keys.
Now clicking on this, as you can see, we have a number of entries by default.
Do not delete these entries.
These are actually keys used to verify the integrity of updates that tells downloads and the integrity
of packages that you can download through details and install on your system.
So if you delete them, you won't be able to verify the integrity of these packages.
So we're keeping everything here the same.
And what we want to do, like I said, is create our own key pair so we can share our public key with
others so we can receive encrypted data that can only be decrypted by us.
To do that, to create a key pair, you can click on the plus sign in here or you can go on file new.
Like I said, this application allows you to manage all sorts of keys.
What we're interested in is creating a p-gp key.
So I'm going to click on the second entry here and I'm going to click on Continue.
Now it's going to ask you for your name.
So in my case, I'm using John Wick.
Next, it's going to ask you for your email address.
Now, it is very important to understand that the people that you'll share the public key with will
be able to see your name and your email address.
Therefore, if you want to stay anonymous and protect your privacy, make sure you use the fake name
that you created when you created your fake identity and make sure you use your private or anonymous
email in here.
In my case, it's J and ck7 at dot n.
We're also going to click on the advanced options to select the encryption type.
I'm going to keep this at RSA because this is a very strong encryption.
We're going to set the key strength to the highest possible, which is 4096.
And you can also set an expiry date so that your key expires at the date that you specify in here.
Now, this would be good if you want to take your security to the next level.
But for this course, it's fine.
I'm going to set it to never expire.
I'll keep this ticked and I'm going to click on Create to create my key pair.
Now it's going to ask me to set a passphrase for the key.
Make sure you set a strong and long one.
Click.
Okay.
And this program is going to generate your key pair.
And as you can see right here, we have a new entry with my key pair.
Now, notice the icon here for this key pair contains two keys as silver and a gold one.
This means that this is a key pair.
It contains a private key and a public key.
Notice all of the other entries in here contain only one gold key, which means that these entries only
contain a public key.
So these can be used to encrypt data for someone else or verify the integrity of data.
But there is no private key stored in here.
Now, to get more information about any of these entries, you can right click and click on properties.
And in here you can see information about the honor, for example, the name John Wick, like we said
it.
The email again, the same email that we set it to.
You can see the key ID, which can be used to verify the key.
And we'll talk about that later.
And if we go on the details, you'll also see the fingerprint, which can also be used to verify the
key.
We actually use this one.
We downloaded the Tor browser, if you remember.
And as we go through this section, actually, you'll see how the verification steps we followed to
verify the Tor browser makes sense, and all of this will click with that.
Now, from here, you can also export your secret key, which is something that you should never do,
because, like I said, we should never share the secret key.
The secret key should always be kept privately.
The only time that you might want to do this is if you're going to completely wipe the system and still
want to use the same key.
You might want to export this store it in an encrypted USB device and then put it on your next installation.
Other than that, there is no need to export your key from here.
From here.
You can also set the expiry so as as shown before we set the expiry to never.
But if you change your mind you can click on this icon and set the key to expire at any date you want.
And going back to the names and signatures, you can see again your name and the email associated with
this key, and you can click on add name to add more contacts to be associated with this key.
But like I said, be very careful when you're doing this because these contacts will be visible to anybody
that can see your public key.
And like I said, in general, we will be sharing our public key with a lot of people because this is
the way this works so that they can encrypt data and send it to us.
So now that we have the key pair created in the next lecture, we're going to talk about how to share
our public key with our contacts, and then we'll see how that can be used to encrypt data and verify
integrity.