Petit test avec password_hash() et password_verify() (PHP 5.5+) ', '', file_get_contents('hash.php')); if (!empty($_POST)) { if(isset($_POST['login']) && isset($_POST['password'])) { if (password_verify($_POST['login'].$_POST['password'], $hash)) { echo '++ valid credentials !! \o/ ++'; } else { echo '--- invalid credentials ---'; } } } } else { if (!empty($_POST)) { if(isset($_POST['login']) && isset($_POST['password'])) { $options = ['cost' => 12]; $hash = password_hash($_POST['login'].$_POST['password'], PASSWORD_DEFAULT, $options); file_put_contents('hash.php', ''.$hash); echo 'hash stored: '.$hash; } } else echo "no hash: a new one will be stored"; } ?>