I've recently been put in charge of a project
where I need to decrypt passwords stored in our database which are encrypted using the crypt() function.
And I'm confused. I was under the assumption that is no way to decrypt the passwords, as crypt uses a one time algorithm.
But, I've been told that there is a way to decrypt the passwords as the person who previously worked on the project was able to do so (who's no loger with us). This would seem true, as the code below seems to produce the same result everytime the same input string is used.
Here is the code used to encrypt the password.
$pass = substr (crypt (substr (crypt ($user_password, "9z"), 2), "9z"), 2);
If I entered in $user_password="testing";
it will result in $pass = 8h0rX7tYMVQ everytime the script is executed.
Can anyone help me work out an algorithm to do decrypt the passwords.
Thanks.