Sequoia PGP
Following a Moral Imperative
Neal H. Walfield <neal@sequoia-pgp.org>
Karakun AG
Basel, Switzerland

November 7, 2023

1 / 41

Outline

Human Rights, A Moral Imperative
A Brief History of PGP
A Look at OpenPGP
A Short Introduction to Sequoia

2 / 41

The Internet

The Internet is wonderful
The Internet simplifies abuse

3 / 41

The Internet

The Internet is wonderful
The Internet simplifies abuse
The programs that we write are not neutral
The programs that we write can harm or protect human rights

3 / 41

Human Rights

Human rights are fundamental

Fundamental means without compromiseProtecting human rights is a moral imperative

4 / 41

What are Human Rights?

Canonical Reference: UN’s Universal
Declaration of Human Rights
Codified 30 freedoms and rights
Ratified in 1948

5 / 41

Right to Personal Security

Everyone has the right to life, liberty and security of person.
Article 3, Universal Declaration of Human Rights

6 / 41

Freedom of Speech

Everyone has the right to freedom of opinion and expression; thisright includes freedom to hold opinions without interference and to seek,
receive and impart information and ideas through any media andregardless of frontiers.
Article 19, Universal Declaration of Human Rights

7 / 41

Right to Privacy

No one shall be subjected to arbitrary interference with his privacy,
family, home or correspondence, nor to attacks upon his honour andreputation. Everyone has the right to the protection of the law against
such interference or attacks.
Article 12, Universal Declaration of Human Rights

8 / 41

Human Rights

Security
Free Expression
Privacy

9 / 41

What is Privacy?

Something to hide

10 / 41

What is Privacy?

Something to hide?

10 / 41

What is Privacy?

Something to hide?
No!
Privacy is a type of consent
Privacy is control over personal information

10 / 41

Privacy in Practice

I may practice ballet
I may tell you I practice ballet
You still have no right to:
Watch
Spy

You must have my informed consent

11 / 41

Privacy: Who Cares?
What happens when someone is watching you?
Task becomes performative
Attention is divided
Focus is on appearance, not results
Afraid to make mistakes

12 / 41

Privacy: Who Cares?
What happens when someone is watching you?
Task becomes performative
Attention is divided
Focus is on appearance, not results
Afraid to make mistakesExamples

Exercising
Practicing
Learning
Working

Less privacy =⇒ less experimentation
Humans need space for experimentation!

12 / 41

Willful Privacy Violations

Mass Surveillance
Surveillance Capitalism
Dark Patterns

Trick users into doing something they wouldn’t normally do
Trick them into violating their privacy

13 / 41

Negligent Privacy Violations

Data Retention+ Data Breaches
All Data Will Be Public(Vorratsdatenspeicherung)Even the best get 0wned.

14 / 41

The Harm is Real15 / 41Moral Imperative

ResistRefuse to violate human rights
Refuse to help others violate human rights
Educate clients and bosses
Just doing my job is not an excuse

Build

Design software to protect users’ privacy
Only collect data that is needed
Encrypt, and authenticate

16 / 41

Outline

Human Rights, A Moral Imperative
A Brief History of PGP
A Look at OpenPGP
A Short Introduction to Sequoia

17 / 41

PGP’s Genesis

Phil Zimmermann, peace activist in the 80s
Peace groups in an adversarial relationship with the US government
Need to protect grass root political organisations
PGP: A tool for cryptographically protecting communication

18 / 41

PGPFirst version released in 1991 in US (32 years old!)1993 US criminal investigation for munitions export without a license
US only allowed 40-bit encryption

Workaround: publish a book, users scan code
US drops case in 1996
Since then, strong encryption for all

19 / 41PGPFirst version released in 1991 in US (32 years old!)1993 US criminal investigation for munitions export without a license
US only allowed 40-bit encryption

Workaround: publish a book, users scan code
US drops case in 1996
Since then, strong encryption for all... but constantly under threat
EU’s Chat Control 2.0

19 / 41Outline

Human Rights, A Moral Imperative
A Brief History of PGP
A Look at OpenPGP
A Short Introduction to Sequoia

20 / 41

OpenPGPIETF standard
First version: RFC 1991, published in 1996
Next version: in IETF last call
Cryptographic refresh
Authenticated encryption
Argon221 / 41

Actively Developed Free Software Implementations

GnuPG (C)
GopenPGP (go)OpenPGP.js (javascript)
PGPainless (Java)
PGPy (Python)
RNP (C++)rPGP (Rust)
Sequoia (Rust)

22 / 41

ScopeDescribes a wire format
Defines encryption, signing, and authentication mechanisms

23 / 41Two basic data structures

Messages
Certificates
Data structures are made up of packets

24 / 41

An Encrypted Message

PKESKr1 (s) PKESKr2 (s) SEIPDs
PKESK: Public Key Encrypted Session Key
One per recipient

SEIPD: Symmetrically Encrypted Integrity Protected Data Packet

25 / 41

A Signed Message

OPS1 OPS2 Literal Data SIG2 SIG1
OPS: One Pass Signature

Signature metadata
Allows for streaming verification

Literal Data: the actual data
SIG: A signature
Signatures nest

