<?php
include('Purifier.php');
$purifier = new Purifier;
$name = $purifier->getInputVar('name');
echo '<br /><strong>Sanitized var:</strong> ' . $name ;
echo '<br /><strong>Clean String:</strong> ' . $purifier->cleanString($name);
echo '<br /><strong>Gen Secure Password:</strong> ' . $purifier->genSecurePassword(32);
echo '<br /><strong>Gen Unique key:</strong> ' . $purifier->genKey(32);
$saltedPassword = $purifier->encryptPassword($name);
echo "<br /><strong>Gen Hashed & Salted Password from '$name' :</strong>\n" .$saltedPassword ;
echo '<br /><strong>Validate Salted Password:</strong> ';
var_dump($purifier->validatePassword($name, $saltedPassword));
?>
<hr />
<form action="example.php" method="post">
<label>Name:</label> <input type="text" name="name" value="<?php echo $name ?>"/>
<input type="submit" value="submit"/>
</form>
|