convert a passphrase to a 32 byte key

def passphrase_to_key(self, passphrase):
        '''convert a passphrase to a 32 byte key'''
        import hashlib
        h = hashlib.new('sha256')
        h.update(passphrase)
        return h.digest()