29

What data is saved in RSA private key in openssl? How to view it?

Wikpedia says these variables are saved.

Smit Johnth
  • 1,731
  • 4
  • 18
  • 27

1 Answers1

45

You can print the data with (change PEM to DER if required):

openssl rsa -in Alice.key -text -inform PEM -noout

The following data is stored:

  • Modulus ($n = pq$)
  • Public exponent ($e$)
  • Private exponent ($d = e^{-1} \pmod{\phi{(n)}}$)
  • First prime ($p$)
  • Second prime ($q$)
  • First exponent, used for Chinese remainder theorem ($d_P = d \pmod{p - 1}$)
  • Second exponent, used for CRT ($d_Q = d \pmod{q - 1}$)
  • Coefficient, used for CRT ($q_{\mathrm{inv}} = q^{-1} \pmod{p}$)
Conrado
  • 6,614
  • 1
  • 30
  • 45