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: 6 years ago
Size: 441 bytes
 

Contents

Class file image Download
<?php
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)
?>