Bcrypt algorithm using crypt() function of PHP

 Methods

Constructor

__construct(array | \Traversable $options) 

Parameters

$options

array\Traversable

Exceptions

\Zend\Crypt\Password\Exception\InvalidArgumentException

Bcrypt

create(string $password) : string

Parameters

$password

string

Exceptions

\Zend\Crypt\Password\Exception\RuntimeException

Returns

string

Get the backward compatibility

getBackwardCompatibility() : bool

Returns

bool

Get the cost parameter

getCost() : string

Returns

string

Get the salt value

getSalt() : string

Returns

string

Set the backward compatibility $2a$ instead of $2y$ for PHP 5.3.7+

setBackwardCompatibility(bool $value) : \Zend\Crypt\Password\Bcrypt

Parameters

$value

bool

Returns

Set the cost parameter

setCost(int | string $cost) : \Zend\Crypt\Password\Bcrypt

Set the salt value

setSalt(string $salt) : \Zend\Crypt\Password\Bcrypt

Verify if a password is correct against an hash value

verify(string $password, string $hash) : bool

Parameters

$password

string

$hash

string

Exceptions

\Zend\Crypt\Password\Exception\RuntimeException when the hash is unable to be processed

Returns

bool

 Properties

 

$backwardCompatibility

$backwardCompatibility : bool

 

$cost

$cost : string

 

$salt

$salt : string

 Constants

 

MIN_SALT_SIZE

MIN_SALT_SIZE