GPG Explained: The Free Tool That Signs the Open Source World

GPG explained in plain terms means understanding the free tool that signs the open source world, a program from 1999 that lets anyone encrypt a file or prove a piece of software really came from its author. The central question is why a command-line tool from the last century is still the standard for signing Linux packages and Git commits, and the answer is that GPG is free, open and trusted, so the whole open source ecosystem could build on it without asking anyone’s permission, and that freedom is the whole point of the design.

GPG, the GNU Privacy Guard, is a free implementation of the OpenPGP standard, first released in 1999 by Werner Koch. It encrypts and signs files and email using public-key cryptography, and it is built around keyrings that hold your own keys and the public keys of people you trust, which means the tool manages both secrets and identities, and that double duty is what makes it the standard for open source signing.

This article explains what GPG is, how it works, and where it runs in the real world.

Key takeaways

  • GPG is the GNU Privacy Guard, a free OpenPGP tool from 1999.
  • It was created by Werner Koch.
  • It encrypts files and email and signs software.
  • It uses keyrings and a web of trust.
  • It is used to sign Linux packages and Git commits today.

What GPG is

GPG is a tool that turns a private key into a signature anyone can check, and that signature is what lets a user trust a download. A developer signs a package with a private key, a user verifies it with the public key, and the signature proves the package was not tampered with, which means the tool replaces blind trust with mathematics, and that replacement is the whole point of signing.

Its signature feature is the keyring. Most encryption tools hide key management, but GPG keeps an explicit ring of keys, your own private keys and the public keys you have collected, which means the user can see exactly who they trust, and because the ring is local, the trust stays under the user’s control.

The design was a reaction to the patent problem. In the 1990s, the original PGP used patented algorithms, so the free software world needed a version it could ship without a licence, and Werner Koch answered with GPG, because a tool that cannot be freely distributed is a tool the community cannot build on.

It became the best-known signing tool in the world, and it is named in every guide to open source security. GPG signs Linux distribution packages, Git commits and release files, it is packaged with every major operating system, and it is still maintained by its original author, which means the tool has served the community for more than twenty-five years without ever being replaced.

Its most famous property is the web of trust. GPG lets users sign each other’s keys, building a network of trust that needs no central authority, which means a key can be trusted because people you trust have vouched for it, and that decentralised model is the reason the tool fits the open source world so well.

Our guide to OpenPGP explains the standard GPG implements, and our guide to libsodium explains a modern library for developers who need encryption without keyrings.

How GPG works

Everything starts with the key pair, a public key you share and a private key you guard. GPG generates the pair from a random seed and protects the private key with a passphrase, which means the key is safe even if the file is stolen, and because the passphrase is the last line of defence, choosing a strong one matters more than any other step.

Each message begins with the recipient’s public key. To encrypt a file, GPG generates a random session key, encrypts the file with it, and encrypts the session key with the recipient’s public key, which means the file itself is protected by a fast symmetric cipher, and because the session key is different every time, the same file encrypted twice looks completely different.

The signature is what makes the design work as a whole. To sign a file, GPG hashes it and encrypts the hash with the private key, which means anyone with the public key can verify the hash and prove the file is unchanged, and because the hash covers the whole file, even a one-byte change breaks the signature.

The keyring spreads the effect further. GPG keeps public keys in a keyring file, and each key carries signatures from other users who have verified it, which means trust can be built up over time, and because the ring is local, the user decides which keys to trust and which to ignore.

The web of trust is what turns individual keys into a network. When you sign someone’s key, you vouch for their identity, and others who trust you can then trust that key, which means trust propagates through the community, and because no central authority is involved, the network grows wherever people meet and verify each other.

The verification comes from checking the signature against the keyring. A user runs GPG to verify a download, the tool checks the signature with the public key, and reports whether the signature is good, which means the user knows in seconds whether to trust the file, and that quick check is what makes signing practical for everyday use.

A dark office desk with a laptop showing a glowing green cipher diagram, a brass key and a notebook beside it
A dark office desk with a laptop showing a glowing green cipher diagram, a brass key and a notebook beside it, shows how GPG works: keys take turns through encryption and signing, file after file, until trust is established.

