Sequoia: A Cool OpenPGP Library
Neal H. Walfield

Delta X, July 21, 2018https://sequoia-pgp.org/talks/2018-08-introduction

Outline

Introduction

Architectural Overview

Status Quo & Future Directions

Introduction

É

A new OpenPGP implementation in Rust

ÉMotivation
ÉGnuPG is hard to modify
Code and API grew organically over 21 years
Lack of unit tests
É Tight component coupling
É
É

Many developers unsatisfied with GnuPG’s API
Rust is memory safe
É GnuPG can’t be used on iOS due to GPLÉÉIntroduction

ÉA new OpenPGP implementation in Rust

ÉMotivation
ÉGnuPG is hard to modify
Code and API grew organically over 21 years
Lack of unit tests
É Tight component coupling
ÉÉ

Many developers unsatisfied with GnuPG’s API
Rust is memory safe
É GnuPG can’t be used on iOS due to GPL
ÉÉSequoia’s Goals

ÉSocialÉ

TechnicalSocial Goals

É

Inclusive environment

ÉFree Software
Community-centered projectÉ

Development in the open
Collaborating with other OpenPGP implementors on design
É Working with application developers to define APIÉÉTechnical Goals

É

First-class library API, second-class command-line interface

É

Friendly APIÉ

Unopinionated low-level API & opinionated high-level API

É

Loose component coupling

ÉTests, tests, tests, . . .

ÉAll modern platforms

É

Tight integration with host systems

Who We Are

É

Neal, Justus, Kai
É
É

É

Former GnuPG developers (2–2.5 years at g10code)At p≡p since Fall 2017

Fundingp≡p (primary)Wau Holland Stiftung (secondary)
É Actively looking to diversify funding base!
ÉÉWho We Are

É

Neal, Justus, Kai
É
É

É

Former GnuPG developers (2–2.5 years at g10code)At p≡p since Fall 2017

Fundingp≡p (primary)Wau Holland Stiftung (secondary)
É Actively looking to diversify funding base!
ÉÉIntroduction

Architectural Overview

Status Quo & Future Directions

Components
openpgp
sequoia-net
sequoia-store
sequoia

sequoia-ffi
Rust
Application

C/Python/. . .
Application

OpenPGP Crate

É
É

Unopinionated low-level API
All of RFC 4880
ÉÉ

Minus the very dangerous bits (MD5, IDEA, . . . )Supports streaming
ÉÉ

Some protection against emission of invalid data

Intended for advanced OpenPGP use cases
Add a signature to an existing message
Strip encryption
É Reencrypt
É Forensics
É Analysis
É etc.
ÉÉ

Sequoia StoreÉ

Key database (SQLite based)
É
É

Public keys
Private keys

Public Key Store

É

More like a per-domain address book than a PGP keyring
É

Domain: email, software signatures, authentication, . . .
É(or per application?)

Keys addressed using labels, not user ids
É Per-domain label =⇒ key mapping, keys shared
É

É

Arbitrary, associated, structured dataÉ

É

Useful for implementing trust models

Keys automatically refreshed in background (à la Parcimonie)

Private Key StoreÉ

Smartcard-like API for using all types of keys
ÉLocal, Remote, Smartcard, TPM, Trusted Enclave, . . .

ÉOne optional password for all local keys

É

Automatic key rotation for forward secrecy
ÉÉ

Mostly compatible with existing OpenPGP implementations(Individual at-rest and transport encryption subkeys)

Sequoia Net

ÉAccesses keyservers, etc.

É

Colocated, not a daemon

Sequoia

É

High-level API
Easy to use
Sensible defaults
É API driven by application needs
É Minimal manipulation of OpenPGP messages
ÉÉ

generate_key
encrypt_sign
É decrypt_verify
É etc.
ÉÉFFIÉ

We maintain important language bindings

É

Idiomatic interface

ÉC bindings
ÉÉ

Already exist
Easy to useServicespk store

App #1

Ésk store

App #2App #nProcess separation for security; colocation for reliability
ÉÉ

É

Sequoia tries to use a shared service, falls back to colocation
When using colocation: synchronization via SQLite
IPC protocol: capnproto

Introduction

Architectural Overview

Status Quo & Future Directions

Progress (Ø > 90% done :-)É

OpenPGP CrateØ ParsingØ Serialization
Ø Encryption
Ø Signature Verification
Ø Decryption
Ø Signature GenerationKey Generation

ÉÉØ Keyservers
x WKD
Tor support

Sequoia Crate
É FFICPython
x ...

Store
Ø Public keys
Private keys
Local
x Smartcards, etc.
x Remotex Associated dataØ Parcimonie

Net

É

ProtocolForward Secrecy
Multi-device
OpenPGP Specification

Ecosystem

É

MUAs
x p≡p
x Enigmail / Thunderbird
Delta Chatx Leap

É

Infrastructure
Keyserver
x Kuvert
x Schleuder

É

Package Managers
Ø sqv (≈ gpgv)
x Cargo (Rust)

ÉToolsØ sq split (≈ gpgsplit)
pgpdumpx gpg-sync
x git
x wgetSequoia & Delta Chat

É

netpgp-based
ÉÉ

É

Incomplete
No upstream development

Uses ca. 10 OpenPGP functions
Key generation
Sign and encrypt
É ...
ÉÉ

É

After 1 day of work. . . 50% ported!

Sequoia & Delta Chat

É

netpgp-based
ÉÉ

É

Incomplete
No upstream development

Uses ca. 10 OpenPGP functions
Key generation
Sign and encrypt
É ...
É
É

É

After 1 day of work. . . 50% ported!

Release ScheduleÉ

sqv and openpgp library this fall
ÉÉ. . . but no promises :-)Further development
High-level API
Smardcard, etc. support
É System-specific protection mechanismsÉ Forward secrecy, multi-device support
É
ÉRelease ScheduleÉ

sqv and openpgp library this fall
ÉÉ. . . but no promises :-)Further development
High-level API
Smardcard, etc. support
É System-specific protection mechanisms
É Forward secrecy, multi-device support
É
ÉRelease ScheduleÉ

sqv and openpgp library this fall
ÉÉ. . . but no promises :-)Further development
High-level API
Smardcard, etc. support
É System-specific protection mechanisms
É Forward secrecy, multi-device support
ÉÉSummaryhttps://sequoia-pgp.org

ÉSequoia is a new OpenPGP
implementation

É

User-focused development

É

Portable & highly integratedÉ

Low-level API is already usable

ÉJoin us on. . .
irc: #sequoia on Freenodemailing list: devel@sequoia-pgp.org
É gitlab:
gitlab.com/sequoia-pgp/
ÉÉ

Sequoia by steve lyon, CC BY-SA 2.0