Dotclear 2.24
|
Functions to handle passwords or sensitive data. More...
Static Public Member Functions | |
static | hmac (string $key, string $data, string $hashfunc='sha1') |
static | hmac_legacy (string $key, string $data, string $hashfunc='sha1') |
static | createPassword (int $length=8) |
Functions to handle passwords or sensitive data.
|
static |
SHA1 or MD5 + HMAC
Returns an HMAC encoded value of $data, using the said $key and $hashfunc as hash method (sha1 or md5 are accepted if hash_hmac function not exists.)
string | $key | Hash key |
string | $data | Data |
string | $hashfunc | Hash function (md5 or sha1) |
References hmac_legacy().
Referenced by http\browserUID(), dcAuth\checkUser(), dcAuth\cryptLegacy(), testHMacBigKeyMD5(), testHMacFallback(), testHMacMD5(), testHMacSHA1Explicit(), and testHMacSHA1Implicit().
|
static |
Legacy hmac method
string | $key | The key |
string | $data | The data |
string | $hashfunc | The hashfunc |
Referenced by hmac(), testHMacLegacy(), testHMacLegacyFallback(), testHMacLegacyMD5(), and testHMacLegacySha1().
|
static |
Password generator
Returns an n characters random password.
integer | $length | required length |
Referenced by dcImportDC1\importUsers(), dcImportWP\importUsers(), dcAuth\recoverUserPassword(), and testCreatePassword().