Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques | |
__construct ($key, $strength=128, $mode='cbc', $priority='openssl') | |
setPassword ($password, $legacyMode=false) | |
encryptString ($stringToEncrypt, $base64encoded=true) | |
decryptString ($stringToDecrypt, $base64encoded=true) | |
getExpandedKey ($blockSize, $iv) | |
Fonctions membres publiques statiques | |
static | isSupported () |
Attributs protégés | |
$key = '' | |
$adapter | |
A simple implementation of AES-128, AES-192 and AES-256 encryption using the high performance mcrypt library.
__construct | ( | $key, | |
$strength = 128 , |
|||
$mode = 'cbc' , |
|||
$priority = 'openssl' |
|||
) |
Initialise the AES encryption object.
Note: If the key is not 16 bytes this class will do a stupid key expansion for legacy reasons (produce the SHA-256 of the key string and throw away half of it).
string | $key | The encryption key (password). It can be a raw key (16 bytes) or a passphrase. |
int | $strength | Bit strength (128, 192 or 256) – ALWAYS USE 128 BITS. THIS PARAMETER IS DEPRECATED. |
string | $mode | Encryption mode. Can be ebc or cbc. We recommend using cbc. |
string | $priority | Priority which adapter we should try first |
decryptString | ( | $stringToDecrypt, | |
$base64encoded = true |
|||
) |
Decrypts a ciphertext into a plaintext string using AES
string | $stringToDecrypt | The ciphertext to decrypt. The first 16 bytes of the raw string must contain the IV (initialisation vector). |
bool | $base64encoded | Should I Base64-decode the data before decryption? |
Références $key.
encryptString | ( | $stringToEncrypt, | |
$base64encoded = true |
|||
) |
Encrypts a string using AES
string | $stringToEncrypt | The plaintext to encrypt |
bool | $base64encoded | Should I Base64-encode the result? |
Références $key.
getExpandedKey | ( | $blockSize, | |
$iv | |||
) |
Get the expanded key
integer | $blockSize | Blocksize to process |
string | $iv | IV |
Références $key.
setPassword | ( | $password, | |
$legacyMode = false |
|||
) |
Sets the password for this instance.
WARNING: Do not use the legacy mode, it's insecure
string | $password | The password (either user-provided password or binary encryption key) to use |
bool | $legacyMode | True to use the legacy key expansion. We recommend against using it. |
Références $password.
|
protected |
|
protected |