PHP Класс phpseclib\Crypt\Rijndael

Автор: Jim Wigginton ([email protected])
Наследование: extends phpseclib\Crypt\Base
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$Nb integer The Block Length divided by 32
$Nk integer The Key Length divided by 32
$Nr integer The Number of Rounds
$c array Shift offsets
$cipher_name_mcrypt string Mcrypt is useable for 128/192/256-bit $block_size/$key_length. For 160/224 not. \phpseclib\Crypt\Rijndael determines automatically whether mcrypt is useable or not for the current $block_size/$key_length. In case of, $cipher_name_mcrypt will be set dynamically at run time accordingly.
$dw array The Inverse Key Schedule
$key_length integer The Key Length (in bytes)
$kl array Holds the last used key- and block_size information
$password_default_salt string The default salt used by setPassword()
$w array The Key Schedule

Открытые методы

Метод Описание
__construct ( integer $mode ) Default Constructor.
_decryptBlock ( string $in ) : string Decrypts a block
_encryptBlock ( string $in ) : string Encrypts a block
_getInvTables ( ) : array Provides the inverse mixColumns and inverse sboxes tables
_getTables ( ) : array Provides the mixColumns and sboxes tables
_setupInlineCrypt ( ) Setup the performance-optimized function for de/encrypt()
_setupKey ( ) Setup the key (expansion)
_subWord ( integer $word ) Performs S-Box substitutions
isValidEngine ( integer $engine ) : boolean Test for engine validity
setBlockLength ( integer $length ) Sets the block length
setKey ( string $key ) Sets the key.
setKeyLength ( integer $length ) Sets the key length.

Описание методов

__construct() публичный Метод

Default Constructor.
public __construct ( integer $mode )
$mode integer

_decryptBlock() публичный Метод

Decrypts a block
public _decryptBlock ( string $in ) : string
$in string
Результат string

_encryptBlock() публичный Метод

Encrypts a block
public _encryptBlock ( string $in ) : string
$in string
Результат string

_getInvTables() публичный Метод

Provides the inverse mixColumns and inverse sboxes tables
См. также: self::_decryptBlock()
См. также: self::_setupInlineCrypt()
См. также: self::_setupKey()
public _getInvTables ( ) : array
Результат array &$tables

_getTables() публичный Метод

Provides the mixColumns and sboxes tables
См. также: self::_encryptBlock()
См. также: self::_setupInlineCrypt()
См. также: self::_subWord()
public _getTables ( ) : array
Результат array &$tables

_setupInlineCrypt() публичный Метод

Setup the performance-optimized function for de/encrypt()
См. также: phpseclib\Crypt\Common\SymmetricKey::_setupInlineCrypt()
public _setupInlineCrypt ( )

_setupKey() публичный Метод

Setup the key (expansion)
См. также: phpseclib\Crypt\Common\SymmetricKey::_setupKey()
public _setupKey ( )

_subWord() публичный Метод

Performs S-Box substitutions
public _subWord ( integer $word )
$word integer

isValidEngine() публичный Метод

This is mainly just a wrapper to set things up for \phpseclib\Crypt\Common\SymmetricKey::isValidEngine()
См. также: phpseclib\Crypt\Common\SymmetricKey::__construct()
public isValidEngine ( integer $engine ) : boolean
$engine integer
Результат boolean

setBlockLength() публичный Метод

Valid block lengths are 128, 160, 192, 224, and 256.
public setBlockLength ( integer $length )
$length integer

setKey() публичный Метод

Rijndael supports five different key lengths
См. также: setKeyLength()
public setKey ( string $key )
$key string

setKeyLength() публичный Метод

Valid key lengths are 128, 160, 192, 224, and 256. Note: phpseclib extends Rijndael (and AES) for using 160- and 224-bit keys but they are officially not defined and the most (if not all) implementations are not able using 160/224-bit keys but round/pad them up to 192/256 bits as, for example, mcrypt will do. That said, if you want be compatible with other Rijndael and AES implementations, you should not setKeyLength(160) or setKeyLength(224). Additional: In case of 160- and 224-bit keys, phpseclib will/can, for that reason, not use the mcrypt php extension, even if available. This results then in slower encryption.
public setKeyLength ( integer $length )
$length integer

Описание свойств

$Nb публичное свойство

The Block Length divided by 32
См. также: self::setBlockLength()
public int $Nb
Результат integer

$Nk публичное свойство

The Key Length divided by 32
См. также: self::setKeyLength()
public int $Nk
Результат integer

$Nr публичное свойство

The Number of Rounds
public int $Nr
Результат integer

$c публичное свойство

Shift offsets
public array $c
Результат array

$cipher_name_mcrypt публичное свойство

Mcrypt is useable for 128/192/256-bit $block_size/$key_length. For 160/224 not. \phpseclib\Crypt\Rijndael determines automatically whether mcrypt is useable or not for the current $block_size/$key_length. In case of, $cipher_name_mcrypt will be set dynamically at run time accordingly.
См. также: phpseclib\Crypt\Common\SymmetricKey::cipher_name_mcrypt
См. также: phpseclib\Crypt\Common\SymmetricKey::engine
См. также: self::isValidEngine()
public string $cipher_name_mcrypt
Результат string

$dw публичное свойство

The Inverse Key Schedule
См. также: self::_setup()
public array $dw
Результат array

$key_length публичное свойство

The Key Length (in bytes)
См. также: self::setKeyLength()
public int $key_length
Результат integer

$kl публичное свойство

Holds the last used key- and block_size information
public array $kl
Результат array

$password_default_salt публичное свойство

The default salt used by setPassword()
См. также: phpseclib\Crypt\Common\SymmetricKey::password_default_salt
См. также: phpseclib\Crypt\Common\SymmetricKey::setPassword()
public string $password_default_salt
Результат string

$w публичное свойство

The Key Schedule
См. также: self::_setup()
public array $w
Результат array