I have an application that encodes data when writing it to a database, and unencodes it when reading from the database. The encoding is done with a symmetric algorithm using a fixed secret key.
I'm imagining a situation where an attacker has gained access to the machine running the application, and assume for simplicity that the database is also running locally on that machine.
The question is how well I can protect the secret key, so that if the user downloads the database they can't do anything with it. One idea is to enter the key manually each time I start the application server. In that case, it seems like, to get the key, a hacker would have to dump the core memory of the running server, and then somehow find the key in that memory, which I could further obfuscate with a separate encrypt/decrypt. Assuming the user doesn't have access to the application source code (e.g., a .py file), it means they'd have to dump memory and reverse engineer the source code (e.g., from a .pyc file) to understand how/where the key was encoded in memory.
Is this a good idea? Is there a name for it? Does it get me any farther than other methods that don't require inputting the key at process start time?