Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(22)  |  Call(16)  |  Derive(0)  |  Import(6)
Return SHA256 digest of the string `s`.

        def sha256(s):
    """Return SHA256 digest of the string `s`."""
    return hashlib.sha256(s).digest()
        


src/l/i/libkeepass-0.1.2/libkeepass/kdb4.py   libkeepass(Download)
 
 
from crypto import xor, sha256, aes_cbc_decrypt, aes_cbc_encrypt
from crypto import transform_key, pad, unpad
 
        stream.write(header)
 
        headerHash = base64.b64encode(sha256(header))
        self.obj_root.Meta.HeaderHash = headerHash
 
        """
        super(KDB4File, self)._make_master_key()
        composite = sha256(''.join(self.keys))
        tkey = transform_key(composite, 
            self.header.TransformSeed, 
            self.header.TransformRounds)
        self.master_key = sha256(self.header.MasterSeed + tkey)
    def __init__(self, unprotect=True):
        self._salsa_buffer = bytearray()
        self.salsa = Salsa20(
            sha256(self.header.ProtectedStreamKey), 
            KDB4_SALSA20_IV)

src/l/i/libkeepass-HEAD/keepass/kdb4.py   libkeepass(Download)
 
 
from crypto import xor, sha256, aes_cbc_decrypt, aes_cbc_encrypt
from crypto import transform_key, pad, unpad
 
        stream.write(header)
 
        headerHash = base64.b64encode(sha256(header))
        self.obj_root.Meta.HeaderHash = headerHash
 
        """
        super(KDB4File, self)._make_master_key()
        composite = sha256(''.join(self.keys))
        tkey = transform_key(composite, 
            self.header.TransformSeed, 
            self.header.TransformRounds)
        self.master_key = sha256(self.header.MasterSeed + tkey)
    def __init__(self, unprotect=True):
        self._salsa_buffer = bytearray()
        self.salsa = Salsa20(
            sha256(self.header.ProtectedStreamKey), 
            KDB4_SALSA20_IV)

src/l/i/libkeepass-0.1.2/libkeepass/kdb3.py   libkeepass(Download)
import base64
 
from crypto import xor, sha256, aes_cbc_decrypt
from crypto import transform_key, unpad
 
        data = unpad(data)
 
        if self.header.ContentHash == sha256(data):
            # put data in bytes io
            self.in_buffer = io.BytesIO(data)
            self.header.MasterSeed2, 
            self.header.KeyEncRounds)
        self.master_key = sha256(self.header.MasterSeed + tkey)
 
 

src/l/i/libkeepass-HEAD/keepass/kdb3.py   libkeepass(Download)
import base64
 
from crypto import xor, sha256, aes_cbc_decrypt
from crypto import transform_key, unpad
 
        data = unpad(data)
 
        if self.header.ContentHash == sha256(data):
            # put data in bytes io
            self.in_buffer = io.BytesIO(data)
            self.header.MasterSeed2, 
            self.header.KeyEncRounds)
        self.master_key = sha256(self.header.MasterSeed + tkey)
 
 

src/l/i/libkeepass-0.1.2/libkeepass/common.py   libkeepass(Download)
 
import io
from crypto import sha256
 
class KDBFile(object):
    def add_credentials(self, **credentials):
        if credentials.has_key('password'):
            self.add_key_hash(sha256(credentials['password']))
        if credentials.has_key('keyfile'):
            self.add_key_hash(load_keyfile(credentials['keyfile']))
            return key.decode('hex')
        # anything else may be a file to hash for the key
        return sha256(key)
    raise IOError('Could not read keyfile.')
 

src/l/i/libkeepass-HEAD/keepass/common.py   libkeepass(Download)
 
import io
from crypto import sha256
 
class KDBFile(object):
    def add_credentials(self, **credentials):
        if credentials.has_key('password'):
            self.add_key_hash(sha256(credentials['password']))
        if credentials.has_key('keyfile'):
            self.add_key_hash(load_keyfile(credentials['keyfile']))
            return key.decode('hex')
        # anything else may be a file to hash for the key
        return sha256(key)
    raise IOError('Could not read keyfile.')