PHP Classes

One Hash Salted Password: Generate and check passwords using a salted hash

Recommend this page to a friend!
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 73 All time: 10,125 This week: 345Up
Version License PHP version Categories
onehashsaltedpasswor 1.0GNU General Publi...5PHP 5, Cryptography
Description 

Author

This class can generate and check passwords using a salted hash.

It takes a given password text and generates a hash using a random salt string value.

The class can also check a previously generated hash matches the hash of a given password using the same salt string value.

Picture of Ákos Nikházy
Name: Ákos Nikházy <contact>
Classes: 8 packages by
Country: Hungary Hungary
Age: 36
All time rank: 4833 in Hungary Hungary
Week rank: 84 Up2 in Hungary Hungary Up
Innovation award
Innovation award
Nominee: 1x

Example

<?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)
?>


  Files folder image Files  
File Role Description
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file OneHashSaltedPassword-demo.php Example Example script
Plain text file OneHashSaltedPassword.class.php Class Class source
Accessible without login Plain text file README.md Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
 100%
Total:73
This week:0
All time:10,125
This week:345Up