PHP 클래스 phpseclib\Crypt\RC2

상속: extends phpseclib\Crypt\Common\BlockCipher
파일 보기 프로젝트 열기: phpseclib/phpseclib 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$block_size integer Block Length of the cipher
$cfb_init_len integer Optimizing value while CFB-encrypting
$cipher_name_mcrypt string The mcrypt specific name of the cipher
$current_key_length integer The key length in bits.
$default_key_length integer The key length in bits.
$invpitable array Inverse key expansion randomization table.
$key string The Key
$key_length integer Key Length (in bytes)
$keys array The Key Schedule
$orig_key string The Original (unpadded) Key
$pitable array Twice the same 256-value sequence to save a modulus in key expansion.
$skip_key_adjustment boolean Don't truncate / null pad key

공개 메소드들

메소드 설명
__construct ( integer $mode ) Default Constructor.
_decryptBlock ( string $in ) : string Decrypts a block
_encryptBlock ( string $in ) : string Encrypts a block
_setupInlineCrypt ( ) Setup the performance-optimized function for de/encrypt()
_setupKey ( ) Creates the key schedule
_setupMcrypt ( ) Setup the \phpseclib\Crypt\Common\SymmetricKey::ENGINE_MCRYPT $engine
decrypt ( string $ciphertext ) : string Decrypts a message.
encrypt ( string $plaintext ) : string Encrypts a message.
getKeyLength ( ) : integer Returns the current key length
isValidEngine ( integer $engine ) : boolean Test for engine validity
setKey ( string $key, integer $t1 = false ) Sets the key.
setKeyLength ( integer $length ) Sets the key length.

메소드 상세

__construct() 공개 메소드

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

_decryptBlock() 공개 메소드

Decrypts a block
또한 보기: phpseclib\Crypt\Common\SymmetricKey::_decryptBlock()
또한 보기: phpseclib\Crypt\Common\SymmetricKey::decrypt()
public _decryptBlock ( string $in ) : string
$in string
리턴 string

_encryptBlock() 공개 메소드

Encrypts a block
또한 보기: phpseclib\Crypt\Common\SymmetricKey::_encryptBlock()
또한 보기: phpseclib\Crypt\Common\SymmetricKey::encrypt()
public _encryptBlock ( string $in ) : string
$in string
리턴 string

_setupInlineCrypt() 공개 메소드

Setup the performance-optimized function for de/encrypt()
또한 보기: phpseclib\Crypt\Common\SymmetricKey::_setupInlineCrypt()
public _setupInlineCrypt ( )

_setupKey() 공개 메소드

Creates the key schedule
또한 보기: phpseclib\Crypt\Common\SymmetricKey::_setupKey()
public _setupKey ( )

_setupMcrypt() 공개 메소드

Setup the \phpseclib\Crypt\Common\SymmetricKey::ENGINE_MCRYPT $engine
또한 보기: phpseclib\Crypt\Common\SymmetricKey::_setupMcrypt()
public _setupMcrypt ( )

decrypt() 공개 메소드

Mostly a wrapper for \phpseclib\Crypt\Common\SymmetricKey::decrypt, with some additional OpenSSL handling code
또한 보기: self::encrypt()
public decrypt ( string $ciphertext ) : string
$ciphertext string
리턴 string $plaintext

encrypt() 공개 메소드

Mostly a wrapper for \phpseclib\Crypt\Common\SymmetricKey::encrypt, with some additional OpenSSL handling code
또한 보기: self::decrypt()
public encrypt ( string $plaintext ) : string
$plaintext string
리턴 string $ciphertext

getKeyLength() 공개 메소드

Returns the current key length
public getKeyLength ( ) : integer
리턴 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

setKey() 공개 메소드

Keys can be of any length. RC2, itself, uses 8 to 1024 bit keys (eg. strlen($key) <= 128), however, we only use the first 128 bytes if $key has more then 128 bytes in it, and set $key to a single null byte if it is empty.
또한 보기: phpseclib\Crypt\Common\SymmetricKey::setKey()
public setKey ( string $key, integer $t1 = false )
$key string
$t1 integer optional Effective key length in bits.

setKeyLength() 공개 메소드

Valid key lengths are 8 to 1024. Calling this function after setting the key has no effect until the next \phpseclib\Crypt\RC2::setKey() call.
public setKeyLength ( integer $length )
$length integer in bits

프로퍼티 상세

$block_size 공개적으로 프로퍼티

Block Length of the cipher
또한 보기: phpseclib\Crypt\Common\SymmetricKey::block_size
public int $block_size
리턴 integer

$cfb_init_len 공개적으로 프로퍼티

Optimizing value while CFB-encrypting
또한 보기: phpseclib\Crypt\Common\SymmetricKey::cfb_init_len
public int $cfb_init_len
리턴 integer

$cipher_name_mcrypt 공개적으로 프로퍼티

The mcrypt specific name of the cipher
또한 보기: phpseclib\Crypt\Common\SymmetricKey::cipher_name_mcrypt
public string $cipher_name_mcrypt
리턴 string

$current_key_length 공개적으로 프로퍼티

The key length in bits.
또한 보기: self::isValidEnine()
또한 보기: self::setKey()
public int $current_key_length
리턴 integer

$default_key_length 공개적으로 프로퍼티

The key length in bits.
또한 보기: self::setKeyLength()
또한 보기: self::setKey()
public int $default_key_length
리턴 integer

$invpitable 공개적으로 프로퍼티

Inverse key expansion randomization table.
또한 보기: self::setKey()
public array $invpitable
리턴 array

$key 공개적으로 프로퍼티

The Key
또한 보기: phpseclib\Crypt\Common\SymmetricKey::key
또한 보기: self::setKey()
public string $key
리턴 string

$key_length 공개적으로 프로퍼티

Key Length (in bytes)
또한 보기: phpseclib\Crypt\RC2::setKeyLength()
public int $key_length
리턴 integer

$keys 공개적으로 프로퍼티

The Key Schedule
또한 보기: self::_setupKey()
public array $keys
리턴 array

$orig_key 공개적으로 프로퍼티

The Original (unpadded) Key
또한 보기: phpseclib\Crypt\Common\SymmetricKey::key
또한 보기: self::setKey()
또한 보기: self::encrypt()
또한 보기: self::decrypt()
public string $orig_key
리턴 string

$pitable 공개적으로 프로퍼티

Twice the same 256-value sequence to save a modulus in key expansion.
또한 보기: self::setKey()
public array $pitable
리턴 array

$skip_key_adjustment 공개적으로 프로퍼티

Don't truncate / null pad key
또한 보기: phpseclib\Crypt\Common\SymmetricKey::_clearBuffers()
public bool $skip_key_adjustment
리턴 boolean