Method | Description | |
---|---|---|
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) |
Method | Description | |
---|---|---|
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. |
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 |
return | string |
protected static checksumVerify ( string $calculated, string $supplied ) | ||
$calculated | string | |
$supplied | string |
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 |
return | string |