TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Saltedpasswords\Salt\SaltInterface Interface Reference
Inheritance diagram for TYPO3\CMS\Saltedpasswords\Salt\SaltInterface:
TYPO3\CMS\Saltedpasswords\Salt\Md5Salt TYPO3\CMS\Saltedpasswords\Salt\PhpassSalt TYPO3\CMS\Saltedpasswords\Salt\BlowfishSalt

Public Member Functions

 checkPassword ($plainPW, $saltedHashPW)
 
 getSaltLength ()
 
 isAvailable ()
 
 getHashedPassword ($password, $salt=null)
 
 isHashUpdateNeeded ($passString)
 
 isValidSalt ($salt)
 
 isValidSaltedPW ($saltedPW)
 

Detailed Description

Interface with public methods needed to be implemented in a salting hashing class.

Definition at line 21 of file SaltInterface.php.

Member Function Documentation

◆ checkPassword()

TYPO3\CMS\Saltedpasswords\Salt\SaltInterface::checkPassword (   $plainPW,
  $saltedHashPW 
)

Method checks if a given plaintext password is correct by comparing it with a given salted hashed password.

Parameters
string$plainPWplain-text password to compare with salted hash
string$saltedHashPWSalted hash to compare plain-text password with
Returns
bool TRUE, if plaintext password is correct, otherwise FALSE

Implemented in TYPO3\CMS\Saltedpasswords\Salt\PhpassSalt, and TYPO3\CMS\Saltedpasswords\Salt\Md5Salt.

◆ getHashedPassword()

TYPO3\CMS\Saltedpasswords\Salt\SaltInterface::getHashedPassword (   $password,
  $salt = null 
)

Method creates a salted hash for a given plaintext password

Parameters
string$passwordPlaintext password to create a salted hash from
string$saltOptional custom salt to use
Returns
string Salted hashed password

Implemented in TYPO3\CMS\Saltedpasswords\Salt\PhpassSalt, and TYPO3\CMS\Saltedpasswords\Salt\Md5Salt.

◆ getSaltLength()

TYPO3\CMS\Saltedpasswords\Salt\SaltInterface::getSaltLength ( )

Returns length of required salt.

Returns
int Length of required salt

Implemented in TYPO3\CMS\Saltedpasswords\Salt\PhpassSalt, TYPO3\CMS\Saltedpasswords\Salt\BlowfishSalt, and TYPO3\CMS\Saltedpasswords\Salt\Md5Salt.

◆ isAvailable()

TYPO3\CMS\Saltedpasswords\Salt\SaltInterface::isAvailable ( )

Returns whether all prequesites for the hashing methods are matched

Returns
bool Method available

Implemented in TYPO3\CMS\Saltedpasswords\Salt\BlowfishSalt, TYPO3\CMS\Saltedpasswords\Salt\Md5Salt, and TYPO3\CMS\Saltedpasswords\Salt\PhpassSalt.

◆ isHashUpdateNeeded()

TYPO3\CMS\Saltedpasswords\Salt\SaltInterface::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.

Parameters
string$passStringSalted hash to check if it needs an update
Returns
bool TRUE if salted hash needs an update, otherwise FALSE

Implemented in TYPO3\CMS\Saltedpasswords\Salt\PhpassSalt, TYPO3\CMS\Saltedpasswords\Salt\BlowfishSalt, and TYPO3\CMS\Saltedpasswords\Salt\Md5Salt.

◆ isValidSalt()

TYPO3\CMS\Saltedpasswords\Salt\SaltInterface::isValidSalt (   $salt)

Method determines if a given string is a valid salt

Parameters
string$saltString to check
Returns
bool TRUE if it's valid salt, otherwise FALSE

Implemented in TYPO3\CMS\Saltedpasswords\Salt\PhpassSalt, TYPO3\CMS\Saltedpasswords\Salt\BlowfishSalt, and TYPO3\CMS\Saltedpasswords\Salt\Md5Salt.

◆ isValidSaltedPW()

TYPO3\CMS\Saltedpasswords\Salt\SaltInterface::isValidSaltedPW (   $saltedPW)

Method determines if a given string is a valid salted hashed password.

Parameters
string$saltedPWString to check
Returns
bool TRUE if it's valid salted hashed password, otherwise FALSE

Implemented in TYPO3\CMS\Saltedpasswords\Salt\PhpassSalt, TYPO3\CMS\Saltedpasswords\Salt\BlowfishSalt, and TYPO3\CMS\Saltedpasswords\Salt\Md5Salt.