Private Party

Security architecture · v1

Sealed by design.

Every message is encrypted with its own key before it is stored, and only your password can unlock it. Here is exactly how it works, including the parts that aren't magic.

X25519AES-256-GCMscryptHKDF-SHA256HMAC-SHA256TOTP · RFC 6238TLS 1.2+HSTSStrict CSPWeb Push · VAPID
① A message arrives ② You open it Sender Gmail, Outlook, …TLS between servers Cloudflare edge SPF · DKIM · DMARCresults attached Our Worker phishing checksin memory only Seal random 256-bit keyAES-256-GCM Stored body → R2 (encrypted)key sealed to X25519 Your password typed at sign-innever stored scrypt N=2¹⁵ r=8 p=3unwraps private key X25519 + HKDF unseals themessage key AES-256-GCM decrypt + verifytamper = refused Sandboxed view no scripts runremote images blocked
  1. Arrives. Another mail server delivers to @privateparty.cc over TLS when it supports it. Cloudflare checks SPF, DKIM and DMARC.
  2. Checked. Our Worker runs phishing checks in memory. Nothing is logged or sent elsewhere.
  3. Sealed. A fresh random 256-bit key encrypts the message with AES-256-GCM. That key is sealed to your X25519 public key.
  4. Stored. Only ciphertext is written: the body to R2, the sender and subject to D1.
  5. Unlocked. Your password runs through scrypt to unwrap your private key, which unseals the message key.
  6. Shown. The decrypted message opens in a sandboxed frame where scripts can't run and trackers can't load.
How a message travels: arriving mail is sealed to your key before it is stored, and only your password can unlock it again.

The key hierarchy

password + random 128-bit salt
   │  scrypt · N=2¹⁵ · r=8 · p=3 · 32 MiB
   ▼
64 bytes ──┬─▶ first half  → SHA-256 → login check (stored)
             └─▶ second half → wrap key (never stored)
                     │  AES-256-GCM
                     ▼
              X25519 private key (stored only wrapped)
                     │  X25519 + HKDF-SHA256 · ephemeral key
                     ▼
              message key · random 256-bit, one per message
                     │  AES-256-GCM · bound to the message ID
                     ▼
              your mail

Spec sheet

Message encryption
AES-256-GCM, a new random key per message, 96-bit random IV. The message ID is bound in as associated data, so ciphertext can't be swapped between messages.
Key sealing
X25519 with an ephemeral key per message, HKDF-SHA256 to derive the sealing key.
Password
scrypt (N=2¹⁵, r=8, p=3) with a 128-bit random salt. One run gives a login check and a separate wrapping key.
Member to member
When every recipient is a member, the message is sealed straight to their keys and stored. It never leaves our server or crosses the internet as email.
Mail apps
Optional. IMAP and SMTP over TLS at mail.privateparty.cc, signed in with app passwords: random, about 98 bits, each revocable on its own. Your main password never goes into a mail app.
What's encrypted
Body, attachments, sender, recipients, subject and preview.
Sign-in
Rate limits per account and per network, optional 2-step codes (TOTP) that can't be replayed.
Sessions
__Host- cookies: HttpOnly, Secure, SameSite=Strict. Your unlocked key sits in an encrypted session record whose key is half in your cookie. Sessions end after 4 h idle or 7 days.
Invite codes
About 98 bits of randomness, stored only as HMAC-SHA256 hashes.
Crypto code
WebCrypto built into the platform, plus Node's scrypt. No hand-rolled ciphers.

Who can see what

YouThe adminSomeone who steals the databasePush services (Apple, Google)
Your stored mail: text, attachments, sender, subject●○○○
Your password●○○○
Date, size, folder and read status of each message●in the databaseyes○
That you have an account, storage used, number sent today●●yes○
New-mail notifications●○○“new mail”, nothing else
Your IP address●keyed hash onlykeyed hash only○

Hardened browser

A strict Content Security Policy: no third-party scripts, fonts, trackers or inline code. Also HSTS (HTTPS only, for two years), no framing by other sites, and CSRF tokens on every change.

Mail that can't bite

Mail opens in a sandboxed frame with its own lockdown policy. Scripts never run, remote images and tracking pixels are blocked, and styles are cleaned.

Phishing radar

Every incoming message is checked on our own server: sender authentication, look-alike domains, links that lie about where they go, password forms and dangerous attachments. Likely phishing goes to Junk with its links switched off.

Locked-down admin

The admin signs in with a long password plus a mandatory authenticator code. Every admin action is logged. The panel manages accounts and invites, but it has no way to read mail.

Abuse brakes

Daily sending limits per member and service-wide. Per-sender limits on incoming mail. Blocked senders are refused before anything is stored.

Quiet notifications

Pushes are sent empty and the app shows “You have new mail”. VAPID keys are sealed at rest. Only Apple's, Google's, Mozilla's and Microsoft's push services are allowed.

What we don't claim

Security pages that promise everything are a red flag. Here are the real limits.

Questions, or found a weakness?

Write to security@privateparty.cc. We read every report.

Claim your address