I am currently working on an ASP.NET MVC 4.5.2 application. The application stores no really valuable data but in my opinion security should never be underestimated, even harmless data can get harmful in the wrong hands. So I decided to encrypt all user related data like chat messages and personal user data. I am using ASP.NET Identity to add users to the application. The user password is automatically hashed by the Identity Framework. But I wanted to go one step further and encrypt these datasets additionally, so that the password hash, e-mail address, username ... is also encrypted in the database. Every text message send by one application user to another should also be encrypted so that only the authorized users can read the content even if the database gets stolen.
After reading lots of articles about how to encrypt these datasets I decided to use something like AES or maybe other encryption algorithms. Encrypt and store data in a database is no big deal. The whole thing gets not really exciting until it comes to store the encryption keys. I've read a huge amout of tutorials and posts on plattforms like StackOverflow which discuss how to properly encrypt sensitive data, but most of the articles are ending without providing solid solutions on how to store encryption keys.
After some research I found some interesting answers from StackOverflow users on this topic:
The Vault is an open source project focusing on storing secrets. I want to provide these links here for other fellows searching for this topic but unfortunately my reputation is not high enough to add all links so I decided to provide only the two most relevant.
Reffering to PaulGs Answer...
[...] My implementation was to have a Key Server application running on a windows box. This application required entry of two separate 'key server master keys' before it could be used. These keys would be known only to the key server administrators. These keys are xor'd together to generate the Master Key, which is stored only in protected memory whilst the application is running. Application can then automatically generate cryptographically strong Key Encrypting Keys, which are stored in encrypted form using the Master Key. [...]
... my question is:
Edit:
How "good" is PaulGs procedure on a security point of view and how can I create "protected memory" as csharp developer? I hope this question is more specific as my last set of questions.