Returning the password and immediately destroying it
328050
def __password(self):
        """"""
        passwd = copy(self._inp_password.value)
        self._inp_password.value = ''
        return passwd
845542
def password_hash(password):
    
    try:
        return bcrypt_sha256.encrypt(password)
    except TypeError:
        return bcrypt_sha256.encrypt(password.decode('utf-8'))
750301
def reset_passwd(self, data):
        
        error = False
        msg = ""

        # Check input format
        if len(data["passwd"]) < 6:
            error = True
            msg = _("Password too short.")
        elif data["passwd"] != data["passwd2"]:
            error = True
            msg = _("Passwords don't match !")

        if not error:
            passwd_hash = hashlib.sha512(data["passwd"].encode("utf-8")).hexdigest()
            user = self.database.users.find_one_and_update({"reset": data["reset_hash"]},
                                                           {"$set": {"password": passwd_hash},
                                                            "$unset": {"reset": True, "activate": True}})
            if user is None:
                error = True
                msg = _("Invalid reset hash.")
            else:
                msg = _("Your password has been successfully changed.")

        return msg, error
294897
def password_generator(length):
    
    return ''.join(random.choice(string.ascii_lowercase + string.digits)
                   for _ in range(length))
570031
function encryptPassword(password, callback) {
        bcrypt.gen_salt(workFactor, function(err, salt) {
            if (err) callback(err);
            
            bcrypt.encrypt(password, salt, function(err, hashedPassword) {
                if (err) callback(err);
                
                callback(null, hashedPassword);
            });
        });
    }
1166605
def password
      return @unsaved_password if @unsaved_password
      out_buffer = FFI::MemoryPointer.new(:pointer)
      status = Sec.SecItemCopyMatching({Sec::Query::ITEM_LIST => CF::Array.immutable([self]),
                                        Sec::Query::SEARCH_LIST => [self.keychain],
                                        Sec::Query::CLASS => self.klass,
                                        Sec::Query::RETURN_DATA => true}.to_cf, out_buffer)
      Sec.check_osstatus(status)
      CF::Base.typecast(out_buffer.read_pointer).release_on_gc.to_s
    end
393252
def del_password(name, root=None):
    '''
    
    '''
    cmd = ['passwd']
    if root is not None:
        cmd.extend(('-R', root))
    cmd.extend(('-d', name))

    __salt__['cmd.run'](cmd, python_shell=False, output_loglevel='quiet')
    uinfo = info(name, root=root)
    return not uinfo['passwd'] and uinfo['name'] == name
1200995
def reset(self):
        '''
        
        '''
        t = self
        while t._output is not None:
            t = t._output
        while t is not None:
            if t._pop and t._pop.returncode is None:
                t._pop.kill()
                t._pop.wait()
            del t._pop
            t._pop = None
            t = t._input
        return self
316028
def dispose(self):
        """"""
        self._username = None
        self._password = None
        self._org_url = None
        self._proxy_url = None
        self._proxy_port = None
        self._token_url = None
        self._securityHandler = None
        self._valid = None
        self._message = None

        del self._username
        del self._password
        del self._org_url
        del self._proxy_url
        del self._proxy_port
        del self._token_url
        del self._securityHandler
        del self._valid
        del self._message
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
1321524
def double_prompt_for_plaintext_password():
    """"""
    password = 1
    password_repeat = 2
    while password != password_repeat:
        password = getpass.getpass('Enter password: ')
        password_repeat = getpass.getpass('Repeat password: ')
        if password != password_repeat:
            sys.stderr.write('Passwords do not match, try again.\n')
    return password
1101538
function (password, salt) {
            // Shortcut
            var cfg = this.cfg;

            // Init HMAC
            var hmac = HMAC.create(cfg.hasher, password);

            // Initial values
            var derivedKey = WordArray.create();
            var blockIndex = WordArray.create([0x00000001]);

            // Shortcuts
            var derivedKeyWords = derivedKey.words;
            var blockIndexWords = blockIndex.words;
            var keySize = cfg.keySize;
            var iterations = cfg.iterations;

            // Generate key
            while (derivedKeyWords.length < keySize) {
                var block = hmac.update(salt).finalize(blockIndex);
                hmac.reset();

                // Shortcuts
                var blockWords = block.words;
                var blockWordsLength = blockWords.length;

                // Iterations
                var intermediate = block;
                for (var i = 1; i < iterations; i++) {
                    intermediate = hmac.finalize(intermediate);
                    hmac.reset();

                    // Shortcut
                    var intermediateWords = intermediate.words;

                    // XOR intermediate with block
                    for (var j = 0; j < blockWordsLength; j++) {
                        blockWords[j] ^= intermediateWords[j];
                    }
                }

                derivedKey.concat(block);
                blockIndexWords[0]++;
            }
            derivedKey.sigBytes = keySize * 4;

            return derivedKey;
        }
1003072
def destroy():
    """"""
    if not os.path.exists(ARGS.database):
        exit('Error: The database does not exist; you must create it first.')
    if ARGS.force:
        os.remove(ARGS.database)
    elif raw_input('Destroy {0} [y/n]? '.format(ARGS.database)) in ('y', 'Y'):
        os.remove(ARGS.database)
1307036
def password=(password)
      raise ArgumentError, "The new password cannot be nil"   unless password
      raise ArgumentError, "The new password cannot be empty" if password.empty?

      self.service.editObject({ "password" => password.to_s })
      self.refresh_details()
    end
51663
def _generate_password():
    
    uuid_str = six.text_type(uuid.uuid4()).encode("UTF-8")
    return hashlib.sha1(uuid_str).hexdigest()
37669
def unlock(self, password, auth_no_user_interaction=None):
        """"""
        return self._M.Encrypted.Unlock(
            '(sa{sv})',
            password,
            filter_opt({
                'auth.no_user_interaction': ('b', auth_no_user_interaction),
            })
        )
1079117
function (req, res) {
    User.destroy({id: req.params.id}).exec(function (err, user) {
      if(err) return res.json({ err: err }, 500);
      else res.ok();
    });
  }