26 / 41

The Anatomy of an OpenPGP Certificate

Primary Key (Fingerprint)
Encryption KeyPublic keys
Identities (User IDs)
Metadata
Expiration
Key capabilities
User preferences

Binding Signature
Signing Key
Binding Signature
Alice <alice@example.org>
Binding Signature
Alice <alice@other.org>
Binding Signature

27 / 41

The Anatomy of an OpenPGP Certificate

Primary Key (Fingerprint)
Encryption Key
Binding Signature

Fingerprint is hash of public key
Fingerprint uniquely identifies
certificate
8F17777118A33DDA9BA48E62AACB3243630052D9

Signing Key
Binding Signature
Alice <alice@example.org>
Binding Signature
Alice <alice@other.org>
Binding Signature

27 / 41

The Anatomy of an OpenPGP Certificate

Primary Key (Fingerprint)

Binding signatures link components
Made by primary key
Over the primary key andcomponent

Chain of trust where fingerprint isthe trust root=⇒ easy to update certificate

Encryption Key
Binding Signature
Signing Key
Binding Signature
Alice <alice@example.org>
Binding Signature
Alice <alice@other.org>
Binding Signature

27 / 41

Public Key Infrastructure: Web of Trust
Justus certifies that 8F17777118A33DDA9BA48E62AACB3243630052D9 belongs to Neal
Justus creates an OpenPGP artifact
Artifact can be reasoned about
Artifact can be published

Everyone can act like a certification authority
Users have their own personal trust roots
Modes of operation
Peer to peer
Federated
Centralized

X.509 (Web PKI) is only centralized

28 / 41PKI Example: Debian Uploads

Debian Developers upload their OpenPGP certificate
Certificates stored in a database
When uploading a package:

System checks signature
System checks that issuer is authorized

Upload can be audited later29 / 41PKI Example: Debian Uploads

Debian Developers upload their OpenPGP certificate
Certificates stored in a database
When uploading a package:

System checks signature
System checks that issuer is authorized

Upload can be audited later
No third-party infrastructure
Same can be done for a website with encrypted communication
Anon.ioFacebook

29 / 41

Outline

Human Rights, A Moral Imperative
A Brief History of PGP
A Look at OpenPGP
A Short Introduction to Sequoia

30 / 41Sequoia PGP

Started in 2017
Founders: Three former GnuPG developers
Justus, Kai, Neal

Primary Sponsors

2017-2023: p≡p Foundation
2023-2024: Sovereign Tech Fund
Post 2024: Unknown
31 / 41Prehistory

2015: Werner Koch hires Neal, Justus & Kai
Formative period
Worked on GnuPG
Worked with developers integrating GnuPG
Worked with GnuPG users
Identified problems
Architectural changes too big to do in GnuPG itself
Disagreements with Werner about visionParted ways in Summer 201732 / 41Sequoia’s Philosophy

Not just an OpenPGP implementation
A project to improve the OpenPGP ecosystem
Yes, a new OpenPGP library
But also:
Improve existing tools
Develop new tools
Rethink UX paradigms

33 / 41

Approach

Safety first (Rust)
Bottom up
Library first
Avoid technical debt
Low-level interfaces are unopinionated, and policy-free…but, secure by default
Documentation, documentation, documentation

34 / 41

Core Components

sequoia-openpgp: Low-level librarysequoia-net: Networking librarysequoia-cert-store: Public key store
sequoia-key-store: Private key store
sequoia-wot: Web of Trust engine

35 / 41Sequoia Products

sq: Command line interface
Chameleon: gpg replacement
Octopus: OpenPGP library for Thunderbird
Hagrid: Software powering keys.openpgp.org keyserver
Sequoia git: software supply chain tool
OpenPGP Interoperability test suite

36 / 41

A Few Users of Sequoiap≡p Engine(Key management library)
RPM Package Manager
SecureDrop(Whistleblower submissions)Anon.io(Anonymous Email Forwarding)Sett (Platform for exchanging
medical data in Switzerland)

37 / 41

Integrating Sequoia

Two easy ways to integrate Sequoia:
cargo add sequoia-openpgp
Rewrite It In Rust

https://fission.codes/rewrite-in-rust/

38 / 41

Integrating Sequoia

Two easy ways to integrate Sequoia:
cargo add sequoia-openpgp
Rewrite It In Rust Just kidding

https://fission.codes/rewrite-in-rust/

38 / 41

Generic Bindings

Large, low-level API to wrap
Hard to do in a policy-free manner
Experience writing a C wrapper was a disaster39 / 41

Point Solution

Small Rust library that exports only the needed functionality
Minimizes impedence mismatches
Reduces language boundary crossings
Examples:p≡p Enginerpm
SecureDrop
Anon.ioCC
PythonPHP

3 727 LOC
2 443 LOC
411 LOC
347 LOC

40 / 41

Summary

We have a moral imperative to:

Actively reject surveillanceCollect as little personal data as possible
Encrypt the personal data that we collect

I believe that PGP is a pretty good solution
High-level abstractions
Good crypto
Flexible PKI
Active ecosystem

Sequoia is my preferred implementation

41 / 41