checks string with users password hash using password manager

        :param instance:
        :param raw_password:
        :param enable_hash_migration: if legacy hashes should be migrated
        :return:
974364
def check_password(cls, instance, raw_password, enable_hash_migration=True):
        
        verified, replacement_hash = instance.passwordmanager.verify_and_update(
            raw_password, instance.user_password
        )
        if enable_hash_migration and replacement_hash:
            if six.PY2:
                instance.user_password = replacement_hash.decode("utf8")
            else:
                instance.user_password = replacement_hash
        return verified
706949
def check_old_password(pwdhash, password):
    
    from flask.ext.bcrypt import Bcrypt
    app.config['BCRYPT_LOG_ROUNDS'] = 12
    bcrypt = Bcrypt(app)
    return bcrypt.check_password_hash(pwdhash, password)
75637
def change_user_password(user, password):
    
    user.password = hash_password(password)
    _datastore.put(user)
    send_password_changed_notice(user)
    password_changed.send(current_app._get_current_object(),
                          user=user)
181137
def get_instance(cls, encoded_key):
        

        login_str = base64.b64decode(encoded_key).decode('utf-8')
        usertoken, password = login_str.strip().split(':', 1)

        instance = cls(usertoken, password)

        return instance
741122
def get_hexdigest(algorithm, salt, raw_password):
    
    if isinstance(salt, unicode):
        salt = salt.encode('utf8')
    if algorithm == 'crypt':
        try:
            import crypt
        except ImportError:
            raise ValueError('"crypt" password algorithm not supported in this environment')
        return crypt.crypt(raw_password, salt)
    # The rest of the supported algorithms are supported by hashlib, but
    # hashlib is only available in Python 2.5.
    try:
        import hashlib
    except ImportError:
        if algorithm == 'md5':
            import md5
            return md5.new(salt + raw_password).hexdigest()
        elif algorithm == 'sha1':
            import sha
            return sha.new(salt + raw_password).hexdigest()
    else:
        if algorithm == 'md5':
            return hashlib.md5(salt + raw_password).hexdigest()
        elif algorithm == 'sha1':
            return hashlib.sha1(salt + raw_password).hexdigest()
    raise ValueError("Got unknown password algorithm type in password.")
1039510
def p_changepassword(self):
        '''
        
        '''

        post_data = self.get_post_data()

        usercheck = MUser.check_user(self.userinfo.uid, post_data['rawpass'])
        if usercheck == 1:
            MUser.update_pass(self.userinfo.uid, post_data['user_pass'])
            output = {'changepass ': usercheck}
        else:
            output = {'changepass ': 0}
        return json.dump(output, self)
500808
def verify(password_hash, password):
    

    ensure(len(password_hash) == PWHASH_SIZE,
           "The password hash must be exactly %s bytes long" %
           nacl.bindings.crypto_pwhash_scryptsalsa208sha256_STRBYTES,
           raising=exc.ValueError)

    return nacl.bindings.crypto_pwhash_scryptsalsa208sha256_str_verify(
        password_hash, password
    )
687118
def ValidatePassword(self, password):
        
        password = to_aes_key(password)
        return hashlib.sha256(password).digest() == self.LoadStoredData('PasswordHash')
1325613
def check_password(raw_password, enc_password):
    
    l = enc_password.split('$')
    #only password of built-in user can split to 3
    if len(l)==3:
        algo, salt, hsh = l
        return hsh == get_hexdigest(algo, salt, raw_password)
    else:
        return False
88213
def password=(new_password)
      if new_password && !new_password.respond_to?(:to_str)
        raise TypeError, "Can't convert #{new_password.class} into String."
      end
      @password = new_password ? new_password.to_str : nil

      # You can't have a nil user with a non-nil password
      @password ||= nil
      @user ||= nil
      if @password != nil
        @user = EMPTY_STR if @user.nil?
      end

      # Reset dependent values
      remove_instance_variable(:@userinfo) if defined?(@userinfo)
      remove_instance_variable(:@normalized_userinfo) if defined?(@normalized_userinfo)
      remove_instance_variable(:@authority) if defined?(@authority)
      remove_instance_variable(:@normalized_password) if defined?(@normalized_password)
      remove_composite_values

      # Ensure we haven't created an invalid URI
      validate()
    end
234721
def check_password(password, encoded, setter=None, preferred='default'):
    
    if password is None:
        return False

    preferred = bCryptPasswordHasher
    hasher = bCryptPasswordHasher

    hasher_changed = hasher.algorithm != preferred.algorithm
    must_update = hasher_changed or preferred.must_update(encoded)
    is_correct = hasher.verify(password, encoded)

    # If the hasher didn't change (we don't protect against enumeration if it
    # does) and the password should get updated, try to close the timing gap
    # between the work factor of the current encoded password and the default
    # work factor.
    if not is_correct and not hasher_changed and must_update:
        hasher.harden_runtime(password, encoded)

    if setter and is_correct and must_update:
        setter(password)
    return is_correct
664106
def check_password(password)
    return false unless key
    key == self.class.hash_password(password, key.split('|', 2).first)
  end
1167750
def check_password_hash(password, password_hash, salt, N=1 << 14, r=8, p=1, buflen=64):
    
    candidate_hash = generate_password_hash(password, salt, N, r, p, buflen)

    return safe_str_cmp(password_hash, candidate_hash)
449187
def update_password(user, password):
    
    user.password = hash_password(password)
    _datastore.put(user)
    send_password_reset_notice(user)
    password_reset.send(app._get_current_object(), user=user)
1152203
def _verify_password(self, raw_password, hashed_password):
        
        PraetorianError.require_condition(
            self.pwd_ctx is not None,
            "Praetorian must be initialized before this method is available",
        )
        return self.pwd_ctx.verify(raw_password, hashed_password)
100285
def authenticated?(password)
      if password_object == password
        update_hash!(password) if password_object.stale?
        return true
      end

      return false
    end
240180
def is_common_password(raw, freq=0):
    
    frequent = WORDS.get(raw, 0)
    if freq:
        return frequent > freq
    return bool(frequent)