Implements HKDF specified in RFC 5869.
Recommend use one of the SHA-2 hash algorithms: sha224, sha256, sha384 or sha512.
public hkdf ( string $algo, string $inputKey, string $salt = null, string $info = null, integer $length ) : string | ||
$algo | string | a hash algorithm supported by `hash_hmac()`, e.g. 'SHA-256' |
$inputKey | string | the source key |
$salt | string | the random salt |
$info | string | optional info to bind the derived key material to application- and context-specific information, e.g. a user ID or API version, see [RFC 5869](https://tools.ietf.org/html/rfc5869) |
$length | integer | length of the output key in bytes. If 0, the output key is the length of the hash algorithm output. |
return | string | the derived key |