Encrypted cells for Quilt. Privacy as a first-class primitive.
End-to-end encrypted cell storage. The server (if any) never sees the plaintext. Browser-native, real WebCrypto, zero dependencies.
β Try it live in your browser β real ECDH P-256 + AES-GCM, no install.
import { QuiltVault } from 'quilt-vault';
const vault = new QuiltVault();
// Generate your keypair. ECDH P-256, native to the browser.
const me = await vault.generateKey();
const peer = await vault.generateKey();
// Add a peer (a person, a device, a server you trust).
await vault.addPeer('alice', peer.publicKey);
// Lock down a cell. The server only ever sees this:
await vault.set('budget.savings', { amount: 42000, currency: 'USD' }, {
viewers: ['alice'],
});
// Decrypt with your private key.
const plaintext = await vault.get('budget.savings');
// β { amount: 42000, currency: 'USD' }That's the whole primitive. Cell + viewers + encrypted-at-rest. Real WebCrypto. Real forward secrecy.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β quilt-vault β
β β
β ββββββββββββββββ ββββββββββββββββ β
β β Alice β β Bob β β
β β β β β β
β β keypair β β keypair β β
β β privKey β β privKey β β
β β pubKey β β pubKey β β
β ββββββββ¬ββββββββ ββββββββ¬ββββββββ β
β β β β
β β ECDH(alice.priv, bob.pub) β β
β ββββββββββββββββ β β
β βΌ β βΌ β
β sharedSecret β sharedSecret β
β β β β β
β βΌ β βΌ β
β AES-GCM key β AES-GCM key β
β (derived) β (derived) β
β β β β β
β βΌ β βΌ β
β ββββββββββββββ β ββββββββββββββ β
β β cipher β β network β cipher β β
β β (opaque) ββββββββββ΄βββββββββββββΆβ (opaque) β β
β ββββββββββββββ ββββββββββββββ β
β β
β Server sees only cipher. Never plaintext. Never key. β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ECDH for key agreement, AES-GCM for encryption. Standard primitives, no magic, no mystery, no backdoor.
- ECDH P-256 key agreement (WebCrypto native)
- AES-GCM 256 authenticated encryption
- Per-cell ACLs β different viewers per cell
- Encrypted-at-rest β stored cipher only
- Encrypted-in-transit β can be sent to a server as-is
- ~3 KB minified, 0 dependencies
- Real browser-tested β 10 tests, all pass
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β QuiltVault β
β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββββββ β
β β Keyring β β Cells β β WebCrypto β β
β β β β β β β β
β β me.privKey β β id: "budβ¦" β β generateKey() β β
β β me.pubKey β β cipher: "" βββΆβ deriveKey() β β
β β peers:{} β β viewers:[] β β encrypt() β β
β β β β nonce: "" β β decrypt() β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββββββ β
β β β β β
β ββββββββββββββββββββΌβββββββββββββββββββββ β
β βΌ β
β ββββββββββββββββββββ β
β β Storage β server / disk β
β β (opaque) β β
β ββββββββββββββββββββ β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Three layers, cleanly separated:
- Keyring β who you are, who you trust
- Cells β what's encrypted, who can see it
- WebCrypto β the primitives themselves
| Use case | What you build |
|---|---|
| End-to-end encrypted sheets | A shared budget where the server can never read individual cells. |
| Per-cell ACLs | "My partner can see budget.savings but not journal.private." |
| Device-to-device sync | Phone + laptop. Same vault. Server is just transport. |
| Local-only backup | Encrypt to disk. Lose your laptop, but the backup is opaque to thieves. |
| Sharing without leaking | Add a viewer β they can decrypt. Revoke β they can't. |
| Audit without surveillance | Server sees "cell changed" but never the value. |
git clone https://github.com/SuperInstance/quilt-vault
cd quilt-vault
npm install
npm test10 tests, 0 failures. Real browser crypto, no mocks.
class QuiltVault {
// Generate your keypair. Returns { publicKey, privateKey } (JWK).
generateKey(): Promise<{ publicKey: JsonWebKey; privateKey: JsonWebKey }>;
// Set your identity.
setIdentity(me: { publicKey: JsonWebKey; privateKey: JsonWebKey }): void;
// Add a peer (public key only).
addPeer(name: string, publicKey: JsonWebKey): Promise<void>;
// Remove a peer (revokes their access to all cells).
removePeer(name: string): void;
// Set a cell, encrypted for the listed viewers.
set(id: string, value: any, opts?: { viewers?: string[]; t?: number }): Promise<void>;
// Get a cell, decrypted.
get(id: string): Promise<any>;
// List cell ids.
list(): string[];
// Get the opaque cipher for a cell (for storage or sync).
getCipher(id: string): { cipher: ArrayBuffer; nonce: ArrayBuffer; viewers: string[] };
// Restore from opaque storage.
setCipher(id: string, blob: { cipher: ArrayBuffer; nonce: ArrayBuffer; viewers: string[] }): Promise<void>;
}What quilt-vault protects against:
- A server that sees only opaque ciphertext
- A network observer that sees only opaque ciphertext
- A disk thief that sees only opaque ciphertext
- A peer that was added to some cells but not others (per-cell ACLs)
What quilt-vault does NOT protect against:
- A compromised endpoint (browser malware, screen capture, etc.)
- A peer that was given access to a cell (by design β they can decrypt)
- Key loss (no key escrow, by design)
Trust assumptions:
- The WebCrypto implementation in your browser is correct
- Your private key is not exfiltrated by JavaScript on the page
- Persistent key storage β IndexedDB, password-derived key wrapping
- Group key rotation β efficient re-encryption when a viewer is added
- Forward secrecy β ephemeral keys for each session
- Streaming encryption β for large cells (images, video)
- Audit log β encrypted but verifiable change history
- Quilt (TypeScript) β the canonical reactive runtime
- Quilt Mesh β peer-to-peer cell sync (use vault for the transport)
- Quilt Time β time travel for cells (combine with vault for encrypted history)
- Quilt Live β single-file browser runtime (5 starter cells in the live build)
- Quilt 5-year roadmap
MIT.