PHP Classes

File: example2.php

Recommend this page to a friend!
  Classes of Ole Aass  >  Secure Password Generation and Validation  >  example2.php  >  Download  
File: example2.php
Role: Example script
Content type: text/plain
Description: Example using HMAC layer
Class: Secure Password Generation and Validation
Create and validate password hashes
Author: By
Last change:
Date: 9 years ago
Size: 494 bytes


Class file image Download

 * This example uses an extra layer of security by first hashing the password through a
 * HMAC hash before it is sent to the crypt function.
 * To learn more about this method please read through my blog post:


$pw = new Password;
$pw->hmacEnabled = true;
$pw->hmacKey = file_get_contents('hmacKey.txt');
$hashed = $pw->hash('verysecret');

For more information send a message to info at phpclasses dot org.