I have an application that requires certain data columns to be obfuscated or encrypted for security reasons. Not all rows need these columns encrypted, only a certain number.
The data cannot be read by anyone with access to the database but obviously needs to be show in the application. Even then it can only be shown to certain people. All users authenticate via LDAP.
My approach is the following:
Data going in:
- Is the data from a data source that requires encryption?
- Then encrypt all relevant columns with a secure key and enter into the database
Data coming out within the application:
- Is the user authenticated?
- Does that user have the relevant security flag enabled?
- When showing each data row, check to see if that data row has encrypted data
- If it has then decrypt it with a secure key and display on screen.
This approach raises issues about where and how the key is stored and who has access to it.
Even developers or DBAs will not have access to that data unless they are authorised to do so.
I do not want to impact the performance of the application too much, especially if it has to display a couple of hundred records at a time.
The application is in C# with a SQL Server 2012 backend.
What is the best approach to implement this scenario?