Postgresql – encrypt data without performance issues

encryptionpostgresqlSecurity

I've googled around for the last 45 minutes or so and it seems like that I can't figure out what kind of options I got when it comes up to encryption in databases.

Problem:

I got a SaaS product and the data is kinda sensitive.
I want to give my customers 100% security on the fact that I can't read their data.

Is this even possible?
What kind of possibilities do I got?

Best Answer

I got a SaaS product and the data is kinda sensitive. I want to give my customers 100% security on the fact that I can't read their data.

If it's software as a service, and you do more than simply store blobs of data then give those blobs back when the customer asks, this is pretty much impossible.

You're dreaming. You can't realistically combine SaaS and the inability to see the customers' data.

(About the only outfit I know that does so is SpiderOak, and it does so by supporting almost no features - it stores stuff, and then it retrieves that stuff. That's it.)

Is this even possible? What kind of possibilities do I got?

Few.

You can't index encrypted data unless you know the key - and the index will contain decrypted values.

You can't write a WHERE clause that filters based on the encrypted values unless you know the key. You could get the client to supply a pre-encrypted key to compare if it's a simple equality test, but you can't do b-tree index scans (requires > and < operators), or much else of interest.

You can't aggregate values unless you know the key.

You really can't do anything useful with them unless you know the key.

In theory you can use homomorphic encryption to allow computations on encrypted values. In practice it's incredibly limited, slow, and impractical, as well as weaker than other crypto. In practice most real-world homomorphic systems are useful for sums and that's about it.