Lesson 3 of 3 Secure Protocols and PKI

The Web of Trust

Not all trust in keys comes from certificate authorities. This lesson explains the web of trust model used by PGP and GPG, how it compares with hierarchical PKI, and how blockchain distributes trust.

Learning outcomes

After completing this lesson, you will be able to:

  • Explain the web of trust model.
  • Describe how PGP and GPG verify and sign keys.
  • Compare the web of trust with hierarchical PKI.
  • Describe how blockchain distributes trust.

Decentralised trust

Hierarchical PKI places trust in certificate authorities: if you trust the root, you trust the certificates beneath it. A web of trust (WoT) has no central authority. Instead, users vouch for each other: when you have verified that a public key really belongs to a person, you sign their key with your own. Others who trust your judgement can then rely on that key without meeting its owner. Trust spreads through these signatures like a social network.

PGP and GPG

Pretty Good Privacy (PGP), created by Phil Zimmermann in 1991, and its open-source implementation GNU Privacy Guard (GPG), both following the OpenPGP standard, use the web of trust. Each user creates a key pair and distributes the public key, for example on a website or key server. Users verify a key by comparing its fingerprint, a hash of the key, with the owner through a trusted channel, such as in person or by phone, and then sign it.

Each user also assigns a level of owner trust to other people, which states how much they trust those people to verify keys carefully. GPG then calculates whether a key is valid: by default, a key is valid if it is signed by one fully trusted key or by several marginally trusted keys. OpenPGP is used to encrypt and sign email and files, to sign software releases and Linux distribution packages, and to sign source code commits.

gpg --full-generate-key
gpg --fingerprint [email protected]
gpg --sign-key [email protected]

The lab for this module walks through generating keys, exchanging and verifying them, signing and encrypting with GPG.

Web of trust versus hierarchical PKI

The two models suit different situations, as the following comparison shows.

Hierarchical PKI (X.509)
Trust anchorRoot certificate authorities
Who verifies identityCAs and RAs under formal policies
RevocationCRLs and OCSP, centrally published
ScalabilityScales to the whole internet
Typical useWebsites, enterprise devices and users, code signing
Web of trust (PGP/GPG)
Trust anchorIndividual users' signatures
Who verifies identityUsers, by comparing fingerprints
RevocationRevocation certificates issued by key owners and distributed to key servers
ScalabilityWorks in communities; scales poorly
Typical useEmail and file encryption among individuals, software and package signing

The web of trust's weakness is that it depends on users' diligence: a careless signer can vouch for a fraudulent key, and newcomers have no signatures. Its strength is independence: no central authority can be compromised or compelled. Key owners should create a revocation certificate when generating keys, so that they can revoke a lost key.

The following diagram shows the verification steps.

Verifying a GPG-signed open-source release. The administrator imports the project's public key, confirms its fingerprint against values published through more than one independent channel, such as the website and conference talks, then verifies the signature with gpg --verify; a valid signature from the verified key shows the release is authentic and unaltered.
The file and key names are illustrative.
Sort into groups

Web of trust or hierarchical PKI?

Exam skills 5.4.2

Decide which trust model each statement describes.

Log in to try this activity Interactive activities are free with an account.

Blockchain

A blockchain is a distributed ledger: a chain of blocks of records, each containing the hash of the previous block, maintained by many participants. Changing a past record would change its block's hash and break every later link, and the participants agree on the valid chain through a consensus mechanism (such as proof of work or proof of stake). Trust is distributed across the network rather than placed in one authority.

Blockchain provides integrity and tamper evidence for records, and transactions are signed with participants' private keys. Its security uses familiar primitives: hashing, digital signatures and key management. Losing a private key usually means losing access permanently, and records cannot easily be removed, which conflicts with privacy rights such as erasure.

Worked example

Verifying a downloaded release

An open-source project signs its releases with GPG and publishes its key fingerprint on its website and in conference talks. How should an administrator verify a downloaded release?

Import the project's public key, confirm that its fingerprint matches the value published through more than one independent channel, then verify the release's signature with gpg --verify. A valid signature from the verified key shows the release is authentic and unaltered. Checking only a hash published on the same server as the download would not protect against a compromised server.

Worked example

Choosing a model

A company needs certificates for 5,000 employee laptops for 802.1X and VPN authentication. A team member suggests using GPG and asking employees to sign each other's keys. Is this suitable?

No. Enterprise device authentication needs centrally issued, centrally revocable identities that network equipment understands, which is hierarchical PKI with X.509 certificates issued by the company's CA through device management. A web of trust depends on individual judgement, scales poorly and is not supported by 802.1X.

Check yourself

How do PGP and GPG users verify that a public key belongs to someone?

Show answer

By comparing the key's fingerprint with the owner through a trusted channel, such as in person, before signing or trusting it.

Exam Tips

Remember for the exam

  • PGP and GPG use a web of trust; X.509 uses a CA hierarchy.
  • Verify keys by comparing fingerprints through a trusted channel.
  • Blockchain distributes trust through hashing, signatures and consensus.