Back to Joomla project (class list)

Class Aes - list of methods

A simple implementation of AES-128, AES-192 and AES-256 encryption using the high performance mcrypt library.
Package: Joomla\CMS\Encrypt
Copyright: (C) 2013 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/Encrypt/Aes.php
Project: Joomla

Method Summary

public
(mixed $key, mixed $strength = 128, mixed $mode = 'cbc', mixed $priority = 'openssl')

Initialise the AES encryption object.
Parameters
  • 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
Show source code of this method: __construct Source Code

public void
(mixed $password, mixed $legacyMode = false)

Sets the password for this instance.
Parameters
  • 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.
Returns
  • void
Since
  • 4.0.0
Show source code of this method: setPassword Source Code

public string
(mixed $stringToEncrypt, mixed $base64encoded = true)

Encrypts a string using AES
Parameters
  • string $stringToEncrypt The plaintext to encrypt
  • bool $base64encoded Should I Base64-encode the result?
Returns
  • 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.
Show source code of this method: encryptString Source Code

public string
(mixed $stringToDecrypt, mixed $base64encoded = true)

Decrypts a ciphertext into a plaintext string using AES
Parameters
  • 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?
Returns
  • string The plain text string
Show source code of this method: decryptString Source Code

public static bool
()

Is AES encryption supported by this PHP installation?
Returns
  • bool
Show source code of this method: isSupported Source Code

public string
(mixed $blockSize, mixed $iv)

Get the expanded key
Parameters
  • int $blockSize Blocksize to process
  • string $iv IV
Returns
  • string
Show source code of this method: getExpandedKey Source Code

Properties Summary

protected string
$key
The cipher key.
protected \Joomla\CMS\Encrypt\AES\AesInterface
$adapter
The AES encryption adapter in use.

Tags Summary

Since
1.0