A client wants certain data encrypted before being written to the database. That part is pretty straightforward.
My questions is this: Where should I store (hide) the encryption key for best security? I assume I do not want to record this key value in the database, but we will need to record it somewhere so that we can retrieve it to be able to decrypt data when needed. (One-way encryption won't work in this particular case.)
Has anyone come up with a clever scheme for handling this?
* Hide the key in a non-descript file on the server (non-database file) and use a server-side script to retrieve it?
* Retrieve it from a web page via https into a web viewer when needed?
* Encrypt the encryption key using a more readily available key (such as the result of some calculation that is tucked away in an obscure script)? (Only really achieving some obfuscation with this approach.)