I have cloud webserver running ubuntu where a MySQL database is installed. The database has a table with sensitive data. To protect the data I would like to encrypt the database (or database content). These are the options I thought about:
- Encryption of the ubuntu disk drive (not the database) Problem: The database content is transparent and the data is not encrypted in the MySQL database
- Encrypting of the column content using AES_ENCRYPT Probem: The content needs to be decrypted for search operations and the private key needs to be transfered for a request. If a hacker has access to the webserver he would probably also have access to the key (stored in a PHP/Script file).
- Encryption using a PHP script Problem: The private key needs to be stored on the webserver. A hacker might get access to it.
Is there a secret way to store the private key on a webserver (maybe on the hardware)? Or what is the best way to encrypt the database / content of a database?