PasswordEncryptor_Blowfish
class PasswordEncryptor_Blowfish extends PasswordEncryptor (View source)
Blowfish encryption - this is the default from SilverStripe 3.
PHP 5.3+ will provide a php implementation if there is no system version available.
Properties
static private array | $encryptors | from PasswordEncryptor |
Methods
No description
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}
Sets the cost of the blowfish algorithm.
Gets the cost that is set for the blowfish algorithm
No description
No description
No description
The algorithm returned by using '$2a$' is not consistent - it might be either the correct (y), incorrect (x) or mostly-correct (a) version, depending on the version of PHP and the operating system, so we need to test it.
Details
static array
get_encryptors()
static PasswordEncryptor
create_for_algorithm(string $algorithm)
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.
string
salt(string $password, Member $member = null)
self::$cost param is forced to be two digits with leading zeroes for ints 4-9
bool
check(string $hash, string $password, string $salt = null, Member $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}
static
set_cost(int $cost)
Sets the cost of the blowfish algorithm.
See {@link PasswordEncryptor_Blowfish::$cost} Cost is set as an integer but Ensure that set values are from 4-31
static int
get_cost()
Gets the cost that is set for the blowfish algorithm
encryptX($password, $salt)
encryptY($password, $salt)
encryptA($password, $salt)
checkAEncryptionLevel()
The algorithm returned by using '$2a$' is not consistent - it might be either the correct (y), incorrect (x) or mostly-correct (a) version, depending on the version of PHP and the operating system, so we need to test it.