1
$\begingroup$

I cannot find if the two numbers for RSA are tested against an elliptic curve primality test. If not, is there a way to extract the two integers of my private key in order to test it by myself?

If this is not an accurate question why?

$\endgroup$
2
  • $\begingroup$ In what format does whatever-you're-using store the private key? ​ ​ $\endgroup$
    – user991
    Nov 16, 2016 at 9:19
  • $\begingroup$ I am using GPG, so the only thing I can say is, I can export the private key that contains those prime numbers. $\endgroup$ Nov 16, 2016 at 9:23

1 Answer 1

3
$\begingroup$

GPG (1.4.21) does not use an elliptic curve primality test. It uses 5 strong pseudoprime tests, with the first to base 2 and the others to a random base. For factors large enough that the key is secure, odds that a composite creep by chance are entirely negligible in practice (for a quantitative estimate see appendix F.1 in FIPS 186-4). Also, the mere fact that an RSA key allows decryption of messages, or generation of signatures that verify, is a fair probabilistic primality test of its factors.

To dump a private key not protected by a passphrase under gpg 1.4.x, use
gpg --export-secret-key -a "john doe" | gpg --list-packets --debug 2

For a key version 4 algo 1, the factors of the public modulus are skey[3] and skey[4].

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.