Skip to content

About

Encrypted cells for Quilt. End-to-end encrypted per-cell access control.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” quilt-vault

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.

License Tests Crypto Try it

β†’ Try it live in your browser β€” real ECDH P-256 + AES-GCM, no install.


⚑ See it in 30 seconds

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.


🎬 How the encryption works

   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚                      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.


🎁 What's in the box

  • 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

πŸ—οΈ Architecture

   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚                      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 cases

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.

πŸ› οΈ Develop

git clone https://github.com/SuperInstance/quilt-vault
cd quilt-vault
npm install
npm test

10 tests, 0 failures. Real browser crypto, no mocks.


πŸ“š API reference

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>;
}

πŸ›‘οΈ Threat model

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

πŸ›£οΈ Roadmap

  1. Persistent key storage β€” IndexedDB, password-derived key wrapping
  2. Group key rotation β€” efficient re-encryption when a viewer is added
  3. Forward secrecy β€” ephemeral keys for each session
  4. Streaming encryption β€” for large cells (images, video)
  5. Audit log β€” encrypted but verifiable change history

πŸ”— Related

License

MIT.

About

Encrypted cells for Quilt. End-to-end encrypted per-cell access control.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages