Rorschach
Rorschach

Reputation: 3802

Basic use of openssl parameters and key generation

Using openssl, I am trying to generate shared parameters with Diffie-Hellman with 2048 modulus.

I believe that I can do this like this: openssl dhparam -C 2048

But, I am trying to complete the whole algorithm and am following a tutorial here: https://sandilands.info/sgordon/diffie-hellman-secret-key-exchange-with-openssl

This tutorial I believe uses the line: openssl genpkey -genparam -algorithm DH -out dhp.pem to generate the same thing but without using the 2048 modulus (i could be wrong here).

How do integrate my use of dhparam instead of genpkey into this tutorial so that I can choose the modulus of 2048, or how do I choose the modulus of genpkey or am I fundamentally misunderstanding something here?

Upvotes: 1

Views: 1571

Answers (1)

oliv
oliv

Reputation: 13239

genpkey is the general purpose key generation utility of openssl.

dhparam is dedicated to diffie-hellman.

Both can be used for the same purpose. In you context you would have to use either

openssl genpkey -genparam -algorithm DH -pkeyopt dh_paramgen_prime_len:2048

or

openssl dhparam 2048

Upvotes: 4

Related Questions