openssl ecparam -name sect571r1 -genkey -noout -out alice_priv_key.pem
openssl ecparam -name sect571r1 -genkey -noout -out bob_priv_key.pem
Extract public key
openssl ec -in alice_priv_key.pem -pubout -out alice_pub_key.pem
openssl ec -in bob_priv_key.pem -pubout -out bob_pub_key.pem
openssl pkeyutl -derive -inkey alice_priv_key.pem -peerkey bob_pub_key.pem -out alice_shared_secret.bin
openssl pkeyutl -derive -inkey bob_priv_key.pem -peerkey alice_pub_key.pem -out bob_shared_secret.bin
base64 alice_shared_secret.bin
base64 bob_shared_secret.bin
diff <(base64 alice_shared_secret.bin) <(base64 bob_shared_secret.bin)
openssl enc -aes-256-cbc -base64 -pass file:alice_shared_secret.bin -md sha256 -p -e -in plain.txt -out cipher.txt
openssl enc -aes-256-cbc -base64 -pass file:bob_shared_secret.bin -md sha256 -p -d -in cipher.txt -out plain_again.txt
openssl enc -aes-256-cbc -base64 -pass file:bob_shared_secret.bin -md sha256 -p -e -in plain.txt -out cipher.txt
openssl enc -aes-256-cbc -base64 -pass file:alice_shared_secret.bin -md sha256 -p -d -in cipher.txt -out plain_again.txt
https://jameshfisher.com/2017/04/14/openssl-ecc/