Cache: Encrypted Local Message Cache
AES-256-GCM encrypted IndexedDB cache with PBKDF2 key derivation, LRU eviction, and TTL expiry. Every byte at rest is encrypted. Corrupted entries self-heal on read.
The Problem
Local caches store sensitive data in plaintext IndexedDB. Browser data is accessible to extensions, XSS attacks, and anyone with local access to the device.
IndexedDB is the standard client-side storage for web and desktop applications. But it stores data as plain JSON objects with no encryption layer. Any browser extension with storage permissions can read the entire database. A single XSS vulnerability exposes every cached message.
Existing solutions either skip local caching entirely (sacrificing offline access and performance) or store plaintext and hope the OS protects it. Neither approach is acceptable for sensitive communications.
The Old Way
The PRIVATE.ME Solution
Every cache entry is encrypted with AES-256-GCM before it touches IndexedDB. Keys are derived via PBKDF2 with 600,000 iterations from the user's primary email. No plaintext is ever stored at rest.
The cache operates as a transparent encryption layer. Application code calls createCache and getCached with the same API as a plain key-value store. Encryption and decryption happen automatically. Corrupted entries are detected via GCM authentication tags and auto-deleted on read.
LRU eviction keeps memory bounded. TTL expiry ensures stale entries are purged. The cache is fully resumable across app restarts with no re-initialization penalty.
The New Way
How It Works
A three-layer architecture: key derivation, transparent encrypt/decrypt, and self-healing storage with automatic eviction.
Key derivation: PBKDF2 with 600,000 iterations from primary email.
Self-healing: Corrupted entries detected via GCM auth tag and auto-deleted.
Bounded storage: LRU eviction + TTL expiry prevent unbounded growth.
Use Cases
Cache messages locally so users can read and compose offline. All cached data encrypted at rest with AES-256-GCM.
AES-256-GCMRetain conversation history on-device without exposing content to local access attacks or browser extensions.
PBKDF2Store session data, tokens, and preferences in encrypted IndexedDB with automatic TTL expiry and LRU eviction.
TTL + LRUProtect sensitive client-side data from XSS, malicious extensions, and physical device access with transparent encryption.
Self-HealingIntegration
import { createCache, getCached } from '@private.me/cache'; // Initialize encrypted cache from user's primary email const cache = await createCache('user@example.com', { maxEntries: 5000, ttlMs: 86400000, // 24 hours evictionPolicy: 'lru' }); // Store — automatically encrypted with AES-256-GCM await cache.set('msg:abc123', messageData); // Retrieve — decrypted transparently, corrupt entries auto-deleted const message = await getCached(cache, 'msg:abc123');
Security Properties
| Property | Mechanism | Guarantee |
|---|---|---|
| Encryption at rest | AES-256-GCM | 256-bit symmetric |
| Key derivation | PBKDF2 (600K iterations) | Brute-force resistant |
| Integrity check | GCM authentication tag | Tamper detection |
| Self-healing | Auto-delete on GCM failure | No corrupt reads |
| Bounded storage | LRU eviction + TTL | Memory bounded |
Ship Proofs, Not Source
Cache generates cryptographic proofs of correct execution without exposing proprietary algorithms. Verify integrity using zero-knowledge proofs — no source code required.
- Tier 1 HMAC (~0.7KB)
- Tier 2 Commit-Reveal (~0.5KB)
- Tier 3 IT-MAC (~0.3KB)
- Tier 4 KKW ZK (~0.4KB)
Use Cases
Deployment Options
SaaS Recommended
Fully managed infrastructure. Call our REST API, we handle scaling, updates, and operations.
- Zero infrastructure setup
- Automatic updates
- 99.9% uptime SLA
- Enterprise SLA available
SDK Integration
Embed directly in your application. Runs in your codebase with full programmatic control.
npm install @private.me/cache- TypeScript/JavaScript SDK
- Full source access
- Enterprise support available
On-Premise Upon Request
Enterprise CLI for compliance, air-gap, or data residency requirements.
- Complete data sovereignty
- Air-gap capable deployment
- Custom SLA + dedicated support
- Professional services included
Enterprise On-Premise Deployment
While Cache is primarily delivered as SaaS or SDK, we build dedicated on-premise infrastructure for customers with:
- Regulatory mandates — HIPAA, SOX, FedRAMP, CMMC requiring self-hosted processing
- Air-gapped environments — SCIF, classified networks, offline operations
- Data residency requirements — EU GDPR, China data laws, government mandates
- Custom integration needs — Embed in proprietary platforms, specialized workflows
Includes: Enterprise CLI, Docker/Kubernetes orchestration, RBAC, audit logging, and dedicated support.