PHP 클래스 Dcrypt\Cryptobase

파일 보기 프로젝트 열기: dopecode/dcrypt

보호된 메소드들

메소드 설명
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