Zend Framework  3.0
Public Member Functions | List of all members
BcryptSha Class Reference

Bcrypt algorithm using crypt() function of PHP with password hashed using SHA2 to allow for passwords >72 characters. More...

Public Member Functions

 create ($password)
 BcryptSha.
 
 verify ($password, $hash)
 Verify if a password is correct against a hash value.
 
- Public Member Functions inherited from Bcrypt
 __construct ($options=[])
 Constructor.
 
 create ($password)
 Bcrypt.
 
 verify ($password, $hash)
 Verify if a password is correct against a hash value.
 
 setCost ($cost)
 Set the cost parameter.
 
 getCost ()
 Get the cost parameter.
 
 setSalt ($salt)
 Set the salt value.
 
 getSalt ()
 Get the salt value.
 
 benchmarkCost ($timeTarget=0.05)
 Benchmark the bcrypt hash generation to determine the cost parameter based on time to target.
 

Additional Inherited Members

- Public Attributes inherited from Bcrypt
const MIN_SALT_SIZE = 22
 
- Protected Attributes inherited from Bcrypt
 $cost = '10'
 
 $salt
 

Detailed Description

Bcrypt algorithm using crypt() function of PHP with password hashed using SHA2 to allow for passwords >72 characters.

Member Function Documentation

create (   $password)

BcryptSha.

Parameters
string$password
Exceptions
Exception\RuntimeException
Returns
string

Implements PasswordInterface.

verify (   $password,
  $hash 
)

Verify if a password is correct against a hash value.

Parameters
string$password
string$hash
Exceptions
Exception\RuntimeExceptionwhen the hash is unable to be processed
Returns
bool

Implements PasswordInterface.