如何获取RSA中的私钥内容的十进制值

时间:2018-09-22 19:22:46

标签: hex decimal rsa keytool

从私钥中,我试图计算prime1,prime2,系数,exponent1,exponent2,私有指数和公共指数的十进制值。

使用命令OpenSSL> rsa-在mykeyprivatekey.txt -text -noout中,我得到类似下面的内容。不确定如何转换为十进制值。

模数:     00:84:ea:3d:7d:57:67:ad:a4:75:45:ba:67:2e:7c:     28:d6:b2:cd:28:05:cb:19:6e:90:d1:46:cc:4a:c3:     bf:ae:1d:87:fe:0e:cf:30:3b:1c:88:15:b3:89:1e:     24:c8:da:e0:56:61:fb:fb:01:c9:90:bd:23:7a:3a:     22:45:5c:ff:59:28:80:6c:59:3b:8a:d1:eb:f0:bb:     ce:07:8f:0e:a5:15:db:96:ee:c9:f8:7d:f6:cc:be:     6c:5a:3e:7f:07:24:38:9a:04:67:95:3d:c4:9b:eb:     43:74:9c:76:95:18:f4:bb:cb:30:da:a5:d6:aa:6c:     f1:4e:c6:09:ed:2d:2d:1e:2c:d9:eb:3c:55:08:0d:     13:00:45:fe:d3:1f:a8:03:39:d3:65:15:dd:8e:72:     9f:55:97:bd:3e:6a:9a:e8:82:24:0b:c0:84:8c:17:     32:37:b3:85:55:19:73:09:30:01:33:3e:77:7e:b0:     df:d6:da:a6:94:c6:3c:79:40:19:88:c9:5c:8d:f4:     9d:d0:f6:52:6f:03:4a:51:96:e7:09:8c:74:e9:09:     39:41:b9:65:9d:10:98:a6:f9:b4:ec:21:41:11:4f:     18:97:34:da:50:84:ec:5c:57:dc:07:ee:e4:4b:9b:     50:57:b5:d4:03:33:59:40:49:43:e4:1e:ab:58:7c:     6a:31

publicExponent:65537(0x10001)

privateExponent:     04:a6:81:72:42:3d:a1:68:b0:a5:b8:e8:e5:4a:78:     cf:52:40:35:57:46:8c:e4:3e:72:e4:0c:3f:cd:6b:     86:77:08:0c:0e:8e:97:3c:6a:3a:24:b0:3c:6a:ee:     94:8c:7b:ee:e9:cc:bc:32:8a:cf:e2:9e:3c:27:8e:     8d:68:bc:92:6d:05:59:45:21:fd:30:6d:15:e6:2c:     46:3d:6e:20:be:8c:09:52:df:84:2f:3c:14:5b:d1:     44:b3:0d:14:bd:e2:b1:18:d8:5a:f3:67:4e:a1:43:     a1:ef:db:82:49:f6:3e:1f:d4:dc:c1:92:aa:31:d7:     9b:8e:f8:47:f1:1d:b4:01:86:d1:cf:5f:57:f0:b5:     bf:fb:44:12:a8:38:bb:a6:14:31:60:51:2f:7c:44:     33:22:d3:0d:57:f1:33:1d:3e:1d:d6:95:f7:0c:2f:     36:b7:13:c6:9a:6a:ee:67:cb:82:c2:6c:f3:e9:38:     79:c4:04:23:6b:cc:54:b8:45:36:25:c2:78:e5:05:     06:5f:c5:69:7f:3b:01:b9:9b:d7:fa:56:59:20:79:     80:8c:99:20:bf:23:d4:46:00:a1:61:d8:d5:c6:cd:     cd:c1:e0:98:63:57:c7:06:8a:35:b2:b0:6c:8a:2e:     bb:04:98:93:8e:b9:5d:69:56:9c:b8:d9:0b:c5:12:     05

prime1:     00:b9:f0:c3:ee:ce:bc:6e:41:6c:96:51:86:ae:b4:     a7:eb:8c:b3:12:79:ea:e2:5d:0c:4d:f8:f6:52:3b:     ca:df:5a:ec:db:87:8a:7a:01:84:50:6d:27:47:70:     b5:f6:9f:c7:94:cb:fa:8e:5b:86:14:7e:dd:61:bb:     c1:b7:32:4f:98:f9:ee:b3:b4:1b:8e:fd:22:64:52:     97:4e:ba:b9:90:c6:db:fb:9a:ba:1d:f0:2a:e5:e9:     69:97:1e:11:1b:1d:3b:8b:69:c8:7c:d5:4d:ac:aa:     33:9c:06:c3:33:67:1d:80:47:a1:1d:66:8c:87:24:     ef:47:84:f4:ed:2d:67:09:c3

