Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Référence de la classe FOFEncryptAesOpenssl
+ Graphe d'héritage de FOFEncryptAesOpenssl:

Fonctions membres publiques

 __construct ()
 
 setEncryptionMode ($mode='cbc', $strength=128)
 
 encrypt ($plainText, $key, $iv=null)
 
 decrypt ($cipherText, $key)
 
 isSupported (FOFUtilsPhpfunc $phpfunc=null)
 
 getBlockSize ()
 
- Fonctions membres publiques hérités de FOFEncryptAesAbstract
 resizeKey ($key, $size)
 

Attributs protégés

 $openSSLOptions = 0
 
 $method = 'aes-128-cbc'
 

Membres hérités additionnels

- Fonctions membres protégées hérités de FOFEncryptAesAbstract
 getZeroPadding ($string, $blockSize)
 

Documentation des constructeurs et destructeur

◆ __construct()

__construct ( )

Documentation des fonctions membres

◆ decrypt()

decrypt (   $cipherText,
  $key 
)

Decrypts a string. Returns the raw binary plaintext.

$ciphertext MUST start with the IV followed by the ciphertext, even for EBC data (the first block of data is dropped in EBC mode since there is no concept of IV in EBC).

WARNING: The returned plaintext is zero-padded to the algorithm's block size during encryption. You are advised to trim the string to the original plaintext's length upon decryption. While rtrim($decrypted, "\0") sounds appealing it's NOT the correct approach for binary data (zero bytes may actually be part of your plaintext, not just padding!).

Paramètres
string$cipherTextThe ciphertext to encrypt
string$keyThe raw binary key (will be zero-padded or chopped if its size is different than the block size)
Renvoie
string The raw unencrypted binary string.

Implémente FOFEncryptAesInterface.

Références $key, et method.

◆ encrypt()

encrypt (   $plainText,
  $key,
  $iv = null 
)

Encrypts a string. Returns the raw binary ciphertext.

WARNING: The plaintext is zero-padded to the algorithm's block size. You are advised to store the size of the plaintext and trim the string to that length upon decryption.

Paramètres
string$plainTextThe plaintext to encrypt
string$keyThe raw binary key (will be zero-padded or chopped if its size is different than the block size)
null | string$ivThe initialization vector (for CBC mode algorithms)
Renvoie
string The raw encrypted binary string.

Implémente FOFEncryptAesInterface.

Références $key, et method.

◆ getBlockSize()

getBlockSize ( )
Renvoie
int

Implémente FOFEncryptAesInterface.

Références method.

◆ isSupported()

isSupported ( FOFUtilsPhpfunc  $phpfunc = null)

Is this adapter supported?

Paramètres
FOFUtilsPhpfunc$phpfunc
Renvoie
bool

Implémente FOFEncryptAesInterface.

◆ setEncryptionMode()

setEncryptionMode (   $mode = 'cbc',
  $strength = 128 
)

Sets the AES encryption mode.

WARNING: The strength is deprecated as it has a different effect in MCrypt and OpenSSL. MCrypt was abandoned in 2003 before the Rijndael-128 algorithm was officially the Advanced Encryption Standard (AES). MCrypt also offered Rijndael-192 and Rijndael-256 algorithms with different block sizes. These are NOT used in AES. OpenSSL, however, implements AES correctly. It always uses a 128-bit (16 byte) block. The 192 and 256 bit strengths refer to the key size, not the block size. Therefore using different strengths in MCrypt and OpenSSL will result in different and incompatible ciphertexts.

TL;DR: Always use $strength = 128!

Paramètres
string$modeChoose between CBC (recommended) or ECB
int$strengthBit strength of the key (128, 192 or 256 bits). DEPRECATED. READ NOTES ABOVE.
Renvoie
mixed

Implémente FOFEncryptAesInterface.

Références $mode, method, et null.

Documentation des champs

◆ $method

$method = 'aes-128-cbc'
protected

◆ $openSSLOptions

$openSSLOptions = 0
protected

La documentation de cette classe a été générée à partir du fichier suivant :