Security Architecture
ShelfLyf uses envelope encryption with per-organisation keys to ensure that your pricing, inventory, deal terms, and PII are cryptographically isolated — even from us.
How it works
Your Browser ShelfLyf API Database
─────────── ──────────── ────────
price: 450 ──── HTTPS ────► Authenticate (Firebase JWT)
terms: Net 30 │
gstin: 29AAB... ▼
Load org's encryption key
(from cache or KMS unwrap)
│
▼
AES-256-GCM encrypt each field:
price → "Bx9k2mP..."
terms → "Qw7nR4j..."
gstin → "Hy3xL9v..."
│
▼ ┌────────────────────┐
Prisma write ─────────────────► │ price: "Bx9k2mP…" │
│ terms: "Qw7nR4j…" │
│ gstin: "Hy3xL9v…" │
On read: │ (ciphertext only) │
decrypt each field └────────────────────┘
│ │
price: 450 ◄─── HTTPS ──── Return decrypted │
terms: Net 30 │
gstin: 29AAB... │
│
DB admin sees ─────────────────────────────────────────────────►│ "Bx9k2mP..."
(gibberish) │ Cannot decrypt
│ without org's key
Each organisation gets a unique 256-bit Data Encryption Key (DEK) generated on signup. Org A's key cannot decrypt Org B's data. Keys are never shared.
The same algorithm used by governments and financial institutions. Each field gets a unique random initialisation vector — encrypting the same value twice produces different ciphertext.
Your org's DEK is itself encrypted by a Key Encryption Key (KEK) stored in Google's hardware security modules. The KEK never leaves Google's tamper-resistant hardware.
Keys are decrypted in-memory only during your request, then discarded. Database dumps, backups, and logs contain only ciphertext. ShelfLyf staff cannot read your data.
What's encrypted
We classify every data field by sensitivity. Anything containing pricing, deal terms, financial data, or personally identifiable information is encrypted at the field level.
Defence in depth
Infrastructure
Cloud Run
Stateless compute with automatic scaling. No persistent server state.
Cloud KMS
Hardware security modules for key encryption. FIPS 140-2 Level 3 validated.
Neon PostgreSQL
Serverless Postgres with connection pooling and automatic backups.
Firebase Auth
Managed authentication with server-side token verification.
Redis (Upstash)
Rate limiting and session caching. No sensitive data stored.
Cloud Build
Automated CI/CD with Workload Identity Federation — no static credentials.