I'm working on an ASP.NET web application that will have to store sensitive information. I would like to encrypt the sensitive fields to protect against any possible SQL injection vulnerabilities. However, I also will need to report on these fields. For these reasons, I've excluded transparent database encryption (since it wouldn't provide protection against SQL injection) and application layer encryption (since it would make it hard to report against the data) and I'm left with database level encryption.
My plan is to use SQL Server's
EncryptByPassphrase function, with an SSL connection to the database to protect the passphrase over the wire. The key would be stored in the
web.config, protected by the Windows Data Protection API at the machine level.
Is this a good plan? What are the potential vulnerabilities?