I would like to use Elliptic Curve Cryptography to asymmetrically encrypt data. That is encrypt data using a public ECC key, so that only someone with the corresponding private key can decrypt it.

I'm aware you cannot just encrypt any arbitrary data with ECC (or with any asymmetric encryption scheme for that matter) so typically you'd just encrypt a one-time random key that is smaller than the ECC key size, say 128 bit. And then encrypt the actual data using a simple symmetric cipher (like AES) with that random key.

I just learned it doesn't work quite like that with ECC, but a scheme like ECIES does something similar adapted for ECC.

My question: **is there a way to do this with openssl or a similar commonly available tool?**

So suppose I have an ECC keypair e.g. `MyPrivateEd25519Key.pem`

and `MyPublicEd25519Key.pem`

(or secp256k1 or secp521r1 or whatever is suitable) and a data file. Can I encrypt the file using the public ECC key, and then decrypt the result using the private key?

I'm quite unclear as to how I can pull this off (if at all) with `openssl`

.