Decode A Sha1 EncryptionJan 7, 2007
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: PHP Code:
$sql = "SELECT email, password, first
WHERE `email` = '" . addslashes(htmlspecialchars($AdminID)) . "'
`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?