Key management and encryption

Key custody by design

Encryption at rest is rooted in your infrastructure. Use TPM 2.0 hardware when available, or set PLEXICHAT_SYSTEM_KEY for container deployments that use software-backed keys.

Key sourceTPM 2.0 or environment
Key storagesystem_keyring.json
Data locationYour database and storage

KEK validation on boot

Plexichat validates every configured key encryption key before it accepts traffic. It rejects insecure keys with a clear error instead of failing silently later.

Length bounds32–64 bytes
Entropy floor≥ 7.0 bits/byte
Weak patternsBlocklisted
Passphrase detectionArgon2 / PBKDF2 required
CompressibilityTrue random only
On failureServer refuses to start

Server-side client cache management (commercial)

On licensed installs, the server owns the per-channel key cache. Clients receive RATCHET_UPDATE broadcasts (opcode 50) over the gateway at /gateway and never retain a long-lived key they can use after a deletion. On the free tier, the messaging service falls back to the v1/v2 keyring envelope and the client manages its own cache.

Free tierv2 envelopes, client manages key cache
Licensedv3 ratchet, server owns key cache
Hard deleteSplits the ratchet interval
Stolen deviceLoses decrypt on next rotation
Rotation cadence1,000 messages or 24h
Gateway signalRATCHET_UPDATE opcode 50
Read compatv1, v2, v3 all decode
Downgrade safetyv3 row returns a sentinel
License keychannel_ratchet_encryption

Threat model addressed: A stolen phone that pulled the active ratchet key while authenticated, a former employee who exported ciphertext out of band, and an admin who copies channel content and tries to decrypt it after deletion.

Commercial license required. Contact [email protected] for pricing.

KEK auto-migration

When you load a keyring with a dedicated KEK (for example, PLEXICHAT_MEDIA_KEY) and decryption fails, the server falls back to PLEXICHAT_SYSTEM_KEY and re-encrypts on the next write. You can roll forward a new KEK without a manual migration window.

Identity protection

Authentication and sessions

Plexichat uses strong password hashing, multi-factor authentication, and tokenized sessions with OAuth 2.0 PKCE.

Password hashingArgon2id
MFATOTP (2FA)
Session modelToken-based
OAuth PKCES256 required

Presence privacy

Presence follows a relationship gate. Use GET /users/{id}/presence to fetch presence only for yourself, friends, or members of a shared server. Requests for strangers return 404 — the server never returns offline to hide visibility.

Network defense and traffic policy

Rate limits and abuse controls

Plexichat enforces traffic protections per route, per user, and per IP with configurable burst windows. Configure limits in config_defaults.py and Nginx — do not rely on hard-coded values in docs.

Global25,000 / 60s, burst 5,000
Per user10,000 / 60s, burst 2,500
Per IP5,000 / 60s, burst 1,500
Hourly (user)300,000
Daily (user)5,000,000
API prefixapi_prefix = /api/v1

Media proxy validation

Plexichat validates external URLs through a media proxy to reduce SSRF risk from avatars, embeds, and remote assets.

Admin RBAC

Role scopes and validation

Plexichat rejects wildcard scopes when you create or update a role. The server returns 400 for * and users.* and validates against the real permission set.

Compliance and data subject rights

GDPR Article 20 data export (DSAR)

The DSAR harvester packages every artifact for a user into a single export bundle. Users can self-serve the same bundle from the client's data export settings.

ScopeUsers, messages, attachments, sessions, voice, audit
Endpoint/api/v1/users/.../data-export
Rate limitPer-user, configurable
Admin visibilityFull request audit trail
Self-serveClient data export UI
RetentionConfigurable

Contact form sub-processor

Messages sent via the contact form are delivered by our sub-processor Formspree (Formspree Inc., US) and used only to respond to your inquiry. See Formspree’s privacy policy. To avoid any third-party processing, email [email protected] directly instead of using the form.

Audit log export (commercial)

Licensed installs can stream the admin audit log to external SIEM-friendly sinks and produce signed export bundles for incident response. Free-tier installs retain the audit log in the database with admin UI access only.

Commercial license required. Contact [email protected] for pricing.

Infrastructure versions and endpoints

Current versions

Postgres18-alpine
Valkey9.1.1
Python3.14
Gateway/gateway
ReadinessGET /api/v1/ready
HealthGET /api/v1/health

Connect to the WebSocket gateway at /gateway (not /ws). Use server.host, api_prefix, tls, and voice.sfu_backend=aiortc as defined in config_defaults.py.