def encrypt_message(address, message):
    hex_public_key = get_public_key_from_address(address)
    x, y = sec_to_public_pair(hex_public_key.decode('hex'))
    public_key = PubKey(BasePoint.curve(), x, y)
    encrypted = b64encode(public_key.encrypt(message))
    return encrypted
Encrypts a message to an address.
dataset/ETHPy150Open coinmessage/coinmessage/coinmessage/__init__.py/encrypt_message