How to store data in db so that nobody with access to it can understand it?

225 views Asked by At

We are soon releasing a private beta of a domestic economy website.

The website of course gathers information from a user's (identified by email only) private financial situation: salary, rent, bills, mortages, etc. All of these are really sensitive information and should not be accessible by anyone - not even us, the tech ppl.

What are best practises for storing data in a non-readable fashion? Of course, member passwords are already hashed in the db.

What I'm thinking about is to encrypt all data using some kind of key. But then again, the application needs access to that key. And I don't want to store it in the db. If supplied by user, I guess I could keep it in the session in order to decrypt every retreived db result. But what about overhead?

Pls, anyone with guidelines?

3

There are 3 answers

1
gimbar On

What about a second keyphrase secured by the users keyphrase? When he logs in his second will be decrypted and stored.

0
ObscureRobot On

First, separate the personally-identifiable information from the statistics. This allows you to perform computations without putting sensitive data at risk. Next, strongly encrypt the personally-identifiable information, and store the keys in a hardened system with limited access. Don't use the same key for all data, but the number of keys you do use is a design decision that is up to you. More keys will be more secure, but harder to handle.

There may be existing standards that apply to your data, depending on where in the world you are and what industries you are working with. Seek these out and follow them.

0
NotMe On

Anyone with admin level access (your tech people for example) can get access to any decryption keys stored on the machine. Regarding session, any admin level person can do memory dumps to pull keys out of session.

Point is, the only "solution" of sorts is great off machine access logging combined with a strong legal document acknowledging that they are being watched and you will prosecute. Also you should perform annual background checks of your tech people. Next, the number of people with that type of access should be extremely limited. As a CEO who takes an active part in our development process, even I don't have access to our production systems.

Regardless, you should still encrypt the database, especially the PII data. Depending on your industry you could be sued if you don't, and never mind the bad press if someone does pull a data dump.