From 83a1925b67db28edbf0be10402c3167a168c22bb Mon Sep 17 00:00:00 2001 From: Arctic Code Date: Sat, 26 Jan 2013 15:00:45 -0800 Subject: [PATCH] Very quick and dirty demo that shows off HashPass --- test.php | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 test.php diff --git a/test.php b/test.php new file mode 100644 index 0000000..f514a9a --- /dev/null +++ b/test.php @@ -0,0 +1,37 @@ +\r\n"; +echo "Required: password and number of iterations, example below:
\r\n"; +echo "http://p.unps.us/pass/?pass=[somepassword]&i=[somenumber](optional)&salt=[anything can go here, use previous salt and previous pass to generate same hash - will always generate same hash with same pass and same salt]
\r\n"; +$password = $_GET["pass"]; +if (!isset($password)) die("Please enter a password"); +$i = $_GET["i"]; +if (!isset($i)) die("Please give me some iterations"); +if (!is_numeric($i)) die("You might not be aware of this, but usually iterations are numbers."); +if ($i >= 51) die("Why are you trying to go so high? Your password is way more than secure after even one iteration
There's a limit of 50 iterations."); +if (empty($_GET['salt'])){ + $salt = ''; +}else{ + $salt = $_GET['salt']; +} +echo "Your pass is: ".$password." and your iterations are: ".$i."\r\n
"; +echo "sha1: ".hash("sha1", $password)."\r\n
"; +echo "sha256: ".hash("sha256", $password)."\r\n
"; +$hashpass = hashpass($password, $salt, $i); +echo "custom HashPass: ".$hashpass."\r\n
"; +$newpass = explode("/", $hashpass); +echo "Your hash is: ".$newpass[0]."
Your salt is: ".$newpass[1]."
\r\n"; +$total = microtime(true) - $start; +echo "execution time: ".$total." seconds"; +?>