I generate key/cert using openssl
openssl.exe req -x509 -days 1000 -newkey rsa:1024 -keyout key.pem -out cert.pem
It prompts for a password. I guess that the password is used for key encryption. However I haven’t specified any cipher. What cipher is used in this case?
The default cipher is
DES-EDE3-CBC, which is three-key triple DES EDE in CBC mode. You can see this in the source code file req.c.If you are using an OpenSSL version compiled with the option
OPENSSL_NO_DES, then the library will not encrypt the key by default. This is the same behavior as if you pass the -nodes argument.An easier way to figure this out is just to look at your key file. It announces the cipher in the PEM header.