prime2:     00:b6:fe:cd:91:0f:71:47:38:df:e0:a4:d8:1e:f2:     09:b7:ad:02:d4:08:a5:3f:53:88:2d:0c:2e:72:16:     9d:e6:3b:13:51:c0:c3:d7:b4:de:35:b9:25:3e:5f:     1f:48:b3:2d:ad:da:53:94:ea:95:ab:7d:db:7c:1e:     ab:29:3d:b1:a0:e5:3e:c0:17:2e:f7:8d:7e:98:68:     8b:88:80:26:79:e8:79:fb:55:43:32:16:ed:e5:44:     e4:fa:09:2e:61:2a:b5:ed:cc:70:ae:0f:0a:20:48:     61:11:de:75:eb:b4:14:f2:df:97:45:46:a6:f0:e7:     ce:17:d4:56:89:bc:fd:48:fb

指数1:     49:25:3a:9e:95:fb:30:50:52:5c:2b:c4:14:b4:02:     9e:b9:e1:b3:f1:fc:01:82:63:15:c5:4b:78:fc:06:     89:a8:e6:26:52:02:9a:8e:40:33:b7:4c:cd:60:bc:     64:41:64:ac:d7:35:40:8d:26:88:a7:83:85:2f:ec:     3b:99:f2:10:16:b9:dd:3d:8b:dd:cb:1c:9d:64:94:     1b:27:7f:5a:41:b0:46:21:0e:f8:3a:03:56:20:65:     26:4a:70:a6:3e:f0:ae:9e:35:7d:4e:17:d9:45:b7:     39:b8:bb:4f:5c:50:11:a7:9b:ec:c9:eb:9c:3a:5e:     5a:bf:25:ee:ab:7e:ae:2b

指数2:     00:9f:63:0b:b5:7f:57:d1:0b:0e:a4:61:b0:04:34:     18:96:ac:d0:bb:d1:d3:ec:76:5b:33:b1:5a:7a:f0:     8c:13:4d:fd:23:c5:dc:4e:73:30:e0:66:24:b4:50:     b1:b4:e6:ab:b0:b3:6a:fd:57:dd:89:03:14:3a:e5:     93:7b:56:4a:f2:b2:f9:96:e2:1a:7c:6f:f7:85:d3:     f9:44:a9:29:da:20:cc:ae:46:b3:42:5b:8a:55:99:     4e:3f:21:e4:0d:a9:df:d0:01:b3:5b:47:aa:30:38:     1a:a4:2f:b9:51:d5:06:32:0c:e1:7a:eb:70:d8:7f:     6e:98:7e:cf:e9:24:7d:10:25

系数:     00:b7:37:fa:ea:7e:88:73:27:55:87:17:62:c9:14:     c9:9e:3d:cc:df:5e:5c:88:92:6f:bc:0f:b3:ad:47:     53:80:eb:1b:01:74:b0:66:34:64:69:e5:08:37:16:     2e:f9:1a:bf:8b:7a:3f:ad:c6:9a:4e:ce:33:48:6b:     8f:25:0b:80:b0:38:62:f2:db:47:03:f4:c5:20:c0:     a0:ac:85:db:aa:3a:2c:b7:00:9a:a0:e7:5f:43:47:     06:20:c9:4d:df:80:ab:96:cb:20:d2:81:c3:65:68:     d1:ea:b9:7e:62:79:3a:2c:99:15:3f:1c:17:a9:aa:     18:ba:9c:8d:9d:51:17:8d:4a

使用此[http://md5decrypt.net/en/Conversion-tools/#results]尝试将十六进制转换为十进制。但是prime1 * prime2!=模数值的十进制值。

我在计算十进制值时做错了。您能帮我把它转换成十进制吗?

1 个答案:

答案 0 :(得分:0)

从openssl我找不到办法。仍然能够从https://defuse.ca/big-number-calculator.htm

的等效十六进制代码中获取十进制值

例如为prime1值说0x00b6fecd910f714738dfe0a4d81ef209b7ad02d408a53f53882d0c2e72169de63b1351c0c3d7b4de35b9253e5f1f48b32dadda5394ea95ab7ddb7c1eab293db1a0e53ec0172ef78d7e98688b88802679e879fb55433216ede544e4fa092e612ab5edcc70ae0f0a20486111de75ebb414f2df974546a6f0e7ce17d45689bcfd48fb

在在线对流器https://defuse.ca/big-number-calculator.htm中使用时,将给出等效的十进制值。