Validates that the password is a current password
498970
def clean_password(self):
        
        user_pass = self.cleaned_data.get('password')
        matches = Password.objects.filter(password=user_pass)
        if not matches:
            raise forms.ValidationError("Your password does not match.")
266917
def check_password(password: str, encrypted: str) -> bool:
    
    # some old passwords have {crypt} in lower case, and passlib wants it to be
    # in upper case.
    if encrypted.startswith("{crypt}"):
        encrypted = "{CRYPT}" + encrypted[7:]
    return pwd_context.verify(password, encrypted)
198262
def is_valid(self, qstr=None):
        """"""
        if qstr is None:
            qstr = self.currentText()
        return osp.isfile(to_text_string(qstr))
1259200
public void validateEnterPassword(AccountPasswordForm form, MessageContext context) {

        // ensure that a current account password was entered
        if (StringUtils.isBlank(form.getCurrentPassword())) {
            context.addMessage(
                    new MessageBuilder()
                            .error()
                            .source("currentPassword")
                            .code("please.enter.current.password")
                            .defaultText("Please enter your current password")
                            .build());
        }

        // check to see if the provided password matches the current account
        // password
        else {

            ILocalAccountPerson account = accountDao.getPerson(form.getUserId());
            if (!passwordService.validatePassword(
                    form.getCurrentPassword(), account.getPassword())) {
                context.addMessage(
                        new MessageBuilder()
                                .error()
                                .source("currentPassword")
                                .code("current.password.doesnt.match")
                                .defaultText(
                                        "Provided password does not match the current account password")
                                .build());
            }
        }

        // ensure a new account password was entered
        if (StringUtils.isBlank(form.getNewPassword())) {
            context.addMessage(
                    new MessageBuilder()
                            .error()
                            .source("newPassword")
                            .code("please.enter.new.password")
                            .defaultText("Please enter a new password")
                            .build());
        }

        // ensure a new account password confirmation was entered
        if (StringUtils.isBlank(form.getConfirmNewPassword())) {
            context.addMessage(
                    new MessageBuilder()
                            .error()
                            .source("confirmNewPassword")
                            .code("please.enter.confirm.password")
                            .defaultText("Please confirm your new password")
                            .build());
        }

        // ensure the new password and new password confirmation match
        if (StringUtils.isNotBlank(form.getNewPassword())
                && StringUtils.isNotBlank(form.getConfirmNewPassword())
                && !form.getNewPassword().equals(form.getConfirmNewPassword())) {

            context.addMessage(
                    new MessageBuilder()
                            .error()
                            .source("confirmPassword")
                            .code("passwords.must.match")
                            .defaultText("Passwords must match")
                            .build());
        }
    }
88507
function(handler, password, cbvalidpass) {
        this.A1 = Util.createHash(this.digestParts["username"] + ":" + this.realm + ":" + password);
        this.validate(handler, cbvalidpass);
    }
593808
def password_link_expired(self, now=None):
        
        if not now: now = datetime.datetime.utcnow()
        return self.password_link_expires < now
1037659
private boolean isValid()
    {
        StringBuilder builder = new StringBuilder();
        for (Match match : matches)
        {
            builder.append(match.getToken());
        }

        return password.equals(builder.toString());
    }
157112
def compare_password(expected, actual):
    """"""
    if expected == actual:
        return True, "OK"
    msg = []
    ver_exp = expected[-8:].rstrip()
    ver_act = actual[-8:].rstrip()

    if expected[:-8] != actual[:-8]:
        msg.append("Password mismatch")
    if ver_exp != ver_act:
        msg.append("asterisk_mbox version mismatch.  Client: '" +
                   ver_act + "',  Server: '" + ver_exp + "'")
    return False, ". ".join(msg)
1064901
function password_handler()
    {
        $keyid  = rcube_utils::get_input_value('_keyid', rcube_utils::INPUT_POST);
        $passwd = rcube_utils::get_input_value('_passwd', rcube_utils::INPUT_POST, true);

        if ($keyid && $passwd !== null && strlen($passwd)) {
            $this->save_password(strtoupper($keyid), $passwd);
        }
    }
553292
def unlock! password=nil
      if password
        password = password.encode(Encoding::UTF_8)
        status = Sec.SecKeychainUnlock self, password.bytesize, password, 1
      else
        status = Sec.SecKeychainUnlock self, 0, nil, 0
      end
      Sec.check_osstatus status
    end
100285
def authenticated?(password)
      if password_object == password
        update_hash!(password) if password_object.stale?
        return true
      end

      return false
    end
31581
def verify(password, hash):
    
    _, algorithm, cost, salt, password_hash = hash.split("$")

    password = pbkdf2.pbkdf2_hex(password, salt, int(cost) * 500)

    return _safe_str_cmp(password, password_hash)
1194003
def clean_new_password2(self):
        """"""
        password1 = self.cleaned_data.get('new_password1')
        password2 = self.cleaned_data.get('new_password2')
        if password1 or password2:
            if password1 != password2:
                raise forms.ValidationError(
                    self.error_messages['password_mismatch'],
                    code='password_mismatch',
                )
            password_validation.validate_password(password2, self.instance)
        return password2
1244815
def validate(self, value, redis):
        '''  '''
        value = super().validate(value, redis)

        if is_hashed(value):
            return value

        return make_password(value)
373125
public boolean validate(String userPassword, String passwordToBeValidate) {

        String data = SignUtils.createPassword(passwordToBeValidate);

        if (data.equals(userPassword)) {
            return true;
        } else {
            return false;
        }
    }
1247061
public function validatePassword()
    {
        /* @var $user User */
        $user = Yii::$app->user->identity;
        if (!$user || !$user->validatePassword($this->oldPassword)) {
            $this->addError('oldPassword', 'Incorrect old password.');
        }
    }
1258777
def password_validator(self, form, field):
        

        # Convert string to list of characters
        password = list(field.data)
        password_length = len(password)

        # Count lowercase, uppercase and numbers
        lowers = uppers = digits = 0
        for ch in password:
            if ch.islower(): lowers += 1
            if ch.isupper(): uppers += 1
            if ch.isdigit(): digits += 1

        # Password must have one lowercase letter, one uppercase letter and one digit
        is_valid = password_length >= 6 and lowers and uppers and digits
        if not is_valid:
            raise ValidationError(
                _('Password must have at least 6 characters with one lowercase letter, one uppercase letter and one number'))