class OpenSSL extends Encrypter implements EncrypterInterface

OpenSSL encrypter.

Constants

DERIVATION_HASH

Derivation hash.

DERIVATION_ITERATIONS

Derivation iterations.

Properties

protected string $key Key used to encrypt/decrypt string.
protected string $cipher The cipher method to use for encryption.
protected string $ivSize Initialization vector size.

Methods

string
deriveKey(string $key, string $salt, int $keySize)

Generate a PBKDF2 key derivation of a supplied key.

from Encrypter
__construct(string $key, string|null $cipher = null)

Constructor.

string
encrypt(string $string)

Encrypts string.

false|string
decrypt(string $string)

Decrypts string.

Details

in Encrypter at line 39
protected string deriveKey(string $key, string $salt, int $keySize)

Generate a PBKDF2 key derivation of a supplied key.

Parameters

string $key The key to derive
string $salt The salt
int $keySize The desired key size

Return Value

string

at line 50
__construct(string $key, string|null $cipher = null)

Constructor.

Parameters

string $key Encryption key
string|null $cipher Cipher

at line 62
string encrypt(string $string)

Encrypts string.

Parameters

string $string String to encrypt

Return Value

string

at line 74
false|string decrypt(string $string)

Decrypts string.

Parameters

string $string String to decrypt

Return Value

false|string