Gets random password from password handler.<p>

@return String
342946
public static String getRandomPassword() {

        if (OpenCms.getPasswordHandler() instanceof I_CmsPasswordGenerator) {
            return ((I_CmsPasswordGenerator)OpenCms.getPasswordHandler()).getRandomPassword();
        }
        return CmsDefaultPasswordGenerator.getRandomPWD();
    }
1321464
public String getPassword() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getPassword");
        String password = jcaConnectionFactory.getPassword();
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "getPassword");
        return password;
    }
436362
public static String uniquePassword() {
        final String[] passwords = new String[] {
            "ALKJVBPIQYTUIWEBVPQALZVKQRWORTUYOYISHFLKAJMZNXBVMNFGAHKJSDFALAPOQIERIUYTGSFGKMZNXBVJAHGFAKX",
            "1234567890",
            "qpowiealksdjzmxnvbfghsdjtreiuowiruksfhksajmzxncbvlaksjdhgqwetytopskjhfgvbcnmzxalksjdfhgbvzm",
            ".@,-+/()#$%^&*!"
        };
        final StringBuilder result = new StringBuilder();
        final long passwordLength = Math.abs(UUID.randomUUID().getLeastSignificantBits() % MIN_PASSWORD_LENGTH_8)
            + MIN_PASSWORD_LENGTH_8;
        for (int index = 0; index < passwordLength; index += 1) {
            final int passIndex = (int) (passwords.length * (long) index / passwordLength);
            final int charIndex = (int) Math.abs(
                UUID.randomUUID().getLeastSignificantBits() % passwords[passIndex].length());
            result.append(passwords[passIndex].charAt(charIndex));
        }
        return result.toString();
    }
243636
public function lostpassword()
    {
        $handlers = [];
        $authenticators = $this->getApplicableAuthenticators(Authenticator::RESET_PASSWORD);
        /** @var Authenticator $authenticator */
        foreach ($authenticators as $authenticator) {
            $handlers[] = $authenticator->getLostPasswordHandler(
                Controller::join_links($this->Link(), 'lostpassword')
            );
        }

        return $this->delegateToMultipleHandlers(
            $handlers,
            _t('SilverStripe\\Security\\Security.LOSTPASSWORDHEADER', 'Lost Password'),
            $this->getTemplatesFor('lostpassword'),
            [$this, 'aggregateAuthenticatorResponses']
        );
    }
34197
public function encodePassword()
    {
        if (!$this->validate(['password'])) {
            return false;
        }
        
        // create random string for password salting
        $this->password_salt = Yii::$app->getSecurity()->generateRandomString();
        // store the password
        $this->password = Yii::$app->getSecurity()->generatePasswordHash($this->password.$this->password_salt);

        return true;
    }
1125095
public static function randomString()
  {
    if ( version_compare(PHP_VERSION,'7.0.0', '<') ){
      return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
        // 32 bits for "time_low"
        mt_rand(0, 0xffff), mt_rand(0, 0xffff),
        // 16 bits for "time_mid"
        mt_rand(0, 0xffff),
        // 16 bits for "time_hi_and_version",
        // four most significant bits holds version number 4
        mt_rand(0, 0x0fff) | 0x4000,
        // 16 bits, 8 bits for "clk_seq_hi_res",
        // 8 bits for "clk_seq_low",
        // two most significant bits holds zero and one for variant DCE1.1
        mt_rand(0, 0x3fff) | 0x8000,
        // 48 bits for "node"
        mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
      );
    }
    else {
      return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
        // 32 bits for "time_low"
        random_int(0, 0xffff), random_int(0, 0xffff),
        // 16 bits for "time_mid"
        random_int(0, 0xffff),
        // 16 bits for "time_hi_and_version",
        // four most significant bits holds version number 4
        random_int(0, 0x0fff) | 0x4000,
        // 16 bits, 8 bits for "clk_seq_hi_res",
        // 8 bits for "clk_seq_low",
        // two most significant bits holds zero and one for variant DCE1.1
        random_int(0, 0x3fff) | 0x8000,
        // 48 bits for "node"
        random_int(0, 0xffff), random_int(0, 0xffff), random_int(0, 0xffff)
      );
    }
  }
979498
public String getAccumuloPassword() {
    if (containsKey(ACCUMULO_PASSWORD_PROP)) {
      return verifyNotNull(ACCUMULO_PASSWORD_PROP, getString(ACCUMULO_PASSWORD_PROP));
    } else if (containsKey(CLIENT_ACCUMULO_PASSWORD_PROP)) {
      return verifyNotNull(CLIENT_ACCUMULO_PASSWORD_PROP, getString(CLIENT_ACCUMULO_PASSWORD_PROP));
    }
    throw new NoSuchElementException(ACCUMULO_PASSWORD_PROP + " is not set!");
  }
