Security
Threat model, best practices, and limitations.
Threat Model
Section titled “Threat Model”pgpilot is designed to protect against these threats:
Data Eavesdropping
Section titled “Data Eavesdropping”Threat: Attacker intercepts your files in transit (email, cloud, USB).
Protection: File encryption.
- How: Use pgpilot to encrypt files before sending.
- Result: Only recipients with private keys can decrypt.
Forged Messages
Section titled “Forged Messages”Threat: Attacker sends a message claiming to be you (impersonation).
Protection: Digital signatures.
- How: Use pgpilot to sign files. Recipients verify with your public key.
- Result: Only you could have signed (proves authenticity).
Key Theft (Disk)
Section titled “Key Theft (Disk)”Threat: Attacker steals your computer or disk.
Protection: Hardware keys (YubiKey) or passphrases.
- Hardware: Private keys never leave the card. Attacker gets nothing.
- Passphrase: Private key is encrypted on disk. Attacker must crack passphrase.
Subkey Compromise
Section titled “Subkey Compromise”Threat: One subkey (e.g., Encryption) is compromised, but you don’t know.
Protection: Subkey rotation and revocation.
- How: Use pgpilot Replace to create new subkey and revoke old.
- Result: Old subkey marked revoked; new one is active.
Key Loss
Section titled “Key Loss”Threat: You lose access to your private key (hardware failure, deletion).
Protection: Backups.
- How: Use pgpilot Backup to export secret key and revocation cert.
- Result: If you lose key, you can restore from backup. If you can’t restore, you can revoke and create new key.
What pgpilot Does NOT Protect Against
Section titled “What pgpilot Does NOT Protect Against”Compromised Computer
Section titled “Compromised Computer”Threat: Malware installs on your computer and reads private keys, passphrases, or plaintext files.
Limitations:
- pgpilot uses
gpgon your computer. If OS is compromised, attacker can intercept. - If using a YubiKey, keys themselves are protected, but attacker could intercept commands to sign/decrypt.
- Decrypted files on disk are readable to malware.
Mitigation:
- Keep OS patched (fewer vulnerabilities)
- Use antivirus / malware scanner
- Don’t run untrusted binaries
- Use a hardware key (harder to extract secrets)
Weak Passphrases
Section titled “Weak Passphrases”Threat: Attacker brute-forces your private key password.
Limitations:
- If passphrase is weak (e.g., “password123”), attacker can try all possibilities.
- 2024 GPUs can test billions of passphrases per second.
Mitigation:
- Use strong passphrases: 15+ characters, mixed case, numbers, symbols
- Use a passphrase manager (Bitwarden, 1Password, KeePass)
- Use a hardware key (no passphrase needed, can’t be brute-forced)
Trust Mistakes
Section titled “Trust Mistakes”Threat: You trust the wrong person’s key (you don’t actually verify their identity).
Limitations:
- pgpilot relies on you to verify fingerprints in person.
- If you skip verification, you might encrypt to an attacker’s key.
Mitigation:
- Always verify fingerprints by comparing in person or via a secure channel.
- Use pgpilot’s trust levels (Marginal / Full) to mark who you’ve verified.
- Encrypt test files to yourself first; only encrypt to strangers after verification.
Network Eavesdropping (Keyserver Lookups)
Section titled “Network Eavesdropping (Keyserver Lookups)”Threat: Attacker monitors your network and sees which keys you’re searching for (privacy leak).
Limitations:
- When you search a keyserver, your search query is visible (unless VPN/Tor).
- Attacker can infer who you’re communicating with.
Mitigation:
- Use VPN or Tor for keyserver lookups
- Use keys.openpgp.org (doesn’t return email addresses in searches, more private)
- Avoid searching by email; search by fingerprint instead
GPG Bugs
Section titled “GPG Bugs”Threat: Undiscovered vulnerability in GnuPG could leak keys or signatures.
Limitations:
- pgpilot delegates all crypto to
gpg. Ifgpgis broken, pgpilot is broken.
Mitigation:
- Keep GnuPG updated:
gpg --versionshould show latest version - Monitor security advisories: https://gnupg.org/security.html
- Use a hardware key (reduces attack surface; much of crypto happens on-chip)
Best Practices
Section titled “Best Practices”Key Creation
Section titled “Key Creation”- Create via pgpilot or
gpg --batch(not interactive; avoids mistakes) - No expiry on master key (pgpilot default; correct design)
- 2-year expiry on subkeys (pgpilot default; balance freshness + usability)
- Use ed25519 / cv25519 (pgpilot default; modern, secure)
Passphrases
Section titled “Passphrases”- Strong: 15+ characters, mix of case + numbers + symbols
- Unique: Don’t reuse passwords from other accounts
- Backed up: Store securely in a password manager
- Reviewed regularly: Ensure you still remember it
Backups
Section titled “Backups”- Backup immediately after key creation (use pgpilot Backup)
- Store offline: USB in a safe, not on your computer
- Encrypt the backup (use VeraCrypt, LUKS, BitLocker)
- Test annual recovery: Restore to temp machine, verify it works
- Document passphrases: Store separately from key backup (in password manager)
Trust & Verification
Section titled “Trust & Verification”- Verify fingerprints in person (meet face-to-face if possible)
- Or via trusted channel (video call, phone call from known number)
- Never trust email/text (attacker can intercept)
- Set trust explicitly (don’t encrypt to Undefined-trust keys)
- Review trust annually (revoke if person is no longer trustworthy)
Key Rotation
Section titled “Key Rotation”- Renew subkeys before expiry (1-2 months before expiration date)
- Rotate compromised subkeys immediately (use pgpilot Replace)
- Publish rotations to keyserver (use pgpilot Publish)
- Announce to contacts (email with new key details)
Hardware Keys (YubiKey)
Section titled “Hardware Keys (YubiKey)”- Change default PIN (from
12345678to strong PIN) - Keep with you (don’t leave unattended)
- Backup master key offline (YubiKey only holds subkeys)
- Test recovery: If card lost, can you restore from backup?
- Document serial number (in case of loss/theft)
File Encryption
Section titled “File Encryption”- Test encryption/decryption (encrypt to yourself first)
- Use armor format (
.asc) for plain text / email - Use binary format (
.gpg) for files, archives - Keep signatures with files (store
.signext to encrypted file) - Verify signatures before trusting (always check signer trust)
Limitations of pgpilot
Section titled “Limitations of pgpilot”No Master Key Expiry
Section titled “No Master Key Expiry”pgpilot doesn’t let you set master key expiry. This is intentional:
- Master key expiry is complex and rarely needed
- Modern practice: keep master key forever; rotate subkeys instead
- If you need expiring master keys, use
gpg --quick-gen-key "Name" ed25519 cert 1y
No Key Server Pulling (Search Only)
Section titled “No Key Server Pulling (Search Only)”pgpilot can import keys from keyservers (pull), but cannot pull updates to your existing keys.
Workaround: Periodically re-import your contacts’ keys to get latest versions:
gpg --keyserver keys.openpgp.org --recv-keys <their-fingerprint>Or use external tools:
gpg --auto-key-retrieve # Fetches unknown signing keys automaticallyNo Expiry Modification (Master Key)
Section titled “No Expiry Modification (Master Key)”You cannot change master key expiry in pgpilot. Use gpg directly:
gpg --quick-set-expire <master-fp> <duration>No User ID Management
Section titled “No User ID Management”pgpilot doesn’t add/remove user IDs (email addresses) on keys.
Workaround: Use gpg --edit-key <fp> → adduid / deluid.
No Direct SSH Key Export (Auth Subkey)
Section titled “No Direct SSH Key Export (Auth Subkey)”pgpilot doesn’t export Auth subkeys as SSH public keys. Use:
gpg --export-ssh-key <fingerprint> > ~/.ssh/id_pgp.pubpgpilot may add this in a future version.
No Key Signing (Web of Trust)
Section titled “No Key Signing (Web of Trust)”pgpilot doesn’t sign other keys (key signing parties). Use:
gpg --default-key <your-fp> --sign-key <their-fp>No Revocation Generation (Master Key)
Section titled “No Revocation Generation (Master Key)”pgpilot cannot generate revocation certificates for master keys. Use:
gpg --gen-revoke <master-fp> > revocation.ascKeep this file offline in case of emergency.
Reporting Security Issues
Section titled “Reporting Security Issues”If you discover a security vulnerability in pgpilot:
- Do NOT post on GitHub issues (public disclosure could harm users)
- Email: guillaume+code@friloux.me
- Include:
- Detailed description of vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
- Allow time for pgpilot maintainers to respond and patch
Responsible disclosure is appreciated. Security researchers will be credited.
OpenPGP Standards
Section titled “OpenPGP Standards”pgpilot uses:
- OpenPGP RFC 4880 (IETF standard)
- Modern algorithms: ed25519 (sign), cv25519 (encrypt), SHA-256+
- Deprecated algorithms avoided: RSA 1024, SHA-1, MD5, IDEA, 3DES, etc.
GnuPG enforces these standards, preventing weak keys.
Further Reading
Section titled “Further Reading”- GnuPG Manual: https://gnupg.org/documentation/manuals/gnupg/
- RFC 4880 (OpenPGP spec): https://tools.ietf.org/html/rfc4880
- keys.openpgp.org privacy policy: https://keys.openpgp.org/about
- YubiKey documentation: https://support.yubico.com/
- NIST Cybersecurity Framework: https://www.nist.gov/cyberframework
PGP Chat — Security Model
Section titled “PGP Chat — Security Model”What the relay sees
Section titled “What the relay sees”The MQTT broker sees only:
- An opaque topic (
SHA256(room_id)truncated to 16 hex chars) - Encrypted blobs (OpenPGP — unreadable without the recipient’s private key)
- Sender fingerprint and Unix timestamp in the wire message JSON
- Presence status (
online/offline) per fingerprint prefix
The broker cannot read message content, resolve sender identity beyond the fingerprint, or determine room membership.
Identity proof
Section titled “Identity proof”Every message is encrypted with gpg --encrypt --sign. Upon receipt,
PGPilot calls gpg --decrypt --status-fd 2 and requires [GNUPG:] VALIDSIG <fp40> in the status output. If the verified fingerprint does not match the
declared sender, the message is silently discarded. Spoofing requires the
victim’s private key.
Invitation codes (pgpilot:join:...) are signed by the inviter’s private
key. PGPilot verifies the signature via gpg --verify before accepting any
invitation.
Ephemeral messages
Section titled “Ephemeral messages”Messages exist only in RAM. Closing PGPilot deletes them permanently.
Only ~/.config/pgpilot/rooms.yaml persists (room IDs and participant
fingerprints — no message content). The file is capped at 1 MiB.
Known limitations
Section titled “Known limitations”| Limitation | Impact | Mitigation |
|---|---|---|
| No forward secrecy | A compromised private key decrypts past messages captured by an attacker | Use a private relay; rotate keys periodically |
| Presence not signed | A malicious relay could publish false online/offline status | Use a trusted private relay |
| Metadata visible | Relay sees who is online and when | Use a private relay; presence fingerprints are truncated to 16 hex |
| Public relay (default) | broker.hivemq.com has no SLA | Self-host Mosquitto or HiveMQ for production |
| No offline delivery | Messages sent while offline are lost | Accept the tradeoff; future: NATS JetStream |
| YubiKey touch policy | A touch-per-operation card requires a touch for each message sent/received | Use a “touch once per session” policy, or a software key |
Questions?
Section titled “Questions?”See FAQ or Troubleshooting for answers to common questions.