Foren

Strategy or best-practice to secure data in database

thumbnail
Prakash Khanchandani, geändert vor 8 Jahren.

Strategy or best-practice to secure data in database

Expert Beiträge: 329 Beitrittsdatum: 10.02.11 Neueste Beiträge
I am developing an application in which users would share private messages with each other. Can be thought of as email exchanges but the messages would be stored in Database.

Is there a way to secure or encrypt or encode data in a way that even Database Administrators also would not be able to read who sent what message.

I would like to know if there are standard best practices or ways to secure database data either throughout the portal or atleast in my custom application.

Please try to answer and provide references as much as possible.

Thank you.
thumbnail
David H Nebinger, geändert vor 8 Jahren.

RE: Strategy or best-practice to secure data in database

Liferay Legend Beiträge: 14916 Beitrittsdatum: 02.09.06 Neueste Beiträge
Some enterprise DBs can encrypt the data in the columns, but it's my understanding the DBAs can see through this, it's more encryption at rest kind of thing.

You'd be forced to encrypt/decrypt on your own. You'll need to override the various methods in your service layer. I'd probably use a model listener for encrypting on the fly, but your decryption will have to be peppered into the getters.

I'd take a page from how Liferay stores the password hashes - use a cleartext prefix which indicates the encryption method (its a cleartext string plus a colon followed by the base64 of the data). This will allow you to alter your encryption method(s) without re-encrypting all existing data, the decrypt code just needs to know how to handle all of the decryption methods. Also allows you test w/o encryption turned on so you can verify business logic w/o the encryption getting in the way.
thumbnail
Prakash Khanchandani, geändert vor 8 Jahren.

RE: Strategy or best-practice to secure data in database

Expert Beiträge: 329 Beitrittsdatum: 10.02.11 Neueste Beiträge
I am working on MySQL.

Wow that's great idea. Thanks a lot.

Let me try.