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

Q

How to print DSA key generation parameters in text format using OpenSSL "dsaparam" 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 "dsaparam -text" command as shown below:

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

OpenSSL> dsaparam -in my_dsa_2048.prm -text -noout
    P:
        00:d3:d3:64:11:42:cf:1a:44:ec:2f:12:99:3c:dc:
        d9:7d:b4:d4:48:e8:80:0e:fe:8b:ff:9e:76:98:88:
        e7:2b:e1:1a:0e:9c:66:cd:4b:86:d0:1b:1c:6f:26:
        b7:7b:40:1c:7e:f7:f3:92:b5:ba:a2:4b:13:6d:2f:
        51:47:f0:d7:20:2a:16:7a:5e:99:9c:cf:e1:49:58:
        c3:28:35:2d:6c:69:63:71:7c:fb:87:9d:5f:7f:ac:
        df:40:05:2c:32:f5:c2:33:14:ff:31:ae:eb:f4:ab:
        42:c6:51:e0:fd:10:cc:51:ba:79:73:cf:57:f2:17:
        ca:2e:e9:66:97:a3:96:8f:61:53:ff:df:c1:50:e3:
        9d:49:ca:23:14:f1:5e:be:ab:39:1d:b4:02:07:84:
        a5:59:f2:f1:ba:60:69:da:a3:10:6d:0e:7a:bb:e5:
        f0:c2:b8:37:10:28:b3:8a:cc:08:8b:f8:3f:a2:e9:
        28:19:39:4e:9d:8d:1c:e2:95:3c:29:b6:d7:a1:b9:
        8c:3f:18:48:7f:e9:d5:73:c1:0d:17:a0:97:38:fa:
        03:6c:7a:f5:c2:6f:46:62:69:83:b5:db:f6:df:d1:
        6c:c0:fc:44:f6:4f:00:dc:ac:cb:6b:c5:1b:62:63:
        1f:ad:79:f4:6b:ff:61:9f:fc:f2:2e:41:db:0f:85:
        cc:e1
    Q:
        00:cd:73:95:80:c8:0c:16:11:3c:7f:6c:73:89:0d:
        c2:50:ca:41:b9:24:d2:3f:0b:62:34:dc:1e:ec:93:
        b1:e2:21
    G:
        59:fa:d5:1e:b7:c6:7c:46:76:81:87:0b:61:70:89:
        9e:14:d1:6b:13:1c:5c:7a:45:44:12:2e:0a:97:f4:
        de:23:f6:de:08:5c:11:d0:f2:e6:2d:af:65:cb:f0:
        ce:3a:dc:b9:c2:0a:62:e9:0b:76:09:56:81:0b:b1:
        85:00:92:9a:09:e6:17:f0:8c:a2:dc:e0:be:b5:8d:
        de:cb:7d:3f:e4:a3:de:91:84:74:0d:2d:c0:7f:30:
        e6:f5:5c:a9:90:50:3a:b8:19:26:ad:1c:20:e1:be:
        65:7d:b3:73:4e:c4:24:a5:25:a7:b5:c6:78:b4:ff:
        ac:64:a2:ac:76:95:b9:35:2b:ab:c5:a2:55:98:fc:
        69:29:19:67:5d:0d:83:89:80:be:a5:f5:09:63:07:
        27:7c:85:76:18:9d:d1:a1:75:b9:7c:0a:99:bb:e3:
        a0:71:0f:a2:37:01:83:b3:b8:2e:cf:e2:d0:21:ce:
        92:db:68:60:58:87:70:41:6b:18:c7:be:7a:98:d9:
        7c:10:76:0d:cb:2c:64:08:e7:b5:95:7b:74:f2:bd:
        3e:ea:51:9c:d9:b2:18:22:16:12:9e:c6:fd:8a:49:
        36:24:31:0c:8f:8d:8b:00:d1:e4:92:22:89:53:14:
        64:0b:51:02:19:c9:c6:29:5f:84:f3:89:e2:48:4b:
        20

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

P: The first prime number of 2048 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_2048.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 "gendsa" and "dsa" Commands

⇒⇒OpenSSL Tutorials

2017-01-07, 163👍, 0💬