OpenSSLHandler
extends BaseHandler
in package
Encryption handling for OpenSSL library
Tags
Table of Contents
Properties
- $authKeyInfo : string
- Authentication key info.
- $encryptKeyInfo : string
- Encryption key info.
- $cipher : string
- Cipher to use
- $digest : string
- HMAC digest to use
- $digestSize : array<string|int, mixed>
- List of supported HMAC algorithms
- $key : string
- Starter key
- $rawData : bool
- Whether the cipher-text should be raw. If set to false, then it will be base64 encoded.
Methods
- __construct() : mixed
- Constructor
- __get() : array<string|int, mixed>|bool|int|string|null
- __get() magic, providing readonly access to some of our properties
- __isset() : bool
- __isset() magic, providing checking for some of our properties
- decrypt() : string
- Decrypt - convert ciphertext into plaintext
- encrypt() : string
- Encrypt - convert plaintext into ciphertext
- substr() : string
- Byte-safe substr()
Properties
$authKeyInfo
Authentication key info.
public
string
$authKeyInfo
= ''
This setting is only used by OpenSSLHandler.
Set to 'authentication' for CI3 Encryption compatibility.
$encryptKeyInfo
Encryption key info.
public
string
$encryptKeyInfo
= ''
This setting is only used by OpenSSLHandler.
Set to 'encryption' for CI3 Encryption compatibility.
$cipher
Cipher to use
protected
string
$cipher
= 'AES-256-CTR'
$digest
HMAC digest to use
protected
string
$digest
= 'SHA512'
$digestSize
List of supported HMAC algorithms
protected
array<string|int, mixed>
$digestSize
= ['SHA224' => 28, 'SHA256' => 32, 'SHA384' => 48, 'SHA512' => 64]
[name => digest size]
$key
Starter key
protected
string
$key
= ''
$rawData
Whether the cipher-text should be raw. If set to false, then it will be base64 encoded.
protected
bool
$rawData
= true
Methods
__construct()
Constructor
public
__construct([Encryption|null $config = null ]) : mixed
Parameters
- $config : Encryption|null = null
__get()
__get() magic, providing readonly access to some of our properties
public
__get(string $key) : array<string|int, mixed>|bool|int|string|null
Parameters
- $key : string
-
Property name
Return values
array<string|int, mixed>|bool|int|string|null__isset()
__isset() magic, providing checking for some of our properties
public
__isset(string $key) : bool
Parameters
- $key : string
-
Property name
Return values
booldecrypt()
Decrypt - convert ciphertext into plaintext
public
decrypt(mixed $data[, mixed $params = null ]) : string
Parameters
- $data : mixed
-
Encrypted data
- $params : mixed = null
-
Overridden parameters, specifically the key
Return values
stringencrypt()
Encrypt - convert plaintext into ciphertext
public
encrypt(mixed $data[, mixed $params = null ]) : string
Parameters
- $data : mixed
-
Input data
- $params : mixed = null
-
Overridden parameters, specifically the key
Return values
stringsubstr()
Byte-safe substr()
protected
static substr(string $str, int $start[, int $length = null ]) : string
Parameters
- $str : string
- $start : int
- $length : int = null