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

Q

How to print DSA key generation parameters in text format using OpenSSL "pkeyparam" command?

✍: FYIcenter.com

A

If you want to see contents of a DSA key generation parameter file in text format, you can use the OpenSSL "pkeyparam -text" command as shown below:

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

OpenSSL> pkeyparam -in my_dsa.prm -text -noout
P:
    00:9e:2f:66:92:7d:1f:a8:89:47:f5:14:d6:02:5b:
    1d:34:7a:8a:7f:28:6b:8b:d7:d5:57:6f:8f:f5:79:
    dd:0d:54:da:54:b4:55:d9:00:67:26:50:89:67:ce:
    f5:04:ce:e6:83:34:63:84:bb:0e:d4:d7:dd:42:22:
    b9:2b:8a:55:63:03:e7:9a:62:5a:e4:e0:0d:e9:9f:
    e1:9b:15:01:dc:5c:43:a4:4a:09:84:b0:88:ed:28:
    dc:ef:bb:47:05:f6:68:4c:db:fc:a6:8c:aa:98:68:
    1e:dc:11:3d:68:71:a7:93:1b:cf:d9:33:0c:3f:53:
    fb:14:00:ce:c7:ec:ba:11:95
Q:
    00:d6:40:3c:ce:84:7d:fc:db:88:0e:cd:3b:39:d3:
    fb:e9:45:f7:52:79
G:
    00:98:1d:a4:54:20:6a:a2:8b:9d:9f:fc:d4:d1:d1:
    5e:5d:8f:11:0f:63:a8:a1:b2:9b:bd:d9:c5:7b:29:
    7c:a8:6d:c1:b2:42:e9:fb:5a:b3:1c:45:53:f7:32:
    3c:fb:a0:e6:26:74:b1:73:1c:a3:b9:3f:bf:64:ed:
    49:9d:44:97:f4:63:4f:7d:6c:00:e2:48:67:b5:ea:
    da:e9:c2:de:f2:a9:b7:7c:98:96:45:db:1e:9f:95:
    d9:14:56:2a:be:3f:00:e9:ee:71:ea:a7:55:09:e8:
    4b:19:cd:59:2e:7d:1e:c1:3b:4b:0d:86:29:4c:cf:
    d0:a8:56:08:ed:7c:4a:0d:a1

This test tells us that a DSA key generation parameters file is made of:

P: The first prime number of 1024 bits.
Q: The second prime number, where (P-1) is multiple of Q.
G: An integer between 1 and P, and generated by (h**((p–1)/q) mod p), 
   where is h is any number.

Options used in this command are:

  • "-in my_dsa.prm" - Read the DSA key generation parameter file.
  • "-text" - Print out parameter information in text format.
  • "-noout" - Do not include parameters itself in the output.

 

OpenSSL "genpkey" Command for DSA Keys

⇒⇒OpenSSL Tutorials

2017-12-21, 461👍, 0💬