I have hosting service hosted on more than 20+ Plesk servers, version 11. As in the previous versions, the passwords were not encrypted, then if i had to design some tools to manage the hosting accounts, i just picked up the cleartext passwords from the Database. but as now the passwords are encrypted, is there any way i can decrypt the passwords? through API or any other way so that i can integrate my php based hosting management with plesk 11?
Why not just figure out what hashing algorithm Plesk uses, and replicate that functionality in your PHP application? You don't need the un-ecrypted version of a password to authenticated against it, and you never really want to store a password in the clear, or with a reversible encryption.
The code provided by Giulio isn't helpful, here's a Python script that actually works. Requires PyCrypto (python-crypto). Assumes that Plesk secret key is stored at
/etc/psa/private/secret_key
. Just run it and pass in encrypted passwords as arguments:Script:
Theoretically, if the program can get the encryption password, yes, you can get back the password in plain text.
EDIT: added decryption code.
I needed this written in PHP, so I ported @freebobbytables' version directly over. Works a charm. Tested with PHP 8.0.