PHP Classes

File: OneHashSaltedPassword-demo.php

Recommend this page to a friend!
  Classes of Ákos Nikházy   One Hash Salted Password   OneHashSaltedPassword-demo.php   Download  
File: OneHashSaltedPassword-demo.php
Role: Example script
Content type: text/plain
Description: Example script
Class: One Hash Salted Password
Generate and check passwords using a salted hash
Author: By
Last change:
Date: 5 years ago
Size: 441 bytes


Class file image Download
require 'OneHashSaltedPassword.class.php';

$a = new OneHashSaltedPassword('testkey');

$pw = $a->GenerateSaltedPassword('test'); //we generating a new hash for the password "test"
echo $pw . '<hr>';
var_dump($a->CheckPassword('test',$pw)); //we pretend someone typed in the correct passoword. Retuns bool(ture)
var_dump($a->CheckPassword('test2',$pw)); //we pretend someone typed in the wrong password. Returns bool(false)