Encryption library.
More...
Encryption library.
Engine / Object Library
- Author
- CaMykS Team camyk.nosp@m.s.co.nosp@m.ntact.nosp@m.@gma.nosp@m.il.co.nosp@m.m
- Version
- 1.0.1.1
- Date
- Creation: Apr 2019
-
Modification: Jul 2025
- Copyright
- 2019 - 2025 CaMykS Team
- Note
- This program is distributed as is - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- Warning
- This library is not loaded with CaMykS initialisation. Cryptographer class.
◆ __construct()
| Cryptographer::__construct |
( |
|
$params = array() | ) |
|
Class constructor.
- Parameters
-
◆ update_param()
| Cryptographer::update_param |
( |
|
$name, |
|
|
|
$value |
|
) |
| |
Update a parameter.
- Parameters
-
- Returns
- void
◆ update_params()
| Cryptographer::update_params |
( |
|
$params | ) |
|
Update some parameters.
- Parameters
-
- Returns
- void
◆ check_engineConfiguration()
| Cryptographer::check_engineConfiguration |
( |
| ) |
|
Check engine configuration.
- Returns
- boolean success
◆ encrypt()
| Cryptographer::encrypt |
( |
|
$data, |
|
|
|
$base64Encode = true |
|
) |
| |
Encrypt data.
- Parameters
-
| string | $data | |
| integer | $base64Encode | |
- Returns
- false on failure, string on success
◆ decrypt()
| Cryptographer::decrypt |
( |
|
$data, |
|
|
|
$base64Decode = true |
|
) |
| |
Decrypt data.
- Parameters
-
| string | $data,. | |
| integer | $base64Decode | |
- Returns
- false on failure, string on success
◆ get_lastErrorCode()
| Cryptographer::get_lastErrorCode |
( |
| ) |
|
Return last error code.
- Returns
- integer
◆ get_lastErrorMessage()
| Cryptographer::get_lastErrorMessage |
( |
| ) |
|
Return last error message.
- Returns
- string
◆ set_lastError()
| Cryptographer::set_lastError |
( |
|
$error | ) |
|
|
private |
Define last error
- Parameters
-
- Returns
- void
◆ _OpenSSL_check_configuration()
| Cryptographer::_OpenSSL_check_configuration |
( |
| ) |
|
|
private |
Check OpenSSL configuration.
- Returns
- boolean result
◆ _OpenSSL_encrypt()
| Cryptographer::_OpenSSL_encrypt |
( |
|
$data | ) |
|
|
private |
Encrypt data using OpenSSL engine.
- Parameters
-
- Returns
- string
◆ _OpenSSL_decrypt()
| Cryptographer::_OpenSSL_decrypt |
( |
|
$data | ) |
|
|
private |
Decrypt data using OpenSSL engine.
- Parameters
-
- Returns
- string
◆ _Mcrypt_check_configuration()
| Cryptographer::_Mcrypt_check_configuration |
( |
| ) |
|
|
private |
Check Mcrypt configuration.
- Returns
- boolean result
◆ _Mcrypt_encrypt()
| Cryptographer::_Mcrypt_encrypt |
( |
|
$data | ) |
|
|
private |
Encrypt data using Mcrypt engine.
- Parameters
-
- Returns
- string
◆ _Mcrypt_decrypt()
| Cryptographer::_Mcrypt_decrypt |
( |
|
$data | ) |
|
|
private |
Decrypt data using Mcrypt engine.
- Parameters
-
- Returns
- string
◆ _Sodium_check_configuration()
| Cryptographer::_Sodium_check_configuration |
( |
| ) |
|
|
private |
Check Sodium configuration.
- Returns
- boolean result
◆ _Sodium_encrypt()
| Cryptographer::_Sodium_encrypt |
( |
|
$data | ) |
|
|
private |
Encrypt data using Sodium engine.
- Parameters
-
- Returns
- string
◆ _Sodium_decrypt()
| Cryptographer::_Sodium_decrypt |
( |
|
$data | ) |
|
|
private |
Decrypt data using Sodium engine.
- Parameters
-
- Returns
- string
◆ $engines
| array Cryptographer::$engines = array('OpenSSL', 'Mcrypt', 'Sodium') |
|
private |
◆ $params
| array Cryptographer::$params |
|
private |
Initial value:= array(
'engine' => 'OpenSSL',
'cipher' => 'aes-256-cbc',
'mode' => '',
'key' => '',
'iv' => '',
)
Engine parameters.
◆ $lastError
| integer Cryptographer::$lastError = 0 |
|
private |
The documentation for this class was generated from the following file: