Class JCrypt

Description

JCrypt is a Joomla Platform class for handling basic encryption/decryption of data.

  • since: 12.1

Located in /libraries/joomla/crypt/crypt.php (line 19)


	
			
Method Summary
 static string genRandomBytes ([integer $length = 16])
 static boolean hasStrongPasswordSupport ()
 static boolean timingSafeCompare (string $known, string $unknown)
 JCrypt __construct ([JCryptCipher $cipher = null], [JCryptKey $key = null])
 string decrypt (string $data)
 string encrypt (string $data)
 JCryptKey generateKey ([array $options = array()])
Methods
static genRandomBytes (line 126)

Generate random bytes.

  • return: Random binary data
  • since: 12.1
  • access: public
static string genRandomBytes ([integer $length = 16])
  • integer $length: Length of the random data to generate
static hasStrongPasswordSupport (line 306)

Tests for the availability of updated crypt().

Based on a method by Anthony Ferrera

static boolean hasStrongPasswordSupport ()
static timingSafeCompare (line 273)

A timing safe comparison method. This defeats hacking attempts that use timing based attack vectors.

  • return: True if the two strings are exactly the same.
  • since: 3.2
  • access: public
static boolean timingSafeCompare (string $known, string $unknown)
  • string $known: A known string to check against.
  • string $unknown: An unknown string to check.
Constructor __construct (line 42)

Object Constructor takes an optional key to be used for encryption/decryption. If no key is given then the secret word from the configuration object is used.

  • since: 12.1
  • access: public
JCrypt __construct ([JCryptCipher $cipher = null], [JCryptKey $key = null])
decrypt (line 61)

Method to decrypt a data string.

  • return: The decrypted data string.
  • since: 12.1
  • throws: InvalidArgumentException
  • access: public
string decrypt (string $data)
  • string $data: The encrypted string to decrypt.
encrypt (line 82)

Method to encrypt a data string.

  • return: The encrypted data string.
  • since: 12.1
  • access: public
string encrypt (string $data)
  • string $data: The data string to encrypt.
generateKey (line 96)

Method to generate a new encryption key[/pair] object.

  • since: 12.1
  • access: public
JCryptKey generateKey ([array $options = array()])
  • array $options: Key generation options.
setKey (line 110)

Method to set the encryption key[/pair] object.

  • since: 12.1
  • access: public
JCrypt setKey (JCryptKey $key)

Documentation generated on Tue, 19 Nov 2013 14:57:39 +0100 by phpDocumentor 1.4.3