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

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -