gpg

GNU Privacy Guard - Encryption & Signing Tool

What Does It Do?

The gpg (GNU Privacy Guard) command is a free implementation of the OpenPGP standard that allows you to encrypt and sign data and communications. It's the go-to tool for email encryption, file signing, and secure key management.

Think of GPG as your personal digital seal and cipher - like a medieval king who seals letters with wax and encrypts secret messages. GPG creates a pair of keys (public and private): your public key is like your mailing address that anyone can use to send you encrypted messages, while your private key is like the only key to your mailbox that only you possess. IT professionals use it to encrypt sensitive emails, sign software releases to prove authenticity, verify downloaded files haven't been tampered with, create secure backups, exchange confidential documents, and establish trust chains through key signing.

Advertisement

[ Insert Google AdSense Banner Code Here ]

When Should I Use It?

Encrypt Emails

Secure email communications with end-to-end encryption.

Sign Documents

Digitally sign files to prove authenticity and integrity.

Verify Software

Check signatures on downloaded software to ensure it hasn't been tampered with.

Encrypt Files

Protect sensitive files with strong public-key cryptography.

Common Commands

gpg --version

Display the GPG version and supported algorithms.

gpg --gen-key

Generate a new GPG key pair (public and private keys).

gpg --list-keys

List all public keys in your keyring.

gpg --list-secret-keys

List all private (secret) keys you own.

gpg --encrypt --recipient user@email.com document.txt

Encrypt a file for a specific recipient using their public key.

gpg --decrypt document.txt.gpg

Decrypt an encrypted file using your private key.

gpg --sign document.txt

Sign a file with your private key to prove authenticity.

gpg --verify document.txt.gpg

Verify the signature on a signed file.

gpg --export user@email.com > publickey.asc

Export a public key to share with others.

gpg --import publickey.asc

Import someone else's public key into your keyring.

CRITICAL SECURITY WARNING

NEVER share your private key! Your private key is the foundation of your identity and security. If compromised, attackers can decrypt all messages sent to you and forge signatures in your name. Keep it absolutely secret and secure.

Back up your private key securely: If you lose your private key, you'll lose access to all encrypted data forever. Create encrypted backups and store them in multiple secure locations (encrypted USB drives, password managers, etc.).

Use strong passphrases: Always protect your private key with a long, complex passphrase (20+ characters). This is your last line of defense if the key file is stolen.

Verify key fingerprints: Before trusting a public key, always verify the fingerprint through a secure channel (in person, phone call, video chat). This prevents man-in-the-middle attacks.

Try It Yourself

Practice gpg commands in the interactive terminal below: