\Pydio\Core\Utils\VarsPasswordEncoder

Class PasswordEncoder

Summary

Methods
Properties
Constants
pbkdf2_apply()
pbkdf2_slow_equals()
pbkdf2_validate_password()
pbkdf2_create_hash()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

pbkdf2_apply()

pbkdf2_apply(  $algorithm,   $password,   $salt,   $count,   $key_length, boolean  $raw_output = false) : string

PBKDF2 key derivation function as defined by RSA's PKCS #5: https://www.ietf.org/rfc/rfc2898.txt $algorithm - The hash algorithm to use. Recommended: SHA256 $password - The password.

$salt - A salt that is unique to the password. $count - Iteration count. Higher is better, but slower. Recommended: At least 1000. $key_length - The length of the derived key in bytes. $raw_output - If true, the key is returned in raw binary format. Hex encoded otherwise. Returns: A $key_length-byte key derived from the password and salt.

Test vectors can be found here: https://www.ietf.org/rfc/rfc6070.txt

This implementation of PBKDF2 was originally created by https://defuse.ca With improvements by http://www.variations-of-shadow.com

Parameters

$algorithm
$password
$salt
$count
$key_length
boolean $raw_output

Throws

\Pydio\Core\Exception\PydioException

Returns

string

pbkdf2_slow_equals()

pbkdf2_slow_equals(  $a,   $b) : boolean

Compares two strings $a and $b in length-constant time.

Parameters

$a
$b

Returns

boolean

pbkdf2_validate_password()

pbkdf2_validate_password(  $password,   $correct_hash) : boolean

Parameters

$password
$correct_hash

Throws

\Pydio\Core\Exception\PydioException

Returns

boolean

pbkdf2_create_hash()

pbkdf2_create_hash(  $password) : string

Parameters

$password

Throws

\Pydio\Core\Exception\PydioException

Returns

string