36 'cipher' => $this->config[
'cipher'],
37 'secret' => count( $this->config[
'secrets'] ) - 1
41 public function crypt( $password ) {
42 $secret = $this->config[
'secrets'][$this->params[
'secret']];
49 $this->hash, $this->params[
'cipher'],
51 if ( $decrypted ===
false ) {
54 $underlyingPassword = $this->factory->newFromCiphertext( $decrypted );
56 $underlyingPassword = $this->factory->newFromType( $this->config[
'underlying'] );
59 $underlyingPassword->crypt( $password );
60 if ( count( $this->args ) ) {
67 $underlyingPassword->toString(), $this->params[
'cipher'], $secret, 0, $iv );
68 if ( $this->hash ===
false ) {
81 if ( count( $this->args ) != 1 || $this->params == $this->
getDefaultParams() ) {
92 $this->params[
'cipher'],
93 $this->config[
'secrets'][$this->params[
'secret']],
97 if ( $underlyingHash ===
false ) {
108 $this->params[
'cipher'],
109 $this->config[
'secrets'][$this->params[
'secret']],
113 if ( $this->hash ===
false ) {
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
Helper class for passwords that use another password hash underneath it and encrypts that hash with a...
crypt( $password)
Hash a password and store the result in this object.
getDelimiter()
Returns the delimiter for the parameters inside the hash.
update()
Updates the underlying hash by encrypting it with the newest secret.
getDefaultParams()
Return an ordered array of default parameters for this password hash.
Helper class for password hash types that have a delimited set of parameters inside of the hash.
Show an error when any operation involving passwords fails to run.