PHP Класс phpseclib\Crypt\RC4

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

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

Свойство Тип Описание
$block_size integer RC4 is a stream cipher so we the block_size to 0
$cipher_name_mcrypt string The mcrypt specific name of the cipher
$key string The Key
$key_length integer Key Length (in bytes)
$stream array The Key Stream for decryption and encryption
$use_inline_crypt mixed Holds whether performance-optimized $inline_crypt() can/should be used.

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

Метод Описание
__construct ( ) : RC4 Default Constructor.
_crypt ( string $text, integer $mode ) : string Encrypts or decrypts a message.
_decryptBlock ( string $in ) Decrypts a block
_encryptBlock ( string $in ) Encrypts a block
_setupKey ( ) Setup the key (expansion)
decrypt ( string $ciphertext ) : string Decrypts a message.
encrypt ( string $plaintext ) : string Encrypts a message.
isValidEngine ( integer $engine ) : boolean Test for engine validity
setKey ( $key ) Sets the key length
setKeyLength ( integer $length ) Sets the key length
usesIV ( ) : boolean RC4 does not use an IV

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

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

Default Constructor.
См. также: phpseclib\Crypt\Common\SymmetricKey::__construct()
public __construct ( ) : RC4
Результат RC4

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

Encrypts or decrypts a message.
См. также: self::encrypt()
См. также: self::decrypt()
public _crypt ( string $text, integer $mode ) : string
$text string
$mode integer
Результат string $text

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

Decrypts a block
public _decryptBlock ( string $in )
$in string

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

Encrypts a block
public _encryptBlock ( string $in )
$in string

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

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

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

$this->decrypt($this->encrypt($plaintext)) == $this->encrypt($this->encrypt($plaintext)). At least if the continuous buffer is disabled.
См. также: phpseclib\Crypt\Common\SymmetricKey::encrypt()
См. также: self::_crypt()
public decrypt ( string $ciphertext ) : string
$ciphertext string
Результат string $plaintext

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

Encrypts a message.
См. также: phpseclib\Crypt\Common\SymmetricKey::decrypt()
См. также: self::_crypt()
public encrypt ( string $plaintext ) : string
$plaintext string
Результат string $ciphertext

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

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

Keys can be between 1 and 256 bytes long.
public setKey ( $key )

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

Keys can be between 1 and 256 bytes long.
public setKeyLength ( integer $length )
$length integer

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

RC4 does not use an IV
public usesIV ( ) : boolean
Результат boolean

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

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

RC4 is a stream cipher so we the block_size to 0
См. также: phpseclib\Crypt\Common\SymmetricKey::block_size
public int $block_size
Результат integer

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

The mcrypt specific name of the cipher
См. также: phpseclib\Crypt\Common\SymmetricKey::cipher_name_mcrypt
public string $cipher_name_mcrypt
Результат string

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

The Key
См. также: self::setKey()
public string $key
Результат string

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

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

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

The Key Stream for decryption and encryption
См. также: self::setKey()
public array $stream
Результат array

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

Holds whether performance-optimized $inline_crypt() can/should be used.
См. также: phpseclib\Crypt\Common\SymmetricKey::inline_crypt
public mixed $use_inline_crypt
Результат mixed