Crypt
class Crypt
Crypt is a Joomla Platform class for handling basic encryption/decryption of data.
Methods
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.
Method to decrypt a data string.
Method to encrypt a data string.
Method to generate a new encryption key[/pair] object.
Generate random bytes.
A timing safe comparison method.
Tests for the availability of updated crypt().
Safely detect a string's length
Safely extract a substring
Details
__construct(
CipherInterface $cipher = null,
Key $key = null)
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.
static
boolean
timingSafeCompare(
string $known,
string $unknown)
A timing safe comparison method.
This defeats hacking attempts that use timing based attack vectors.
NOTE: Length will leak.
static
boolean
hasStrongPasswordSupport()
Tests for the availability of updated crypt().
Based on a method by Anthony Ferrera