Cryptography: Hash
Julien PACHET (contact me)
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
Click here for detailed information about this class on phpclasses.org