X25519: how to generate public key?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

X25519: how to generate public key?

Olivier Meunier
Hi,

using openSSL 1.1.0e, I generate my private key using:
openssl genpkey -algorithm x25519 -out x25519.key.pem

But I cannot find how to generate the public key. I tried:
openssl ec -in x25519.key.pem -pubout -out x25519.key.pub.pem
but got the errors:
read EC key
unable to load Key
16084:error:0608308E:digital envelope
routines:EVP_PKEY_get0_EC_KEY:expecting a ec key:crypto\evp\p_lib.c:319:

What is the right command to get the public key?
Thanks,

Olivier

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: X25519: how to generate public key?

Dr. Stephen Henson
On Tue, Mar 14, 2017, Olivier Meunier wrote:

> Hi,
>
> using openSSL 1.1.0e, I generate my private key using:
> openssl genpkey -algorithm x25519 -out x25519.key.pem
>
> But I cannot find how to generate the public key. I tried:
> openssl ec -in x25519.key.pem -pubout -out x25519.key.pub.pem
> but got the errors:
> read EC key
> unable to load Key
> 16084:error:0608308E:digital envelope
> routines:EVP_PKEY_get0_EC_KEY:expecting a ec
> key:crypto\evp\p_lib.c:319:
>
> What is the right command to get the public key?
> Thanks,
>

X25519 is trteated as a distinct algorithm, not as an EC curve.

You don't actually "generate" the public key you can extract or calculate the
public key corresponding to a private key though.

The pkey command can do this for any supported algorithm:

openssl pkey -in privkey.pem -pubout -out pubkey.pem

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org
--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: X25519: how to generate public key?

Olivier Meunier
Thank you for your quick answer.
Olivier

Le 14/03/2017 à 13:43, Dr. Stephen Henson a écrit :

> On Tue, Mar 14, 2017, Olivier Meunier wrote:
>
>> Hi,
>>
>> using openSSL 1.1.0e, I generate my private key using:
>> openssl genpkey -algorithm x25519 -out x25519.key.pem
>>
>> But I cannot find how to generate the public key. I tried:
>> openssl ec -in x25519.key.pem -pubout -out x25519.key.pub.pem
>> but got the errors:
>> read EC key
>> unable to load Key
>> 16084:error:0608308E:digital envelope
>> routines:EVP_PKEY_get0_EC_KEY:expecting a ec
>> key:crypto\evp\p_lib.c:319:
>>
>> What is the right command to get the public key?
>> Thanks,
>>
> X25519 is trteated as a distinct algorithm, not as an EC curve.
>
> You don't actually "generate" the public key you can extract or calculate the
> public key corresponding to a private key though.
>
> The pkey command can do this for any supported algorithm:
>
> openssl pkey -in privkey.pem -pubout -out pubkey.pem
>
> Steve.
> --
> Dr Stephen N. Henson. OpenSSL project core developer.
> Commercial tech support now available see: http://www.openssl.org

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users