Property | Type | Description | |
---|---|---|---|
$_cipher | string | Encryption cipher | |
$_digests | array | name => digest size pairs | |
$_driver | string | PHP extension to be used | |
$_drivers | array | List of usable drivers (PHP extensions) | |
$_handle | mixed | Cipher handle | |
$_key | string | Encryption key | |
$_mode | string | Cipher mode | |
$_modes | array | List of available modes | |
$func_override | boolean | mbstring.func_override flag |
Method | Description | |
---|---|---|
__construct ( array $params = [] ) : void | Class constructor | |
__get ( string $key ) : mixed | __get() magic | |
create_key ( integer $length ) : string | Create a random key | |
decrypt ( string $data, array $params = NULL ) : string | Decrypt | |
encrypt ( string $data, array $params = NULL ) : string | Encrypt | |
hkdf ( $key, $digest = 'sha512', $salt = NULL, $length = NULL, $info = '' ) : string | HKDF | |
initialize ( array $params ) : CI_Encryption | Initialize |
Method | Description | |
---|---|---|
_cipher_alias ( string &$cipher ) : void | Cipher alias | |
_get_params ( array $params ) : array | Get params | |
_mcrypt_decrypt ( string $data, array $params ) : string | Decrypt via MCrypt | |
_mcrypt_encrypt ( string $data, array $params ) : string | Encrypt via MCrypt | |
_mcrypt_get_handle ( string $cipher, string $mode ) : resource | Get MCrypt handle | |
_mcrypt_initialize ( array $params ) : void | Initialize MCrypt | |
_openssl_decrypt ( string $data, array $params ) : string | Decrypt via OpenSSL | |
_openssl_encrypt ( string $data, array $params ) : string | Encrypt via OpenSSL | |
_openssl_get_handle ( string $cipher, string $mode ) : string | Get OpenSSL handle | |
_openssl_initialize ( array $params ) : void | Initialize OpenSSL | |
strlen ( string $str ) : integer | Byte-safe strlen() | |
substr ( string $str, integer $start, integer $length = NULL ) : string | Byte-safe substr() |
public __construct ( array $params = [] ) : void | ||
$params | array | Configuration parameters |
return | void |
protected _cipher_alias ( string &$cipher ) : void | ||
$cipher | string | Cipher name |
return | void |
protected _get_params ( array $params ) : array | ||
$params | array | Input parameters |
return | array |
protected _mcrypt_get_handle ( string $cipher, string $mode ) : resource | ||
$cipher | string | Cipher name |
$mode | string | Encryption mode |
return | resource |
protected _mcrypt_initialize ( array $params ) : void | ||
$params | array | Configuration parameters |
return | void |
protected _openssl_initialize ( array $params ) : void | ||
$params | array | Configuration parameters |
return | void |
public create_key ( integer $length ) : string | ||
$length | integer | Output length |
return | string |
public hkdf ( $key, $digest = 'sha512', $salt = NULL, $length = NULL, $info = '' ) : string | ||
$key | Input key | |
$digest | A SHA-2 hashing algorithm | |
$salt | Optional salt | |
$length | Output length (defaults to the selected digest size) | |
$info | Optional context/application-specific info | |
return | string | A pseudo-random key |
public initialize ( array $params ) : CI_Encryption | ||
$params | array | Configuration parameters |
return | CI_Encryption |
protected array $_drivers | ||
return | array |
protected static bool $func_override | ||
return | boolean |