Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which encryption AES/DES should i use for private key for ssl certificate? [closed]

I've just bought comodo essential wildcard certificate, they asked me to generate csr to activate it.

As i understood, i need to:

  1. Generate RSA 2048bit private key
  2. Generate CSR based on it

As i see, openssl genrsa command accepts different encryption params:

  • -des encrypt the generated key with DES in cbc mode -des3 encrypt the generated key with DES in ede cbc mode (168 bit key)
  • -aes128,
  • -aes192,
  • -aes256

What should i use?

like image 536
avasin Avatar asked Jan 02 '14 15:01

avasin


People also ask

Which is better AES or DES encryption?

AES data encryption is a more mathematically efficient and elegant cryptographic algorithm, but its main strength rests in the option for various key lengths. AES allows you to choose a 128-bit, 192-bit or 256-bit key, making it exponentially stronger than the 56-bit key of DES.

Does SSL use AES?

SSL uses symmetric cryptography using the session key after the initial handshake is done. The most widely used symmetric algorithms are AES-128, AES-192 and AES-256.

What type of encryption does SSL use?

SSL/TLS uses both asymmetric and symmetric encryption to protect the confidentiality and integrity of data-in-transit. Asymmetric encryption is used to establish a secure session between a client and a server, and symmetric encryption is used to exchange data within the secured session.

How many times more secure is AES-128 than DES?

It's known to perform six times faster than DES. But what makes AES so great? The biggest strength of AES lies in the various key lengths it provides, which enables you to choose between 128-, 192-, and 256-bit keys.


1 Answers

The encryption param of openssl genrsa command is used to specify which algorithm to use for encrypting your private key (using the password you specify).

CSR (Certificate Signing Request) includes your public key and some additional public information to be included into certificate. CSR never includes a private key.

So, choice of algorithm for encrypting the private key is completely unrelated to CSR. Choose whatever you prefer. AES variants and Triple-DES (-des3) should be preferred; plain DES is usually considered not secure these days. Also see why AES is more secure than DES. But I think algorithm choice in this particular case is not as important as using a strong password and protecting it.

Note: remember that if you protect your private key with a password, you will be prompted to enter the password every time you want to access the private key, such as when starting your web server. If you forget the password, your private key is effectively lost and you must generate a new key and request a new certificate. You could generate a private key without encryption (without password): openssl genrsa -out filename.key 2048. It is also possible to remove the password (effectively, store it unencrypted) at any time using command like this: openssl rsa -in encrypted.key -out unencrypted.key. You’ll need the password for that (you will be prompted to enter it).

like image 162
vond Avatar answered Nov 12 '22 05:11

vond