0

Recently moved my wordpress site to another hosting provider and after importing my database I had issues establishing a database connection. I edited wp-config file and entered my DB_PASSWORD to re-establish a database connection. This fixed my connections problems, but now I would I have a password that I would like to encyrpt. How can I go about doing this.

WP-CONFIG.PHP

/** MySQL database password */
define('DB_PASSWORD', 'my_none_encrypted_password');
Eggs
  • 111
  • 1
  • 7

1 Answers1

1

Encrypting the DB-Password in the wp-config.php is of no use, neither in your use-case nor in any other.

What is encrypted, has to be decryptable by the system in order to access the database, which means if an attacker is able to get your wp-config.php, he can get everything he needs to decrypt the encrypted password.

For your use case (preventing wp-config to be downloadable if the php-handler is not set), you can put your wp-config.php in a folder that is not accessible by web. Further information can be found here.

HU is Sebastian
  • 2,893
  • 1
  • 13
  • 14