PHP Класс Dcrypt\Cryptobase

Автор: Michael Meyer (mmeyer2k) ([email protected])
Показать файл Открыть проект

Защищенные методы

Метод Описание
checksum ( string $cyphertext, string $iv, string $key, string $cipher = 'rijndael-128', string $mode = 'cbc', string $algo = 'sha256' ) : string Create a message authentication checksum.
checksumVerify ( string $calculated, string $supplied ) Verify checksum during decryption step and throw error if mismatching.
key ( string $password, string $iv, integer $cost, string $cipher = 'rijndael-128', string $mode = 'cbc', string $algo = 'sha256' ) : string Transform password into key and perform iterative HMAC (if specified)

Приватные методы

Метод Описание
hashNormalize ( string $hash, integer $size, string $algo ) : string This will normalize a hash to a certain length by extending it if too short and truncating it if too long. This ensures that any hash algo will work with any combination of other settings. However, it is probably best to make sure that the keysize and algo size are identical so that the input hash passes through unchanged.

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

checksum() защищенный статический Метод

Create a message authentication checksum.
protected static checksum ( string $cyphertext, string $iv, string $key, string $cipher = 'rijndael-128', string $mode = 'cbc', string $algo = 'sha256' ) : string
$cyphertext string Cyphertext that needs a checksum.
$iv string Initialization vector.
$key string HMAC key
$cipher string Cipher string
$mode string Cipher mode string
$algo string Hashing algorithm to use for internal operations
Результат string

checksumVerify() защищенный статический Метод

Verify checksum during decryption step and throw error if mismatching.
protected static checksumVerify ( string $calculated, string $supplied )
$calculated string
$supplied string

key() защищенный статический Метод

Transform password into key and perform iterative HMAC (if specified)
protected static key ( string $password, string $iv, integer $cost, string $cipher = 'rijndael-128', string $mode = 'cbc', string $algo = 'sha256' ) : string
$password string Encryption key
$iv string Initialization vector
$cost integer Number of HMAC iterations to perform on key
$cipher string Mcrypt cipher
$mode string Mcrypt block mode
$algo string Hashing algorithm to use for internal operations
Результат string