If I generate a Diffie-Hellman prime openssl dhparam 512 -text
(deliberately of small size to keep the paste size below small; I know minimum is 2048 and up), what are the different parts of the output:
PKCS#3 DH Parameters: (512 bit)
prime:
00:84:f7:d4:6a:96:54:da:8e:b0:68:4d:8f:42:fe:
52:a1:4f:dc:05:f7:0b:f1:4a:fd:dd:0a:27:b7:b4:
c4:09:db:4d:80:c2:b0:46:e0:f6:dc:fe:e2:9a:d2:
5c:e8:7c:6e:9f:81:aa:bc:4b:8c:6e:67:b5:e5:b2:
03:b6:56:d3:c3
generator: 2 (0x2)
-----BEGIN DH PARAMETERS-----
MEYCQQCE99RqllTajrBoTY9C/lKhT9wF9wvxSv3dCie3tMQJ202AwrBG4Pbc/uKa
0lzofG6fgaq8S4xuZ7XlsgO2VtPDAgEC
-----END DH PARAMETERS-----
I understand the generator is the base number that's usually either 2 or 5. The question is the prime number and the DH parameters.
- What is the prime represented in?
- How can it be converted to an actual prime integer?
- What is encoded (and why?) in the DH parameters section?
- How do different applications (such as httpd) use this output?
openssl asn1parse -inform pem < YOUR_PARAMETERS.FILE
.Error: offset too large
.