██████╗ █████╗ ███████╗███████╗██╗ ██╗ █████╗ ██╗ ██╗██╗ ████████╗
██╔══██╗██╔══██╗██╔════╝██╔════╝██║ ██║██╔══██╗██║ ██║██║ ╚══██╔══╝
██████╔╝███████║███████╗███████╗██║ ██║███████║██║ ██║██║ ██║
██╔═══╝ ██╔══██║╚════██║╚════██║╚██╗ ██╔╝██╔══██║██║ ██║██║ ██║
██║ ██║ ██║███████║███████║ ╚████╔╝ ██║ ██║╚██████╔╝███████╗██║
╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝
[ SOVEREIGN ZERO-KNOWLEDGE CRYPTOGRAPHIC CORE & NATIVE CITADEL // v1.0.0 ]
PassVault is an air-gapped, zero-knowledge credentials vault engineered with a dual-layer cryptographic architecture. It pairs an ultra-responsive React 19 + TypeScript frontend with a hardware-hardened Rust Native Ring-3 Citadel backend (Tauri v1.8.3).
The system is constructed upon a strict Zero-Trust, Zero-Knowledge, and Anti-Surveillance Doctrine:
- True Air-Gapped Offline Operation: Zero external network calls. No remote CDNs, no external web fonts, no cloud analytics. All stylesheets (Tailwind CSS), scripts, and assets are bundled locally with an offline Content Security Policy (
connect-src 'self' ipc:; object-src 'none'). - Non-Volatile Cryptographic Boundary: Master passwords and decrypted credentials never touch non-volatile disk unencrypted.
- Page-Isolated Physical RAM Pinning: Decrypted keys are held in dedicated, page-granularity virtual memory (
VirtualAlloc+VirtualLockon Windows), immune to OS paging (pagefile.sys) and protected against heap memory sharing leaks. - Cryptographic AAD Binding: Field-level ciphertexts are cryptographically bound to their record ID and field name via AES-GCM Additional Authenticated Data (
AAD), mathematically eliminating cross-field and cross-record ciphertext substitution.
+---------------------------------------------------------------------------------------------------+
| PASSVAULT THREAT BOUNDARY |
+---------------------------------------------------------------------------------------------------+
| |
| +-----------------------------------+ +-----------------------------------------+ |
| | REACT 19 FRONTEND ENGINE | | NATIVE RUST CITADEL CORE | |
| | - WebCrypto AES-256-GCM (AES-NI) | | - Dedicated VirtualAlloc / VirtualLock | |
| | - PBKDF2-HMAC-SHA256 (600k iter) | | - Multi-Lane Argon2id (64 MiB, t=3,p=4)| |
| | - WebAuthn FIDO2 / Windows Hello | | - Pure Binary .pvdb v1.0 Engine | |
| | - CSPRNG Scrambled Virtual Pad | | - Win32 DWM Anti-Capture Shield | |
| | - Cryptographic Envelope v2 (AAD)| | - Win32 Clipboard Privacy & Purge | |
| +-----------------+-----------------+ +--------------------+--------------------+ |
| | | |
| | 16 Type-Safe IPC Command Handlers | Direct Win32 / NT APIs|
| v v |
| +-----------------------------------+ +-----------------------------------------+ |
| | TAURI DESKTOP IPC BRIDGE | | OS SUBSYSTEM & HARDWARE ENCLAVE | |
| | - Strict Localhost Origin Bind | <-----------> | - Windows DPAPI (CryptProtectData) | |
| | - Sanitized Path Traversal Guard | | - SetWindowDisplayAffinity (DWM) | |
| | - Zero-Residual IPC Buffers | | - Full-Length In-Place Zero Fill Purge | |
| +-----------------------------------+ +-----------------------------------------+ |
| |
+---------------------------------------------------------------------------------------------------+
+-----------------------+
| MASTER PASSWORD |
+-----------+-----------+
|
v
+-------------------------------+
| 128-bit CSPRNG SALT |
+---------------+---------------+
|
v
+-------------------------------+
| KDF DERIVATION ENGINE |
| - Web: PBKDF2-SHA256 (600k) |
| - Native: Argon2id (64MiB) |
+---------------+---------------+
|
v
+-------------------------------+
| 256-bit MASTER AES KEY |
| (Locked in Physical RAM) |
+---------------+---------------+
|
+------------------------+------------------------+
| |
v v
+-------------------------+ +-------------------------+
| RECORD FIELD CIPHER | | CONTAINER INTEGRITY |
| 96-bit Unique Nonce/IV | | 128-bit GHASH Auth Tag |
| AAD: `${id}:${field}` | | Header AAD Verification |
+------------+------------+ +------------+------------+
| |
+------------------------+------------------------+
|
v
+-------------------------------+
| CRYPTOGRAPHIC ENVELOPE |
| AES-256-GCM AEAD (v2) |
+-------------------------------+
Every individual field within a vault item is independently encrypted using AES-256-GCM (Galois/Counter Mode):
- Key Size: 256 bits (32 octets).
- Initialization Vector (IV / Nonce): 96 bits (12 octets) sourced via OS-level CSPRNG (
crypto.getRandomValuesin WebCrypto /rand::rngs::OsRngin Rust). - Authentication Tag: 128 bits (16 octets) GHASH tag enforcing tamper-evidence.
- Additional Authenticated Data (AAD - Envelope v2): Every encrypted field is cryptographically bound to
${item.id}:${fieldName}as AAD. This ensures that any attempt to swap ciphertext blocks across fields (e.g., placing thepasswordciphertext into thenamefield to force plaintext display) causes authentication failure during decryption.
| Parameter | Frontend Engine (WebCrypto) | Native Backend (Rust Citadel) |
|---|---|---|
| Algorithm | PBKDF2-HMAC-SHA256 |
Argon2id (v0x13) |
| Iterations / Passes ( |
600,000 rounds (OWASP 2025) |
3 iterations |
| Memory Cost ( |
Standard digest working memory |
64 MB ( |
| Parallelism ( |
1 lane |
4 parallel threads |
| Salt Entropy |
128 bits (16 bytes CSPRNG) |
128 bits (16 bytes CSPRNG) |
| Derived Key Length |
256 bits (32 bytes) |
256 bits (32 bytes) |
| Resistance Profile | High GPU/ASIC resistance | Maximum ASIC/FPGA/GPU memory hardness |
PassVault features a dedicated Panic Reset Passphrase:
- Cryptographic Hashing: Salted with a 16-byte CSPRNG salt and stretched via 600,000 rounds of
PBKDF2-HMAC-SHA256. - Timing-Safe Evaluation: Verified via
constantTimeEqualin JavaScript andconstant_time_eqin Rust to eliminate side-channel timing attacks. - Execution: Entering the panic code at the unlock screen permanently zeroes and purges all local vault databases (
.pvdband.pv), destroys WebAuthn/DPAPI credentials, and flushes memory before transitioning to an unrecoverable reset state.
To eliminate Base64 encoding bloat (+33% size penalty) and JSON serialization overhead, PassVault stores data in a Pure Binary Container (.pvdb v1.0):
================================================================================
PASSVAULT BINARY VAULT FILE FORMAT SPECIFICATION (.pvdb v1.0)
================================================================================
Offset Size (Bytes) Field Description
--------------------------------------------------------------------------------
0x00 4 Magic Signature b"PVDB" (0x50, 0x56, 0x44, 0x42)
0x04 1 Version 0x01 (Format Version 1)
0x05 1 Cipher Suite 0x01 (PBKDF2) / 0x02 (Argon2id)
0x06 2 Flags / Features 0x0001 (PVDB_FLAG_HEADER_AAD)
0x08 16 KDF Master Salt 128-bit CSPRNG Salt (Raw Bytes)
0x18 12 Vault Nonce / IV 96-bit AES-GCM IV (Raw Bytes)
0x24 4 Payload Length (N) Big-Endian uint32 length (Ciphertext + Tag)
0x28 N - 16 AES-GCM Ciphertext Encrypted Binary Payload (Raw Bytes)
0x28+N-16 16 GHASH Auth Tag 128-bit Integrity Tag (Raw Bytes)
================================================================================
Total Header Size: 40 Bytes (0x00 to 0x27).
Flags: 0x0001 binds the entire 40-byte binary header as AES-GCM AAD.
- Zero Base64 Inflation: Raw byte streams are persisted directly, saving 25-33% disk space.
- Header AAD Binding: The 40-byte header is authenticated via AES-GCM AAD; tampering with magic bytes, cipher suite, or salt corrupts the tag and prevents decryption.
- Atomic Disk I/O: Written to a temporary buffer file (
vault.pvdb.tmp.[RANDOM_U64]), synchronized to physical media viaFile::sync_all(), and atomically swapped viastd::fs::rename. - Full-Length Zero-Fill Purge: Deletion overwrites the entire physical length of the file with
0x00in 64 KiB blocks, followed bysync_all(), before unlinking the directory entry.
Standard heap memory allocations (Vec<u8>) share 4 KiB virtual memory pages. Calling VirtualUnlock on a dropped heap buffer inadvertently unlocks the entire shared OS page. PassVault implements Isolated Page-Granularity Buffers:
- Direct Page Allocation: Allocates dedicated, page-aligned virtual pages via
VirtualAlloc(MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE)on Windows. - Physical RAM Pinning: Pins the page in physical RAM via
VirtualLock, preventing Windows from writing secrets topagefile.sysor swap. - Deterministic Scrubbing: Upon
Drop, performs volatile memory zeroing across the entire virtual page, issues a sequential compiler barrier (compiler_fence(Ordering::SeqCst)), and releases the lock prior toVirtualFree(MEM_RELEASE).
To defeat screenshot scrapers, BitBlt screen loggers, DXGI Desktop Duplication capture, OBS, and Discord stream spying:
- Invokes Win32
SetWindowDisplayAffinity(raw_hwnd, WDA_EXCLUDEFROMCAPTURE = 0x11). - Windows Desktop Window Manager (DWM) renders the PassVault window as pure opaque black in all capture contexts while remaining fully visible to the user.
Copying sensitive credentials to the system clipboard exposes them to clipboard monitors and cloud synchronizers. PassVault enforces:
- Clipboard Privacy Flags: Registers and sets Win32 clipboard metadata:
ExcludeClipboardContentFromMonitorProcessingCanIncludeInClipboardHistory = 0(BlocksWin + Vclipboard history logging)CanUploadToCloudClipboard = 0(Blocks Microsoft Account cloud sync)
- OS-Level Auto-Purge: A dedicated background thread executes retry-hardened
OpenClipboard()andEmptyClipboard()after a user-configured timeout (10s, 15s, 30s, 60s, 120s). - Volatile Memory Cleanup: UTF-16 payload buffers allocated via
GlobalAlloc(GMEM_MOVEABLE)are wiped with volatile writes before freeing.
- FIDO2 / Windows Hello Integration: Registers user credentials via
navigator.credentials.createand verifies authentications with 32-byte CSPRNG challenges andauthenticatorDatauser presence (UP) and user verification (UV) bit audits. - Dual-Tier Hardware Envelope: On desktop, master keys are wrapped in an IndexedDB hardware enclave (
pv_hw_keystore_v1) bound via AAD torawCredId, and additionally encrypted via Windows DPAPI (CryptProtectData) tied to current Windows logon credentials and TPM 2.0 state.
- Dynamic Scrambled Layout: On-screen keypad with PIN, Alphabet, Symbols, and Full Scrambled modes.
- Unbiased Shuffling: Key order is shuffled after every click using an unbiased rejection-sampled CSPRNG Fisher-Yates algorithm (
secureShuffle), defeating mouse-coordinate click loggers. - Zero Hardware Keystrokes: Eliminates physical keyboard events, bypassing user-mode keyboard hooks (
WH_KEYBOARD_LL,GetAsyncKeyState) and kernel filter drivers.
All native operations execute through type-safe, validated Tauri IPC handlers:
| Command Identifier | Arguments | Return Type | Security & Architectural Function |
|---|---|---|---|
encrypt_payload |
payload: String, password: String |
Result<String, String> |
Encrypts UTF-8 payload with Argon2id + AES-256-GCM; scrubs IPC memory |
decrypt_payload |
packed: String, password: String |
Result<String, String> |
Validates nonce/tag bounds; decrypts and verifies GHASH tag |
hash_password |
password: String |
Result<String, String> |
Computes salted PHC Argon2id verifier string |
verify_password_hash |
password: String, stored_hash: String |
Result<bool, String> |
Constant-time Argon2id password verification |
derive_master_key_argon2id |
password: String, salt_b64: String |
Result<Vec<u8>, String> |
Derives 256-bit key into physical RAM-pinned SecureBuffer |
save_vault_db |
filename: Option<String>, content: String |
Result<String, String> |
Sanitizes path; atomic write + fsync of JSON vault |
save_binary_vault_db |
filename: Option<String>, data: Vec<u8> |
Result<String, String> |
Sanitizes path; atomic write + fsync of .pvdb binary vault |
load_vault_db |
filename: Option<String> |
Result<String, String> |
Confined boundary check; reads JSON vault from disk |
load_binary_vault_db |
filename: Option<String> |
Result<Vec<u8>, String> |
Confined boundary check; reads binary .pvdb from disk |
purge_vault_db |
filename: Option<String> |
Result<(), String> |
Overwrites full file size with zeros + fsync + unlinks |
protect_master_salt |
salt_b64: String |
Result<String, String> |
Encrypts master salt via Windows DPAPI (CryptProtectData) |
unprotect_master_salt |
protected_b64: String |
Result<String, String> |
Decrypts DPAPI blob; volatile-zeros Win32 buffer before LocalFree |
audit_environment_security |
None | Result<SecurityAuditReport, String> |
Telemetry check: IsDebuggerPresent, DPAPI support, DWM shield status |
copy_clipboard_secure |
text: String, delay_seconds: u64 |
Result<(), String> |
Sets clipboard privacy flags, copies secret, and schedules auto-wipe |
scrub_clipboard_native |
delay_seconds: u64 |
Result<(), String> |
Spawns worker thread to wipe system clipboard via Win32 API |
set_window_capture_protection |
window: Window, enabled: bool |
Result<bool, String> |
Toggles Win32 DWM WDA_EXCLUDEFROMCAPTURE on native window HWND |
PassVault/
├── .gitignore # Hardened filter for Rust targets, .pv, .pvdb, keys, temp files
├── index.html # Offline HTML5 viewport with strict Content-Security-Policy
├── index.css # Local styling, custom cyber scrollbars, 3D flip utilities
├── package.json # Frontend dependencies (React 19, Tailwind, Vite, Tauri API 1.6)
├── tsconfig.json # Strict TypeScript compiler flags
├── vite.config.ts # Localhost:1420 strict-port bundler configuration
├── types.ts # Master TypeScript interfaces, enums & vault data contracts
├── App.tsx # Master state orchestrator (Persistence, Migration, Modals)
├── hooks/
│ ├── useToast.ts # Floating notification queue (monotonic/crypto UUID IDs)
│ └── useAutoLock.ts # Inactivity timer with visibilitychange listeners
├── utils/
│ ├── csprng.ts # Rejection-sampled unbiased RNG, secureShuffle, constantTimeEqual
│ ├── securityAnalyzer.ts # Entropy evaluation & vault hygiene (CVV/Notes excluded)
│ ├── binaryVault.ts # Pure Binary .pvdb v1.0 Packer/Unpacker with Header AAD
│ ├── constants.ts # Glass presets, service categories, default security configs
│ └── formatters.ts # Safe URL hostname, card masking & date formatters
├── services/
│ ├── tauriBridge.ts # 16-method Type-Safe native IPC bridge (isTauriRuntime detection)
│ ├── cryptoService.ts # Envelope v2 (Field AAD), native Argon2id, 600k-round PBKDF2
│ └── biometricService.ts # Windows Hello / WebAuthn FIDO2 hardware bridge
├── components/
│ ├── auth/
│ │ ├── SetupScreen.tsx # Master key creation, virtual pad & panic code setup
│ │ └── UnlockScreen.tsx # Authentication, biometric trigger & anti-debug status
│ ├── common/
│ │ ├── ActionDialogModal.tsx # Glassmorphic modal replacing insecure window.prompt/confirm
│ │ ├── Modal.tsx # Reusable dialog viewport wrapper
│ │ ├── ToastContainer.tsx # Cyber notification dispatcher
│ │ ├── ResetConfirmModal.tsx # Database wipe confirmation dialog
│ │ └── VirtualKeypad.tsx # Scrambled anti-keylogger virtual keyboard
│ ├── vault/
│ │ ├── VaultCard.tsx # 3D Flip credential card with glassmorphic styling
│ │ └── RecordModal.tsx # Add/Edit record modal with input validation
│ ├── dashboard/
│ │ └── DashboardView.tsx # Category overview, folder grid, search & filter radar
│ ├── settings/
│ │ └── SettingsView.tsx # Transparency matrix, screen shield toggle & backup manager
│ ├── layout/
│ │ └── Sidebar.tsx # Navigation rail & profile indicator
│ ├── PasswordGenerator.tsx # Key Forge cryptographic password generator
│ ├── SecurityAssistant.tsx # Offline Sentinel assistant with live telemetry audit
│ ├── StrengthMeter.tsx # Real-time NIST entropy gauge
│ └── VaultHealth.tsx # Vault security audit dashboard
└── src-tauri/
├── Cargo.toml # Rust dependencies (aes-gcm, argon2, zeroize, windows-sys)
├── tauri.conf.json # Hardened allowlist, strict CSP, withGlobalTauri
└── src/
├── crypto/
│ ├── zeroize_mem.rs # VirtualAlloc/VirtualLock page-isolated RAM buffer
│ ├── kdf.rs # Multi-lane Argon2id (64MiB) & constant-time eq
│ └── mod.rs # AES-256-GCM AEAD, bounds validation, salted verifiers
├── storage/
│ ├── atomic_fs.rs # CWE-22 sanitized atomic file I/O & full-length zero purge
│ ├── dpapi.rs # Windows CryptProtectData & CryptUnprotectData wrappers
│ └── mod.rs # Storage module exports
├── security/
│ ├── anti_debug.rs # IsDebuggerPresent & CheckRemoteDebuggerPresent hooks
│ ├── clipboard.rs # Win32 secure clipboard flags & auto-wipe thread
│ ├── window_shield.rs # Win32 SetWindowDisplayAffinity(WDA_EXCLUDEFROMCAPTURE)
│ └── mod.rs # Security module exports
├── commands.rs # 16 registered Tauri IPC command handlers
├── lib.rs # Library entrypoint & window setup initialization
└── main.rs # Native runtime entrypoint
| Technique ID | Threat Vector | PassVault Defensive Implementation |
|---|---|---|
| T1056 | Keylogging / Input Capture | Scrambled Virtual Matrix (no keystrokes) + Windows Hello WebAuthn biometrics |
| T1113 | Screen Capture / Spying | Win32 SetWindowDisplayAffinity (WDA_EXCLUDEFROMCAPTURE) renders window black |
| T1003 | OS Credential Dumping | VirtualAlloc + VirtualLock physical RAM pinning prevents swap file exposure |
| T1115 | Clipboard Data Collection | Dedicated Win32 OS thread executes EmptyClipboard + history/cloud exclusion flags |
| T1057 | Process Discovery & Debugging | Active interrogation via IsDebuggerPresent, CheckRemoteDebuggerPresent, TracerPid |
| T1555 | Credentials from Password Stores | Pure binary .pvdb field-level AES-256-GCM AEAD with unique 96-bit IVs and AAD binding |
| T1110 | Brute Force Attacks | 600,000-round PBKDF2 / Argon2id KDF + progressive exponential lockout timers |
| T1485 | Data Destruction & Tampering | GHASH 128-bit authentication tag verification aborts on 1-bit tampering |
| T1083 | File & Directory Discovery | Sanitized filenames reject path traversal (..), slashes, and reserved DOS device names |
- Node.js: v18.0.0 or higher (v22.x recommended)
- Rust: v1.70.0 or higher with
cargoandrustc - Windows Build Tools: Visual Studio C++ Build Tools (MSVC) for native Tauri compilation
# Install frontend dependencies
npm install
# Start local development server (127.0.0.1:1420)
npm run dev
# Launch Tauri native desktop application in development mode
npm run tauri dev# Execute TypeScript compiler check
npm run typecheck
# Run Rust unit test suite
cd src-tauri
cargo test
cd ..
# Run npm dependency vulnerability audit
npm audit# Compile and optimize frontend distribution bundle
npm run build
# Check Rust release profile
cd src-tauri
cargo check --release
cargo build --release
cd ..
# Package standalone native Windows application (.exe / .msi)
npm run tauri build| Verification Vector | Command / Scope | Status | Result / Metrics |
|---|---|---|---|
| TypeScript Typecheck | tsc --noEmit |
PASSED | 0 errors |
| Vite Production Bundler | npm run build |
PASSED | 1,714 modules transformed; clean dist/ |
| npm Dependency Security | npm audit |
PASSED | 0 vulnerabilities |
| Rust Compiler Baseline | cargo check & cargo check --release |
PASSED | 0 errors, 0 warnings |
| Path Traversal Defense | storage::atomic_fs::tests::blocks_path_traversal |
PASSED | Traversal and DOS device names rejected |
| Memory Isolation & Zeroize | crypto::zeroize_mem::tests::isolated_pages |
PASSED | Cache-line aligned; volatile wipe on drop |
| Nonce Bounds & DoS Guard | crypto::tests::malformed_nonce_returns_err |
PASSED | Truncated nonce handled gracefully (no panic) |
| Windows DPAPI Envelope | storage::dpapi::tests::dpapi_roundtrip |
PASSED | Hardware wrap/unwrap with volatile wipe verified |
| KDF & Cryptographic AEAD | crypto::tests::encrypt_decrypt_roundtrip |
PASSED | Full roundtrip verified; tampering detected |
Developed with Sovereign Technical Rigor by ByGhost
Air-Gapped Cryptographic Security & Kernel Engineering
Official Web: https://byghost.tr | Source: github.com/ByGh00st/PassVault