public static function LockrAes256CbcSha256KeyWrapper::encrypt in Lockr 7.2
Same name and namespace in other branches
- 7.3 vendor/lockr/lockr/src/KeyWrapper/LockrAes256CbcSha256KeyWrapper.php \Lockr\KeyWrapper\LockrAes256CbcSha256KeyWrapper::encrypt()
Encrypt the given plaintext.
Parameters
string $plaintext:
Return value
array
Overrides KeyWrapperInterface::encrypt
File
- vendor/
lockr/ lockr-client/ src/ KeyWrapper/ LockrAes256CbcSha256KeyWrapper.php, line 23
Class
Namespace
Lockr\KeyWrapperCode
public static function encrypt($plaintext, $key = null) {
if (is_null($key)) {
$key = random_bytes(self::KEY_LEN);
}
$iv = random_bytes(self::IV_LEN);
return self::doEncrypt($plaintext, $key, $iv);
}