def encrypt(data, raw_pubkey)
      raise ArgumentError, "invalid pubkey of length #{raw_pubkey.size}" unless raw_pubkey.size == 64
      Crypto::ECIES.encrypt data, raw_pubkey
    end
def encrypt(data, raw_pubkey)
      raise ArgumentError, "invalid pubkey of length #{raw_pubkey.size}" unless raw_pubkey.size == 64
      Crypto::ECIES.encrypt data, raw_pubkey
    end
Encrypt data with ECIES method using the public key of the recipient.