You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

24 lines
437 B

<?php
echo "Enter password hash to verify against: ";
$hash = trim(fgets(STDIN), PHP_EOL);
echo "Enter password: ";
hide_term();
$password = trim(fgets(STDIN), PHP_EOL);
echo PHP_EOL;
restore_term();
$verified = password_verify($password, $hash);
if($verified)
echo "Password verified\n";
else
echo "Password did not match\n";
function hide_term() {
system('stty -echo');
}
function restore_term() {
system('stty echo');
}