Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe Core

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'
 

Documentation des fonctions membres

◆ ensureConstantExists()

static ensureConstantExists (   $name)
static

Throws an exception if the constant doesn't exist.

Paramètres
string$name
Renvoie
void
Exceptions
Ex

Références $name, et Core\ensureTrue().

◆ ensureFunctionExists()

static ensureFunctionExists (   $name)
static

Throws an exception if the function doesn't exist.

Paramètres
string$name
Renvoie
void
Exceptions
Ex

Références $name, et Core\ensureTrue().

Référencé par RuntimeTests\runtimeTest().

◆ ensureTrue()

◆ hashEquals()

static hashEquals (   $expected,
  $given 
)
static

Checks if two equal-length strings are the same without leaking information through side channels.

Paramètres
string$expected
string$given
Exceptions
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().

◆ incrementCounter()

static incrementCounter (   $ctr,
  $inc 
)
static

Adds an integer to a block-sized counter.

Paramètres
string$ctr
int$inc
Exceptions
Ex

Références $i, Core\BLOCK_BYTE_SIZE, Core\ensureTrue(), et Core\ourStrlen().

◆ ourStrlen()

◆ ourSubstr()

static ourSubstr (   $str,
  $start,
  $length = null 
)
static

Behaves roughly like the function substr() in PHP 7 does.

Paramètres
string$str
int$start
int$length
Exceptions
Ex

Références $start, null, et Core\ourStrlen().

Référencé par Encoding\loadBytesFromChecksummedAsciiSafeString(), Core\pbkdf2(), et Encoding\trimTrailingWhitespace().

◆ pbkdf2()

static pbkdf2 (   $algorithm,
  $password,
  $salt,
  $count,
  $key_length,
  $raw_output = false 
)
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/.

Paramètres
string$algorithmThe hash algorithm to use. Recommended: SHA256
string$passwordThe password.
string$saltA salt that is unique to the password.
int$countIteration count. Higher is better, but slower. Recommended: At least 1000.
int$key_lengthThe length of the derived key in bytes.
bool$raw_outputIf true, the key is returned in raw binary format. Hex encoded otherwise.
Exceptions
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().

◆ secureRandom()

static secureRandom (   $octets)
static

Returns a random byte string of the specified length.

Paramètres
int$octets
Exceptions
Ex

Référencé par Key\createNewRandomKey(), Crypto\encryptInternal(), et Core\hashEquals().

Documentation des champs

◆ AUTHENTICATION_INFO_STRING

const AUTHENTICATION_INFO_STRING = 'DefusePHP|V2|KeyForAuthentication'

◆ BLOCK_BYTE_SIZE

const BLOCK_BYTE_SIZE = 16

◆ BUFFER_BYTE_SIZE

const BUFFER_BYTE_SIZE = 1048576

◆ CIPHER_METHOD

const CIPHER_METHOD = 'aes-256-ctr'

◆ CURRENT_VERSION

const CURRENT_VERSION = "\xDE\xF5\x02\x00"

Référencé par Crypto\encryptInternal().

◆ ENCRYPTION_INFO_STRING

const ENCRYPTION_INFO_STRING = 'DefusePHP|V2|KeyForEncryption'

◆ HASH_FUNCTION_NAME

◆ HEADER_VERSION_SIZE

const HEADER_VERSION_SIZE = 4

◆ KEY_BYTE_SIZE

const KEY_BYTE_SIZE = 32

◆ LEGACY_AUTHENTICATION_INFO_STRING

const LEGACY_AUTHENTICATION_INFO_STRING = 'DefusePHP|KeyForAuthentication'

◆ LEGACY_BLOCK_BYTE_SIZE

const LEGACY_BLOCK_BYTE_SIZE = 16

◆ LEGACY_CIPHER_METHOD

const LEGACY_CIPHER_METHOD = 'aes-128-cbc'

◆ LEGACY_ENCRYPTION_INFO_STRING

const LEGACY_ENCRYPTION_INFO_STRING = 'DefusePHP|KeyForEncryption'

◆ LEGACY_HASH_FUNCTION_NAME

const LEGACY_HASH_FUNCTION_NAME = 'sha256'

◆ LEGACY_KEY_BYTE_SIZE

const LEGACY_KEY_BYTE_SIZE = 16

◆ LEGACY_MAC_BYTE_SIZE

const LEGACY_MAC_BYTE_SIZE = 32

◆ MAC_BYTE_SIZE

const MAC_BYTE_SIZE = 32

◆ MINIMUM_CIPHERTEXT_SIZE

const MINIMUM_CIPHERTEXT_SIZE = 84

◆ SALT_BYTE_SIZE


La documentation de cette classe a été générée à partir du fichier suivant :