gpg --verify tor-browser.tar.xz.asc tor-browser.tar.xz
If you only ever run one GnuPG command, it'll probably be that one: checking that a download was signed by the people who are supposed to have built it. Encryption gets the attention, but verification is what most people actually use GPG for.
GnuPG (the GNU Privacy Guard, command name gpg) is the free implementation of the OpenPGP standard. Kleopatra is a graphical front end from the KDE project that sits on top of it. On Windows, both come in the Gpg4win installer. On Linux, gpg is usually already installed and Kleopatra is a package away. On macOS, GPG Suite is the common bundle, or brew install gnupg if you prefer the terminal. Tails ships both. For background on what the keys and signatures actually mean, start with PGP for beginners.
Making a key pair
From the command line:
gpg --full-generate-key
Recent GnuPG versions default to an ECC key (Ed25519 for signing, Curve25519 for encryption), which is a good choice. You'll be asked for a name, an email and an expiry. Set an expiry, one or two years. You can extend it later with gpg --edit-key and the expire command, and if you lose the key, it dies on its own instead of haunting keyservers forever.
In Kleopatra: File, then New OpenPGP Key Pair. Enter a name and email, tick "Protect the generated key with a passphrase", and open Advanced Settings if you want to change the algorithm or expiry. Click Create.
The name and email don't have to be real. For a pseudonymous identity, use the pseudonym and an address that belongs to it, not your own. Everything in the user ID is visible to anyone who gets your public key.
GnuPG writes a revocation certificate automatically into ~/.gnupg/openpgp-revocs.d/. Copy it somewhere safe and offline. If the key is ever compromised, publishing that certificate tells everyone to stop using it.
Sharing and importing keys
gpg --armor --export [email protected] > mykey.asc
gpg --import theirkey.asc
gpg --fingerprint [email protected]
In Kleopatra, Export and Import are buttons on the toolbar.
Always compare fingerprints through a second channel before trusting a key. A key with the right name on it proves nothing; anyone can create one. Read the fingerprint aloud over a call, compare it with one printed on a business card, or check it against a source you already trust. Once you're satisfied, certify it (Kleopatra's "Certify" action, or gpg --sign-key), which marks it as verified in your keyring.
Keyservers are less useful than they were. The old SKS network collapsed around 2019 after spam and certificate-flooding attacks. keys.openpgp.org is the main one now, and it only publishes user IDs once the email owner confirms them. Many people simply put their key on their website or in their profile instead.
Encrypting and signing
gpg --encrypt --sign --armor -r [email protected] message.txt
gpg --decrypt message.txt.asc
The first command produces message.txt.asc, encrypted to their key and signed with yours. Add -r with your own address too if you want to be able to read it later; by default you can't decrypt what you encrypted to someone else.
Kleopatra has a Notepad tab where you can type text, pick recipients and click Sign / Encrypt Notepad, then copy the armoured block into an email or chat. For files, use File, then Sign/Encrypt, or right-click a file in Windows Explorer if Gpg4win's shell extension is installed.
Verifying downloads
This is the everyday use. Taking Tor Browser as the example, which our guide to verifying a Tor Browser download covers in detail:
gpg --auto-key-locate nodefault,wkd --locate-keys [email protected]
gpg --verify tor-browser-*.tar.xz.asc tor-browser-*.tar.xz
You want to see "Good signature from" followed by the expected name. You'll also see a warning that the key is not certified with a trusted signature. That warning means you haven't personally certified the key, not that something is wrong. What matters is that the signing key's fingerprint matches the one published by the project.
"BAD signature" means stop. Delete the file and download it again from the official site.
In Kleopatra, File, then Decrypt/Verify, and select the .asc or .sig file; it finds the matching download in the same folder.
Things that go wrong
The pinentry dialog doesn't appear. Usually on a headless SSH session or a strange terminal. Setting export GPG_TTY=$(tty) in your shell profile fixes most cases.
"No secret key." You're trying to decrypt something that wasn't encrypted to any key you hold, often because the sender used an old or different key. Ask which fingerprint they used.
Mail client integration breaks. Thunderbird has had built-in OpenPGP since version 78 and doesn't use your GnuPG keyring by default; it keeps its own. People import keys into Kleopatra and wonder why Thunderbird can't see them. You can import them into Thunderbird directly, or configure it to use external GnuPG for smartcard keys.
Losing the private key. No passphrase reset exists, and no one can recover it for you. Back up ~/.gnupg (or export your secret key with gpg --export-secret-keys --armor) to encrypted offline storage. A VeraCrypt container on a USB stick works fine.
For the underlying ideas of public and private keys, the glossary has short definitions. The GnuPG documentation is dense but authoritative when a command misbehaves.