MediaWiki REL1_33
Argon2Password Class Reference

Implements Argon2, a modern key derivation algorithm designed to resist GPU cracking and side-channel attacks. More...

Inheritance diagram for Argon2Password:
Collaboration diagram for Argon2Password:

Public Member Functions

 crypt ( $password)
 @inheritDoc
 
 equals ( $other)
 @inheritDoc
 
 needsUpdate ()
 @inheritDoc
 
 toString ()
 @inheritDoc
 
 verify ( $password)
 @inheritDoc
 
- Public Member Functions inherited from Password
 __construct (PasswordFactory $factory, array $config, $hash=null)
 Construct the Password object using a string hash.
 
 getType ()
 Get the type name of the password.
 

Protected Member Functions

 isSupported ()
 @inheritDoc
 
- Protected Member Functions inherited from Password
 assertIsSafeSize ( $hash)
 Assert that hash will fit in a tinyblob field.
 
 parseHash ( $hash)
 Perform any parsing necessary on the hash to see if the hash is valid and/or to perform logic for seeing if the hash needs updating.
 

Private Member Functions

 prepareParams ()
 

Static Private Attributes

static null[] $knownOptions
 Array with known password_hash() option names as keys.
 

Additional Inherited Members

- Public Attributes inherited from Password
const MAX_HASH_SIZE = 255
 Hash must fit in user_password, which is a tinyblob.
 
- Protected Attributes inherited from Password
array $config
 Array of configuration variables injected from the constructor.
 
PasswordFactory $factory
 Factory that created the object.
 
string $hash
 String representation of the hash without the type.
 

Detailed Description

Implements Argon2, a modern key derivation algorithm designed to resist GPU cracking and side-channel attacks.

See also
https://en.wikipedia.org/wiki/Argon2

Definition at line 30 of file Argon2Password.php.

Member Function Documentation

◆ crypt()

Argon2Password::crypt ( $password)

@inheritDoc

Reimplemented from Password.

Definition at line 75 of file Argon2Password.php.

References $params, and(), list, and prepareParams().

◆ equals()

Argon2Password::equals ( $other)

@inheritDoc

Reimplemented from Password.

Definition at line 83 of file Argon2Password.php.

References and(), and verify().

◆ isSupported()

Argon2Password::isSupported ( )
protected

@inheritDoc

Reimplemented from Password.

Definition at line 43 of file Argon2Password.php.

◆ needsUpdate()

Argon2Password::needsUpdate ( )

@inheritDoc

Reimplemented from Password.

Definition at line 113 of file Argon2Password.php.

References $params, and(), list, and prepareParams().

◆ prepareParams()

Argon2Password::prepareParams ( )
private
Returns
mixed[] Array of 2nd and third parmeters to password_hash()

Definition at line 51 of file Argon2Password.php.

References $params, and and().

Referenced by crypt(), and needsUpdate().

◆ toString()

Argon2Password::toString ( )

@inheritDoc

Reimplemented from Password.

Definition at line 104 of file Argon2Password.php.

References $res, and Password\assertIsSafeSize().

◆ verify()

Argon2Password::verify ( $password)

@inheritDoc

Reimplemented from Password.

Definition at line 95 of file Argon2Password.php.

References and().

Referenced by equals().

Member Data Documentation

◆ $knownOptions

null [] Argon2Password::$knownOptions
staticprivate
Initial value:
= [
'memory_cost' => null,
'time_cost' => null,
'threads' => null,
]

Array with known password_hash() option names as keys.

Definition at line 34 of file Argon2Password.php.


The documentation for this class was generated from the following file: