PGP
The following guide shows you how to setup PGP encryption on your computer in preparation for the GPG Keyparty. Valid at: Nov 2017.
If you're interested in what PGP is and how it works, have a look at this article.
To use PGP keys GnuPG is required to be installed on your computer.
Windows
Prerequisites
You can install GnuPG on Windows using Gpg4win.
Generating a Key
When generating a passphrase, make sure it is a good one because it will be the only defence if your key is compromised. As your key will be the thing which keeps all your communications safe, this is in your best interest.
- Open up the Kleopatra application which would have been installed from Gpg4win
- From the Menu Bar, go to File -> New Certificate
- Within the new window that pops up select "Create a personal OpenPGP key pair"
- Enter in your full name and email into the corresponding input boxes
- Click "Next"
- Click "Create Key"
- You will be asked to enter a passphrase. This should be a strong password. It will pop up issues it finds in your password
- Your computer will now generate your key pair and will give you a confirmation on success.
Congratulations! You have successfully created a PGP key pair.
Adding another UID
UIDs are unique identifiers within a key which alias your main key with other values, such as if you have multiple email addresses. Each UID consists of a name, email and optionally a comment. This is useful for having various emails associated with a single key pair.
- Open up the Kleopatra application
- Select your key
- Right click and select "Add User-ID"
- Provide the details you would like for your new UID (name, email and optionally comment)
- Enter your passphrase to unlock your key to add the changes
Exporting Public Key
- Open up the Kleopatra application
- Select the key you wish to export
- Click "Export Certificates" (shortcut Ctrl + e)
- Save file
Importing Public Keys
- Open up the Kleopatra application
- Click "Import Certificates" (shortcut Ctrl + i)
- Select the file containing the public key you wish to import
Linux
Prerequisites
GnuPG should already be installed on your system, this can be checked by typing in gpg --version
from within a terminal. If not already installed, it can be installed using your systems package manager.
Generating a Key
When generating a passphrase, make sure it is a good one because it will be the only defence if your key is compromised. As your key will be the thing which keeps all your communications safe, this is in your best interest.
- Open up a terminal.
- Enter in
gpg --gen-key
- Keep the default selection of the kind of key (RSA and RSA)
- Keep the default size of the key (2048)
- Choose an expiry date
- Confirm this is correct
- Enter in your full name
- Enter in your email address
- The comment is optional and can be kept blank if desired
- Double check details and progress by entering "O" (for Okay)
- Enter in a passphrase. This should be a strong password.
- Your computer will now generate your key pair
Adding another UID
UIDs are unique identifiers within a key which alias your main key with other values, such as if you have multiple email addresses. Each UID consists of a name, email and optionally a comment. This is useful for having various emails associated with a single key pair.
- Open up a terminal
- Enter in
gpg --edit-key EMAIL
replacing EMAIL with an email address associated with your key - Enter in
adduid
within the new prompt - Provide the details you would like for your new UID (name, email and optionally comment)
- Confirm your choice
- Enter your passphrase to unlock your key to add the changes
- Enter in
save
to save your changes and exit
Exporting Public Key
- Open up a terminal
- Enter in
gpg --output public_key.asc --armor --export EMAIL
replacing EMAIL with an email address associated with your key - Your public key is now within the public_key.asc file
Importing Public Keys
- Open up a terminal
- Enter in
gpg --import FILE_NAME
where FILE_NAME is the file containing the public key you wish to import
macOS
Prerequisites
You will need to download the GPG tools for Mac. There are many to choose from, like GPG Suite.
Generating a Key
When generating a passphrase, make sure it is a good one because it will be the only defence if your key is compromised. As your key will be the thing which keeps all your communications safe, this is in your best interest.
After installing, the GPG Keychain Manager will automatically ask you to generate a PGP key pair.
Congratulations! You have successfully created a PGP key pair.
Adding another UID
UIDs are unique identifiers within a key which alias your main key with other values, such as if you have multiple email addresses. Each UID consists of a name, email and optionally a comment. This is useful for having various emails associated with a single key pair.
- Click on your key in the GPG Keychain Manager
- Click 'Details' in the menu bar
- Select the User IDs tab
- Click the + symbol to add a new identity to your key
Exporting Public Key
Click 'Export' in the menu bar in GPG Keychain. Alternatively, right click on your key and select copy to copy the public key to your clipboard.
Import Public Keys
Click 'Import' in the menu bar in GPG Keychain