Skip to content

Instantly share code, notes, and snippets.

@josephscott
Created October 25, 2012 22:44
Show Gist options
  • Save josephscott/3955939 to your computer and use it in GitHub Desktop.
Save josephscott/3955939 to your computer and use it in GitHub Desktop.
<?php
require 'PasswordHash.php';
$hasher = new PasswordHash( 8, FALSE );
$password1 = '012345678901234567890123456789012345678901234567890123456789012345678901';
$password2 = $password1 . 'Z';
echo "PASS1 : {$password1}\n";
$hash1 = $hasher->HashPassword( $password1 );
echo "HASH1 : {$hash1}\n";
echo "PASS2 : {$password2}\n";
$hash2 = $hasher->HashPassword( $password2 );
echo "HASH2 : {$hash2}\n";
echo "** PASS1 works with HASH2 : ";
if ( $hasher->CheckPassword( $password1, $hash2 ) ) {
echo "yes !!!!!!\n";
} else {
echo "no\n";
}
echo "** PASS1 length: " . strlen( $password1 ) . "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment