TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
AbstractSalt Class Reference
Inheritance diagram for AbstractSalt:
Md5Salt Pbkdf2Salt PhpassSalt BlowfishSalt

Public Member Functions

 base64Encode ($input, $count)
 

Protected Member Functions

 applySettingsToSalt ($salt)
 
 getGeneratedSalt ()
 
 getItoa64 ()
 
 getSetting ()
 
 getLengthBase64FromBytes ($byteLength)
 

Detailed Description

Abstract class with methods needed to be extended in a salted hashing class.

Definition at line 21 of file AbstractSalt.php.

Member Function Documentation

applySettingsToSalt (   $salt)
abstractprotected

Method applies settings (prefix, optional hash count, optional suffix) to a salt.

Parameters
string$saltA salt to apply setting to
Returns
string Salt with setting
base64Encode (   $input,
  $count 
)

Encodes bytes into printable base 64 using the *nix standard from crypt().

Parameters
string$inputThe string containing bytes to encode.
int$countThe number of characters (bytes) to encode.
Returns
string Encoded string

Definition at line 60 of file AbstractSalt.php.

References AbstractSalt\getItoa64().

Referenced by PhpassSalt\cryptPassword(), Md5Salt\getGeneratedSalt(), and PhpassSalt\getGeneratedSalt().

getGeneratedSalt ( )
abstractprotected

Generates a random base salt settings for the hash.

Returns
string A string containing settings and a random salt
getItoa64 ( )
abstractprotected

Returns a string for mapping an int to the corresponding base 64 character.

Returns
string String for mapping an int to the corresponding base 64 character

Referenced by AbstractSalt\base64Encode().

getLengthBase64FromBytes (   $byteLength)
protected

Method determines required length of base64 characters for a given length of a byte string.

Parameters
int$byteLengthLength of bytes to calculate in base64 chars
Returns
int Required length of base64 characters

Definition at line 94 of file AbstractSalt.php.

Referenced by Md5Salt\applySettingsToSalt(), BlowfishSalt\applySettingsToSalt(), PhpassSalt\applySettingsToSalt(), PhpassSalt\cryptPassword(), Md5Salt\isValidSalt(), BlowfishSalt\isValidSalt(), Pbkdf2Salt\isValidSalt(), and PhpassSalt\isValidSalt().

getSetting ( )
abstractprotected

Returns setting string to indicate type of hashing method.

Returns
string Setting string of hashing method