Dotclear 2.24
Loading...
Searching...
No Matches
crypt Class Reference

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)
 

Detailed Description

Functions to handle passwords or sensitive data.

Member Function Documentation

◆ hmac()

static hmac ( string  $key,
string  $data,
string  $hashfunc = 'sha1' 
)
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.)

Parameters
string$keyHash key
string$dataData
string$hashfuncHash function (md5 or sha1)
Returns
string

References hmac_legacy().

Referenced by http\browserUID(), dcAuth\checkUser(), dcAuth\cryptLegacy(), testHMacBigKeyMD5(), testHMacFallback(), testHMacMD5(), testHMacSHA1Explicit(), and testHMacSHA1Implicit().

◆ hmac_legacy()

static hmac_legacy ( string  $key,
string  $data,
string  $hashfunc = 'sha1' 
)
static

Legacy hmac method

Parameters
string$keyThe key
string$dataThe data
string$hashfuncThe hashfunc
Returns
string

Referenced by hmac(), testHMacLegacy(), testHMacLegacyFallback(), testHMacLegacyMD5(), and testHMacLegacySha1().

◆ createPassword()

static createPassword ( int  $length = 8)
static

Password generator

Returns an n characters random password.

Parameters
integer$lengthrequired length
Returns
string

Referenced by dcImportDC1\importUsers(), dcImportWP\importUsers(), dcAuth\recoverUserPassword(), and testCreatePassword().


The documentation for this class was generated from the following file: