def key_from_password(password):
    """This method just hashes self.password."""
    if isinstance(password, unicode):
        password = password.encode('utf-8')
    if not isinstance(password, bytes):
        raise TypeError("password must be byte string, not %s" % type(password))
    
    sha = SHA256.new()
    sha.update(password)
    return sha.digest()