I am using this piece of code to encrypt my password:-
public function hashSSHA($password) {
$salt = sha1(rand());
$salt = substr($salt, 0, 10);
$encrypted = base64_encode(sha1($password . $salt, true) . $salt);
$hash = array("salt" => $salt, "encrypted" => $encrypted);
return $hash;
}
Now I realize that, I need reverse process of it. So I tried with this
base64_decode(sha1(str_replace($password, $salt), true) . $salt);
and this
base64_decode(str_replace(sha1(str_replace($password, $salt), true) , $salt));
to get my decrypted password, But none of working.