A web application I'm developing needs to store some sensitive data in a database. I need to be able to retrieve and use this data later on so hashing isn't enough.
The web application might, at some point in the future, be load-balanced, so I'm trying to get things done correctly now instead of battling this later.
I've created a two-step process for this using standard technologies:
- The sensitive data is encrypted using AES in the SQL database.
- To make sure the AES key/IV values are as secure as possible, they are encrypted by the IIS web application using DPAPI (user scope) and stored in a file in
This is because I don't think I can make use of the DPAPI alone if load-balancing will be in use - am I correct?
I'm wondering if I'm not overcomplicating things with the second step, but I don't like the idea of keeping the AES key in plain-text in some
web.config file in the IIS application.
Is this approach OK and relatively secure?