1
$\begingroup$

I generated a 2048-bit RSA key with ssh-keygen. When running:

openssl rsa -in key -noout -text

The result is:

Private-Key: (2048 bit)
modulus:
    00:cb:df:46:64:71:ec:0e:f2:40:d2:65:da:6f:17:
    80:70:ad:30:31:eb:c4:a1:ff:f5:ec:d3:c7:f1:b1:
    af:bc:e9:98:56:df:ee:d6:c3:d0:1c:1b:67:9a:a8:
    ac:46:32:22:f0:97:10:26:f7:ad:ab:da:8a:4f:3f:
    8e:1a:ac:2d:c6:5e:e8:b6:70:1e:4e:15:b7:ea:e4:
    23:6e:29:59:e3:7d:c7:15:74:60:86:16:d1:92:4c:
    cc:bb:22:15:ae:2c:22:01:5b:89:68:89:e1:aa:53:
    32:5d:7f:26:de:97:ea:db:da:38:56:0a:2b:b3:0d:
    c7:dd:1a:c4:63:cf:c5:90:78:f6:0b:26:21:f0:29:
    02:73:cd:0c:5d:84:e4:9c:15:e8:d7:98:e3:02:15:
    4d:62:a7:14:14:07:05:4e:28:8a:ca:48:92:23:d8:
    4a:f1:a7:88:f8:9a:4f:d0:27:73:3a:62:fc:7d:9d:
    aa:ba:a1:5b:8e:ea:79:04:de:88:b7:31:89:44:d7:
    15:03:8b:64:6d:20:e4:9b:f5:33:88:49:8c:7b:8e:
    f6:d0:97:83:1c:2c:8a:70:a1:65:ab:ac:b9:76:d6:
    77:f9:7b:a0:c8:1d:56:d6:74:d6:4f:0a:5f:dc:e2:
    87:fc:dd:e7:9b:cb:77:9e:f7:12:d7:44:a3:14:f6:
    5f:5f
publicExponent: 65537 (0x10001)
privateExponent:
    00:92:f0:3a:e8:fc:5e:fa:2a:ca:63:9a:7b:84:24:
    39:33:7c:ef:c6:9b:3a:5e:d4:7f:e8:90:7f:84:88:
    df:b3:d5:dd:31:88:36:b9:5d:ea:69:c7:aa:b5:82:
    aa:9f:f1:54:d3:78:dd:70:68:85:28:de:db:5e:e0:
    dc:c8:06:9e:fb:61:be:72:77:7e:b0:22:e1:2b:10:
    01:25:4d:f2:76:8f:59:e4:f1:ba:fc:0a:08:44:5c:
    cc:16:78:2b:8e:1c:4a:ea:15:92:84:e1:13:df:d2:
    14:f3:e4:48:1c:98:fb:f2:37:66:f1:44:65:58:a9:
    2f:0b:02:56:d7:e5:91:6c:5d:28:97:0d:b0:22:e0:
    6b:71:3e:79:15:67:bb:ca:b8:f1:60:4c:70:df:16:
    93:1b:3b:2c:ba:c1:7d:f8:1a:fc:21:af:fe:1a:69:
    f3:4a:3a:41:a2:9b:a7:8f:44:56:0f:35:d5:81:db:
    f8:f0:89:6b:76:f2:56:bf:f2:52:7a:2b:bd:78:ba:
    d5:fa:8a:f8:1f:27:16:61:ff:1b:cc:0c:3e:75:01:
    07:6e:e0:ac:62:4f:86:0d:51:b6:cf:a9:e7:4d:1a:
    84:ef:61:60:01:ff:31:57:e5:f8:2c:60:9a:cd:3a:
    e9:cf:27:96:be:5f:22:d4:12:95:fd:60:3c:33:1d:
    46:d1
