Is there a way to encrypt the following user fields in the database so that they cannot be retrieved from a compromised database?
- Username
- Email address
A solution to encrypt the whole database would also be great.
If you want encrypt it, it means you need to decrypt it. So it means that the algorithm that encrypt and decrypt are available somewhere in your application or drupal files.
I guess if the user that has access to your database he has also access to your files, or at least I guess he can have access easily.
And in that case, encrypted datas are useless.
The most important its to hash the password with algorithms like SHA1 and use a salt or private key, thing that Drupal 7 is doing.
This is just my point of view, but if you want do it what you can use this module http://drupal.org/project/aes and with some user hooks, such as hook_user_presave() and hook_user_load().
The trick in this case it's that your module should be the last one before saving save the data and be the first one that decrypt data.
core.extention.yml
config file ?
Commented
Mar 23, 2021 at 14:56
Database encryption will help you to encrypt the email: drupal.org/project/dbee.
Looking into this same module you could try to encrypt also the user name.
core.extention.yml
config file ?
Commented
Mar 23, 2021 at 14:57
The easiest (but not cheapest) way to encrypt the whole DB would be to use an Oracle DB (with this module) with Transparent Database Encryption.