encryptByKey() public method
Encrypts data using a cryptographic key.
Derives keys for encryption and authentication from the input key using HKDF and a random salt, which is very fast relative to encryptByPassword(). The input key must be properly random -- use generateRandomKey() to generate keys. The encrypted data includes a keyed message authentication code (MAC) so there is no need to hash input or output data.
See also:
public string encryptByKey ( $data, $inputKey, $info = null ) | ||
---|---|---|
$data | string |
The data to encrypt |
$inputKey | string |
The input to use for encryption and authentication |
$info | string |
Optional context and application specific information, see hkdf() |
return | string |
The encrypted data |
Please login to continue.