class PasswordEncryptor_PHPHash extends PasswordEncryptor

Encryption using built-in hash types in PHP.

Please note that the implemented algorithms depend on the PHP distribution and architecture.

Methods

static Array
get_encryptors()

No description

create_for_algorithm(String $algorithm)

No description

String
encrypt(String $password, String $salt = null, Member $member = null)

Return a string value stored in the {@link Member->Password} property.

String
salt(String $password, Member $member = null)

Return a string value stored in the {@link Member->Salt} property.

check($hash, $password, $salt = null, $member = null)

This usually just returns a strict string comparison, but is necessary for retain compatibility with password hashed with flawed algorithms - see {@link PasswordEncryptor_LegacyPHPHash} and {@link PasswordEncryptor_Blowfish}

__construct(String $algorithm)

No description

string
getAlgorithm()

No description

Details

in PasswordEncryptor at line 25
static Array get_encryptors()

Return Value

Array Map of encryptor code to the used class.

in PasswordEncryptor at line 34
static PasswordEncryptor create_for_algorithm(String $algorithm)

Parameters

String $algorithm

Return Value

PasswordEncryptor

Exceptions

PasswordEncryptor_NotFoundException

at line 295
String encrypt(String $password, String $salt = null, Member $member = null)

Return a string value stored in the {@link Member->Password} property.

The password should be hashed with {@link salt()} if applicable.

Parameters

String $password Cleartext password to be hashed
String $salt (Optional)
Member $member (Optional)

Return Value

String Maximum of 512 characters.

in PasswordEncryptor at line 78
String salt(String $password, Member $member = null)

Return a string value stored in the {@link Member->Salt} property.

Parameters

String $password Cleartext password
Member $member (Optional)

Return Value

String Maximum of 50 characters

in PasswordEncryptor at line 89
check($hash, $password, $salt = null, $member = null)

This usually just returns a strict string comparison, but is necessary for retain compatibility with password hashed with flawed algorithms - see {@link PasswordEncryptor_LegacyPHPHash} and {@link PasswordEncryptor_Blowfish}

Parameters

$hash
$password
$salt
$member

at line 278
__construct(String $algorithm)

Parameters

String $algorithm A PHP built-in hashing algorithm as defined by hash_algos()

at line 291
string getAlgorithm()

Return Value

string