prime1:
    00:e3:ae:54:73:03:0c:3d:2d:52:68:d6:f2:d1:d8:
    2e:7e:0b:14:9f:f5:ae:a3:3d:bf:4a:40:2b:fe:18:
    99:4d:23:ab:af:53:1d:b0:e3:27:e9:b4:63:af:54:
    04:dc:3c:bd:dc:c4:fb:1f:fe:c8:03:38:6f:7f:00:
    5e:80:05:2a:19:52:be:af:1b:8a:96:f1:4d:f5:32:
    32:5f:b0:2d:89:04:f0:c1:4a:b1:3b:b5:e0:96:a0:
    af:b1:f4:0f:b8:38:35:f3:55:d9:78:40:7e:7e:ba:
    3b:04:1b:ff:c7:9c:6f:77:b9:38:fa:e9:65:d0:09:
    34:34:da:9f:06:78:37:32:95
prime2:
    00:d8:90:ad:b6:d0:94:eb:f2:1b:7d:18:7e:cf:fe:
    29:48:02:c2:4f:1f:b7:e4:47:9d:cc:df:51:55:2d:
    4d:23:f0:93:8b:25:42:fe:a4:0a:57:48:9c:d0:7f:
    33:2b:10:5e:e6:68:c5:dc:53:c8:0e:77:51:a3:14:
    b5:a0:23:f1:87:4c:75:0e:c6:48:99:ec:3f:d4:ef:
    51:8c:ce:d2:3c:c8:2b:e5:2e:d3:9e:6b:f9:f3:d3:
    b1:50:46:59:bd:66:1f:04:f4:72:43:87:c7:32:de:
    69:fe:ea:19:e3:fb:b1:23:2a:d8:29:73:ec:04:54:
    45:be:c7:e6:56:05:b1:ac:c3
exponent1:
    7a:5d:38:f9:cf:0b:86:dd:92:ca:d1:ab:12:e8:92:
    a4:1f:24:68:8b:cb:dd:e3:d3:a8:fe:30:26:91:e5:
    e2:35:67:92:04:a3:92:6b:a3:09:d1:6f:39:cd:78:
    07:3d:85:f4:de:d0:f0:73:27:df:c3:36:f9:14:a3:
    b5:3e:11:50:26:ce:60:a1:f6:ac:04:e8:16:fd:71:
    61:47:f8:51:09:9c:b2:e5:87:b7:45:9a:7c:99:c3:
    93:6a:4e:00:7e:05:50:d0:34:de:92:1a:e9:d5:00:
    de:c6:85:83:2c:2a:24:38:21:cd:88:1e:b5:de:1c:
    76:c3:80:70:23:af:d6:b9
exponent2:
    00:cc:20:8a:ec:cf:6c:1f:7d:c4:35:44:7a:7b:78:
    58:d6:dc:6a:e4:83:c4:24:72:f0:a5:64:35:58:70:
    eb:ce:1d:7c:24:e2:c9:64:15:a0:fd:a6:9e:d0:d3:
    a4:9a:49:c2:f9:b0:f6:16:f8:0d:90:bd:1d:00:f7:
    8b:3e:d7:c2:58:42:53:ef:ca:2c:32:91:81:95:26:
    c2:9a:53:73:cd:00:ec:87:08:7d:45:4d:07:7b:b1:
    24:e7:c2:77:e1:d3:39:17:c5:85:52:6b:cf:f1:fd:
    bc:b1:1f:5d:aa:0b:da:6a:88:7e:d9:8b:bf:82:51:
    20:b0:73:e1:83:61:b8:98:5b
coefficient:
    4c:a7:10:44:f1:a8:b2:5e:10:cc:ac:22:4f:8b:49:
    15:00:b3:a9:11:16:10:19:1c:8e:28:be:e7:e2:d7:
    48:23:a3:c6:8e:9b:d3:41:eb:11:64:9f:0a:17:c4:
    ba:c3:1f:4e:af:77:cb:38:be:96:75:a3:32:1c:a5:
    c4:53:fd:5d:80:28:b3:95:c8:74:f5:77:d4:8b:7a:
    7d:6f:4b:ba:f0:c6:65:03:54:71:70:84:02:b8:f3:
    df:e0:d2:64:14:78:da:2e:72:80:e4:14:7c:8e:f5:
    3a:83:ee:72:bb:99:98:9c:63:31:d3:c1:6f:e5:73:
    85:55:94:27:3c:31:16:8e

