PHP 클래스 Dcrypt\Hash

16 bytes => iv 12 bytes => cost checksum 4 bytes => cost 32 bytes => hmac ivivivivivivivivsssssssssssscosthmachmachmachmachmachmachmachmac
상속: extends Support
파일 보기 프로젝트 열기: dopecode/dcrypt 1 사용 예제들

공개 메소드들

메소드 설명
ihmac ( string $data, string $key, integer $iter, string $algo = 'sha256' ) : string Perform a raw iterative HMAC operation with a configurable algo.
make ( string $input, string $password, integer $cost = 250000 ) : string Hash an input string into a salted 512 byte hash.
verify ( string $input, string $hash, string $password ) : boolean Check the validity of a hash.

비공개 메소드들

메소드 설명
build ( string $input, string $password, integer $cost, string | null $salt = null ) : string Internal function used to build the actual hash.
cost ( integer $cost ) : integer Return a normalized cost value.
costHash ( $cost, $salt, $password )

메소드 상세

ihmac() 공개 정적인 메소드

This class always performs at least one hash to prevent the input from being passed back unchanged if bad parameters are set.
public static ihmac ( string $data, string $key, integer $iter, string $algo = 'sha256' ) : string
$data string Data to hash.
$key string Key to use to authenticate the hash.
$iter integer Number of times to iteratate the hash
$algo string Name of algo (sha256 or sha512 recommended)
리턴 string

make() 공개 정적인 메소드

Hash an input string into a salted 512 byte hash.
public static make ( string $input, string $password, integer $cost = 250000 ) : string
$input string Data to hash.
$password string HMAC validation password.
$cost integer Cost value of the hash.
리턴 string

verify() 공개 정적인 메소드

Check the validity of a hash.
public static verify ( string $input, string $hash, string $password ) : boolean
$input string Input to test.
$hash string Known hash to validate against.
$password string HMAC password to use during iterative hash.
리턴 boolean