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 FOFEncryptAes

Fonctions membres publiques

 __construct ($key, $strength=128, $mode='cbc', FOFUtilsPhpfunc $phpfunc=null, $priority='openssl')
 
 setPassword ($password, $legacyMode=false)
 
 encryptString ($stringToEncrypt, $base64encoded=true)
 
 decryptString ($stringToDecrypt, $base64encoded=true)
 
 getExpandedKey ($blockSize, $iv)
 

Fonctions membres publiques statiques

static isSupported (FOFUtilsPhpfunc $phpfunc=null)
 

Attributs protégés

 $key = ''
 
 $adapter
 

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $key,
  $strength = 128,
  $mode = 'cbc',
FOFUtilsPhpfunc  $phpfunc = null,
  $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.
FOFUtilsPhpfunc$phpfuncFor testing
string$priorityPriority which adapter we should try first

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 
)
Paramètres
$blockSize
$iv
Renvoie
string

Références $key.

◆ isSupported()

static isSupported ( FOFUtilsPhpfunc  $phpfunc = null)
static

Is AES encryption supported by this PHP installation?

Paramètres
FOFUtilsPhpfunc$phpfunc
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.

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 :