Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques | |
encrypt ($plaintext) | |
decrypt ($ciphertext) | |
setNonce ($nonce) | |
Fonctions membres publiques hérités de Salsa20 | |
usesNonce () | |
setKey ($key) | |
setNonce ($nonce) | |
setCounter ($counter) | |
encrypt ($plaintext) | |
decrypt ($ciphertext) | |
Fonctions membres publiques hérités de StreamCipher | |
__construct () | |
usesIV () | |
Fonctions membres publiques hérités de SymmetricKey | |
__construct ($mode) | |
setIV ($iv) | |
enablePoly1305 () | |
setPoly1305Key ($key=null) | |
setNonce ($nonce) | |
setAAD ($aad) | |
usesIV () | |
usesNonce () | |
getKeyLength () | |
getBlockLength () | |
getBlockLengthInBytes () | |
setKeyLength ($length) | |
setKey ($key) | |
setPassword ($password, $method='pbkdf2',... $func_args) | |
encrypt ($plaintext) | |
decrypt ($ciphertext) | |
getTag ($length=16) | |
setTag ($tag) | |
enablePadding () | |
disablePadding () | |
enableContinuousBuffer () | |
disableContinuousBuffer () | |
isValidEngine ($engine) | |
setPreferredEngine ($engine) | |
getEngine () | |
getMode () | |
Fonctions membres protégées | |
isValidEngineHelper ($engine) | |
setup () | |
Fonctions membres protégées hérités de Salsa20 | |
createPoly1305Key () | |
setup () | |
setupKey () | |
encryptBlock ($in) | |
decryptBlock ($in) | |
poly1305 ($ciphertext) | |
Fonctions membres protégées hérités de SymmetricKey | |
getIV ($iv) | |
openssl_translate_mode () | |
isValidEngineHelper ($engine) | |
setEngine () | |
encryptBlock ($in) | |
decryptBlock ($in) | |
setupKey () | |
setup () | |
pad ($text) | |
unpad ($text) | |
createInlineCryptFunction ($cipher_code) | |
poly1305 ($text) | |
Fonctions membres protégées statiques | |
static | quarterRound (&$a, &$b, &$c, &$d) |
static | doubleRound (&$x0, &$x1, &$x2, &$x3, &$x4, &$x5, &$x6, &$x7, &$x8, &$x9, &$x10, &$x11, &$x12, &$x13, &$x14, &$x15) |
static | salsa20 ($x) |
Fonctions membres protégées statiques hérités de Salsa20 | |
static | leftRotate ($x, $n) |
static | quarterRound (&$a, &$b, &$c, &$d) |
static | doubleRound (&$x0, &$x1, &$x2, &$x3, &$x4, &$x5, &$x6, &$x7, &$x8, &$x9, &$x10, &$x11, &$x12, &$x13, &$x14, &$x15) |
static | salsa20 ($x) |
Fonctions membres protégées statiques hérités de SymmetricKey | |
static | safe_intval ($x) |
static | safe_intval_inline () |
static | nullPad128 ($str) |
Attributs protégés | |
$cipher_name_openssl = 'chacha20' | |
Attributs protégés hérités de Salsa20 | |
$p1 = false | |
$p2 = false | |
$key_length = 32 | |
$enbuffer | |
$debuffer | |
$counter = 0 | |
$usingGeneratedPoly1305Key = false | |
Attributs protégés hérités de StreamCipher | |
$block_size = 0 | |
Attributs protégés hérités de SymmetricKey | |
$mode | |
$block_size = 16 | |
$key = false | |
$iv = false | |
$encryptIV | |
$decryptIV | |
$continuousBuffer = false | |
$enbuffer | |
$debuffer | |
$cfb_init_len = 600 | |
$changed = true | |
$nonIVChanged = true | |
$engine | |
$cipher_name_mcrypt | |
$cipher_name_openssl | |
$cipher_name_openssl_ecb | |
$inline_crypt | |
$explicit_key_length = false | |
$aad = '' | |
$newtag = false | |
$oldtag = false | |
$poly1305Key | |
$usePoly1305 = false | |
$nonce = false | |
Fonctions membres privées | |
encrypt_with_libsodium ($plaintext) | |
decrypt_with_libsodium ($ciphertext) | |
Membres hérités additionnels | |
Champs de données hérités de Salsa20 | |
const | ENCRYPT = 0 |
const | DECRYPT = 1 |
Champs de données hérités de SymmetricKey | |
const | MODE_CTR = -1 |
const | MODE_ECB = 1 |
const | MODE_CBC = 2 |
const | MODE_CFB = 3 |
const | MODE_CFB8 = 7 |
const | MODE_OFB8 = 8 |
const | MODE_OFB = 4 |
const | MODE_GCM = 5 |
const | MODE_STREAM = 6 |
const | MODE_MAP |
const const | ENGINE_INTERNAL = 1 |
const | ENGINE_EVAL = 2 |
const | ENGINE_MCRYPT = 3 |
const | ENGINE_OPENSSL = 4 |
const | ENGINE_LIBSODIUM = 5 |
const | ENGINE_OPENSSL_GCM = 6 |
const | ENGINE_MAP |
decrypt | ( | $ciphertext | ) |
Decrypts a message.
$this->decrypt($this->encrypt($plaintext)) == $this->encrypt($this->encrypt($plaintext)). At least if the continuous buffer is disabled.
string | $ciphertext |
Références ChaCha20\decrypt_with_libsodium(), et ChaCha20\setup().
|
private |
Decrypts a message with libsodium
string | $ciphertext |
Références SymmetricKey\$aad, SymmetricKey\$key, SymmetricKey\$newtag, SymmetricKey\$nonce, $params, et Salsa20\poly1305().
Référencé par ChaCha20\decrypt().
|
staticprotected |
The doubleround function
int | $x0 | (by reference) |
int | $x1 | (by reference) |
int | $x2 | (by reference) |
int | $x3 | (by reference) |
int | $x4 | (by reference) |
int | $x5 | (by reference) |
int | $x6 | (by reference) |
int | $x7 | (by reference) |
int | $x8 | (by reference) |
int | $x9 | (by reference) |
int | $x10 | (by reference) |
int | $x11 | (by reference) |
int | $x12 | (by reference) |
int | $x13 | (by reference) |
int | $x14 | (by reference) |
int | $x15 | (by reference) |
encrypt | ( | $plaintext | ) |
Encrypts a message.
string | $plaintext |
Références ChaCha20\encrypt_with_libsodium(), et ChaCha20\setup().
|
private |
Encrypts a message with libsodium
string | $plaintext |
Références SymmetricKey\$aad, SymmetricKey\$key, SymmetricKey\$nonce, $params, et Salsa20\poly1305().
Référencé par ChaCha20\encrypt().
|
protected |
Test for engine validity
This is mainly just a wrapper to set things up for ::isValidEngine()
int | $engine | protected |
Références SymmetricKey\$continuousBuffer, SymmetricKey\$engine, et counter.
|
staticprotected |
|
staticprotected |
The Salsa20 hash function function
On my laptop this loop unrolled / function dereferenced version of parent::salsa20 encrypts 1mb of text in 0.65s vs the 0.85s that it takes with the parent method.
If we were free to assume that the host OS would always be 64-bits then the if condition in leftRotate could be eliminated and we could knock this done to 0.60s.
For comparison purposes, RC4 takes 0.16s and AES in CTR mode with the Eval engine takes 0.48s. AES in CTR mode with the PHP engine takes 1.19s. Salsa20 / ChaCha20 do not benefit as much from the Eval approach due to the fact that there are a lot less variables to de-reference, fewer loops to unroll, etc
string | $x |
setNonce | ( | $nonce | ) |
Sets the nonce.
string | $nonce |
Références SymmetricKey\$nonce, et SymmetricKey\setEngine().
|
protected |
Setup the self::ENGINE_INTERNAL $engine
(re)init, if necessary, the internal cipher $engine
_setup() will be called each time if $changed === true typically this happens when using one or more of following public methods:
Références Salsa20\$counter, SymmetricKey\$key, SymmetricKey\$nonce, Salsa20\$p2, et Salsa20\createPoly1305Key().
Référencé par ChaCha20\decrypt(), et ChaCha20\encrypt().
|
protected |