4 require_once
'Services/Password/classes/class.ilBasePasswordEncoder.php';
26 foreach(
$config as $key => $value)
28 switch(strtolower($key))
37 if(!isset(
$config[
'cost']) && static::class == self::class)
66 $encoder =
new self(
array(
'cost' => $cost));
67 $encoder->encodePassword(
'test',
'');
68 $end = microtime(
true);
70 while(($end -
$start) < $time_target && $cost < 32);
88 return parent::isSupportedByRuntime() && version_compare(phpversion(),
'5.5.0',
'>=');
108 if($costs < 4 || $costs > 31)
110 require_once
'Services/Password/exceptions/class.ilPasswordException.php';
113 $this->costs = sprintf(
'%1$02d',
$costs);
125 require_once
'Services/Password/exceptions/class.ilPasswordException.php';
129 return password_hash($raw, PASSWORD_BCRYPT,
array(
139 return password_verify($raw, $encoded);
147 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} ...
Create styles array
The data for the language used.
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.