PHP 클래스 Neos\Flow\Security\Cryptography\Pbkdf2HashingStrategy

상속: implements Neos\Flow\Security\Cryptography\PasswordHashingStrategyInterface
파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$algorithm string Hash algorithm to use, see hash_algos()
$derivedKeyLength integer Derived key length
$dynamicSaltLength integer Length of the dynamic random salt to generate in bytes
$iterationCount integer Hash iteration count, high counts (>10.000) make brute-force attacks unfeasible

공개 메소드들

메소드 설명
__construct ( integer $dynamicSaltLength, integer $iterationCount, integer $derivedKeyLength, string $algorithm ) Construct a PBKDF2 hashing strategy with the given parameters
hashPassword ( string $password, string $staticSalt = null ) : string Hash a password for storage using PBKDF2 and the configured parameters.
validatePassword ( string $password, string $hashedPasswordAndSalt, string $staticSalt = null ) : boolean Validate a password against a derived key (hashed password) and salt using PBKDF2.

메소드 상세

__construct() 공개 메소드

Construct a PBKDF2 hashing strategy with the given parameters
public __construct ( integer $dynamicSaltLength, integer $iterationCount, integer $derivedKeyLength, string $algorithm )
$dynamicSaltLength integer Length of the dynamic random salt to generate in bytes
$iterationCount integer Hash iteration count, high counts (>10.000) make brute-force attacks unfeasible
$derivedKeyLength integer Derived key length
$algorithm string Hash algorithm to use, see hash_algos()

hashPassword() 공개 메소드

Will use a combination of a random dynamic salt and the given static salt.
public hashPassword ( string $password, string $staticSalt = null ) : string
$password string Cleartext password that should be hashed
$staticSalt string Static salt that will be appended to the random dynamic salt
리턴 string A Base64 encoded string with the derived key (hashed password) and dynamic salt

validatePassword() 공개 메소드

Iteration count and algorithm have to match the parameters when generating the derived key.
public validatePassword ( string $password, string $hashedPasswordAndSalt, string $staticSalt = null ) : boolean
$password string The cleartext password
$hashedPasswordAndSalt string The derived key and salt in Base64 encoding as returned by hashPassword for verification
$staticSalt string Static salt that will be appended to the dynamic salt
리턴 boolean TRUE if the given password matches the hashed password

프로퍼티 상세

$algorithm 보호되어 있는 프로퍼티

Hash algorithm to use, see hash_algos()
protected string $algorithm
리턴 string

$derivedKeyLength 보호되어 있는 프로퍼티

Derived key length
protected int $derivedKeyLength
리턴 integer

$dynamicSaltLength 보호되어 있는 프로퍼티

Length of the dynamic random salt to generate in bytes
protected int $dynamicSaltLength
리턴 integer

$iterationCount 보호되어 있는 프로퍼티

Hash iteration count, high counts (>10.000) make brute-force attacks unfeasible
protected int $iterationCount
리턴 integer