Representa el algoritmo de la contraseña
Auxiliar de $this->getuserPassword
@param string $cadena
@return string
492696
private function password($cadena){
        $valores = array();
        $valor = 0;
        $encadena = str_split(strtolower($cadena));
        foreach ($encadena as $i){
            $j = array_search($i, $this->letras) % 10;
            $valores[] = $j;
            $valor += $j;
        }
        $digito = implode(array_slice(str_split($valor), -1 ));
        $prima = implode(array_slice($valores,0, 3));
        $secon = implode(array_slice($valores,-2));
        $operacion = abs($prima - $secon);
        $longitud = strlen($operacion);
        if ($longitud == 1){
            $resultado_final = "00" . $operacion;
        }elseif($longitud == 2){
            $resultado_final = "0" . $operacion;
        }else{
            $resultado_final = $operacion;
        }
        $texto = ucfirst(implode(array_slice($encadena,0, 3)));
        $this->entrada['password'] = $texto . "_" . $digito . $resultado_final;
        return $this->entrada['password'];
    }
1318084
public function getAuthToken($scramble, $password)
    {
        return sha1($scramble . sha1($hash1 = sha1($password, true), true), true) ^ $hash1;
    }
260989
public function authenticate($password, $testPassword = true)
    {
        $auths = $this->loadAuthorizers($password, $testPassword);

        $lastAuthorizer = null;
        foreach ($auths as $lastAuthorizer => $result) {
            if (is_callable($result)) {
                $result = call_user_func($result);
            }

            if ($result instanceof AdapterInterface) {
                $result = $result->authenticate();
            }

            if ($result instanceof Result) {
                if (! $result->isValid()) {
                    break;
                }
            } else {
                if (true === $result) {
                    $result = new Result(Result::SUCCESS, $this->getLoginName());

                } else {
                    // Always a fail when not true
                    if ($result === false) {
                        $code   = Result::FAILURE_CREDENTIAL_INVALID;
                        $result = array();
                    } else {
                        $code   = Result::FAILURE_UNCATEGORIZED;
                        if (is_string($result)) {
                            $result = array($result);
                        }
                    }
                    $result = new Result($code, $this->getLoginName(), $result);
                    break;
                }
            }
        }

        if ($result->isValid() && $this->definition instanceof \Gems_User_DbUserDefinitionAbstract) {
            $this->definition->checkRehash($this, $password);
        }


        $this->afterAuthorization($result, $lastAuthorizer);

        // \MUtil_Echo::track($result);
        $this->_authResult = $result;

        return $result;
    }
923642
private function getAuthHeader()
    {
        $credential = $this->apiContext->getCredential();

        $header = '<wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">';
        $header .= '<wsse:UsernameToken wsu:Id="UsernameToken-9" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">';
        $header .= '<wsse:Username>' . $credential->getUsername() . '</wsse:Username>';
        $header .= '<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">' . $credential->getPassword() . '</wsse:Password>';
        $header .= '</wsse:UsernameToken>';
        $header .= '</wsse:Security>';

        $headerbody = new \SoapVar($header, XSD_ANYXML, null, null, null);
        return new \SOAPHeader(self::PAYU_NAMESPACE, 'Security', $headerbody, true);
    }
225060
public function getPassword() : IHashedPassword
    {
        return new class implements IHashedPassword
        {
            /**
             * Gets the hashed password string.
             *
             * @return string
             */
            public function getHash() : string
            {
                // TODO: Implement getHash() method.
            }

            /**
             * Gets the hashing algorithm.
             *
             * @return string
             */
            public function getAlgorithm() : string
            {
                // TODO: Implement getAlgorithm() method.
            }

            /**
             * Gets the hashing cost factor.
             *
             * @return int
             */
            public function getCostFactor() : int
            {
                // TODO: Implement getCostFactor() method.
            }

            /**
             * Returns an associated array of the values indexed by the property names.
             *
             * This returns all properties regardless of accessibility.
             *
             * @return array
             */
            public function toArray() : array
            {
                // TODO: Implement toArray() method.
            }

            /**
             * Sets the properties of the object.
             *
             * The property types and structure are NOT validated in any way
             * and as such this should only be used for restoring object
             * state from a persistence store which is in a valid state.
             *
             * @param array $properties
             *
             * @return void
             */
            public function hydrate(array $properties)
            {
                // TODO: Implement hydrate() method.
            }
        };
    }
556807
public function getPassword($unhashed = false) {
        if((bool) $unhashed === true){
            return $this->_inputPassword;
        }else{
            return \password_hash($this->_inputPassword, \PASSWORD_DEFAULT);
        }
    }
1146025
public function getPasswordAge()
    {
        $date = \MUtil_Date::ifDate(
                $this->_getVar('user_password_last_changed'),
                array(\Gems_Tracker::DB_DATETIME_FORMAT, \Gems_Tracker::DB_DATE_FORMAT, \Zend_Date::ISO_8601)
                );
        if ($date instanceof \MUtil_Date) {
            return abs($date->diffDays());
        } else {
            return 0;
        }
    }