1207129
protected function guessPasswordResetBroker(): string
    {
        $accessarea = str_before(Route::currentRouteName(), '.');
        $passwordResetBroker = str_plural(mb_strstr($accessarea, 'area', true));

        return config('auth.passwords.'.$passwordResetBroker) ? $passwordResetBroker : config('auth.defaults.passwords');
    }
634020
public function getVerifyHandler()
    {
        if (is_callable($this->verifyHandler)) {
            return $this->verifyHandler;
        }

        return function ($password, $hash) {
            return password_verify($password, $hash);
        };
    }
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);
    }
263694
public static function create_new_password()
    {
        $words = Security::config()->uninherited('word_list');

        if ($words && file_exists($words)) {
            $words = file($words);

            list($usec, $sec) = explode(' ', microtime());
            mt_srand($sec + ((float)$usec * 100000));

            $word = trim($words[random_int(0, count($words) - 1)]);
            $number = random_int(10, 999);

            return $word . $number;
        } else {
            $random = mt_rand();
            $string = md5($random);
            $output = substr($string, 0, 8);

            return $output;
        }
    }
444694
public function setPasswordAction()
    {
        $userId = $this->params()->fromRoute('userId', null);
        $token = $this->params()->fromRoute('token', null);

        if ($userId === null || $token === null) {
            return $this->notFoundAction();
        }

        $user = $this->getUserMapper()->findById($userId);

        if (!$user) {
            return $this->notFoundAction();
        }

        $record = $this->getUserRegistrationMapper()->findByUser($user);

        if (!$record ||  !$this->userRegistrationService->isTokenValid($user, $token, $record)) {
            // Invalid Token, Lets surprise the attacker
            return $this->notFoundAction();
        }

        if ($record->isResponded()) {
            // old link, password is already set by the user
            return $this->redirectToPostVerificationRoute();
        }

        $form = $this->getServiceLocator()->get('HtUserRegistration\SetPasswordForm');

        if ($this->getRequest()->isPost()) {
            $form->setData($this->getRequest()->getPost());
            if ($form->isValid()) {
                $this->userRegistrationService->setPassword($form->getData(), $record);

                return $this->redirectToPostVerificationRoute();
            }
        }

        return array(
            'user' => $user,
            'form' => $form
        );
    }
995096
protected function getPasswordAttempts()
    {
        if ($this->_user == NULL)
            return false;

        $this->_attempts = UserMetadata::model()->getPrototype('UserMetadata', array(
                'user_id' => $this->getUser()->id,
                'key' => 'passwordAttempts'
            ), array(
                'user_id' => $this->getUser()->id,
                'key' => 'passwordAttempts',
                'value' => 0
        ));

        return $this->_attempts;
    }
1309353
public function generatePassword()
    {
        $salts = Site::salts(12);
        $special_char1 = '~<>?|:.(),';
        $special_char2 = '!@#$%^&*_+-*+';
        $pass = $special_char2.$salts.$special_char1;

        return str_shuffle($pass);
    }
954622
public function getPassword()
    {
        $password = array_get($this->manifest, 'password', $this->password);
        if ($this->isSecured()) {
            if (empty($password)) {
                throw new BadRequestException('Password is required for secured package.');
            } elseif (strlen($password) < static::PASSWORD_LENGTH) {
                throw new BadRequestException(
                    'Password must be at least ' . static::PASSWORD_LENGTH . ' characters long for secured package.'
                );
            }
        }

        return $password;
    }
180662
protected function generateRandomPassword()
    {
        $alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890+*=-_/()!?[]{}';
        $password = array();
        $alphabetLength = strlen($alphabet) - 1;
        
        for ($i = 0; $i < 10; $i++) {
            $charIndex = mt_rand(0, $alphabetLength);
            $password[] = $alphabet[$charIndex];
        }
        
        $password = implode('', $password);
        
        if (!preg_match('/\d/', $password)) {
            $password = mt_rand(0, 9) . $password . mt_rand(0, 9);
        }
        
        return $password;
    }
1094149
public function generateRandomPassword()
    {
        $alphabet = "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789";
        $pass = array();
        $alphaLength = strlen($alphabet) - 1;
        for ($i = 0; $i < 8; $i++) {
            $n = rand(0, $alphaLength);
            $pass[] = $alphabet[$n];
        }
        return implode($pass);
    }