Comparing GPG with other signing tools

GPG is one of several tools for signing and encrypting, and each was built with a different emphasis. PGP is the original commercial product with a polished interface and a licence, OpenSSL is the general-purpose toolkit with command-line signing but no keyring, and GPG is the free OpenPGP tool with a keyring and a web of trust, while each approach trades something for something else.

The table below sets out the main contrasts between the leading approaches.

Aspect GPG PGP OpenSSL
Licence Free, GPL Commercial Free, Apache
Standard OpenPGP OpenPGP X.509
Keyring Yes Yes No
Year 1999 1991 1998
Best for Open source signing Email privacy TLS certificates

The practical result is that GPG is the right choice for open source signing, PGP suits email privacy, and OpenSSL fits TLS certificates instead.

Where GPG is used

Linux distributions use it to sign packages. Debian, Fedora, Arch and every other major distribution sign their packages with GPG, because users must be able to verify that a package came from the distribution, which means the tool protects millions of installations every day.

Developers use it to sign Git commits. Programmers sign their commits with GPG so that a project can prove who wrote each change, because a repository that accepts unsigned commits cannot tell an impostor from a contributor, and that proof is the reason signed commits are now the norm in serious projects.

Release managers use it to sign tarballs. Open source projects sign their release files with GPG, because a download from a mirror must be verifiable, which means the tool protects the supply chain from the author all the way to the user.

Journalists use it to protect sources. Reporters and their sources exchange encrypted email with GPG, because a message that only the recipient can read is the safest way to share sensitive information, and that protection is the reason the tool is recommended by press-freedom groups.

Teaching uses it as the OpenPGP example. Cryptography courses introduce GPG when they explain public-key cryptography, because it is the tool students can install and use in minutes, and a student who has signed a file with GPG understands public keys in a way no lecture can match.

Strengths and limits

The greatest strength of GPG is its ubiquity. A tool that ships with every Linux distribution and signs the world’s software is tested far more thoroughly than any new design, and that testing is real, measured in the decades of use and confirmed by the distributions that depend on it every day.

It is also a strength that the design is free and open. GPG is published under the GPL, audited in public and maintained by its community, and that openness is worth more than cleverness in a field where a secret tool is a tool nobody trusts.

The limits are real, though, and the biggest is usability. GPG’s command line and key management confuse newcomers, which means many users give up before they sign anything, and a tool that only experts can use is a tool that protects fewer people than it should.

GPG checklist

  • Use GPG to sign software releases and Git commits.
  • Remember your private key is protected by your passphrase.
  • Back up your private key and revocation certificate.
  • Compare it with OpenSSL to see the keyring trade-off.
  • Note it implements the OpenPGP standard.
  • Publish your public key where others can find it.
  • Verify fingerprints in person before signing a key.
  • Revoke a key immediately if it is ever compromised.
  • Choose a modern tool for messaging, not email encryption.

Frequently asked questions

What is GPG in simple terms?

It is a free program from 1999 that encrypts files and email and signs software, using public-key cryptography with keyrings and a web of trust instead of a central authority.

Who created GPG?

Werner Koch, who released the first version in 1999 as a free replacement for PGP, and who still maintains it today.

How is GPG different from PGP?

Both implement OpenPGP, but GPG is free software under the GPL, while the original PGP was a commercial product, and GPG is the version the open source world adopted.

Is GPG still secure?

Yes, the cryptography is sound and the tool is actively maintained, though its usability is poor and email encryption is rarely the right answer for new projects.

Where is GPG used?

In Linux package signing, Git commit signing, release files, and encrypted email, wherever the open source world needs to prove who made something.

When should I use GPG?

When you sign a software release, when you verify a download, or when you need OpenPGP encryption that anyone can check.

The bottom line

GPG explained in one line is this: the free signing tool, a 1999 program that let the open source world encrypt and sign without a licence and still guards its software today.

It is proof that free tools can outlast commercial ones, and the reason it still matters is that every package installed since has been judged partly by the lesson GPG taught.

This article is general information about how GPG works, not advice about choosing encryption for a particular device or system.

Latest articles

Scroll to Top