Add GnuPG interoperability tests; generate GnuPG-compatible Curve25519 keys, v0.3.1

This commit is contained in:
2026-10-07 16:15:21 +03:00
parent 750665f96b
commit edf7cec93e
6 changed files with 115 additions and 8 deletions
+4 -3
View File
@@ -1,6 +1,6 @@
# Encryption plan: OpenPGP mail encryption for ep-mail
Status: **Phases 1–3 and the desktop parts of 4–6 are implemented.** Android support, manual interop checks with Thunderbird/GnuPG and an independent security review are still open; see [TODO.md](./TODO.md).
Status: **Phases 1–3 and the desktop parts of 4–6 are implemented.** Android support, a manual Thunderbird check and an independent security review are still open; see [TODO.md](./TODO.md).
## 1. Format: OpenPGP with PGP/MIME (RFC 3156)
@@ -13,7 +13,7 @@ Decision: OpenPGP only for v1; S/MIME may follow later.
- Library: [OpenPGP.js](https://github.com/openpgpjs/openpgpjs) (`openpgp`), pure JS, usable in Electron and the Android WebView.
- Messages: `multipart/encrypted` (`application/pgp-encrypted` + `application/octet-stream`), signed and encrypted together. Attachments go inside the encrypted payload.
- Keys: Curve25519 with modern defaults.
- Keys: Curve25519 (legacy EdDSA/ECDH, OpenPGP v4). OpenPGP.js' default native Ed25519 keys are rejected by GnuPG 2.5, so the widely supported format is used.
- Also detect and decrypt legacy inline PGP (`-----BEGIN PGP MESSAGE-----`).
- Out of scope for v1: Autocrypt headers, key servers, Web Key Directory.
@@ -55,7 +55,7 @@ Decision: OpenPGP only for v1; S/MIME may follow later.
| 2 | Receive: detect PGP/MIME and inline PGP, decrypt on open, verify signatures, status UI, missing-key and wrong-passphrase handling | Done (desktop) |
| 3 | Send: public-key keyring and contact import, encrypt and sign on compose, encrypted Sent copy, downgrade warnings | Done (desktop) |
| 4 | Trust and polish: fingerprint verification, key-change warnings, passphrase cache timeout, Android Keystore and biometric unlock | Desktop done; Android open |
| 5 | Interop testing with Thunderbird and GnuPG, large attachments, multiple recipients, corrupted payloads | Automated tests done; manual interop open |
| 5 | Interop testing with Thunderbird and GnuPG, large attachments, multiple recipients, corrupted payloads | Automated and GnuPG interop tests done; Thunderbird check open |
| 6 | Docs, security review, release | Docs and release done; independent review open |
## 6. Phase 1 implementation notes
@@ -73,6 +73,7 @@ Decision: OpenPGP only for v1; S/MIME may follow later.
- Encrypted messages appear in the list as "Encrypted message"; they are decrypted on demand (`pgp:decrypt-message`) and the plaintext is never cached on disk. Attachments are read from the decrypted payload.
- Compose shows Encrypt and Sign options. Encrypt turns on by default when every recipient has a key; if a key is missing the app asks before sending unencrypted. Encryption happens before the message is sent or queued offline, so passphrases and plaintext never enter the outbox. The Sent copy is also encrypted to the sender's own key.
- A signature from a key that differs from the one on file for the sender is flagged as a changed key.
- Interop: [tests/pgp-gnupg-interop.test.cjs](./tests/pgp-gnupg-interop.test.cjs) runs against a real GnuPG (skipped when it is not installed).
- Tests: [tests/pgp-mail.test.cjs](./tests/pgp-mail.test.cjs) (round trips, several recipients, tampering, key changes, large attachments, inline PGP).
- Limits: subjects and headers are not encrypted; drafts are stored unencrypted; opening encrypted attachments requires the passphrase to be remembered (see Settings → Encryption keys).
## 8. Risks