Roundcube
to decrypt the password stored in Roundcube DB
<?php
function rcube_decrypt($cipher, $key) {
$cipher = base64_decode($cipher);
$iv = substr($cipher, 0, 8);
$ciphertext = substr($cipher, 8);
$plaintext = openssl_decrypt($ciphertext, 'DES-EDE3-CBC', $key, OPENSSL_RAW_DATA, $iv);
return $plaintext;
}
$encrypted = "L7Rv00A8TuwJAr67kITxxcSgnIk25Am/";
#key can be found in config.inc.php as $config['des_key'] = '...';
$key = "rcmail-!24ByteDESkey*Str";
$decrypted = rcube_decrypt($encrypted, $key);
echo "Decrypted password: " . $decrypted . "\n";
Last updated