From dfee0188d10c372fcb64604de6b0ec1470dec9ce Mon Sep 17 00:00:00 2001
From: =?utf8?q?Th=C3=A9r=C3=A8se=20Godefroy?= GPG4Win is a email and file encryption software package that includes GnuPG. Download and install the latest version, choosing default options whenever asked. After it's installed, you can close any windows that it creates. To follow the rest of the steps in this guide, you'll use the program called "PowerShell", which is a program you'll see elsewhere referred to as a "terminal." This allows you to operate your computer using the command line.
-
+
Use the following command to export your secret key so you can import it into your email client at the next step. To avoid getting your key compromised, store this in a safe place, and make sure that if it is transferred, it is done so in a trusted way. Exporting your keys can be done with the following commands:
- +
$ gpg --export-secret-keys -a [keyid] > my_secret_key.asc
-$ gpg --export -a [keyid] > my_public_key.asc
-
+$ gpg --export -a [keyid] > my_public_key.asc
+
Like every other file or folder, gpg keys are subject to permissions. If these are not set correctly, your system may not be accepting your keys. You can follow the next steps to check, and update to the right permissions.
-# Check your permissions: ls -l ~/.gnupg/*# Check your permissions: ls -l ~/.gnupg/*
+# Set permissions to read, write, execute for only yourself, no others. These are the recommended permissions for your folder.
+You can use the code chmod 700 ~/.gnupg
# Set permissions to read and write for yourself only, no others. These are the recommended permissions for the keys inside your folder.
+You can use the code: chmod 600 ~/.gnupg/*
If you have (for any reason) created your own folders inside ~/.gnupg, you must also additionally apply execute permissions to that folder. Folders require execution privileges to be opened. For more information on permissions, you can check out this detailed information guide.
If you have (for any reason) created your own folders inside ~/.gnupg, you must also additionally apply execute permissions to that folder. Folders require execution privileges to be opened. For more information on permissions, you can check out this detailed information guide.
Use the following commands to transfer your keys. To avoid getting your key compromised, store it in a safe place, and make sure that if it is transferred, it is done so in a trusted way. Importing and exporting a key can be done with the following commands:
- +
$ gpg --export-secret-keys -a keyid > my_private_key.asc
$ gpg --export -a keyid > my_public_key.asc
$ gpg --import my_private_key.asc
-$ gpg --import my_public_key.asc
-
+$ gpg --import my_public_key.asc
+
Ensure that the keyID printed is the correct one, and if so, then go ahead and add ultimate trust for it:
- + +
$ gpg --edit-key [your@email]
-
+
Because this is your key, you should choose ultimate. You shouldn't trust anyone else's key ultimately.
Refer to troubleshoot in step 2.B for more information on permissions. When transferring keys, your permissions may get mixed, and errors may be prompted. These are easily avoided when your folders and files have the right permissions