Class FOFEncryptAES

Description

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

  • since: 1.0

Located in /libraries/fof/encrypt/aes.php (line 18)


	
			
Method Summary
 static boolean isSupported ()
 FOFEncryptAES __construct (string $key, [int $strength = 256], [string $mode = 'cbc'])
 string decryptString (string $stringToDecrypt, [bool $base64encoded = true])
 string encryptString (string $stringToEncrypt, [bool $base64encoded = true])
Methods
static isSupported (line 161)

Is AES encryption supported by this PHP installation?

  • access: public
static boolean isSupported ()
Constructor __construct (line 36)

Initialise the AES encryption object

  • access: public
FOFEncryptAES __construct (string $key, [int $strength = 256], [string $mode = 'cbc'])
  • string $key: The encryption key (password). It can be a raw key (32 bytes) or a passphrase.
  • int $strength: Bit strength (128, 192 or 256)
  • string $mode: Ecnryption mode. Can be ebc or cbc. We recommend using cbc.
decryptString (line 127)

Decrypts a ciphertext into a plaintext string using AES

  • return: The plain text string
  • access: public
string decryptString (string $stringToDecrypt, [bool $base64encoded = true])
  • 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?
encryptString (line 78)

Encrypts a string using AES

  • return: 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.
  • access: public
string encryptString (string $stringToEncrypt, [bool $base64encoded = true])
  • string $stringToEncrypt: The plaintext to encrypt
  • bool $base64encoded: Should I Base64-encode the result?

Documentation generated on Tue, 19 Nov 2013 14:53:38 +0100 by phpDocumentor 1.4.3