Checks a password
324814
def simple_password(request):
    
    if request.method == "POST":
        form = PasswordForm(data=request.POST)
        if form.is_valid():
            # TODO: set session with better param
            request.session["simple_auth"] = True
            return redirect(form.cleaned_data["url"] or "/")
    else:
        form = PasswordForm()
    return render(request, "simple_auth/password_form.html",
                  {"form": form})
412912
def getpass(self, prompt, default=None):
        """"""
        return click.prompt(prompt, hide_input=True, default=default)
1263557
public function checkPassword(): bool
    {
        if (!isset($this->regex)) {
            return true;
        }

        return filter_var($this->password, FILTER_VALIDATE_REGEXP, [
            'options' => [
                'regexp' => $this->regex
            ]
        ]);
    }
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
1362940
function checkPassword($password)
    {
        if ($this->password == '') {
            return false;
        }
        list ($algo, $salt, $hash) = explode(':', $this->password);
        if ($hash == $algo($salt . $password)) {
            return true;
        } else {
            return false;
        }
    }
495995
private char[] readPassword(String description, boolean echoInput) {
        getConsole().print(description + ": ");
        return getConsole().readPassword(echoInput);
    }
894656
def is_password(self, is_password):
        

        if is_password:
            self.is_forgetable = True

        self._is_password = is_password
1092872
def make_password(length, chars=string.letters + string.digits + '#$%&!'):
    
    return get_random_string(length, chars)
100285
def authenticated?(password)
      if password_object == password
        update_hash!(password) if password_object.stale?
        return true
      end

      return false
    end
649089
def is_valid_password(password):
    
    pattern = re.compile(r"^.{4,25}$")
    return password and pattern.match(password)
110499
protected function checkLogin()
    {
        $pass = $this->doc->__get("password");
        if($pass){
            if(session('pass') === md5($pass)){
                return true;
            }else{
                return false;
            }
        }else{
            return true;
        }
    }
1014143
def inspect
      inspected = super

      # mask password
      inspected.gsub! @password, '*******' if @password
      inspected.gsub! @management_console_password, '*******' if @management_console_password
      inspected.gsub! @bearer_token, '********' if @bearer_token
      # Only show last 4 of token, secret
      inspected.gsub! @access_token, "#{'*'*36}#{@access_token[36..-1]}" if @access_token
      inspected.gsub! @client_secret, "#{'*'*36}#{@client_secret[36..-1]}" if @client_secret

      inspected
    end
1163561
def _padd_password(self):
        """"""
        password = self.session._auth_password
        if isinstance(password, str):
            password = str.encode(password)
        return password.ljust(16, b'\x00')
467628
def check_auth(self, username, password):
        '''  '''
        return username == self.queryname and password == self.querypw
1135150
def _prompt_password(prompt="Password: "):
    """"""
    fd = sys.stdin.fileno()
    old_settings = termios.tcgetattr(fd)
    tty.setraw(fd)

    print(prompt, end="", flush=True)
    password = []
    try:
        while True:
            ch = sys.stdin.buffer.read(1)[0]
            if ch in (ord("\r"), ord("\n"), 4):  # If user presses Enter or ctrl-d
                print("\r")
                break
            elif ch == 127:  # DEL
                try:
                    password.pop()
                except IndexError:
                    pass
                else:
                    print("\b \b", end="", flush=True)
            elif ch == 3:  # ctrl-c
                print("^C", end="", flush=True)
                raise KeyboardInterrupt
            else:
                password.append(ch)
                print("*", end="", flush=True)
    finally:
        termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)

    return bytes(password).decode()
210166
def password_prompt(ctx, param, value):
    """"""
    if ctx.resilient_parsing:
        return

    if not value:
        if 'password_stdin' in ctx.params:
            with click.open_file('-') as fp:
                value = fp.read().strip('\n')
        else:
            value = click.prompt('Password', hide_input=True)

    click.echo(value)
    return value
1003752
def hash_password(self, plain_password):
        """"""
        salt = uuid.uuid4().hex
        encrypted_password = self.get_hash(salt, plain_password)
        return salt + '$' + encrypted_password