I'm trying to understand the difference between generating a private key using openssl genrsa and adding -newkey to req.
I found a 2014 answer saying the underlying code is the same, one from 2015 saying the encryption is different, and a 2017 mailing list answer saying genrsa "creates keys in a legacy RSA algorithm-specific format." However, I don't see any reference to this in the docs for genrsa nor for req.
Is there any substantial difference between them?
genrsawrites 'traditional' (PKCS1) format; in 3.0.0 up it writes PKCS8.req -newkeywrites PKCS8 since 1.0.0.genrsadefaults to unencrypted, but you can specify encryption with (almost) any cipher;req -newkeyis encrypted unless either commandline option or the config file says no, and if encrypted is always 3DES. If you don't specify the length (which you can and always could in either method) the default is 2048 since 1.0.2 forgenrsaand 1.0.2g forreq -newkey; before those it was less and sometimes differed between the two methods. – dave_thompson_085 Oct 08 '23 at 01:21