0

I'm automating the process of creating WordPress sites with a custom shell script. Is it possible to encrypt MYSQL passwords with BCrypt for WordPress? If so, what's the best way to approach this?

Snippet:

#!/bin/bash

execute="
CREATE DATABASE IF NOT EXISTS $dbName;
GRANT SELECT, INSERT, UPDATE, DELETE
  ON $dbName.*
  TO '$dbUser'@'localhost' IDENTIFIED BY '$dbPass';
FLUSH PRIVILEGES;
"

mysql -uroot -p --show-warnings -e "$execute"

With Ruby, I can encrypt it like so:

encryptedPass="$(ruby -e "require'bcrypt';puts BCrypt::Password.create('$dbPass')")"
Deidora
  • 1
  • 2
  • This may be worth checking out if anyone runs into ths same issue: https://github.com/dxw/wp_bcrypt – Deidora Mar 27 '15 at 20:57

1 Answers1

0

Write your own WordPress plugin to convert the hashes using BCrypt. Also, if you plan to go this route, make sure to audit your code thoroughly. I've included two links that have helped me get started down the path and I'm hoping they might help anyone else who's interested in hardening their setup.

Deidora
  • 1
  • 2