openpgp-notes/book/source/02-highlevel.md
Heiko Schaefer 6a37e6966d
Edits of chapter 2
Integrates Paul's suggestions in #20
2023-09-20 22:33:52 +02:00

6.6 KiB

A high-level view

A very brief history

The OpenPGP standard has evolved over time, and remains under active development.

(Also see https://www.openpgp.org/about/history/)

"Pretty Good Privacy (PGP)"

The earliest roots of OpenPGP trace back to "Pretty Good Privacy (PGP)", a software program written by Phil Zimmermann and first released in 1991.

The original PGP software has played a role in the political struggles sometimes referred to as the "Crypto Wars" (also see https://en.wikipedia.org/wiki/Crypto_(book) for some of that history, including about the history of PGP).

The original "PGP" software was never under a Free Software license, even though its source code has at one point been widely published.

The ownership and branding of the product has changed over the years. The software enjoys a continued existence, albeit with changing name and scope.

Standardizing OpenPGP

While the original PGP software was developed as a commercial product, the owner at the time, "PGP Inc." started a standardization effort with the IETF in July 1997. The resulting open standard was named OpenPGP.

The result of this early standardization work is RFC 2440 "OpenPGP Message Format", published November 1998. RFC 2440 describes OpenPGP version 3.

The name "OpenPGP" can be used freely by implementations (unlike the name "PGP", which is a registered trademark).

GnuPG, an early Free Software implementation

First released 1997-12-20, GnuPG (the "Gnu Privacy Guard") is an implementation of the OpenPGP standard.

GnuPG has been a major early Free Software implementation of OpenPGP. It has played an important (and successful) role in the release of NSA documents by Edward Snowden.

The GnuPG program binary is called gpg, thus the names "GnuPG" and "gpg" are often used interchangeably.

Note: The terms "pgp key" and "gpg key" are sometimes used. Since PGP and GnuPG are just two of many existing OpenPGP implementations, the proper term is "OpenPGP key" (or "OpenPGP certificate", more on that later).

The present

OpenPGP version 4

In 2007, RFC 4880, defining version 4 of OpenPGP, was published. This version is currently most commonly used in the wild.

(major_implementations)=

Multiple major implementations

Today multiple new Free Software implementations of OpenPGP play important roles:

  • Protonmail, who provide email encryption services for a large number of users, use (and maintain) OpenPGP.js as well as GopenPGP.
  • The Thunderbird email software is using the RNP implementation for their built-in OpenPGP support since version 78 (released in mid-2020).
  • The RPM Package Manager software includes an OpenPGP backend based on Sequoia PGP, a modern OpenPGP implementation in Rust. Fedora uses Sequoia PGP in rpm since version 38.

The road ahead

OpenPGP version 6

As of this writing (in 2023), version 6 of OpenPGP is approaching publication as an RFC. The IETF working group's charter centers around updating the cryptographic mechanisms, adding new algorithms, and deprecation of obsolete algorithms.

This document describes OpenPGP version 6, while pointing out differences to previous versions that are relevant to application developers.

Significant work on support for OpenPGP version 6 has already been done for multiple implementations, including:

  • GOpenPGP,
  • OpenPGP.js,
  • PGPainless,
  • PGPy,
  • Sequoia PGP.

Concepts

Certificates/Keys

Use of OpenPGP is centered around (asymmetric) cryptographic keys.

In OpenPGP, bare cryptographic keys are combined with additional metadata into "OpenPGP certificates", which are a relatively complex data structure (OpenPGP certificates are also often called "OpenPGP keys").

An OpenPGP certificate can evolve over time, with components being added, expiring, or being marked as invalid.

See the chapter about certificates for more on OpenPGP certificates, and their internal makeup, and the chapter about private keys for handling of private key material in OpenPGP.

Other important topics around certificates are their management, authentication, and trust models. We will only touch on those, in this document.

High-Level operations

With OpenPGP it's possible to:

  • Encrypt and Decrypt Messages
  • Sign Data
  • Issue and examine Statements about Keys and Identities (to perform CA-like functionality)

Building blocks

To perform these high-level operations, the following building blocks are used:

  • Encryption
  • Signature Algorithms
  • OpenPGP Signatures (made from raw signatures; Certifications, Data Signatures)
  • Keys, Subkeys
  • User IDs

Zooming in: Internal structure of OpenPGP data

OpenPGP data is internally structured as "packets." We'll look at examples of this internal structure throughout the following chapters. Familiarizing ourselves with the internal format of OpenPGP data will enable us to debug issues.

Gaining some familiarity with the internal structure of OpenPGP data will also help us to read the OpenPGP RFC, which describes the structure of OpenPGP packets in full detail.

In this text, however, most of the time we look at OpenPGP at a higher level of abstraction.

(interop_section)=

Interoperability

OpenPGP was standardized in 1997 to encourage development of interoperable implementations. This has already been a success early on, but in recent years, there has been much development of new implementations.

Historically, interoperability has only been tested ad-hoc. Since 2019 the Sequoia project is maintaining and operating the "OpenPGP interoperability test suite", for more rigorous and systematic testing. The test suite has identified numerous issues.