25

If I've connected to a https url, how can I determine the cipher strength of the connection? My understanding is that after the asymmetric public-key handshake the information is encrypted using a symmetric key with a given strength but I can't seem to find that number (128-bit etc).

Please let me know if I am misunderstanding something with the process too.

Edit: The reason I ask is that I have a template for a security disclaimer that contains a statment This website uses XX-bit encryption and I'd like to fill that with the correct number.

  • which browser are you using? – john Jul 25 '11 at 1:37
  • IE8, but my users will use various different browsers and I'd like to make a statement on the website about the security it uses (see update). Or is such a statement impossible without knowing the browser? – Flash Jul 25 '11 at 1:44
  • Are you asking for client side in the browser or how to extract this on the server to be returned on the web page you are serving? – Nasko Jul 29 '11 at 16:56
  • Just because your particular connection uses a certain bit-length, the web server (like Apache) can still be configured to use different key-lengths. http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2009867 – Kevin Meredith May 10 '13 at 15:21
  • I am not sure, but sha2sslchecker.com can be help you. – user56931 Oct 3 '14 at 9:16

10 Answers 10

17

The SSL symetric encryption is the result of a negotiation between client and server. It is possible to restrict it from the server side by using the configuration files. For example, apache SSL configuration include a

SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

That can be tune to accept only the strongest encryptions, for example you may want to require only :

SSLProtocol all -SSLv3 -SSLv2
SSLCipherSuite HIGH:MEDIUM

Other variables can be used to do more things like client authentication or require per-directory ciphers.

You can also manipulate the negotiation from the client side. As for an example, please refer to this link that is talking a bit about Firefox SSL settings tuning. I assume other browsers have ways to do this as well.

It seems as this page says that :

The server decides upon the list of cryptography and compression algorithms sent by the client whether to continue or cancel the session. There must be at least one match in both lists, otherwise the session will fail. The cipher combination which took the highest place in the client's list will be used for future communication.

I'm looking for the official protocol.

  • 1
    I don't think you want SSLProtocol all... – AviD Jul 25 '11 at 7:58
  • @AviD never trust copy/paste :P I've remove the SSLv2. Thx. – M'vy Jul 25 '11 at 8:10
  • 1
    The official SSL/TLS protocol is RFC 2246, 4346 or 5246, depending on the version (TLS 1.0 to 1.2). Bottom-line: the client sends an ordered list of supported cipher suites ("preferred" one coming first), then the server chooses one of them. Many SSL/TLS servers honor the client preferences, i.e. select the first cipher suite that they also support (depending on their configuration), but that's just Tradition. – Thomas Pornin Jul 25 '11 at 14:54
  • 1
    In practice you only need regular 3DES with RSA key exchange (supported on NT4 and up) and AES variants (preferably with EDH key exchange): DHE-RSA-AES256-SHA:AES128-SHA:DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-SHA. – Hubert Kario Jul 29 '11 at 10:35
  • @M'vy Recent research (POODLE vulnerability) reveals that you also have to remove SSLv3. Best is now SSLProtocol +TLSv1.2 +TLSv1.1 +TLSv1 – David Tonhofer Oct 25 '14 at 8:49
13

SSL Labs have a SSL Server Test tool on their site which will test an SSL-enabled site and provide valuable information about its security (such as key length), including known vulnerabilities particular to the configuration.

  • 1
    +1 for SSL Labs, but this only tests for support - as @Justice answered, at runtime the protocol will select one of these, and its impossible to tell ahead of time what the client configuration will be using. – AviD Jul 25 '11 at 7:07
  • @AviD, valid point. As it's not possible to guarantee what the client will use, perhaps the OP could update his disclaimer to state "This website /supports/ XX-bit encryption"? – lew Jul 25 '11 at 7:37
  • That's a good idea. Or, have it updated in runtime, according to the selected suite - but I'm pretty sure that's not so simple, if its even possible. – AviD Jul 25 '11 at 7:45
  • @AviD, Apache2 tells you which cipher is used, so you should have the information. It may not be that easy, though, to convert that string to a number of bits... – Alexis Wilke Sep 19 '16 at 20:57
