hathor-cpp-scanner/tests/php_hash_test.php

22 lines
800 B
PHP
Raw Normal View History

2016-06-13 08:27:43 -07:00
<?php
$cplus_hash = '$5$12$Qnn1UbvWbbXj1vrswrIkyeP9pf6WRygWWFo9gsVUY01';
$php_hash = '$2y$12$0RRmz/ZOosa9eC9NyrX.0eIH27JYwHJ4.0cNpnuLRFn5SRq.G8BOC';
printf("\nC++ Hash : %s : %s (true)\n", $cplus_hash, var_export(password_verify('password', $cplus_hash), true));
printf("PHP Hash : %s : %s (true)\n", $php_hash, var_export(password_verify('password', $php_hash), true));
print "\nChanging one letter of each hash\n\n";
$cplus_hash = '$5$12$Qnn1UbvWbbXj1vrswrIkyeP9pf6WRygWWFo9gsVUY02';
$php_hash = '$2y$12$0RRmz/ZOosa9eC9NyrX.0eIH27JYwHJ4.0cNpnuLRFn5SRq.G8BOc';
printf("C++ Hash : %s : %s (false)\n", $cplus_hash, var_export(password_verify('password', $cplus_hash), true));
printf("PHP Hash : %s : %s (false)\n\n", $php_hash, var_export(password_verify('password', $php_hash), true));
?>