change password that is used to store data encrypted on server

@param $newPassword
@return array backupInfo
@throws BlocktrailSDKException
321758
public function passwordChange($newPassword) {
        if ($this->locked) {
            throw new BlocktrailSDKException("Wallet needs to be unlocked to change password");
        }

        if (!$this->secret) {
            throw new BlocktrailSDKException("No secret");
        }

        $encryptedSecret = CryptoJSAES::encrypt($this->secret, $newPassword);

        $this->sdk->updateWallet($this->identifier, ['encrypted_secret' => $encryptedSecret]);

        $this->encryptedSecret = $encryptedSecret;

        return [
            'encrypted_secret' => MnemonicFactory::bip39()->entropyToMnemonic(new Buffer(base64_decode($this->encryptedSecret))),
        ];
    }
1171273
public function editUserPassword($user_name, $new_password)
    {
        $url          = $this->url.'users/'.$user_name.'/password';
        $option       = [
            'newpassword' => $password
        ];
        $access_token = $this->getToken();
        $header []    = 'Authorization: Bearer '.$access_token;

        return Http::postCurl($url, $option, $header, 'PUT');
    }
212766
function changeAuthPassword($user, $password, $multicall = false)
    {
        if (!is_string($user) || !isset(self::$levels[$user])) {
            throw new InvalidArgumentException('user = ' . print_r($user, true));
        }
        if (!is_string($password)) {
            throw new InvalidArgumentException('password = ' . print_r($password, true));
        }

        return $this->execute(ucfirst(__FUNCTION__), array($user, $password), $multicall);
    }
597696
public function changePassword($data) {
    if (!isset($data['password']) || (string) $data['password'] === '') {
      return ['result' => false, 'message' => 'Please specify a password.'];
    }
    if (!$this->checkPassword($data['oldPassword'])) {
      return ['result' => false, 'message' => 'Incorrect password.'];
    }
    $this->passwordTemp = (string) $data['password'];
    if ($this->save()) {
      return ['result' => true, 'message' => 'Your password has been changed.'];
    } else {
      return ['result' => false, 'message' => 'Couldn\'t save new password.'];
    }
  }
351288
public function setPassword($password)
    {
        $password = (string) $password;

        if ($this->exists() && $this->password !== $password) {
            $this->updated['password'] = true;
        }

        $this->password = $password;

        return $this;
    }
424329
public function reset(string $code, string $new_password): bool
    {
        return $this->auth_repository->reset($code, $new_password);
    }
1139852
public boolean setPassword(final String _name,
                               final String _newpasswd,
                               final String _oldpasswd)
        throws LoginException
    {
        boolean ret = false;

        final LoginContext login = new LoginContext(
                this.application,
                new SetPasswordCallbackHandler(ActionCallback.Mode.SET_PASSWORD, _name, _newpasswd, _oldpasswd));
        login.login();
        ret = true;
        return ret;
    }
720978
public function changePassword()
    {
        if (!\OxidEsales\Eshop\Core\Registry::getSession()->checkSessionChallenge()) {
            return;
        }

        $oUser = $this->getUser();
        if (!$oUser) {
            return;
        }

        $sOldPass = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('password_old', true);
        $sNewPass = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('password_new', true);
        $sConfPass = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('password_new_confirm', true);

        /** @var \OxidEsales\Eshop\Core\InputValidator $oInputValidator */
        $oInputValidator = \OxidEsales\Eshop\Core\Registry::getInputValidator();
        if (($oExcp = $oInputValidator->checkPassword($oUser, $sNewPass, $sConfPass, true))) {
            switch ($oExcp->getMessage()) {
                case 'ERROR_MESSAGE_INPUT_EMPTYPASS':
                case 'ERROR_MESSAGE_PASSWORD_TOO_SHORT':
                    return \OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay(
                        'ERROR_MESSAGE_PASSWORD_TOO_SHORT',
                        false,
                        true
                    );
                default:
                    return \OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay(
                        'ERROR_MESSAGE_PASSWORD_DO_NOT_MATCH',
                        false,
                        true
                    );
            }
        }

        if (!$sOldPass || !$oUser->isSamePassword($sOldPass)) {
            /** @var \OxidEsales\Eshop\Core\UtilsView $oUtilsView */
            $oUtilsView = \OxidEsales\Eshop\Core\Registry::getUtilsView();

            return $oUtilsView->addErrorToDisplay('ERROR_MESSAGE_CURRENT_PASSWORD_INVALID', false, true);
        }

        // testing passed - changing password
        $oUser->setPassword($sNewPass);
        if ($oUser->save()) {
            $this->_blPasswordChanged = true;
            // deleting user autologin cookies.
            \OxidEsales\Eshop\Core\Registry::getUtilsServer()->deleteUserCookie(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopId());
        }
    }
