PGP (Pretty Good Privacy) is an encryption standard that lets you send messages no one else can read — not your ISP, not the mail server, not anyone without the right key.
The tool you'll use is GPG (GNU Privacy Guard) — a free, open-source implementation of the PGP standard. The GUI apps below are frontends that use GPG underneath.
sudo apt update && sudo apt install gnupg
sudo pacman -S gnupg
sudo dnf install gnupg2
GPG is pre-installed on many distros — run gpg --version first to check.
sudo apt update && sudo apt install kleopatra
sudo pacman -S kleopatra
sudo dnf install kleopatra
Kleopatra depends on GPG and will pull it in automatically. Launch it from your app menu.
Download and install GPG Suite from gpgtools.org. It includes GPG Keychain (key manager) and a Mail plugin for Apple Mail.
Open GPG Keychain from your Applications folder after installing.
Install Gpg4win — it includes gpg.exe for use in PowerShell / Command Prompt.
Or via winget:
winget install GnuPG.Gpg4win
After install, open a new PowerShell window and continue with the commands below.
Install Gpg4win — Kleopatra is included in the default install.
Or via winget:
winget install GnuPG.Gpg4win
Launch Kleopatra from the Start menu after installing.
Verify the install:
gpg --version
You should see gpg (GnuPG) 2.x.x.
Run the interactive key generation wizard:
gpg --full-generate-key
Key type — choose (9) ECC (sign and encrypt) for modern elliptic-curve crypto. If not listed, use (1) RSA and RSA.
Curve / size — ECC: Curve 25519. RSA: 4096 bits.
Expiry — 0 for no expiry. A 1–2 year expiry limits damage if your key is compromised.
Name & email — use the address you'll receive encrypted mail at. This is public.
Passphrase — protects your private key on disk. Use a 4–6 word diceware phrase. Do not lose this.
Your private key is stored in ~/.gnupg/ (Linux/macOS) or %APPDATA%\gnupg\ (Windows). Back it up securely. If you lose it, you cannot decrypt old messages.
List your keys to confirm everything was created correctly:
gpg --list-secret-keys --keyid-format LONG
You'll see output like this:
sec ed25519/XXXXXXXXXXXXXXXX 2026-01-01 [SC]
AABB CCDD AABB CCDD AABB CCDD AABB CCDD AABB CCDD
uid [ultimate] Your Name <you@example.com>
ssb cv25519/YYYYYYYYYYYYYYYY 2026-01-01 [E]
The 40-character hex string is your fingerprint. Print it on its own:
gpg --fingerprint you@example.com
Always share your fingerprint alongside your public key so recipients can verify they have the real one.
Export to an ASCII-armored file you can share:
gpg --armor --export you@example.com > mypubkey.asc
Or print directly to the terminal to copy:
gpg --armor --export you@example.com
.asc file — this is your public key, safe to sharemypubkey.asc.asc file — this is your public key, safe to shareWays to share your public key:
/pgp.txtgpg --keyserver keys.openpgp.org --send-keys YOUR_FINGERPRINT/pgp.txt in every email you sendTo encrypt a message to me, you first need my public key in your keyring.
curl -s https://twhalley.online/pgp.txt | gpg --import
curl -s https://twhalley.online/pgp.txt | gpg --import
Invoke-WebRequest https://twhalley.online/pgp.txt -OutFile twhalley.asc
gpg --import twhalley.asc
twhalley.asctwhalley.asc and click Opentwhalley.asctwhalley.asc onto the GPG Keychain windowtwhalley.asctwhalley.asc and click OpenMy public key (click to select all, then save to a file and import):
Verify the import succeeded and check the fingerprint:
gpg --fingerprint twhalley@email.com
Verify the fingerprint — right-click the imported key → Certificate Details.
Verify the fingerprint — click the imported key in GPG Keychain to see details.
Verify the fingerprint — right-click the imported key → Certificate Details.
My fingerprint should read exactly:
57EF 6CBB 932C B8A5 D2D6 19C9 57BF 243E C833 BD52
Always verify fingerprints out-of-band. If what GPG / the app shows doesn't match the line above, discard the key and re-download it.
Write your message into a plain text file:
nano message.txtnano message.txtnotepad message.txtSave the file, then encrypt it to my address:
gpg --armor --encrypt --recipient twhalley@email.com message.txt
This produces message.txt.asc — the ciphertext. Open it and you'll see:
-----BEGIN PGP MESSAGE-----
hF4Dr7uXO/ql35MSAQdAjmTc...
[unreadable ciphertext]
-----END PGP MESSAGE-----
To also encrypt to yourself (so you can re-read it later):
gpg --armor --encrypt \
--recipient twhalley@email.com \
--recipient you@example.com \
message.txt
message.txtmessage.txt and click Openmessage.txt.asc in the same foldermessage.txtmessage.txt in Findermessage.txt.gpg (or .asc) in the same folderIf Services isn't showing, go to System Settings → Keyboard → Keyboard Shortcuts → Services and enable the OpenPGP entries.
message.txtmessage.txt and click Openmessage.txt.asc in the same folderOnly someone with my private key (me) can read this — not your ISP, not the mail server, nobody else.
Open message.txt.asc and copy the entire contents — including the
-----BEGIN PGP MESSAGE----- header and -----END PGP MESSAGE-----
footer. Paste it into the body of an email to:
twhalley@email.com
If you'd like a reply back encrypted to you, paste your public key at the bottom of the email:
gpg --armor --export you@example.com
Copy the output and paste it after the encrypted message block.
Export your public key (Step 5) and paste the contents of the .asc file at the bottom of the email.
That's it — end-to-end encrypted email. No app, no subscription, no central server controlling your keys.
Save the encrypted reply block (including headers) to a file, then decrypt it:
gpg --decrypt reply.asc
GPG prompts for your passphrase and prints the plaintext. To save it to a file:
gpg --decrypt reply.asc > reply.txt
reply.ascreply.asc and click Openreply.ascreply.ascreply.asc and click OpenIf someone signs a message, verify it with:
gpg --verify signed_message.asc
You must have the sender's public key imported. GPG reports Good signature or Bad signature.
In Kleopatra, use File → Decrypt/Verify Files — it handles both decryption and signature verification automatically.
Right-click the signed file in Finder → Services → OpenPGP: Verify Signature. GPG Suite reports the result in a dialog.
In Kleopatra, use File → Decrypt/Verify Files — it handles both decryption and signature verification automatically.
gpg --keyserver keys.openpgp.org --send-keys YOUR_FINGERPRINT
In Kleopatra: right-click your key → Publish on Server.
In GPG Keychain: right-click your key → Send Public Key to Key Server.
In Kleopatra: right-click your key → Publish on Server.
keys.openpgp.org requires email verification and supports key deletion — a privacy-respecting choice.
gpg --gen-revoke you@example.com > revoke.asc
In Kleopatra: right-click your key → Generate Revocation Certificate. Save the file somewhere safe and offline.
In GPG Keychain: right-click your key → Export Revocation Certificate. Save it somewhere safe and offline.
In Kleopatra: right-click your key → Generate Revocation Certificate. Save the file somewhere safe and offline.
Anyone with your revocation certificate can revoke your key. Store it offline. If your private key is ever compromised, upload this cert immediately.
~/.muttrc.