Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques statiques | |
static | incrementCounter ($ctr, $inc) |
static | secureRandom ($octets) |
static | hashEquals ($expected, $given) |
static | ensureConstantExists ($name) |
static | ensureFunctionExists ($name) |
static | ensureTrue ($condition, $message='') |
static | ourStrlen ($str) |
static | ourSubstr ($str, $start, $length=null) |
static | pbkdf2 ($algorithm, $password, $salt, $count, $key_length, $raw_output=false) |
Champs de données | |
const | HEADER_VERSION_SIZE = 4 |
const | MINIMUM_CIPHERTEXT_SIZE = 84 |
const | CURRENT_VERSION = "\xDE\xF5\x02\x00" |
const | CIPHER_METHOD = 'aes-256-ctr' |
const | BLOCK_BYTE_SIZE = 16 |
const | KEY_BYTE_SIZE = 32 |
const | SALT_BYTE_SIZE = 32 |
const | MAC_BYTE_SIZE = 32 |
const | HASH_FUNCTION_NAME = 'sha256' |
const | ENCRYPTION_INFO_STRING = 'DefusePHP|V2|KeyForEncryption' |
const | AUTHENTICATION_INFO_STRING = 'DefusePHP|V2|KeyForAuthentication' |
const | BUFFER_BYTE_SIZE = 1048576 |
const | LEGACY_CIPHER_METHOD = 'aes-128-cbc' |
const | LEGACY_BLOCK_BYTE_SIZE = 16 |
const | LEGACY_KEY_BYTE_SIZE = 16 |
const | LEGACY_HASH_FUNCTION_NAME = 'sha256' |
const | LEGACY_MAC_BYTE_SIZE = 32 |
const | LEGACY_ENCRYPTION_INFO_STRING = 'DefusePHP|KeyForEncryption' |
const | LEGACY_AUTHENTICATION_INFO_STRING = 'DefusePHP|KeyForAuthentication' |
|
static |
Throws an exception if the constant doesn't exist.
string | $name |
Ex |
Références $name, et Core\ensureTrue().
|
static |
Throws an exception if the function doesn't exist.
string | $name |
Ex |
Références $name, et Core\ensureTrue().
Référencé par RuntimeTests\runtimeTest().
|
static |
Throws an exception if the condition is false.
bool | $condition | |
string | $message |
Ex |
Références $message.
Référencé par Key\__construct(), KeyOrPassword\__construct(), RuntimeTests\AESTestVector(), KeyOrPassword\deriveKeys(), Core\ensureConstantExists(), Core\ensureFunctionExists(), Core\hashEquals(), RuntimeTests\HKDFTestVector(), RuntimeTests\HMACTestVector(), Core\incrementCounter(), Encoding\loadBytesFromChecksummedAsciiSafeString(), Core\ourStrlen(), Core\pbkdf2(), RuntimeTests\runtimeTest(), Encoding\saveBytesToChecksummedAsciiSafeString(), et RuntimeTests\testEncryptDecrypt().
|
static |
Checks if two equal-length strings are the same without leaking information through side channels.
string | $expected | |
string | $given |
Ex |
Références Core\ensureTrue(), Core\HASH_FUNCTION_NAME, null, Core\ourStrlen(), et Core\secureRandom().
Référencé par Encoding\loadBytesFromChecksummedAsciiSafeString(), et Crypto\verifyHMAC().
|
static |
Adds an integer to a block-sized counter.
string | $ctr | |
int | $inc |
Ex |
Références $i, Core\BLOCK_BYTE_SIZE, Core\ensureTrue(), et Core\ourStrlen().
|
static |
Computes the length of a string in bytes.
string | $str |
Ex |
Références Core\ensureTrue(), et null.
Référencé par Key\__construct(), Encoding\binToHex(), KeyOrPassword\deriveKeys(), Core\hashEquals(), Encoding\hexToBin(), Core\incrementCounter(), Encoding\loadBytesFromChecksummedAsciiSafeString(), Core\ourSubstr(), Core\pbkdf2(), RuntimeTests\runtimeTest(), Encoding\saveBytesToChecksummedAsciiSafeString(), et Encoding\trimTrailingWhitespace().
|
static |
Behaves roughly like the function substr() in PHP 7 does.
string | $str | |
int | $start | |
int | $length |
Ex |
Références $start, null, et Core\ourStrlen().
Référencé par Encoding\loadBytesFromChecksummedAsciiSafeString(), Core\pbkdf2(), et Encoding\trimTrailingWhitespace().
|
static |
Computes the PBKDF2 password-based key derivation function.
The PBKDF2 function is defined in RFC 2898. Test vectors can be found in RFC 6070. This implementation of PBKDF2 was originally created by Taylor Hornby, with improvements from http://www.variations-of-shadow.com/.
string | $algorithm | The hash algorithm to use. Recommended: SHA256 |
string | $password | The password. |
string | $salt | A salt that is unique to the password. |
int | $count | Iteration count. Higher is better, but slower. Recommended: At least 1000. |
int | $key_length | The length of the derived key in bytes. |
bool | $raw_output | If true, the key is returned in raw binary format. Hex encoded otherwise. |
Ex |
-suppress InvalidOperand
Références $count, $i, $last, $output, $password, Encoding\binToHex(), Core\ensureTrue(), Core\ourStrlen(), et Core\ourSubstr().
Référencé par KeyOrPassword\deriveKeys().
|
static |
Returns a random byte string of the specified length.
int | $octets |
Ex |
Référencé par Key\createNewRandomKey(), Crypto\encryptInternal(), et Core\hashEquals().
const AUTHENTICATION_INFO_STRING = 'DefusePHP|V2|KeyForAuthentication' |
Référencé par KeyOrPassword\deriveKeys(), et RuntimeTests\runtimeTest().
const BLOCK_BYTE_SIZE = 16 |
Référencé par Crypto\encryptInternal(), Core\incrementCounter(), et RuntimeTests\testEncryptDecrypt().
const BUFFER_BYTE_SIZE = 1048576 |
const CIPHER_METHOD = 'aes-256-ctr' |
Référencé par RuntimeTests\AESTestVector(), et RuntimeTests\runtimeTest().
const CURRENT_VERSION = "\xDE\xF5\x02\x00" |
Référencé par Crypto\encryptInternal().
const ENCRYPTION_INFO_STRING = 'DefusePHP|V2|KeyForEncryption' |
Référencé par KeyOrPassword\deriveKeys(), et RuntimeTests\runtimeTest().
const HASH_FUNCTION_NAME = 'sha256' |
const HEADER_VERSION_SIZE = 4 |
Référencé par RuntimeTests\testEncryptDecrypt().
const KEY_BYTE_SIZE = 32 |
Référencé par KeyOrPassword\deriveKeys(), et RuntimeTests\runtimeTest().
const LEGACY_AUTHENTICATION_INFO_STRING = 'DefusePHP|KeyForAuthentication' |
const LEGACY_BLOCK_BYTE_SIZE = 16 |
const LEGACY_CIPHER_METHOD = 'aes-128-cbc' |
const LEGACY_ENCRYPTION_INFO_STRING = 'DefusePHP|KeyForEncryption' |
const LEGACY_HASH_FUNCTION_NAME = 'sha256' |
const LEGACY_KEY_BYTE_SIZE = 16 |
const LEGACY_MAC_BYTE_SIZE = 32 |
const MAC_BYTE_SIZE = 32 |
const MINIMUM_CIPHERTEXT_SIZE = 84 |
Référencé par RuntimeTests\testEncryptDecrypt().
const SALT_BYTE_SIZE = 32 |
Référencé par KeyOrPassword\deriveKeys(), Crypto\encryptInternal(), et RuntimeTests\testEncryptDecrypt().