That's not how you do it. You encrypt the password the user gives you, Then compare it to the encrypted password stored in the database.