![]() |
TYPO3
7.6
|
Public Member Functions | |
checkPassword ($plainPW, $saltedHashPW) | |
getHashedPassword ($password, $salt=null) | |
isAvailable () | |
getSaltLength () | |
getSetting () | |
isHashUpdateNeeded ($passString) | |
isValidSalt ($salt) | |
isValidSaltedPW ($saltedPW) | |
![]() | |
base64Encode ($input, $count) | |
Public Attributes | |
const | ITOA64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' |
Protected Member Functions | |
applySettingsToSalt ($salt) | |
getGeneratedSalt () | |
getItoa64 () | |
getSaltSuffix () | |
![]() | |
applySettingsToSalt ($salt) | |
getGeneratedSalt () | |
getItoa64 () | |
getSetting () | |
getLengthBase64FromBytes ($byteLength) | |
Static Protected Attributes | |
static | $saltLengthMD5 = 6 |
static | $saltSuffixMD5 = '$' |
static | $settingMD5 = '$1$' |
Class that implements MD5 salted hashing based on PHP's crypt() function.
MD5 salted hashing with PHP's crypt() should be available on most of the systems.
Definition at line 24 of file Md5Salt.php.
|
protected |
Method applies settings (prefix, suffix) to a salt.
string | $salt | A salt to apply setting to |
Definition at line 59 of file Md5Salt.php.
References AbstractSalt\getLengthBase64FromBytes(), Md5Salt\getSaltLength(), Md5Salt\getSaltSuffix(), and Md5Salt\getSetting().
Referenced by Md5Salt\getHashedPassword().
checkPassword | ( | $plainPW, | |
$saltedHashPW | |||
) |
Method checks if a given plaintext password is correct by comparing it with a given salted hashed password.
string | $plainPW | plain-text password to compare with salted hash |
string | $saltedHashPW | salted hash to compare plain-text password with |
Implements SaltInterface.
Definition at line 78 of file Md5Salt.php.
References Md5Salt\isValidSalt().
|
protected |
Generates a random base 64-encoded salt prefixed and suffixed with settings for the hash.
Proper use of salts may defeat a number of attacks, including:
Definition at line 98 of file Md5Salt.php.
References AbstractSalt\base64Encode(), and Md5Salt\getSaltLength().
Referenced by Md5Salt\getHashedPassword().
getHashedPassword | ( | $password, | |
$salt = null |
|||
) |
Method creates a salted hash for a given plaintext password
string | $password | plaintext password to create a salted hash from |
string | $salt | Optional custom salt with setting to use |
Implements SaltInterface.
Definition at line 111 of file Md5Salt.php.
References Md5Salt\applySettingsToSalt(), Md5Salt\getGeneratedSalt(), and Md5Salt\isValidSalt().
|
protected |
Returns a string for mapping an int to the corresponding base 64 character.
Definition at line 128 of file Md5Salt.php.
Referenced by Md5Salt\isValidSalt(), and BlowfishSalt\isValidSalt().
getSaltLength | ( | ) |
Returns length of a MD5 salt in bytes.
Implements SaltInterface.
Definition at line 148 of file Md5Salt.php.
Referenced by Md5Salt\applySettingsToSalt(), Md5Salt\getGeneratedSalt(), and Md5Salt\isValidSalt().
|
protected |
Returns suffix to be appended to a salt.
Definition at line 158 of file Md5Salt.php.
Referenced by Md5Salt\applySettingsToSalt().
getSetting | ( | ) |
Returns setting string of MD5 salted hashes.
Definition at line 168 of file Md5Salt.php.
Referenced by Md5Salt\applySettingsToSalt(), Md5Salt\isValidSalt(), and Md5Salt\isValidSaltedPW().
isAvailable | ( | ) |
Returns whether all prerequisites for the hashing methods are matched
Implements SaltInterface.
Definition at line 138 of file Md5Salt.php.
isHashUpdateNeeded | ( | $passString | ) |
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 or if the user's password hash was generated in an bulk update with class ext_update.
string | $passString | Salted hash to check if it needs an update |
Implements SaltInterface.
Definition at line 185 of file Md5Salt.php.
isValidSalt | ( | $salt | ) |
Method determines if a given string is a valid salt
string | $salt | String to check |
Implements SaltInterface.
Definition at line 196 of file Md5Salt.php.
References Md5Salt\getItoa64(), AbstractSalt\getLengthBase64FromBytes(), Md5Salt\getSaltLength(), and Md5Salt\getSetting().
Referenced by Md5Salt\checkPassword(), Md5Salt\getHashedPassword(), and Md5Salt\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 226 of file Md5Salt.php.
References Md5Salt\getSetting(), and Md5Salt\isValidSalt().
|
staticprotected |
Definition at line 37 of file Md5Salt.php.
|
staticprotected |
Definition at line 44 of file Md5Salt.php.
|
staticprotected |
Definition at line 51 of file Md5Salt.php.
const ITOA64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' |
Keeps a string for mapping an int to the corresponding base 64 character.
Definition at line 30 of file Md5Salt.php.