6

I'm trying to setup OpenVPN with as much security as I can. I'm in the process of selecting a cipher for OpenVPN. Which is the safest one, tls-cipher DHE-RSA-AES256-SHA or tls-cipher AES256-SHA?

I've already configured it with these settings:

  • HMAC: SHA512 for auth option
  • DH: 2048 bit
  • cipher: AES-256-CFB

And password is requested during connection.

My OpenVPN version is 2.2.1. Is my setup OK? I took a look at this post as reference, but I'm not sure, if I'm missing something?

9

For the ciphers, use DHE-RSA-AES256-SHA.

If you use openssl ciphers -v you can get more information about each cipher:

$ openssl ciphers -v DHE-RSA-AES256-SHA 
DHE-RSA-AES256-SHA      SSLv3 Kx=DH       Au=RSA  Enc=AES(256)  Mac=SHA1
$ openssl ciphers -v AES256-SHA
AES256-SHA              SSLv3 Kx=RSA      Au=RSA  Enc=AES(256)  Mac=SHA1

From this you can see that both ciphers can be used in SSLv3, both use RSA for authentication (Au=RSA), both use 256-bit AES for encryption (Enc=AES(256)), and both use SHA-1 for the message authentication code (Mac=SHA1).

So the only difference between these two ciphers is the key exchange. AES256-SHA uses RSA for the key exchange (Kx=RSA). DHE-RSA-AES256-SHA uses ephemeral Diffie–Hellman (Kx=DH is Diffie-Hellman for the key exchange, and the DHE is ephemeral Diffie–Hellman).

Diffie-Hellman is slightly harder to break in theory than RSA, but not so much that it will be a deciding factor. DHE offers perfect forward secrecy and because the key is ephemeral (i.e., never stored on disk), stealing the private key is much more difficult. Those two are deciding factors, so DHE-RSA-AES256-SHA should win for security.

The question 1024-bit DHE vs 2048-bit RSA has a better comparison of the virtues of the two key exchanges, and the question Is there any particular reason to use Diffie-Hellman over RSA for key exchange? has a very detailed comparson between the two.

  • thank you for your answer and the clear explainations linked. – Zen Nov 28 '13 at 10:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.