PHP Classes

Hash: Store and validate hashes for data authentication

Recommend this page to a friend!
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 59%Total: 2,099 All time: 1,863 This week: 660Up
Version License Categories
class_hash 1.0.0GNU General Publi...Cryptography, Validation, Security


This class is meant to create hash strings that are used as keys to store private data.

The hash strings and the private data are stored in a database table so it can verified securely only on the server side. This capability can be for instance to prevent link stealing.

You may construct an hash string from:

- Session id of the user
- Private data of the server
- Private data of the web site
- An item to check
- Timestamp of a query
- A maximum number of accesses
- A maximum duration

Next, in another page, the class can check whether the hash is valid by passing as parameter in the UL, depending on:

- The item to check
- The session id of the user
- The private data of the server
- The private data of the Web site
- The moment when the has was saved in database
- The moment and the number of the access

Picture of Julien PACHET
Name: Julien PACHET <contact>
Classes: 15 packages by
Country: France France
Age: 47
All time rank: 301 in France France
Week rank: 280 Down11 in France France Down

  Files folder image Files  
File Role Description
Accessible without login Plain text file Aux. Function library to manage mysql database
Plain text file Class base class source
Accessible without login Plain text file hash_check.php Example Second page to check the hash and let access to the ressource
Accessible without login Plain text file hash_start.php Example Start page with the link to the check page with the resource

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:1,863
This week:660Up
 User Ratings  
 All time