OPENSSL-DHPARAM(1ossl)
π OPENSSL-DHPARAM π
okay so bestie, welcome to the openssl-dhparam page β it lives in the OpenSSL manual, and it's literally all about DH parameter manipulation and generation. yes. that's the whole vibe. let's get into it π
β¨ SYNOPSIS β¨
openssl dhparam [-help] [-inform DER|PEM] [-outform DER|PEM] [-in
filename] [-out filename] [-dsaparam] [-check] [-noout] [-text]
[-verbose] [-quiet] [-2] [-3] [-5] [-engine id] [-rand files]
[-writerand file] [-provider name] [-provider-path path] [-provparam
[name:]key=value] [-propquery propq] [numbits]
like, that's a lot of flags but we're gonna go through every single one, don't even worry π«Ά
πΈ DESCRIPTION πΈ
This command is used to manipulate DH parameter files. that's it, that's the job. main character energy honestly.
also!! if you wanna see examples of how to generate a key using a named safe prime group without generating intermediate parameters, go peek at EXAMPLES in openssl-genpkey(1). iykyk π
π₯ OPTIONS π₯
-helpβ prints out a usage message. classic. always there for you π-inform DER|PEM,-outform DER|PEMβ the input format and the output format. default isPEM, no cap. the object is compatible with the PKCS#3 DHparameter structure. for all the deets, checkopenssl-format-options(1)β¨-in filenameβ tells it which input file to read parameters from. if you don't specify it, it reads from standard input π«Ά-out filenameβ which output file to write parameters to. if this option isn't present, standard output gets used. and yes, the output filename can be the same as the input filename β which leads to replacing the file contents. π
β οΈ heads up bestie: file I/O is not atomic. the output file gets truncated and then written. so like, don't be surprised, okay?
-dsaparamβ if you use this, DSA parameters are read or created rather than DH parameters, and then they get converted to DH format. otherwise, safe primes (meaning(p-1)/2is also prime) are used for DH parameter generation.
DH parameter generation with the -dsaparam option is much faster. πββοΈπ¨ but beware β with such DSA-style DH parameters, a fresh DH key should be created for each use to avoid small-subgroup attacks that may be possible otherwise. like, actually. not a drill π
-checkβ performs numerous checks to see if the supplied parameters are valid, and displays a warning if they're not. it's giving vibe check but for math π-2,-3,-5β the generator to use: either2,3or5. if one of these is present then the input file is ignored and parameters are generated instead. if it's not present butnumbitsis present, parameters are generated with the default generator2β¨numbitsβ says a parameter set should be generated of size numbits. it must be the last option. if it's present then the input file is ignored and parameters are generated instead. if it's not present but a generator (-2,-3or-5) is present, parameters are generated with a default length of 2048 bits. the minimum length is 512 bits. the maximum length is 10000 bits. respect the range π-nooutβ inhibits the output of the encoded version of the parameters. sometimes you just don't wanna be perceived π-textβ prints out the DH parameters in human readable form. for when you want to actually see it π-engine idβ see "Engine Options" inopenssl(1). also: this option is deprecated. yeah. we moved on π«-rand files,-writerand fileβ see "Random State Options" inopenssl(1)for the details π-provider name-provider-path path-provparam [name:]key=value-propquery propqβ see "Provider Options" inopenssl(1), plusprovider(7)andproperty(7). slay β-verboseβ enables the output of progress messages, which is handy when running commands interactively that may take a long time to execute. bless, honestly π-quietβ suppresses the output of progress messages, which may be undesirable in batch scripts or pipelines. shhh π€«
π¦ NOTES π¦
This command replaces the dh and gendh commands of previous releases. out with the old, in with the iconic β¨
π SEE ALSO π
openssl(1), openssl-pkeyparam(1), openssl-dsaparam(1), openssl-genpkey(1).
go read them, they're all besties π
π HISTORY π
- The
-engineoption was deprecated in OpenSSL 3.0. - The
-Coption was removed in OpenSSL 3.0. rip bozo πͺ¦
π COPYRIGHT π
Copyright 2000-2023 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
k bye bestie, this page was brought to you by OpenSSL 3.5.0, dated 2026-09-25, and the header OPENSSL-DHPARAM(1ossl) πΈπ periodt.
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms