LFCS · Question #423
What openssl command will generate a private RSA key of 2048 bits and no passphrase?
The correct answer is B. openssl genrsa out privkey.pem 2048. The openssl genrsa command is used to generate an RSA private key, and specifying the output file and bit length without encryption options creates an unencrypted key.
Question
Options
- Aopenssl genrsa des3 out privkey.pem 2048
- Bopenssl genrsa out privkey.pem 2048
- Copenssl genrsa nopass out privkey.pem 2048
- Dopenssl genrsa nopass des3 out privkey.pem 2048
How the community answered
(16 responses)- A6% (1)
- B88% (14)
- C6% (1)
Why each option
The `openssl genrsa` command is used to generate an RSA private key, and specifying the output file and bit length without encryption options creates an unencrypted key.
The `des3` option encrypts the private key with a passphrase using the DES3 algorithm, which contradicts the requirement for "no passphrase."
The `openssl genrsa` command generates an RSA private key. When only the `out` file and the key length (e.g., `2048`) are specified, OpenSSL generates the key without any encryption, meaning it will not prompt for a passphrase.
The `nopass` option is typically used with `openssl rsa` to remove a passphrase from an existing key, or in contexts where an encryption algorithm is implicitly chosen; for `genrsa`, omitting encryption options already defaults to no passphrase.
This option includes both `nopass` and `des3`, which are contradictory; `des3` encrypts with a passphrase, making `nopass` irrelevant or leading to an error.
Concept tested: OpenSSL RSA private key generation without passphrase
Source: https://www.openssl.org/docs/manmaster/man1/genrsa.html
Topics
Community Discussion
No community discussion yet for this question.