Implementation Reference

High-Level Architecture

PWDnow relies strictly on a Two-Layer architecture, establishing a concrete boundary between cryptographic isolated processes and the zero-knowledge frontend interface.

The Two-Layer Model

Layer 1: Vault Daemon

Rust (systemd)
  • Operating Modes: Runs strictly offline, bound directly to the local machine.
  • Storage Backend: Uses SQLite integrated with the SQLCipher extension for encrypted on-disk persistence.
  • Memory Protection: Vault Master Key (VMK) is kept inside a LockedKey struct. Implements mlock() to stop paging and mprotect(PROT_NONE) to seal idle memory pages.
  • Cryptography: AES-256-GCM, Argon2id KDF, and Post-Quantum hybrid algorithms (ML-KEM-1024, ML-DSA-87).

Layer 2: Web Interface

React / Express
  • Zero-Knowledge UI: The frontend never observes plaintext Master Keys, KEK, VMK, or DEK schemas. It trades inputs for opaque blobs.
  • Session Management: Ephemeral session_token values held exclusively in memory via JS private class fields, aggressively nullified on visibility exits.
  • Server Proxy: Node.js proxies IPC calls directly via WebSockets, enforcing strictly randomized per-request CSP headers to block injection.

Inter-Process Communication (IPC)

/run/vault-daemon/vault.sock

Communication passes over an isolated Unix Domain Socket bridging the WebSocket proxy and the Rust Daemon engine.

SO_PEERCRED AuthenticationThe daemon intrinsically verifies connection origins utilizing OS-level SO_PEERCRED identity challenges to ensure exclusively trusted access.

Every data transaction is mapped safely through strongly-typed Request/Response enumerations utilizing MessagePack binary framing layers.

MessagePack Request Sequence
1. Unlock RequestWeb -> Daemon
2. Verify Socket UID (SO_PEERCRED)Kernel Level
3. IPC Result: session_tokenDaemon -> Web
4. Authenticated Request with auth_then!Daemon Macro

The P2W Format (Vault Export)

P2W is PWDnow's proprietary export format, engineered meticulously to deter offline tampering and evade traffic analysis through exponential structural padding.

Suite 0x02 SpecImplementation Detail
Key DerivationArgon2id (m=256 MiB, t=3, p=1). Subkeys expanded via HKDF-SHA3-512 domain tags.
Double AEAD EncryptionInner enveloping uses AES-256-GCM. Outer enveloping secures it via XChaCha20-Poly1305. Plaintext headers bound to AAD.
Exponential Padding (F-02)Fills payload using random padding items targeting exponential layout targets (64 KB, 256 KB, 1 MB+) to obscure factual vault volume metrics.
Meta Obfuscation (F-07)Plaintext headers conceal timestamp and size fields entirely—access allowed only after successfully processing PRF payload decrypts.

Threat Mitigations & Capabilities

Replay Attacks (MFA)

TOTP verification leverages a localized used-token memory cache structure that instantly drops consumed values to circumvent re-use within drift periods.

Active Forensic Wipe

In coercion configurations, presenting a WIPE_TICKET_KEY executes a 7-pass overwrite destruction protocol inside the daemon layer abruptly concluding execution.

SLA P1 Sentinel

Companion pwdnow-monitor tracks RAM leakage, forcing CRITICAL restarts on monotonic memory bounds breaches shielding persistence engines.

Frequently Asked Questions

Over an isolated Unix domain socket at /run/vault-daemon/vault.sock, authenticated with OS-level SO_PEERCRED identity checks, using MessagePack-framed Request/Response messages — never a network socket.
P2W is PWDnow's proprietary vault-export format: Argon2id key derivation (m=256 MiB, t=3, p=1), a double AEAD envelope (AES-256-GCM inside XChaCha20-Poly1305), and exponential padding that hides the true size of the exported vault from anyone who intercepts the file.
Yes. The Vault Master Key is held in a LockedKey struct that calls mlock() to keep it out of swap and mprotect(PROT_NONE) to seal the memory pages when idle; session tokens live only in JS private class fields that are nullified on visibility exits.
Presenting a WIPE_TICKET_KEY triggers a 7-pass overwrite destruction protocol inside the daemon layer and immediately ends execution — this is the mechanism behind Travel Mode and Duress Mode described on the home page.