Reputation: 3802
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
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