10

Hmm there are number of tools that you can use. On a Linux system:

Initiate a single SSL connection to the website via the browser etc....

Enter the command :

ssldump -i eth0 -p 80

This will elucidate the SSL handshake to the webserver (by dumping SSL traffic on the specific interface). The dump shows the cipher suite used.

Look for this : cipherSuite TLS_RSA_WITH_RC4_128_SHA

You may need to replace eth0 with the name of your default ethernet interface.

  • Note that the -p command line option is not the PORT but the PASSWORD. So "80" is probably not correct? – Alexis Wilke Sep 19 '16 at 21:02
6

SSL includes a feature known as "ciphersuite negotiation". The client presents a list of ciphersuites that it is willing to use, and the server selects its favorite from that list. Although you may test your website using your copy of some browser, someone else might be using a different browser with a different configuration and your website may use a weaker ciphersuite for that person.

You should check the documentation for your web server to understand how to configure your web server to use only those ciphersuites that meet your needs.

3

If you are using Chrome, and maybe Firefox, you can click on stuff to the left of https://xxx in the URL bar and check it. It will tell you which cipher suite was selected (like RC4 or AES), and the size of the key used.

I'm using Safari at the moment (new MacBook Air), and I don't immediately see how to do this. Clicking on the lock icon in the upper right only shows me the certificate, but not the strength of the current connection.

The other way of doing this is with a packet sniffer -- the very thing SSL is supposed to protect against. The first few packets, where they negotiate the encryption algorithm and strength, are unencrypted. You can see from them which strength they've chosen for a connection.

  • Added explicit steps and details in my answer to compliment Robert's answer. – JohnC Sep 12 '16 at 16:05
2

I just wanted to add to the answers above that the only way to get the result you need is to have the server not do negotiation or do but using only some ciphers of the same length.

For example, in apache, you could add

SSLRequire %{SSL_CIPHER_USEKEYSIZE} = 256

to only accept 256 key size.

But be careful, as this will probably lead to clients not being able to connect if they don't offer a cipher suite allowed by the server. If you go down this path you should monitor the ssl negotiation errors at the server for some time to make estimates.

2

Clientside:

For Firefox there is an extension: https://addons.mozilla.org/en-US/firefox/addon/cipherfox/

Right-click and selecting "View Page Info" works too.

Serverside:

see How can I determine the encryption strength of an SSL connection

0

On IE-8 after you have browsed to an https site you can select File->Properties and it will show the type of encryption being used. For Firefow click the lock icon to the left of the URL and select More Information.

0

To add to @Robert-David-Graham answer:

In Chrome when you click on the lock icon the Developer Tools > Security tab appears. Refresh the page to get the security info for the page origin(s). Then use the left nav to switch from the Overview to the Main Origin (or any other origin). There you will see Connection Protocol, Key Exchange, and Cipher Suite.

Sample LinkedIn home page security info

0

The ciphersuite is chosen by client and server.

The client sends a list of acceptable ciphersuites to the server ordered by preference. The server then chooses one and informs the client. The server is supposed to respect the clients preferences but may not actually do so (In apache the setting "SSLHonorCipherOrder" controls this).

Most browsers will provide a way to see what ciphersuite is in use, for example in firefox you click on the icon next to the address bar. Then click the sideways arrow, then click more information. For example from google I get.

TLS_ECDHE_RSA_WITH_AES128_GCM_SHA256

Theres various information in that string (google it if you want a full explanation) but the important bit for this question is "AES128-GCM". This tells you that the encryption algorithm is AES 128 (so 128 bit encryption) in GCM mode.

The reason I ask is that I have a template for a security disclaimer that contains a statment This website uses XX-bit encryption and I'd like to fill that with the correct number.

The danger with what you propose is that the selected encryption algorithm will depend on the client. For example the least-bad encyrption algorithm supported by SSL/TLS stack in windows XP (used by IE, among other things) is 3DES which is considered to have an effective security level of 112 bits.

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.