973039
public function lostPasswordForm()
    {
        $loginFieldLabel = (Config::inst()->get(LDAPAuthenticator::class, 'allow_email_login') === 'yes') ?
            _t('SilverStripe\\LDAP\\Forms\\LDAPLoginForm.USERNAMEOREMAIL', 'Username or email') :
            _t('SilverStripe\\LDAP\\Forms\\LDAPLoginForm.USERNAME', 'Username');
        $loginField = TextField::create('Login', $loginFieldLabel);

        $action = FormAction::create(
            'forgotPassword',
            _t('SilverStripe\\Security\\Security.BUTTONSEND', 'Send me the password reset link')
        );
        return LostPasswordForm::create(
            $this,
            $this->authenticatorClass,
            'LostPasswordForm',
            FieldList::create([$loginField]),
            FieldList::create([$action]),
            false
        );
    }
710264
protected function getPassword(Request $request)
    {
        $url = $request->getQueryParam('url');

        $password = $request->getParam('password');
        if (isset($password)) {
            $this->sessionSegment->setFlash($url, $password);
        } else {
            $password = $this->sessionSegment->getFlash($url);
        }

        return $password;
    }
937665
public function authenticateToken(TokenInterface $token,
                                      UserProviderInterface $userProvider,
                                      $providerKey)
    {
        if (($user = $userProvider->loadUserByUsername($token->getUsername())) && ($user->getPassword()
            == $token->getCredentials())) {
            return new UsernamePasswordToken(
                $user, $user->getPassword(), $providerKey, $user->getRoles()
            );
        }
        throw new BadCredentialsException('The presented password is invalid.');
    }
451306
public function getPassword()
    {
        if (null !== $this->password) {
            return $this->password;
        }

        $this->parseUserInfo();

        return $this->password;
    }
564287
public function setPasswordResetToken($token = '')
    {
        if (empty($this->passwordResetTokenAttribute) || !is_string($this->passwordResetTokenAttribute)) {
            return null;
        }
        return $this->{$this->passwordResetTokenAttribute} = $token;
    }
1295265
protected function _getAuthenticateChallengeHeader()
    {
        $wwwauth = 'Digest realm="' . $this->getRealm() . '", '
            /*
             * Domain directive is not meaningful in Proxy-Authenticate headers,
             * for which the protection space is always the entire proxy; if present
             * it should be ignored.
             */
            . ( ($this->getDomains()) ? 'domain="' . $this->domains . '", ' : '' )
            . 'nonce="' . $this->_generateNonce() . '", '
            /*
             * This can be treated as a session id. If this changes the browser
             * will deauthenticate the user.
             */
            . ( ($this->isUseOpaque()) ? 'opaque="' . $this->_generateOpaque() . '", ' : '' )
            /*
             * indicating that the previous request from the client was
             * rejected because the nonce value was stale. If stale is TRUE
             * (case-insensitive), the client may wish to simply retry the request
             * with a new encrypted response, without reprompting the user for a
             * new username and password. The server should only set stale to TRUE
             * if it receives a request for which the nonce is invalid but with a
             * valid digest for that nonce (indicating that the client knows the
             * correct username/password). If stale is FALSE, or anything other
             * than TRUE, or the stale directive is not present, the username
             * and/or password are invalid, and new values must be obtained.
             */
            . ( (isset($this->stale)) ? 'stale="true"' : '' )
            . 'algorithm="' . $this->defaultAlgorithm . '", '
            . 'qop="' . implode(',', $this->supportedQops) . '"';

        return $wwwauth;
    }
684215
public function getPassword($uuid)
	{
		if($this->_groups != null)
		{
			foreach($this->_groups as &$group)
			{
				$value = $group->getPassword($uuid);
				if($value != null)
					return $value->getPlainString();
			}
		}
		return null;
	}
1303394
public function getBasicAuth()
    {
        if (empty($this->basicAuth))
            return "";

        if (empty($this->basicAuth["username"]))
            // Username cannot be empty in Basic Authentication
            return "";

        $username = $this->basicAuth["username"];
        $password = isset($this->basicAuth["password"]) ? $this->basicAuth["password"] : "";
        return sprintf("%s:%s@", $username, $password);
    }
1164236
public function DKIM_Sign($signHeader)
    {
        if (!defined('PKCS7_TEXT')) {
            if ($this->exceptions) {
                throw new Exception($this->lang('extension_missing') . 'openssl');
            }

            return '';
        }
        $privKeyStr = !empty($this->DKIM_private_string) ?
            $this->DKIM_private_string :
            file_get_contents($this->DKIM_private);
        if ('' != $this->DKIM_passphrase) {
            $privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase);
        } else {
            $privKey = openssl_pkey_get_private($privKeyStr);
        }
        if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) {
            openssl_pkey_free($privKey);

            return base64_encode($signature);
        }
        openssl_pkey_free($privKey);

        return '';
    }
401442
private function getPassword()
    {
        $password = $this->secret("Enter your password");
        $passwordAgain = $this->secret("Enter your password again");

        $validator = Validator::make([
            'password'              => $password,
            'password_confirmation' => $passwordAgain,
        ], [
            'password' => 'required|min:5|confirmed',
        ]);

        if( $validator->fails() ) {
            $this->info('');
            $this->error("The password must be at least 5 characters and must match!");
            $this->info('');

            return $this->getPassword();
        }

        $this->password = bcrypt($password);
    }