I decided to sha1 passwords into the database for the creation of a user account.
When logging into the system, this sql statement works, but I can't figure out how to reverse it, so I'm assuming this is a one-way encryption:
$sql = "SELECT email, password, first
FROM `account`
WHERE `email` = '" . addslashes(htmlspecialchars($AdminID)) . "'
AND
`password` = '" . sha1(addslashes(htmlspecialchars($AdminPswd))) . "';";
I need to have a statement to retrieve the encryption and decode it for password retrieval (when a user lost their password). Is there a way to decode this or should I choose another encryption technique (2-way) other than the basic base64_decode/base64_encode?
Thanks in advance for your help.