1DHPARAM(1) OpenSSL DHPARAM(1)
2
3
4
6 dhparam - DH parameter manipulation and generation
7
9 openssl dhparam [-inform DER|PEM] [-outform DER|PEM] [-in filename]
10 [-out filename] [-dsaparam] [-check] [-noout] [-text] [-C] [-2] [-5]
11 [-rand file(s)] [-engine id] [numbits]
12
14 This command is used to manipulate DH parameter files.
15
17 -inform DER|PEM
18 This specifies the input format. The DER option uses an ASN1 DER
19 encoded form compatible with the PKCS#3 DHparameter structure. The
20 PEM form is the default format: it consists of the DER format
21 base64 encoded with additional header and footer lines.
22
23 -outform DER|PEM
24 This specifies the output format, the options have the same meaning
25 as the -inform option.
26
27 -in filename
28 This specifies the input filename to read parameters from or
29 standard input if this option is not specified.
30
31 -out filename
32 This specifies the output filename parameters to. Standard output
33 is used if this option is not present. The output filename should
34 not be the same as the input filename.
35
36 -dsaparam
37 If this option is used, DSA rather than DH parameters are read or
38 created; they are converted to DH format. Otherwise, "strong"
39 primes (such that (p-1)/2 is also prime) will be used for DH
40 parameter generation.
41
42 DH parameter generation with the -dsaparam option is much faster,
43 and the recommended exponent length is shorter, which makes DH key
44 exchange more efficient. Beware that with such DSA-style DH
45 parameters, a fresh DH key should be created for each use to avoid
46 small-subgroup attacks that may be possible otherwise.
47
48 -check
49 check if the parameters are valid primes and generator.
50
51 -2, -5
52 The generator to use, either 2 or 5. If present then the input file
53 is ignored and parameters are generated instead. If not present but
54 numbits is present, parameters are generated with the default
55 generator 2.
56
57 -rand file(s)
58 a file or files containing random data used to seed the random
59 number generator, or an EGD socket (see RAND_egd(3)). Multiple
60 files can be specified separated by a OS-dependent character. The
61 separator is ; for MS-Windows, , for OpenVMS, and : for all others.
62
63 numbits
64 this option specifies that a parameter set should be generated of
65 size numbits. It must be the last option. If this option is present
66 then the input file is ignored and parameters are generated
67 instead. If this option is not present but a generator (-2 or -5)
68 is present, parameters are generated with a default length of 2048
69 bits.
70
71 -noout
72 this option inhibits the output of the encoded version of the
73 parameters.
74
75 -text
76 this option prints out the DH parameters in human readable form.
77
78 -C this option converts the parameters into C code. The parameters can
79 then be loaded by calling the get_dhnumbits() function.
80
81 -engine id
82 specifying an engine (by its unique id string) will cause dhparam
83 to attempt to obtain a functional reference to the specified
84 engine, thus initialising it if needed. The engine will then be set
85 as the default for all available algorithms.
86
88 The program dhparam combines the functionality of the programs dh and
89 gendh in previous versions of OpenSSL and SSLeay. The dh and gendh
90 programs are retained for now but may have different purposes in future
91 versions of OpenSSL.
92
94 PEM format DH parameters use the header and footer lines:
95
96 -----BEGIN DH PARAMETERS-----
97 -----END DH PARAMETERS-----
98
99 OpenSSL currently only supports the older PKCS#3 DH, not the newer
100 X9.42 DH.
101
102 This program manipulates DH parameters not keys.
103
105 There should be a way to generate and manipulate DH keys.
106
108 dsaparam(1)
109
111 The dhparam command was added in OpenSSL 0.9.5. The -dsaparam option
112 was added in OpenSSL 0.9.6.
113
114
115
1161.0.2k 2017-01-26 DHPARAM(1)