Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe Aes

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
 

Description détaillée

A simple implementation of AES-128, AES-192 and AES-256 encryption using the high performance mcrypt library.

Depuis
1.0

Documentation des constructeurs et destructeur

◆ __construct()

__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).

Paramètres
string$keyThe encryption key (password). It can be a raw key (16 bytes) or a passphrase.
int$strengthBit strength (128, 192 or 256) – ALWAYS USE 128 BITS. THIS PARAMETER IS DEPRECATED.
string$modeEncryption mode. Can be ebc or cbc. We recommend using cbc.
string$priorityPriority which adapter we should try first
Obsolète:
5.0 $strength will be removed

Références $key, et $mode.

Documentation des fonctions membres

◆ decryptString()

decryptString (   $stringToDecrypt,
  $base64encoded = true 
)

Decrypts a ciphertext into a plaintext string using AES

Paramètres
string$stringToDecryptThe ciphertext to decrypt. The first 16 bytes of the raw string must contain the IV (initialisation vector).
bool$base64encodedShould I Base64-decode the data before decryption?
Renvoie
string The plain text string

Références $key.

◆ encryptString()

encryptString (   $stringToEncrypt,
  $base64encoded = true 
)

Encrypts a string using AES

Paramètres
string$stringToEncryptThe plaintext to encrypt
bool$base64encodedShould I Base64-encode the result?
Renvoie
string The cryptotext. Please note that the first 16 bytes of the raw string is the IV (initialisation vector) which is necessary for decoding the string.

Références $key.

◆ getExpandedKey()

getExpandedKey (   $blockSize,
  $iv 
)

Get the expanded key

Paramètres
integer$blockSizeBlocksize to process
string$ivIV
Renvoie
string

Références $key.

◆ isSupported()

static isSupported ( )
static

Is AES encryption supported by this PHP installation?

Renvoie
boolean

◆ setPassword()

setPassword (   $password,
  $legacyMode = false 
)

Sets the password for this instance.

WARNING: Do not use the legacy mode, it's insecure

Paramètres
string$passwordThe password (either user-provided password or binary encryption key) to use
bool$legacyModeTrue to use the legacy key expansion. We recommend against using it.
Depuis
4.0.0
Renvoie
void

Références $password.

Documentation des champs

◆ $adapter

$adapter
protected

◆ $key

$key = ''
protected

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