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] [-noout] [-text] [-C] [-2] [-5] [-rand
11 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 stan‐
29 dard 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 param‐
40 eter 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 param‐
45 eters, a fresh DH key should be created for each use to avoid
46 small-subgroup attacks that may be possible otherwise.
47
48 -2, -5
49 The generator to use, either 2 or 5. 2 is the default. If present
50 then the input file is ignored and parameters are generated
51 instead.
52
53 -rand file(s)
54 a file or files containing random data used to seed the random num‐
55 ber generator, or an EGD socket (see RAND_egd(3)). Multiple files
56 can be specified separated by a OS-dependent character. The sepa‐
57 rator is ; for MS-Windows, , for OpenVMS, and : for all others.
58
59 numbits
60 this option specifies that a parameter set should be generated of
61 size numbits. It must be the last option. If not present then a
62 value of 512 is used. If this option is present then the input file
63 is ignored and parameters are generated instead.
64
65 -noout
66 this option inhibits the output of the encoded version of the
67 parameters.
68
69 -text
70 this option prints out the DH parameters in human readable form.
71
72 -C this option converts the parameters into C code. The parameters can
73 then be loaded by calling the get_dhnumbits() function.
74
75 -engine id
76 specifying an engine (by it's unique id string) will cause req to
77 attempt to obtain a functional reference to the specified engine,
78 thus initialising it if needed. The engine will then be set as the
79 default for all available algorithms.
80
82 The program dhparam combines the functionality of the programs dh and
83 gendh in previous versions of OpenSSL and SSLeay. The dh and gendh pro‐
84 grams are retained for now but may have different purposes in future
85 versions of OpenSSL.
86
88 PEM format DH parameters use the header and footer lines:
89
90 -----BEGIN DH PARAMETERS-----
91 -----END DH PARAMETERS-----
92
93 OpenSSL currently only supports the older PKCS#3 DH, not the newer
94 X9.42 DH.
95
96 This program manipulates DH parameters not keys.
97
99 There should be a way to generate and manipulate DH keys.
100
102 dsaparam(1)
103
105 The dhparam command was added in OpenSSL 0.9.5. The -dsaparam option
106 was added in OpenSSL 0.9.6.
107
108
109
1100.9.8b 2003-01-30 DHPARAM(1)