However the prime numbers

0xd890adb6d094ebf21b7d187ecffe294802c24f1fb7e4479dccdf51552d4d23f0938b2542fea40a57489cd07f332b105ee668c5dc53c80e7751a314b5a023f1874c750ec64899ec3fd4ef518cced23cc82be52ed39e6bf9f3d3b1504659bd661f04f4724387c732de69feea19e3fbb1232ad82973ec045445bec7e65605b1acc3 * 0x00e3ae5473030c3d2d5268d6f2d1d82e7e0b149ff5aea33dbf4a402bfe18994d23abaf531db0e327e9b463af5404dc3cbddcc4fb1ffec803386f7f005e80052a1952beaf1b8a96f14df532325fb02d8904f0c14ab13bb5e096a0afb1f40fb83835f355d978407e7eba3b041bffc79c6f77b938fae965d0093434da9f0678373295

don't multiply to get the modulus value

0xcbdf466471ec0ef240d265da6f178070ad3031ebc4a1fff5ecd3c7f1b1afbce99856dfeed6c3d01c1b679aa8ac463222f0971026f7adabda8a4f3f8e1aac2dc65ee8b6701e4e15b7eae4236e2959e37dc71574608616d1924cccbb2215ae2c22015b896889e1aa53325d7f26de97eadbda38560a2bb30dc7dd1ac463cfc59078f60b2621f0290273cd0c5d84e49c15e8d798e302154d62a7141407054e288aca489223d84af1a788f89a4fd027733a62fc7d9daabaa15b8eea7904de88b7318944d715038b646d20e49bf53388498c7b8ef6d097831c2c8a70a165abacb976d677f97ba0c81d56d674d64f0a5fdce287fcdde79bcb779ef712d744a314f65f5f

But instead multiply to get:

0xc09bc3cff1c7e492b6cdb15d0681be4e87d3d9123669212e36c9670ad6ad95cc9bf18168cb02c2834cd8a44718530991c177b2ba55ae580b37e50f4b797c90f4bfd361d8d75ac54e804b27c26b6236833c3f801c4f2bfc9fe9597c25494bf59151f62170e8917660af7574843068b6211b1c4efe7bfbce7d9abc996e301b52103cfa368669d4879d700bb8192b1c2d2170038f70166d8dcce8717a314e5092a9f52a725fecf1cc67b18fcb73ef278e4dbbb245e9a38719e31deed7098b815cd0d058c15aee239663e019089cbecabfa142a3b1fcdcbe0967aac259b0108106672b5105687e914136cd023c79881ced32d1f511d0f72613541b0188e78a0ca37f

I'm trying to figure out why this would be, considering that the modulus is supposed to be the product of both primes.

$\endgroup$

closed as off-topic by Maarten Bodewes Sep 13 at 21:00

  • This question does not appear to be about cryptography within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ I'm not sure this is the correct site, but, you should also include how did you multiply the primes. $\endgroup$ – kelalaka Sep 13 at 19:50
  • $\begingroup$ I assumed it would have a better chance of being answered in here than anywhere else due to the nature of cryptography. As for how it was multiplied, it was just done in Python (which supports big integers such as these). I've also multiplied it in an online big number calculator just to check and the same value is output. $\endgroup$ – jbal Sep 13 at 19:51
  • $\begingroup$ superuser.com/search?q=openssl+rsa $\endgroup$ – kelalaka Sep 13 at 19:52
  • $\begingroup$ The values of publicExponent, prime1, prime2, exponent1, exponent2, coefficient are consistent. But the values of modulus and privateExponent are not consistent with the rest; nor are they mutually consistent for the stated publicExponent. How that happened is off-topic. $\endgroup$ – fgrieu Sep 14 at 12:34