Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques | |
__construct ($mode) | |
setIV ($iv) | |
setKeyLength ($length) | |
setKey ($key) | |
encrypt ($plaintext) | |
decrypt ($ciphertext) | |
enableContinuousBuffer () | |
disableContinuousBuffer () | |
setPreferredEngine ($engine) | |
Fonctions membres publiques hérités de DES | |
__construct ($mode) | |
setKey ($key) | |
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 () | |
Champs de données | |
const | MODE_3CBC = -2 |
const | MODE_CBC3 = self::MODE_CBC |
Champs de données hérités de DES | |
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 |
Fonctions membres protégées | |
isValidEngineHelper ($engine) | |
setupKey () | |
Fonctions membres protégées hérités de DES | |
isValidEngineHelper ($engine) | |
encryptBlock ($in) | |
decryptBlock ($in) | |
setupKey () | |
setupInlineCrypt () | |
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) | |
Attributs protégés | |
$key_length = 24 | |
$cipher_name_mcrypt = 'tripledes' | |
$cfb_init_len = 750 | |
$key_length_max = 24 | |
Attributs protégés hérités de DES | |
$block_size = 8 | |
$key_length = 8 | |
$cipher_name_mcrypt = 'des' | |
$openssl_mode_names | |
$cfb_init_len = 500 | |
$des_rounds = 1 | |
$key_length_max = 8 | |
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 | |
Attributs privés | |
$mode_3cbc | |
$des | |
Membres hérités additionnels | |
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 statiques hérités de DES | |
static | $shuffle |
static | $ipmap |
static | $invipmap |
static | $sbox1 |
static | $sbox2 |
static | $sbox3 |
static | $sbox4 |
static | $sbox5 |
static | $sbox6 |
static | $sbox7 |
static | $sbox8 |
__construct | ( | $mode | ) |
Default Constructor.
Determines whether or not the mcrypt or OpenSSL extensions should be used.
$mode could be:
string | $mode | public |
Références SymmetricKey\$mode, et Symfony\Contracts\Service\__construct().
decrypt | ( | $ciphertext | ) |
Decrypts a message.
string | $ciphertext |
Références TripleDES\encrypt(), et SymmetricKey\unpad().
Référencé par TripleDES\encrypt().
disableContinuousBuffer | ( | ) |
Treat consecutive packets as if they are a discontinuous buffer.
The default behavior.
enableContinuousBuffer | ( | ) |
Treat consecutive "packets" as if they are a continuous buffer.
Say you have a 16-byte plaintext $plaintext. Using the default behavior, the two following code snippets will yield different outputs:
echo $des->encrypt(substr($plaintext, 0, 8)); echo $des->encrypt(substr($plaintext, 8, 8));
echo $des->encrypt($plaintext);
The solution is to enable the continuous buffer. Although this will resolve the above discrepancy, it creates another, as demonstrated with the following:
$des->encrypt(substr($plaintext, 0, 8)); echo $des->decrypt($des->encrypt(substr($plaintext, 8, 8)));
echo $des->decrypt($des->encrypt(substr($plaintext, 8, 8)));
With the continuous buffer disabled, these would yield the same output. With it enabled, they yield different outputs. The reason is due to the fact that the initialization vector's change after every encryption / decryption round when the continuous buffer is enabled. When it's disabled, they remain constant.
Put another way, when the continuous buffer is enabled, the state of the () object changes after each encryption / decryption round, whereas otherwise, it'd remain constant. For this reason, it's recommended that continuous buffers not be used. They do offer better security and are, in fact, sometimes required (SSH uses them), however, they are also less intuitive and more likely to cause you problems.
encrypt | ( | $plaintext | ) |
Encrypts a message.
string | $plaintext |
Références TripleDES\decrypt(), et SymmetricKey\pad().
Référencé par TripleDES\decrypt().
|
protected |
Test for engine validity
This is mainly just a wrapper to set things up for ::isValidEngine()
int | $engine | protected |
Références SymmetricKey\$engine, SymmetricKey\$mode, et SymmetricKey\openssl_translate_mode().
setIV | ( | $iv | ) |
Sets the initialization vector.
SetIV is not required when ::MODE_ECB is being used.
string | $iv |
Références SymmetricKey\$iv.
setKey | ( | $key | ) |
Sets the key.
Triple DES can use 128-bit (eg. strlen($key) == 16) or 192-bit (eg. strlen($key) == 24) keys.
DES also requires that every eighth bit be a parity bit, however, we'll ignore that.
public
Références SymmetricKey\$key, et SymmetricKey\setEngine().
setKeyLength | ( | $length | ) |
Sets the key length.
Valid key lengths are 128 and 192 bits.
If you want to use a 64-bit key use DES.php
setPreferredEngine | ( | $engine | ) |
Sets the internal crypt engine
int | $engine | public |
Références SymmetricKey\$engine.
|
protected |
Creates the key schedule
|
protected |
|
protected |
|
private |
|
protected |
|
protected |
|
private |
const MODE_3CBC = -2 |
Encrypt / decrypt using inner chaining
Inner chaining is used by SSH-1 and is generally considered to be less secure then outer chaining (self::MODE_CBC3).
const MODE_CBC3 = self::MODE_CBC |
Encrypt / decrypt using outer chaining
Outer chaining is used by SSH-2 and when the mode is set to ::MODE_CBC.