php - How can I improve this login? -
i have code:
if (strcmp($user->pass, crypt($password, $user->pass)) == 0) { echo 'good'; } else { echo 'kill'; }
in php , know how can improved, since think terrible, right?
thanks!
if comparing hashed password, use hash_equals instead.
if (hash_equals($hashed_password, crypt($user_input, $hashed_password))) { echo "password verified!"; }
for reference:
Comments
Post a Comment