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.

string|bool
decrypt(string $string)

Decrypts string.

Details

in Encrypter at line 41
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 52
__construct(string $key, string|null $cipher = null)

Constructor.

Parameters

string $key Encryption key
string|null $cipher Cipher

at line 64
string encrypt(string $string)

Encrypts string.

Parameters

string $string String to encrypt

Return Value

string

at line 76
string|bool decrypt(string $string)

Decrypts string.

Parameters

string $string String to decrypt

Return Value

string|bool