We built a platform for the Indian judiciary, which meant storing some of the most sensitive data imaginable: matters of national security, sealed cases, and confidential proceedings. This raised a hard question: how do you store data so that nobody except the user can read it, not even the people who run the servers?
In this talk, we walk through the end-to-end encryption architecture we designed to make that guarantee real. The central design decision was deliberate and uncompromising: encryption keys never live on the server in plaintext. Each user has a public/private keypair, where the private key is encrypted with their password before it ever touches the database. Documents are encrypted client-side with their own Data Encryption Keys (DEKs), and sharing a document never exposes a secret either.
The interesting problems started when we moved beyond flat file lists. Real cases live in folders, so we had to build folder management akin to Google Drive or Dropbox, sharing, moving, and managing collaborators, but without ever breaking the zero-knowledge model. Our answer was a system of Hierarchical DEKs that models the file system as a tree, where sharing a folder transparently grants access to everything beneath it.
We'll also cover the tradeoffs we weighed and what we learned along the way.