First you need to know the type of Hashes you are using.
Because there are One-Way and Two-Way Hashes, if it’s one-way, you can’t decrypt the password:
Single Hand: In this case your system needs to generate a new temporary password, and send this new password to the client with the link to reset this password.
Double Hand: In this case your system can search by e-mail the user decrypt the password and send to his email, however it is not a good practice.
PHP ONE-HAND ENCRYPTION
MD5
<?php
$string = 'O rato reu a ropa do rei de Roma';
$codificada = md5($string);
echo "Resultado da codificação usando md5: " . $codificada;
// 54cf74d1acdb4037ab956c269b63c8ac
?>
SHA1
<?php
$string = 'O rato reu a ropa do rei de Roma';
$codificada = sha1($string);
echo "Resultado da codificação usando sha1: " . $codificada;
// b186b709f7cf5a1d98d413379a66e511df8d59a4
?>
PHP DUAL-HAND ENCRYPTION
BASE64
<?php
$string = 'O rato reu a ropa do rei de Roma';
$codificada = base64_encode($string);
echo "Resultado da codificação usando base64: " . $codificada;
// TyByYXRvIHJldSBhIHJvcGEgZG8gcmVpIGRlIFJvbWE=
$original = base64_decode($codificada);
echo "Resultado da decodificação usando base64: " . $original;
// O rato reu a ropa do rei de Roma
// Note que $original vai ser idêntica a $string
?>
Here is a Link explaining a little more about the types of encryption in PHP
http://blog.thiagobelem.net/criptografia-no-php-usando-md5-sha1-e-base64/
password reset or password recovery? to reset vc do not need to know your previous password
– Math
@Math I wrote this way because I didn’t know what the best solution was, I was waiting for guidance if it would be better to recover or reset
– Latrova