← CodePrimer
PHP Intermediate Auth

Hash passwords with password_hash

How should I store passwords?

password_hash / password_verify.

Sample
<?php
$hash = password_hash($plain, PASSWORD_DEFAULT);
if (password_verify($plain, $hash)) {
  echo 'Match';
}

Notes

Never store plain-text passwords.

Keywords: password · hash · bcrypt · auth · login

Related

Need more coins?

You do not have enough coins for this action.

Your balance: 0 coins

Share