September 2001
Intermediate to advanced
768 pages
32h 45m
English
string mhash_keygen_s2k(const hash, string password, string salt, int bytes)
| hash | mhash constant representing a specific hash algorithm |
| password | User password |
| salt | Random data |
| bytes | Key length |
Generates a salted key based on the specified hash algorithm.
Returns:
Salted key value as a string; FALSE on error
Description:
mhash_keygen_s2k() generates a key of bytes length from a user-given password , using the hash hash . This produces the “Salted S2K” data element described in RFC 2440. This function can be used to compute checksums, message digests, and other signatures.
The salt is a random piece of data used to generate the key. To check the key, you must also know the salt , so it’s a good idea to append the salt to ...
Read now
Unlock full access