There is no "key" per se.
As I mentioned, all the logic for Zen Cart passwords is in the password_funcs.php file.
You can look it up in the file just as easily as I can paste it here. Granted, since your questions are still asking the same thing and you don't seem to be looking in the direction I'm sending you, about all I can do further is paste it here ... so ...
To encrypt a password, call this function, passing the plaintext password to it. This is ONLY needed if you're preparing to save TO the database:
Code:
function zen_encrypt_password($plain) {
$password = '';
for ($i=0; $i<10; $i++) {
$password .= zen_rand();
}
$salt = substr(md5($password), 0, 2);
$password = md5($salt . $plain) . ':' . $salt;
return $password;
}
If you're reading FROM the database and want to validate a password, you pass the typed password and the encrypted password from the database to this function:
Code:
function zen_validate_password($plain, $encrypted) {
if (zen_not_null($plain) && zen_not_null($encrypted)) {
// split apart the hash / salt
$stack = explode(':', $encrypted);
if (sizeof($stack) != 2) return false;
if (md5($stack[1] . $plain) == $stack[0]) {
return true;
}
}
return false;
}
THERE IS NO "decrypt" CAPABILITY FOR THESE PASSWORDS.