[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/src/Encrypt/ -> Aes.php (summary)

Joomla! Content Management System

Copyright: (C) 2013 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
File Size: 280 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Aes:: (7 methods):
  __construct()
  setPassword()
  encryptString()
  decryptString()
  isSupported()
  getExpandedKey()
  hash_pbkdf2()


Class: Aes  - X-Ref

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')   X-Ref
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: string          $key      The encryption key (password). It can be a raw key (16 bytes) or a passphrase.
param: int             $strength Bit strength (128, 192 or 256) – ALWAYS USE 128 BITS. THIS PARAMETER IS DEPRECATED.
param: string          $mode     Encryption mode. Can be ebc or cbc. We recommend using cbc.
param: string          $priority Priority which adapter we should try first

setPassword($password, $legacyMode = false)   X-Ref
Sets the password for this instance.

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

param: string $password   The password (either user-provided password or binary encryption key) to use
param: bool   $legacyMode True to use the legacy key expansion. We recommend against using it.
return: void

encryptString($stringToEncrypt, $base64encoded = true)   X-Ref
Encrypts a string using AES

param: string $stringToEncrypt The plaintext to encrypt
param: bool   $base64encoded   Should I Base64-encode the result?
return: string  The cryptotext. Please note that the first 16 bytes of

decryptString($stringToDecrypt, $base64encoded = true)   X-Ref
Decrypts a ciphertext into a plaintext string using AES

param: string $stringToDecrypt The ciphertext to decrypt. The first 16 bytes of the raw string must contain
param: bool   $base64encoded   Should I Base64-decode the data before decryption?
return: string  The plain text string

isSupported()   X-Ref
Is AES encryption supported by this PHP installation?

return: boolean

getExpandedKey($blockSize, $iv)   X-Ref
Get the expanded key

param: integer  $blockSize  Blocksize to process
param: string   $iv         IV
return: string

hash_pbkdf2($algo, $password, $salt, $count, $length = 0, $rawOutput = false)   X-Ref
Shim for missing hash_pbkdf2

param: string   $algo       Algorithm to use
param: string   $password   Plaintext password
param: string   $salt       Salt for the hash
param: integer  $count      Number of iterations
param: integer  $length     Length
param: boolean  $rawOutput  Raw output
return: string  Hashed string



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer