Decrypt Plesk 11+ Passwords
We had a need to decrypt plesk passwords to interface with another system so after a bit of hacking about the following code is what we arrived at. <?php $key = file_get_contents(“/etc/psa/private/secret_key”); $hash = explode(‘$’, ‘$AES-128-CBC$some-example-string==$some-example-salt==’); $iv = base64_decode($hash[2]); $ct = base64_decode($hash[3]); $dec = str_replace(“\0”, “”, mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, $ct , MCRYPT_MODE_CBC, $iv)); echo($dec); ?> All