4 require_once
'Services/Password/classes/class.ilBasePasswordEncoder.php';
26 switch (strtolower(
$key)) {
34 if (!isset(
$config[
'cost']) && static::class == self::class) {
61 $encoder =
new self(array(
'cost' => $cost));
62 $encoder->encodePassword(
'test',
'');
63 $end = microtime(
true);
64 }
while ((
$end -
$start) < $time_target && $cost < 32);
82 return parent::isSupportedByRuntime() && version_compare(phpversion(),
'5.5.0',
'>=');
101 if ($costs < 4 || $costs > 31) {
102 require_once
'Services/Password/exceptions/class.ilPasswordException.php';
105 $this->costs = sprintf(
'%1$02d',
$costs);
116 require_once
'Services/Password/exceptions/class.ilPasswordException.php';
120 return password_hash($raw, PASSWORD_BCRYPT, array(
130 return password_verify($raw, $encoded);
138 return password_needs_rehash($encoded, PASSWORD_BCRYPT, array(
benchmarkCost($time_target=0.05)
Class for user password exception handling in ILIAS.
isPasswordValid($encoded, $raw, $salt)
{Checks a raw password against an encoded password.The raw password has to be injected into the encod...
requiresReencoding($encoded)
{Returns whether or not the a encoded password needs to be re-encoded.string boolean} ...
isSupportedByRuntime()
{Returns whether or not the encoder is supported by the runtime (PHP, HHVM, ...)boolean} ...
__construct(array $config=array())
encodePassword($raw, $salt)
{Encodes the raw password.The password to encode The salt string The encoded password} ...
isPasswordTooLong($password)
Checks if the password is too long.