I am using sha1 encryption for encrypting my password, but I am facing problem with that. For some users, login is not working.
my code,(in sign up)
// all validation is done here
$password = sha1($_POST['password']);
// inserting data is here
in login my query is
$email = $_POST['email'];
$password = sha1($_POST['password']);
select * from users where email = $email and password = $password and status = 1 and deleted = 0;
one of the user facing problem with password,
im$$man
Am I doing some thing wrong.
please help me.
I am using sha1 encryption for encrypting my password,
Nope. SHA1 isn't encryption, it's a hash function. Understanding the difference between encrypting and hashing is crucial to implementing this safely:
password_hash() and password_verify()Also, the way you wrote your query leads me to believe it is vulnerable to SQL injection.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With