I know very little about openssl so I'm wondering whether the default parameters to openssl genpkey
are sufficiently secure. If I run openssl genpkey -algorithm rsa
I get a private key. But is it fine to use like that? I don't even know whether rsa
is the correct value to be using in that command. There seem to be an overwhelming number of options to openssl so could you help explain what options to pass to make things secure?
1 Answer
Short answer: yes. The makers of OpenSSL aren't stupid, and they didn't design the tool to produce insecure output by default. After that, it's up to the user not to make mistakes that make the system insecure, for instance by leaking the private key.
A RSA 2048-bit key (or 4096-bit, if you're paranoid) will provide security for all your uses. Attacks on systems protected with such strong keys are never done on the crypto itself, but rather going around it: backdoors in the application, bugs, social engineering, use of malware, etc. Security is a process, not a product.
-
-
It's whatever is configured in the OpenSSL config file
openssl.cnf
; usually 2048 bits for a RSA key.– dr_Nov 17, 2015 at 8:13
--be-secure
and stop worrying. The defaults aren't stupid, and you won't introduce huge easily-avoidable vulnerabilities by accepting them, generally; but unless you can be much more precise about what kind of threats you wish to be secure against, this question is unanswerable.