[code=php]<?php
$key = 'putkey';
$iv = put'iv';
$pass = 'putpass';
echo encrypt_db_password($pass, $key, $iv);
function encrypt_db_password($db_pass, $key, $iv) {
if (extension_loaded('mcrypt')) {
$td = mcrypt_module_open(MCRYPT_BLOWFISH, '', 'cbc', '');
$block_size = mcrypt_enc_get_block_size($td);
$strlen = strlen($db_pass);
$pads = $block_size-$strlen % $block_size;
$db_pass .= str_repeat(' ', $pads);
mcrypt_generic_init($td, $key, $iv);
$encrypted = mcrypt_generic($td, $db_pass);
mcrypt_generic_deinit($td);
mcrypt_module_close($td);
$text = base64_encode("$encrypted");
return trim($text);
} else {
throw new Exception(
"ERROR: PHP extension 'mcrypt' not loaded!
);
}
}[/php]
if you need to encrypt them. But now we use plain text passwords, so if you did not drop database to used an old dump to recreate, use plain text.