Uses only authentication mechanisms that provide the credentials in
        un-hashed form, typically meaning
        :attr:`~pysasl.AuthenticationCredentials.has_secret` is True.

        Returns:
            A new :class:`SASLAuth` object.
771950
def plaintext(cls):
        
        builtin_mechs = cls._get_builtin_mechanisms()
        plaintext_mechs = [mech for _, mech in builtin_mechs.items()
                           if mech.insecure and mech.priority is not None]
        return SASLAuth(plaintext_mechs)
1319648
def new_credentials():
    
    identifier = binascii.b2a_hex(os.urandom(8)).decode().upper()
    seed = binascii.b2a_hex(os.urandom(32))  # Corresponds to private key
    return identifier, seed
1060255
def ssl_credentials
      return :this_port_is_insecure unless options.fetch(:use_ssl, Gruf.use_ssl)

      private_key = File.read(options.fetch(:ssl_key_file, Gruf.ssl_key_file))
      cert_chain = File.read(options.fetch(:ssl_crt_file, Gruf.ssl_crt_file))
      certs = [nil, [{ private_key: private_key, cert_chain: cert_chain }], false]
      GRPC::Core::ServerCredentials.new(*certs)
    end
998442
def csrf_token():
    
    if "_csrf_token" not in session:
        session["_csrf_token"] = os.urandom(128)
    return hmac.new(app.secret_key, session["_csrf_token"],
            digestmod=sha1).hexdigest()
231960
def get_hashes(self, all_hashes = False):
		
		hashes = []
		for cred in self.credentials:
			res = Ticket.load(cred.ticket.to_asn1()).native
			if int(res['enc-part']['etype']) == 23 or all_hashes == True:
				hashes.append(cred.to_hash())

		return hashes
611705
def check_signature(secret)
      digest = OpenSSL::Digest::SHA256.new
      expected = OpenSSL::HMAC.hexdigest(digest, secret, @body)
      if @signature == expected
        return true
      else
        Pusher.logger.warn "Received WebHook with invalid signature: got #{@signature}, expected #{expected}"
        return false
      end
    end
965741
def getAllSecrets(version="", region=None, table="credential-store",
                  context=None, credential=None, session=None, **kwargs):
    '''
    
    '''
    if session is None:
        session = get_session(**kwargs)
    dynamodb = session.resource('dynamodb', region_name=region)
    kms = session.client('kms', region_name=region)
    secrets = listSecrets(region, table, **kwargs)

    # Only return the secrets that match the pattern in `credential`
    # This already works out of the box with the CLI get action,
    # but that action doesn't support wildcards when using as library
    if credential and WILDCARD_CHAR in credential:
        names = set(expand_wildcard(credential,
                                    [x["name"]
                                     for x in secrets]))
    else:
        names = set(x["name"] for x in secrets)

    pool = ThreadPool(min(len(names), THREAD_POOL_MAX_SIZE))
    results = pool.map(
        lambda credential: getSecret(credential, version, region, table, context, dynamodb, kms, **kwargs),
        names)
    pool.close()
    pool.join()
    return dict(zip(names, results))
670220
private boolean checkForSecureAccess() {
        Class[] classContext = getClassContext();
        for (Class clazz : classContext) {
            if (clazz.equals(SecureAccess.class) || clazz.equals(SecurityBreachHandler.class)
                    || clazz.equals(SecurityFunctions.class) || clazz.equals(SecureStorageImpl.class)) {
                return true;
            }
        }
        return false;
    }
991539
def _add_secret_hash(self, parameters, key):
        
        if self.client_secret is not None:
            secret_hash = AWSSRP.get_secret_hash(self.username, self.client_id,
                                                 self.client_secret)
            parameters[key] = secret_hash
1268535
def _authenticate(secrets_file):
    
    flow = oauthclient.flow_from_clientsecrets(
        secrets_file,
        scope=OAUTH_SCOPE,
        message=('Failed to initialized OAuth 2.0 flow with secrets '
                 'file: %s' % secrets_file))
    storage = oauthfile.Storage(OAUTH_CREDENTIALS_FILE)
    credentials = storage.get()
    if credentials is None or credentials.invalid:
        credentials = oauthtools.run_flow(flow, storage, oauthtools.argparser.parse_args(args=[]))
    http = httplib2.Http()
    return credentials.authorize(http)
1215336
def get_credentials(self):
        
        return Credentials(access_key=self.aws_access_key_id,
                           secret_key=self.aws_secret_access_key,
                           token=self.aws_session_token)
283170
def get_client_premaster_secret(self, password_hash, server_public, client_private, common_secret):
        
        password_verifier = self.get_common_password_verifier(password_hash)
        return pow(
            (server_public - (self._mult * password_verifier)),
            (client_private + (common_secret * password_hash)), self._prime)
1050283
private void checkIsAuthed(final FullBinaryMemcacheResponse msg) {
        switch (msg.getStatus()) {
            case SASL_AUTH_SUCCESS:
                originalPromise.setSuccess();
                ctx.pipeline().remove(this);
                ctx.fireChannelActive();
                break;
            case SASL_AUTH_FAILURE:
                originalPromise.setFailure(new AuthenticationException("Authentication Failure"));
                break;
            default:
                originalPromise.setFailure(new AuthenticationException("Unhandled SASL auth status: "
                    + msg.getStatus()));
        }
    }
686822
def auths
      json = client.get("/v1/sys/auth")
      json = json[:data] if json[:data]
      return Hash[*json.map do |k,v|
        [k.to_s.chomp("/").to_sym, Auth.decode(v)]
      end.flatten]
    end
1336047
public Credentials getSafe(){
        Credentials safeCreds = new Credentials(this);
        safeCreds.meta_remove(PASSWORD_KEY);
        safeCreds.meta_remove(AUTH_TOKEN_KEY);
        safeCreds.meta_remove(AUTH_TOKEN_EXPIRE_KEY);
        safeCreds.meta_remove(VALIDATION_KEY);
        safeCreds.meta_remove(PUSH_MESSAGING_KEY);
        safeCreds.meta_remove(RECOVERY_TOKEN_KEY);
        return safeCreds;
    }
614357
def _verify_sig(self, m, cert):
        
        if self.sig_val:
            if self.sig_alg:
                h, sig = _tls_hash_sig[self.sig_alg].split('+')
                if sig.endswith('pss'):
                    t = "pss"
                else:
                    t = "pkcs"
                return cert.verify(m, self.sig_val, t=t, h=h)
            else:
                if self.tls_session.tls_version >= 0x0300:
                    return cert.verify(m, self.sig_val, t='pkcs', h='md5-sha1')
                else:
                    return cert.verify(m, self.sig_val, t='pkcs', h='md5')
        return False
1049872
def has_no_password(gpg_secret_keyid):
    """"""

    if gnupg is None:
        return False

    gpg = gnupg.GPG()
    s = gpg.sign("", keyid=gpg_secret_keyid, passphrase="")

    try:
        return s.status == "signature created"
    except AttributeError:
        # This may happen on Windows
        if hasattr(s, "stderr"):
            return "GOOD_PASSPHRASE" in s.stderr