1169536
public function resetPassword() : string {
		$newPass = bin2hex(random_bytes(20));
		$newHash = password_hash($newPass, PASSWORD_BCRYPT);

		$stmt = $this->db->prepare(
			"UPDATE accounts SET pw_hash=? WHERE id=?;"
		);
		$stmt->bind_param("si", $newHash, $this->id);
		$stmt->execute();
		$this->db->commit();
		$this->pwHash = $newHash;

		$this->sessionManager->wipeLoginSession();
		return $newPass;
	}
78100
public static function changePasswordByCodeWithUsername($username, $code, $newPassword, $login)
    {
        return static::changePasswordByCode(static::getEmailByUsername($username), $code, $newPassword, $login);
    }
438865
public function changePassPhrase($old_passphrase, $new_passphrase)
    {
        $args = [
            (string)$old_passphrase,
            (string)$new_passphrase
        ];
        return null === $this->rpc->query("walletPassPhraseChange", $args);
    }
979194
public function encrypt($password)
    {

        if (PasswordConstraintsService::singleton()->validate($password)) {
            $salt = helpers_Random::generateString($this->getSaltLength());
            return $salt.hash($this->getAlgorithm(), $salt.$password);
        }

        throw new PasswordConstraintsException(
            __( 'Password must be: %s' ,
            implode( ',', PasswordConstraintsService::singleton()->getErrors() )
        ));
    }
1061787
public void changePassword(final String oldPassword,
            final String newPassword) {

        final Authentication currentUser =
                SecurityContextHolder.getContext().getAuthentication();
        final String username = currentUser.getName();

        if (authenticationManager == null) {
            logger.debug(
                    "No authentication manager set. can't change Password!");

            return;
        } else {
            logger.debug("Re-authenticating user '" + username
                    + "' for password change request.");

            authenticationManager.authenticate(
                    new UsernamePasswordAuthenticationToken(username,
                            oldPassword));
        }

        logger.debug("Changing password for user '" + username + "'");

        final SecurityUser user = (SecurityUser) loadUserByUsername(username);

        user.setPassword(passwordEncoder.encode(newPassword));
        users.add(user);
    }
151734
function changePassword(masterPassword, newPassword1, newPassword2) {
    if (newPassword1 !== newPassword2) throw new Error("New passwords must match.");
    else {
        var contents = getContents(masterPassword);
        init(newPassword1, contents);
    }
}
1102644
public function resetPassword(UserEntity $user, $newPassword)
    {
        $hashedPassword = $this->hashPassword($newPassword);

        $user->setPassword($hashedPassword);

        return $this->userMapper->persist($user);
    }
891203
public function resetPassword($newPassword)
    {
        $success = false;
        if (!$this->isForgotPasswordTokenExpired()) {
            $this->password = $newPassword;
            $this->setAttribute(self::FORGOT_PASSWORD_EXPIRATION_FIELD, time()); // expire token
            $this->setTrustedAction(true);
            $success = $this->save();
        }

        return $success;
    }
1117935
function user_update_password($user, $newpassword) {
        global $DB;

        if ($this->is_internal()) {
            $puser = $DB->get_record('user', array('id'=>$user->id), '*', MUST_EXIST);
            // This will also update the stored hash to the latest algorithm
            // if the existing hash is using an out-of-date algorithm (or the
            // legacy md5 algorithm).
            if (update_internal_user_password($puser, $newpassword)) {
                $user->password = $puser->password;
                return true;
            } else {
                return false;
            }
        } else {
            // We should have never been called!
            return false;
        }
    }