OpenSSL "genpkey -genparam" - Generate DH Parameters

Q

How to generate a new DH parameter file using OpenSSL "genpkey -genparam" command?

✍: FYIcenter.com

A

If you need a new DH parameter file in order to create new DH keys, you can use the OpenSSL "genpkey -genparam" command as shown below:

C:\Users\fyicenter>\local\openssl\openssl.exe

OpenSSL> genpkey -genparam -algorithm dh -out my_dh.prm
.......................................+........................................
............................................................................+...
............+..+................................................................
................................................................................
......................+...........................+.............................
...............................................................................+
............+...................................................................
...........+...........................+........................................
..................................+.............................................
.................................................+............+.................
.....................................................+..........................
.+.....+........+............+.............+......................+....+.....+..
...........................................................+.........+..........
........................+.....................................+.+..++*++*++*

OpenSSL> exit

C:\Users\fyicenter>type my_dh.prm
-----BEGIN DH PARAMETERS-----
MIGHAoGBALzizRYfhhdc1miJMXG88tKCCdLOSIG7G2Fsh27ec41AP+pExiT781P/
JjnLmy85Niy9OhTZDkiSnAqNiWO+DC/3elIKjHfxQgBMMd+57MCduH9MEOVEQKb/
drJkPFeCBShJlM+KyoNCpLfV0Tu/icb/KTQAUdiQA0cehBtTNmwzAgEC
-----END DH PARAMETERS-----

Options used in this command are:

  • "-genparam" - Generate key generation required parameters
  • "-algorighm dh" - Use DH algorithm
  • "-out my_dh.prm" - Save output (the new DH key generation parameters) in a file.

 

OpenSSL "pkeyparam -text" - Print DH Parameters in Text

OpenSSL "genpkey" Command for DH Keys

OpenSSL "genpkey" Command for DH Keys

⇑⇑ OpenSSL Tutorials

2017-11-02, 2504🔥, 0💬