gpg --full-generate-keyInteractively creates a new key pair; choose RSA 4096 or an ECC curve.
The free implementation of OpenPGP: generate keys, encrypt and decrypt files, and create and verify digital signatures — used everywhere from email to release verification.
sudo apt install gnupggpg --full-generate-keyInteractively creates a new key pair; choose RSA 4096 or an ECC curve.
gpg --list-keysLists public keys in your keyring; --list-secret-keys shows private keys.
gpg --export -a <id> > <file>Exports a public key in ASCII-armored form.
Example
gpg --export -a alice@example.com > alice.pubgpg --import <file>Imports a key into your keyring.
Example
gpg --import alice.pubgpg --fingerprint <id>Shows a key’s fingerprint to verify it out of band.
Example
gpg --fingerprint alice@example.comgpg -e -r <recipient> <file>Encrypts a file to a recipient’s public key, producing file.gpg.
Example
gpg -e -r alice@example.com report.pdfgpg -e -r <a> -r <b> <file>Encrypts so several recipients can each decrypt.
Example
gpg -e -r alice@example.com -r bob@example.com report.pdfgpg -c <file>Symmetric encryption with a passphrase — no keys needed.
Example
gpg -c backup.targpg -d <file>.gpg > <out>Decrypts a file.
Example
gpg -d report.pdf.gpg > report.pdfgpg --sign <file>Creates a signed, compressed version of a file.
Example
gpg --sign release.targpg --detach-sign -a <file>Creates a separate .asc signature, the usual way to sign releases.
Example
gpg --detach-sign -a release.targpg --verify <sig> <file>Verifies a detached signature against the file.
Example
gpg --verify release.tar.asc release.targpg --verify <file>.ascVerifies a clearsigned or inline-signed file.
Example
gpg --verify SHA256SUMS.ascgpg --edit-key <id>Opens the key editor to set trust, add user IDs or expiry.
Example
gpg --edit-key alice@example.comgpg --export-secret-keys -a <id> > <file>Backs up a private key — store it somewhere safe.
Example
gpg --export-secret-keys -a alice@example.com > alice.keygpg --armor --export <id> | gpg --keyserver <ks> --send-keys <id>Publishes a public key to a keyserver.
Example
gpg --send-keys 0xDEADBEEFThe ubiquitous toolkit for TLS and general cryptography: inspect certificates, generate keys and CSRs, convert formats, hash, encrypt and create random secrets.
Encodes and decodes Base64, the standard way to carry binary data over text channels — common in tokens, config files and shell file-transfer tricks.