1 \section{Cipher suites}
2 \label{section:CipherSuites}
3 \todo{team: section 8 is currently a bit messy. Re-do it}
5 Cipher suites are a combination of algorithms to provide for
6 Confidentiality, Integrity and Authenticity
7 \footnote{\url{http://en.wikipedia.org/wiki/Information\_security}} of
8 communication. For example: sending encrypted data over the wire does not
9 ensure that the data can not be modified (message integrity), similarly
10 encrypted data can be sent from an adversary. It is therefore paramount to
11 prove that data has been sent from the desired source (message authenticity).
12 This concept is known as authenticated encryption
13 \footnote{\url{http://en.wikipedia.org/wiki/Authenticated\_encryption}}
14 \footnote{\url{http://www.cs.jhu.edu/~astubble/dss/ae.pdf}}.
16 \subsection{Forward Secrecy}
17 Forward Secrecy or Perfect Forward Secrecy is a property of a cipher suite
18 that ensures confidentiality even if the server key has been compromised.
19 Thus if traffic has been recorded it can not be decrypted even if an adversary
20 has got hold of the decryption key
21 \footnote{\url{http://en.wikipedia.org/wiki/Forward\_secrecy}}
22 \footnote{\url{https://www.eff.org/deeplinks/2013/08/pushing-perfect-forward-secrecy-important-web-privacy-protection}}.
24 \subsection{Recommended cipher suites}
26 In principle, system administrators who want to improve their servers need to
27 make a hard decision between locking out some users while keeping very high
28 cipher suite security levels or supporting as many users as possible while
29 lowering some settings. \url{https://www.ssllabs.com/} gives administrators a
30 tool to test out different settings. The authors used ssllabs.com to arrive at
31 a set of cipher suites which we will recommend throught this document.
32 \textbf{Caution: these settings can only represent a subjective choice of the
33 authors at the time of this writing. It might be a wise choice to select your
34 own cipher suites based on the instructions in section
35 \ref{section:ChoosingYourOwnCipherSuites}}.
38 \subsubsection{Configuration A: strong ciphers, fewer clients}
40 At the time of this writing, we recommend the following set of strong cipher
41 suites which may be useful in an environment where you do not depend on many,
42 diverse external clients and where compatibility is not an issue. An example
43 of such an environment might be machine 2 machine communications or corporate
44 environments where you can define the software which must be used.
47 We arrived at this set of cipher suites by selecting
51 \item Perfect forward secrecy / ephemeral Diffie Hellman
52 \item strong Hashes (SHA-2)
53 \item GCM as chaining mode if possible
56 This results in the string:
58 \begin{lstlisting}[breaklines]
59 'EECDH+aRSA+AES256:EDH+aRSA+AES256:!SSLv3'
62 %$\implies$ resolves to
65 %openssl ciphers -V $string
72 \begin{tabular}{lllllll}
74 \textbf{ID} & \textbf{OpenSSL Name} & \textbf{Version} & \textbf{KeyEx} & \textbf{Auth} & \textbf{Cipher} & \textbf{Hash}\\\cmidrule(lr){1-7}
75 \verb|0xC030| & ECDHE-RSA-AES256-GCM-SHA384 & TLSv1.2 & ECDH & RSA & AESGCM(256) & AEAD \\
76 \verb|0xC028| & ECDHE-RSA-AES256-SHA384 & TLSv1.2 & ECDH & RSA & AES(256) & SHA384 \\
77 \verb|0x009F| & DHE-RSA-AES256-GCM-SHA384 & TLSv1.2 & DH & RSA & AESGCM(256) & AEAD \\
78 \verb|0x006B| & DHE-RSA-AES256-SHA256 & TLSv1.2 & DH & RSA & AES(256) & SHA256 \\
84 \textbf{Compatibility}
86 Only clients which support TLS1.2 are covered by these cipher suites (Chrome 30,
87 Win 7 and Win 8.1 crypto stack, Opera 17, OpenSSL $\ge$ 1.0.1e, Safari 6 / iOS
88 6.0.1, Safari 7 / OS X 10.9).
92 \subsubsection{Configuration B: weaker ciphers, many clients}
94 In this section we propose a slighly "weaker" set of cipher suites. There are
95 some known weaknesses of for example SHA-1 which is included in this set.
96 However, the advantage of this set of cipher suites is its wider compatibility
100 \textbf{In the following document, all further examples in this paper will use Configuration B}.
103 We arrived at this set of cipher suites by selecting
106 \item TLS 1.2, TLS 1.1, TLS 1.0
108 \todo{AK: Note that SHA1 is considered broken but if we are in DHE, we might get around it as long as you can not calculate a SHA1 collision ``live'' on the wire}
112 This results in the string:
114 \begin{lstlisting}[breaklines]
115 'EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EDH+CAMELLIA256:EECDH:EDH+aRSA:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SEED:!AES128:!CAMELLIA128:!ECDSA:AES256-SHA'
121 \begin{tabular}{lllllll}
123 \textbf{ID} & \textbf{OpenSSL Name} & \textbf{Version} & \textbf{KeyEx} & \textbf{Auth} & \textbf{Cipher} & \textbf{Hash}\\\cmidrule(lr){1-7}
124 \verb|0xC030| & ECDHE-RSA-AES256-GCM-SHA384 & TLSv1.2 & ECDH & RSA & AESGCM(256) & AEAD \\
125 \verb|0xC028| & ECDHE-RSA-AES256-SHA384 & TLSv1.2 & ECDH & RSA & AES(256) & SHA384 \\
126 \verb|0x009F| & DHE-RSA-AES256-GCM-SHA384 & TLSv1.2 & DH & RSA & AESGCM(256) & AEAD \\
127 \verb|0x006B| & DHE-RSA-AES256-SHA256 & TLSv1.2 & DH & RSA & AES(256) & SHA256 \\
128 \verb|0x0088| & DHE-RSA-CAMELLIA256-SHA & SSLv3 & DH & RSA & Camellia(256) & SHA1 \\
129 \verb|0xC014| & ECDHE-RSA-AES256-SHA & SSLv3 & ECDH & RSA & AES(256) & SHA1 \\
130 \verb|0x0039| & DHE-RSA-AES256-SHA & SSLv3 & DH & RSA & AES(256) & SHA1 \\
131 \verb|0x0035| & AES256-SHA & SSLv3 & RSA & RSA & AES(256) & SHA1 \\
136 \textbf{Compatibility}
138 Note that these cipher suites will not work with anything using Windows XP's
139 crypto stack (IE, Outlook), Java 6, Java 7 and Android 2.3. Java 7 could be
140 made compatible by installing the "Java Cryptography Extension (JCE) Unlimited
141 Strength Jurisdiction Policy Files"
142 (JCE) \footnote{\url{http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html}}.
143 We could not verify yet if installing JCE also fixes the Java 7
144 DH-parameter length limitation (1024 bit).
148 For a detailed explanation of the cipher suites chosen, please see
149 \ref{section:ChoosingYourOwnCipherSuites}. In short, finding the perfect cipher
150 string is impossible and must be a tradeoff. On the one hand
151 there are mandatory and optional ciphers defined in a few RFCs, on the other hand
152 there are clients and servers only implementing subsets of the specification.
154 Straight forward, we wanted strong ciphers, forward secrecy
155 \footnote{\url{http://nmav.gnutls.org/2011/12/price-to-pay-for-perfect-forward.html}}
156 and the most clients we could get while still having a cipher string that can be
157 used on older servers too (think OpenSSL 0.9.8). This cipher string is meant to be used
158 by copy and paste and needs to just work.
161 \item TLS1.2 is preferred over TLSv1.0/SSLv3 (while still providing a useable cipher
163 \item AES256 and CAMELLIA256 count as strong ciphers at the moment; preferrably in
165 \todo{add a reference here please}
166 \todo{Adi: add 128bit ciphers too} \\
167 \todo{Team: discuss ordering of keys (256 $\rightarrow$ 128 or vice versa?)}
168 \item DHE or ECDHE for forward secrecy
169 \item RSA as this will fit most of todays setup
170 \item AES256-SHA as a last ressort (with this cipher at the end, even systems with
171 very old versions of openssl like 0.9.8 will just work. Just forward secrecy
172 will not be used. On systems that do not support elliptic curves, that cipher
173 offers support for the Microsoft crypto libraries that only support ECDHE.
175 \todo{Adi: review "justification" when next section is written}
179 \subsection{Known insecure and weak cipher suites}
180 \todo{PG: please write this section. List all known broken, obsolete, weak and insecure cipher suites . Or even better: find the best site which keeps track of outdated cipher suites and simply reference it. We do not want to maintain such a list ourselves!}
182 Ciphers with 112bit or less are considered weak and aren't recommended. Note that
183 \texttt{3DES} provides only 112bit of security
184 \footnote{url{http://csrc.nist.gov/publications/PubsSPs.html\#800-57-part1}}.
186 \subsection{Compatibility}
187 \todo{write this section. The idea here is to first document which server (and openssl) version we assumed. Once these parameters are fixed, we then list all clients which are supported for Variant A) and B). Therefore we can document compatibilities to some extent. The sysadmin can then choose roughly what he looses or gains by omitting certain cipher suites.}
190 \subsection{Choosing your own cipher suites}
191 \label{section:ChoosingYourOwnCipherSuites}
193 \todo{ Adi... you want to describe how to make your own selection of cipher suites here.}
195 SSL/TLS cipher suites consist of a key exchange mechanism, an authentication, a
196 stream cipher (or a block cipher with a chaining mode) and a message authentication
199 Many of those mechanisms are interchangeable like the key exchange in this example:
200 \texttt{ECDHE-RSA-AES256-GCM-SHA384} and \texttt{DHE-RSA-AES256-GCM-SHA384}.
201 To provide a decent level of security, all algorithms need to be safe (subject to
202 the disclaimer in section \ref{section:disclaimer}).
204 Note: There are some very weak cipher suites in about every crypto library, most of
205 them for historic reasons like the crypto export embargo
206 \footnote{\url{http://en.wikipedia.org/wiki/Export_of_cryptography_in_the_United_States}}.
207 For the following chapter support of those is assumed to be disabled by having
208 \texttt{!EXP:!LOW:!NULL} as part of the cipher string.
210 \todo{Team: do we need references for all cipher suites considered weak?}
212 \subsubsection{key exchange}
214 Many algorithms allow a secure key exchange. Among those are RSA, DSA, DH, EDH, ECDSA,
215 ECDH, EECDH and a few others. During the key exchange, keys for authentication and for
216 encryption are exchanged. For RSA and DSA those keys are the same.
219 \begin{tabular}{| l | l | l | l |}
221 & \textbf{Key} & \textbf{\cellcolor{orange}EC} & \textbf{\cellcolor{green}ephemeral} \\ \cmidrule(lr){1-4}
222 \cellcolor{red} RSA & RSA & \cellcolor{green}no & \cellcolor{red} no \\
223 \cellcolor{red} DH & RSA & \cellcolor{green}no & \cellcolor{red} no \\
224 \cellcolor{green} EDH & RSA & \cellcolor{green}no & \cellcolor{green} yes \\
225 \cellcolor{red} ECDH & both & \cellcolor{orange}yes & \cellcolor{red} no \\
226 \cellcolor{orange} EECDH & both & \cellcolor{orange}yes & \cellcolor{green} yes \\
227 \cellcolor{red} DSA & DSA & \cellcolor{green}no & \cellcolor{red} no \\
228 \cellcolor{red} ECDSA & DSA & \cellcolor{orange}yes & \cellcolor{red} no \\
233 %disabled: \texttt{!PSK:!SRP}
236 \textbf{Ephemeral Key Exchange} uses different keys for authentication (the server's RSA
237 key) and encryption (a randomly created key). This advantage is called ``Forward
238 Secrecy'' and means that even recorded traffic cannot be decrypted later when someone
239 gets the server key. \\
240 All ephemeral key exchange mechanisms base on Diffie-Hellman algorithm and require
241 pre-generated Diffe-Hellman parameter (which allow fast ephemeral key generation). It
242 is important to note that the Diffie-Hellman parameters need to be at least as strong
243 (speaking in number of bits) as the RSA host key. \todo{TODO: reference!}
246 \textbf{Elliptic Curves}\ref{section:EllipticCurveCryptography} required by current TLS
247 standards only consist of the so-called NIST-curves (\texttt{secp256r1} and
248 \texttt{secp384r1}) which may be weak because the parameters that led to their generation
249 weren't properly explained (by the NSA). \\
250 Disabling support for Elliptic Curves leads to no ephemeral key exchange being available
251 for the Windows platform. When you decide to use Elliptic Curves despite the uncertainty,
252 make sure to at least use the stronger curve of the two supported by all clients
253 (\texttt{secp384r1}).
256 Other key exchange mechanisms like Pre-Shared Key (PSK) or Secure Remote Password
257 (SRP) are irrelevant for regular SSL/TLS use.
259 \subsubsection{authentication}
261 RSA, DSA, DSS, ECDSA, ECDH, FORTEZZA(?).
263 Other authentication mechanisms like Pre Shared Keys aren't used in SSL/TLS: \texttt{!PSK:!aNULL}
265 \subsubsection{encryption}
267 AES, CAMELLIA, SEED, ARIA(?), FORTEZZA(?)...
269 Other ciphers like IDEA, RC2, RC4, 3DES or DES are weak and therefor not recommended:
270 \texttt{!DES:!3DES:!RC2:!RC4:!eNULL}
272 \subsubsection{message authentication}
274 SHA-1 (SHA), SHA-2 (SHA256, SHA384), AEAD
276 Note that SHA-1 is considered broken and should not be used. SHA-1 is however a the
277 only still available message authentication mechanism supporting TLS1.0/SSLv3. Without
278 SHA-1 most clients will be locked out.
280 Other hash functions like MD2, MD4 or MD5 are unsafe and broken: \texttt{!MD2:!MD4:!MD5}
282 \subsubsection{combining cipher strings}
283 %% reference 'man ciphers' and 'openssl ciphers' and show some simple examples
284 %% VERY IMPORTANT: hint at the IANA-list and the differences in implementations
286 \todo{ Adi... The text below was simply the old text, still left here for reference.}
288 %%% NOTE: we do not need to list this all here, can move to an appendix
289 %At the time of this writing, SSL is defined in RFCs:
292 %\item RFC2246 - TLS1.0
294 %\item RFC4132 - Camelia
295 %\item RFC4162 - SEED
297 %\item RFC4346 - TLS 1.1
299 %\item RFC4785 - PSK\_NULL
300 %\item RFC5246 - TLS 1.2
301 %\item RFC5288 - AES\_GCM
302 %\item RFC5289 - AES\_GCM\_SHA2\_ECC
303 %\item RFC5430 - Suite B
304 %\item RFC5487 - GCM\_PSK
305 %\item RFC5489 - ECDHE\_PSK
306 %\item RFC5932 - Camelia
307 %\item RFC6101 - SSL 3.0
308 %\item RFC6209 - ARIA
309 %\item RFC6367 - Camelia
310 %\item RFC6655 - AES\_CCM
311 %\item RFC7027 - Brainpool Curves
314 \subsubsection{Overview of SSL Server settings}
317 Most Server software (Webservers, Mail servers, etc.) can be configured to prefer certain cipher suites over others.
318 We followed the recommendations by Ivan Ristic's SSL/TLS Deployment Best Practices\footnote{\url{https://www.ssllabs.com/projects/best-practices/index.html}} document (see section 2.2 "Use Secure Protocols") and arrived at a list of recommended cipher suites for SSL enabled servers.
320 Following Ivan Ristic's adivce we arrived at a categorisation of cipher suites.
323 \begin{tabular}{lllll}
324 \cmidrule[\heavyrulewidth]{2-5}
325 & \textbf{Version} & \textbf{KeyEx} & \textbf{Cipher} & \textbf{MAC} \\\cmidrule(lr){2-5}
326 \cellcolor{green}prefer & TLS 1.2 & DHE\_DSS & AES\_256\_GCM & SHA384 \\
327 & & DHE\_RSA & AES\_256\_CCM & SHA256 \\
328 & & ECDHE\_ECDSA & AES\_256\_CBC & \\
329 & & ECDHE\_RSA & & \\
331 \cellcolor{orange}consider & TLS 1.1 & DH\_DSS & AES\_128\_GCM & SHA \\
332 & TLS 1.0 & DH\_RSA & AES\_128\_CCM & \\
333 & & ECDH\_ECDSA & AES\_128\_CBC & \\
334 & & ECDH\_RSA & CAMELLIA\_256\_CBC & \\
335 & & RSA & CAMELLIA\_128\_CBC & \\
338 & SSL 3.0 & NULL & NULL & NULL \\
339 & & DH\_anon & RC4\_128 & MD5 \\
340 & & ECDH\_anon & 3DES\_EDE\_CBC & \\
343 \cellcolor{blue}{\color{white}special }
344 & & PSK & CAMELLIA\_256\_GCM & \\
345 & & DHE\_PSK & CAMELLIA\_128\_GCM & \\
346 & & RSA\_PSK & ARIA\_256\_GCM & \\
347 & & ECDHE\_PSK & ARIA\_256\_CBC & \\
348 & & & ARIA\_128\_GCM & \\
349 & & & ARIA\_128\_CBC & \\
351 \cmidrule[\heavyrulewidth]{2-5}
355 A remark on the ``consider'' section: the BSI (Federal office for information security, Germany) recommends in its technical report TR-02102-2\footnote{\url{https://www.bsi.bund.de/SharedDocs/Downloads/DE/BSI/Publikationen/TechnischeRichtlinien/TR02102/BSI-TR-02102-2_pdf.html}} to \textbf{avoid} non-ephemeral\footnote{Ephemeral keys are session keys which are destroyed upon termination of the encrypted session. In TLS/SSL, they are realized by the DHE cipher suites. } keys for any communication which might contain personal or sensitive data. In this document, we follow BSI's advice and therefore only keep cipher suites containing (EC)DH\textbf{E} (ephemeral) variants. System administrators, who can not use forward secrecy can still use the cipher suites in the ``consider'' section. We however, do not recommend them in this document.
357 %% NOTE: s/forward secrecy/perfect forward secrecy???
359 Note that the entries marked as ``special'' are cipher suites which are not common to all clients (webbrowsers etc).
362 \subsubsection{Tested clients}
364 Next we tested the cipher suites above on the following clients:
366 %% NOTE: we need to test with more systems!!
368 \item Chrome 30.0.1599.101 Mac OS X 10.9
369 \item Safari 7.0 Mac OS X 10.9
370 \item Firefox 25.0 Mac OS X 10.9
371 \item Internet Explorer 10 Windows 7
372 \item Apple iOS 7.0.3
376 The result of testing the cipher suites with these clients gives us a preference order as shown in table \ref{table:prefOrderCipherSuites}.
377 Should a client not be able to use a specific cipher suite, it will fall back to the next possible entry as given by the ordering.
381 \begin{tabular}{cllcccc}
383 \textbf{Pref} & \textbf{Cipher Suite} & \textbf{ID} & \multicolumn{4}{l}{\textbf{Supported by}}\\
385 & \textbf{OpenSSL Name} & & Chrome & FF & IE & Safari \\
387 \phantom{0}1 & \verb|TLS_DHE_RSA_WITH_AES_256_GCM_SHA384| & \verb|0x009f| & \no & \no & \no & \no \\
388 & \verb|DHE-RSA-AES256-GCM-SHA384| & & &&&\\\rowcolor{lightlightgray}
389 \phantom{0}2 & \verb|TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384| & \verb|0xC024| & \no & \no & \no & \yes \\\rowcolor{lightlightgray}
390 & \verb|ECDHE-ECDSA-AES256-SHA384| & & &&&\\
391 \phantom{0}3 & \verb|TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384| & \verb|0xC028| & \no & \no & \no & \yes \\
392 & \verb|ECDHE-RSA-AES256-SHA384| & & &&&\\\rowcolor{lightlightgray}
393 \phantom{0}4 & \verb|TLS_DHE_RSA_WITH_AES_256_CBC_SHA256| & \verb|0x006B| & \yes & \no & \no & \yes \\\rowcolor{lightlightgray}
394 & \verb|DHE-RSA-AES256-SHA256| & & &&&\\
395 \phantom{0}5 & \verb|TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA| & \verb|0xC00A| & \yes & \yes & \yes & \yes \\
396 & \verb|ECDHE-ECDSA-AES256-SHA| & & &&&\\\rowcolor{lightlightgray}
397 \phantom{0}6 & \verb|TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA| & \verb|0xC014| & \yes & \yes & \yes & \yes \\\rowcolor{lightlightgray}
398 & \verb|ECDHE-RSA-AES256-SHA| & & &&&\\
399 \phantom{0}7 & \verb|TLS_DHE_RSA_WITH_AES_256_CBC_SHA| & \verb|0x0039| & \yes & \yes & \no & \yes \\
400 & \verb|DHE-RSA-AES256-SHA| & & &&&\\\rowcolor{lightlightgray}
401 \phantom{0}8 & \verb|TLS_DHE_DSS_WITH_AES_256_CBC_SHA| & \verb|0x0038| & \no & \yes & \yes & \no \\\rowcolor{lightlightgray}
402 & \verb|DHE-DSS-AES256-SHA| & & &&&\\
403 \phantom{0}9 & \verb|TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA| & \verb|0x0088| & \no & \yes & \no & \no \\
404 & \verb|DHE-RSA-CAMELLIA256-SHA| & & &&&\\\rowcolor{lightlightgray}
405 \phantom{}10 & \verb|TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA| & \verb|0x0087| & \no & \yes & \no & \no \\\rowcolor{lightlightgray}
406 & \verb|DHE-DSS-CAMELLIA256-SHA| & & &&&\\
409 \caption{Preference order of cipher suites. All suites are supported by OpenSSL.}
410 \label{table:prefOrderCipherSuites}
413 Note: the above table \ref{table:prefOrderCipherSuites} contains Elliptic curve key exchanges. There are currently strong doubts\footnote{\url{http://safecurves.cr.yp.to/rigid.html}} concerning ECC.
414 If unsure, remove the cipher suites starting with ECDHE in the table above.
417 Based on this ordering, we can now define the corresponding settings for servers. We will start with the most common web servers.