/** * Checks entered password matches the hash * @param $password string password that the user supplied * @param $expected string hash from storage (eg. from your database) * @return bool whether or not the password matched or not */ public function checkPassword($password, $expected) { return PasswordUtils::compare(crypt($password, $expected), $expected); }