Let's build an end-to-end encrypted data store
bulwark.id
bulwark.id
A few small observations:
1) GCM encryption is limited to 64GB under the same key/IV. Files bigger than that may need splitting up.
2) GCM is broken if you reuse an IV with the same key. So be very careful here.
3) I don't see anything about how synchronisation works. When multiple clients can read or update a central store, clients really need to know which is the latest. We used vector clocks for this to get event ordering. Some care is needed to preserve privacy and integrity and performance when adding in additional metadata.
However modern data stores need to do more than just store values with known keys. The most popular stores support some sort of query system that implies the database itself can make sense of the data. However when the data is encrypted this is no longer possible as the data store cannot make any sense if the stored information.
I’d love to see something that could support queries on encrypted data without comprising privacy. I just don’t know how that would be possible.
Ie show me all records created between two specific dates
Assuming you're talking about client-specified queries (database-specified are impossible by definition of "encrypted"), the keyword you want is "fully homomorphic encryption". AFAIK, there aren't any fully working systems yet, although they're pretty close and should be available Real Soon Now.
The main restriction is that for any given query you have a response of a fixed (and known-to-the-attacker) size, so you can't do open-ended queries like "all records between 2021-01-01 and 2021-12-31". Instead you'd get something like a fixed-size mapreduce/foldMap interface, and queries would look something like "total number of records (modulo UINT_MAX+1) matching predicate x and first N such records according to ordering y", where N, sizeof x, and sizeof y - but not x and y themselves - are known by the database/attacker.
https://m-cacm.acm.org/magazines/2012/9/154574-cryptdb-proce...
Update: It's been a while since I've looked into encrypted databases. They do a reasonable job, but they are limited in various ways. Private Information Retrieval is also interesting.
https://en.m.wikipedia.org/wiki/Private_information_retrieva...
If you would download the entire database for each query that would be private, but also have a linear communication overhead. You could rewrite data to a new location after you read it, which is what ORAM does, and it has at least a logarithmic communication overhead. This is where the buck stops, logarithmic is a theoretical minimum cost even for the weakest computational access pattern privacy guarantees. With differential privacy guarantees a double logarithmic overhead is possible, but it is not clear when such guarantees are useful. Fully homomorphic encryption would only allow to push the overhead from communication to computation.
On the practical side there are symmetric searchable encryption schemes with forward and backward privacy. They are reasonably functional, with reasonable leakage, without any guarantees. They tend to be vulnerable to sophisticated adversaries with knowledge about the queries or the documents. These schemes often have to deal with more than just access pattern privacy, because they not all passive (where the server is only a storage device, the client selects the documents to access). They have to worry about the search tokens presented to the server, which is now running code. Some of these schemes have to deal with a malicious server breaking protocol.
What if you could create an iterable blob storage (prefix searches, range searches, date searches, etc..) and use that as the backbone for a social network/inbox system? It was a work in progress, I never finished it, but would like pick it back up when I have time.
It stores encrypted blobs in any content-addressed store, and provides a copy-on-write key-value store API.
Can someone clarify use cases for these encrypted services? Otherwise, it seems a lot like when RIAA tried to stop users from distributing MP3s. Once the cat is outta the bag, can't really put it back in. Zeroes and ones are trivial to copy.