How can i generate ec curve25519 keys using openSSL? When I run

openssl ecparam -name curve25519 -genkey -noout -out private.ec.key

I have this message

unknown curve name (curve25519)

1 Answer 1


Use the genpkey command:

openssl genpkey -algorithm x25519

or, for edwards25519:

openssl genpkey -algorithm ed25519

This requires a recent OpenSSL version.

  • $\begingroup$ openssl say: Algorithm x25519 not found $\endgroup$ Jun 25, 2019 at 9:20
  • $\begingroup$ Your OpenSSL version is too old. $\endgroup$ Jun 25, 2019 at 9:34
  • $\begingroup$ when i run openssl version it answer with LibreSSL 2.6.5 $\endgroup$ Jun 25, 2019 at 9:52
  • 1
    $\begingroup$ You need to update your openssl version to 1.1.1 minimum $\endgroup$
    – camp0
    Jun 25, 2019 at 10:14
  • $\begingroup$ @camp0+ 1.1.0 has x25519; 1.1.1 adds ed25519 x448 ed448 . Libre, although it started as a fork, is now separate and I don't know its status/history. $\endgroup$ Jun 28, 2019 at 0:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.