![]() |
TYPO3
7.6
|
Public Member Functions | |
getHashCount () | |
getMaxHashCount () | |
isAvailable () | |
getMinHashCount () | |
getSaltLength () | |
getSetting () | |
isHashUpdateNeeded ($saltedPW) | |
isValidSalt ($salt) | |
isValidSaltedPW ($saltedPW) | |
setHashCount ($hashCount=null) | |
setMaxHashCount ($maxHashCount=null) | |
setMinHashCount ($minHashCount=null) | |
![]() | |
checkPassword ($plainPW, $saltedHashPW) | |
getHashedPassword ($password, $salt=null) | |
isAvailable () | |
getSaltLength () | |
getSetting () | |
isHashUpdateNeeded ($passString) | |
isValidSalt ($salt) | |
isValidSaltedPW ($saltedPW) | |
![]() | |
base64Encode ($input, $count) | |
Public Attributes | |
const | HASH_COUNT = 7 |
const | MAX_HASH_COUNT = 17 |
const | MIN_HASH_COUNT = 4 |
![]() | |
const | ITOA64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' |
Protected Member Functions | |
applySettingsToSalt ($salt) | |
getCountLog2 ($setting) | |
![]() | |
applySettingsToSalt ($salt) | |
getGeneratedSalt () | |
getItoa64 () | |
getSaltSuffix () | |
![]() | |
applySettingsToSalt ($salt) | |
getGeneratedSalt () | |
getItoa64 () | |
getSetting () | |
getLengthBase64FromBytes ($byteLength) | |
Static Protected Attributes | |
static | $hashCount |
static | $maxHashCount |
static | $minHashCount |
static | $saltLengthBlowfish = 16 |
static | $settingBlowfish = '$2a$' |
![]() | |
static | $saltLengthMD5 = 6 |
static | $saltSuffixMD5 = '$' |
static | $settingMD5 = '$1$' |
Class that implements Blowfish salted hashing based on PHP's crypt() function.
Warning: Blowfish salted hashing with PHP's crypt() is not available on every system.
Definition at line 24 of file BlowfishSalt.php.
|
protected |
Method applies settings (prefix, hash count) to a salt.
Overwrites Md5Salt::applySettingsToSalt() with Blowfish specifics.
string | $salt | A salt to apply setting to |
Definition at line 90 of file BlowfishSalt.php.
References BlowfishSalt\getHashCount(), AbstractSalt\getLengthBase64FromBytes(), BlowfishSalt\getSaltLength(), and BlowfishSalt\getSetting().
|
protected |
Parses the log2 iteration count from a stored hash or setting string.
string | $setting | Complete hash or a hash's setting string or to get log2 iteration count from |
Definition at line 107 of file BlowfishSalt.php.
References BlowfishSalt\getSetting().
Referenced by BlowfishSalt\isHashUpdateNeeded().
getHashCount | ( | ) |
Method returns log2 number of iterations for password stretching.
Definition at line 127 of file BlowfishSalt.php.
Referenced by BlowfishSalt\applySettingsToSalt(), and BlowfishSalt\isHashUpdateNeeded().
getMaxHashCount | ( | ) |
Method returns maximum allowed log2 number of iterations for password stretching.
Definition at line 140 of file BlowfishSalt.php.
Referenced by BlowfishSalt\setHashCount().
getMinHashCount | ( | ) |
Method returns minimum allowed log2 number of iterations for password stretching.
Definition at line 163 of file BlowfishSalt.php.
Referenced by BlowfishSalt\setHashCount().
getSaltLength | ( | ) |
Returns length of a Blowfish salt in bytes.
Overwrites Md5Salt::getSaltLength() with Blowfish specifics.
Implements SaltInterface.
Definition at line 176 of file BlowfishSalt.php.
Referenced by BlowfishSalt\applySettingsToSalt(), and BlowfishSalt\isValidSalt().
getSetting | ( | ) |
Returns setting string of Blowfish salted hashes.
Overwrites Md5Salt::getSetting() with Blowfish specifics.
Definition at line 189 of file BlowfishSalt.php.
Referenced by BlowfishSalt\applySettingsToSalt(), BlowfishSalt\getCountLog2(), BlowfishSalt\isValidSalt(), and BlowfishSalt\isValidSaltedPW().
isAvailable | ( | ) |
Returns whether all prerequisites for the hashing methods are matched
Implements SaltInterface.
Definition at line 150 of file BlowfishSalt.php.
isHashUpdateNeeded | ( | $saltedPW | ) |
Checks whether a user's hashed password needs to be replaced with a new hash.
This is typically called during the login process when the plain text password is available. A new hash is needed when the desired iteration count has changed through a change in the variable $hashCount or HASH_COUNT.
string | $saltedPW | Salted hash to check if it needs an update |
Implements SaltInterface.
Definition at line 205 of file BlowfishSalt.php.
References BlowfishSalt\getCountLog2(), BlowfishSalt\getHashCount(), and BlowfishSalt\isValidSalt().
isValidSalt | ( | $salt | ) |
Method determines if a given string is a valid salt.
Overwrites Md5Salt::isValidSalt() with Blowfish specifics.
string | $salt | String to check |
Implements SaltInterface.
Definition at line 225 of file BlowfishSalt.php.
References Md5Salt\getItoa64(), AbstractSalt\getLengthBase64FromBytes(), BlowfishSalt\getSaltLength(), and BlowfishSalt\getSetting().
Referenced by BlowfishSalt\isHashUpdateNeeded(), and BlowfishSalt\isValidSaltedPW().
isValidSaltedPW | ( | $saltedPW | ) |
Method determines if a given string is a valid salted hashed password.
string | $saltedPW | String to check |
Implements SaltInterface.
Definition at line 255 of file BlowfishSalt.php.
References BlowfishSalt\getSetting(), and BlowfishSalt\isValidSalt().
setHashCount | ( | $hashCount = null | ) |
Method sets log2 number of iterations for password stretching.
int | $hashCount | log2 number of iterations for password stretching to set |
Definition at line 273 of file BlowfishSalt.php.
References BlowfishSalt\$hashCount, BlowfishSalt\getMaxHashCount(), and BlowfishSalt\getMinHashCount().
setMaxHashCount | ( | $maxHashCount = null | ) |
Method sets maximum allowed log2 number of iterations for password stretching.
int | $maxHashCount | Maximum allowed log2 number of iterations for password stretching to set |
Definition at line 286 of file BlowfishSalt.php.
References BlowfishSalt\$maxHashCount.
setMinHashCount | ( | $minHashCount = null | ) |
Method sets minimum allowed log2 number of iterations for password stretching.
int | $minHashCount | Minimum allowed log2 number of iterations for password stretching to set |
Definition at line 299 of file BlowfishSalt.php.
References BlowfishSalt\$minHashCount.
|
staticprotected |
Definition at line 49 of file BlowfishSalt.php.
Referenced by BlowfishSalt\setHashCount().
|
staticprotected |
Definition at line 57 of file BlowfishSalt.php.
Referenced by BlowfishSalt\setMaxHashCount().
|
staticprotected |
Definition at line 65 of file BlowfishSalt.php.
Referenced by BlowfishSalt\setMinHashCount().
|
staticprotected |
Definition at line 72 of file BlowfishSalt.php.
|
staticprotected |
Definition at line 79 of file BlowfishSalt.php.
const HASH_COUNT = 7 |
The default log2 number of iterations for password stretching.
Definition at line 29 of file BlowfishSalt.php.
const MAX_HASH_COUNT = 17 |
The default maximum allowed log2 number of iterations for password stretching.
Definition at line 35 of file BlowfishSalt.php.
const MIN_HASH_COUNT = 4 |
The default minimum allowed log2 number of iterations for password stretching.
Definition at line 41 of file BlowfishSalt.php.