3 \section{Cipher suites}
4 \label{section:CipherSuites}
5 \todo{team: section 8 is currently a bit messy. Re-do it}
6 \todo{daniel: tex properly and add sources}
9 \subsection{Architectural overview }
11 A cipher suite is a standardised collection of key exchange algorithms, ciphers,
12 Message authentication code (MAC) that provides authenticated encryption schemes.
13 It consists of the following components:
16 \item{Key exchange protocol:}
17 ``An (interactive) key exchange protocol is a method whereby parties who do not
18 share any secret information can generate a shared, secret key by communicating
19 over a public channel. The main property guaranteed here is that an
20 eavesdropping adversary who sees all the messages sent over the communication
21 line does not learn anything about the resulting secret key.'' {1}
22 Katz, Lindell Introduction to Modern cryptography
23 Example: DH ECDH DHE ECDHE RSA
25 \item{Authentication:}
26 The client authenticates the server by its certificate. Optionally the server
27 may authenticate the client certificate.
28 Example: RSA ECDSA DSA
31 The cipher is used to encrypt the message stream. It also contains the key size
32 and mode used by the suite.
34 Example: AES128 AES128\_GCM Camellia128
37 \item{Message authentication code (MAC):}
38 A MAC ensures that the message has not been tampered with (integrity).
39 Examples: SHA256 SHA384 SHA
41 \todo{find a good visualisation for a cipher suite composition}
43 \item{Authenticated encryption scheme:}
44 An encryption scheme which provides confidentiality, integrity and authenticity.
48 \subsection{Forward Secrecy}
49 Forward Secrecy or Perfect Forward Secrecy is a property of a cipher suite
50 that ensures confidentiality even if the server key has been compromised.
51 Thus if traffic has been recorded it can not be decrypted even if an adversary
52 has got hold of the server key
53 \footnote{\url{http://en.wikipedia.org/wiki/Forward\_secrecy}}
54 \footnote{\url{https://www.eff.org/deeplinks/2013/08/pushing-perfect-forward-secrecy-important-web-privacy-protection}}.
56 \subsection{Recommended cipher suites}
57 \label{section:recommendedciphers}
59 In principle, system administrators who want to improve their servers need to
60 make a hard decision between locking out some users while keeping very high
61 cipher suite security levels or supporting as many users as possible while
62 lowering some settings. \url{https://www.ssllabs.com/} gives administrators a
63 tool to test out different settings. The authors used ssllabs.com to arrive at
64 a set of cipher suites which we will recommend throughout this document.
65 \textbf{Caution: these settings can only represent a subjective choice of the
66 authors at the time of this writing. It might be a wise choice to select your
67 own cipher suites based on the instructions in section
68 \ref{section:ChoosingYourOwnCipherSuites}}.
71 \subsubsection{Configuration A: strong ciphers, fewer clients}
73 At the time of this writing, we recommend the following set of strong cipher
74 suites which may be useful in an environment where you do not depend on many,
75 diverse external clients and where compatibility is not an issue. An example
76 of such an environment might be machine 2 machine communications or corporate
77 environments where you can define the software which must be used.
80 We arrived at this set of cipher suites by selecting
84 \item Perfect forward secrecy / ephemeral Diffie Hellman
85 \item strong Hashes (SHA-2)
86 \item GCM as chaining mode if possible
89 This results in the string:
91 \begin{lstlisting}[breaklines]
92 'EECDH+aRSA+AES256:EDH+aRSA+AES256:!SSLv3'
95 %$\implies$ resolves to
98 %openssl ciphers -V $string
103 \todo{make a column for cipher chaining mode}
106 \begin{tabular}{lllllll}
108 \textbf{ID} & \textbf{OpenSSL Name} & \textbf{Version} & \textbf{KeyEx} & \textbf{Auth} & \textbf{Cipher} & \textbf{MAC}\\\cmidrule(lr){1-7}
109 \verb|0xC030| & ECDHE-RSA-AES256-GCM-SHA384 & TLSv1.2 & ECDH & RSA & AESGCM(256) & AEAD \\
110 \verb|0xC028| & ECDHE-RSA-AES256-SHA384 & TLSv1.2 & ECDH & RSA & AES(256) (CBC) & SHA384 \\
111 \verb|0x009F| & DHE-RSA-AES256-GCM-SHA384 & TLSv1.2 & DH & RSA & AESGCM(256) & AEAD \\
112 \verb|0x006B| & DHE-RSA-AES256-SHA256 & TLSv1.2 & DH & RSA & AES(256) (CBC) & SHA256 \\
118 \textbf{Compatibility}
120 Only clients which support TLS1.2 are covered by these cipher suites (Chrome 30,
121 Win 7 and Win 8.1 crypto stack, Opera 17, OpenSSL $\ge$ 1.0.1e, Safari 6 / iOS
122 6.0.1, Safari 7 / OS X 10.9).
126 \subsubsection{Configuration B: weaker ciphers, many clients}
128 In this section we propose a slightly "weaker" set of cipher suites. For example, there are
129 some known weaknesses for SHA-1 which is included in this set.
130 However, the advantage of this set of cipher suites is its wider compatibility
134 \textbf{In the following document, all further examples in this paper will use Configuration B}.
137 We arrived at this set of cipher suites by selecting
140 \item TLS 1.2, TLS 1.1, TLS 1.0
142 \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}
146 This results in the string:
148 \begin{lstlisting}[breaklines]
149 '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'
153 \todo{make a column for cipher chaining mode}
155 \begin{tabular}{lllllll}
157 \textbf{ID} & \textbf{OpenSSL Name} & \textbf{Version} & \textbf{KeyEx} & \textbf{Auth} & \textbf{Cipher} & \textbf{MAC}\\\cmidrule(lr){1-7}
158 \verb|0xC030| & ECDHE-RSA-AES256-GCM-SHA384 & TLSv1.2 & ECDH & RSA & AESGCM(256) & AEAD \\
159 \verb|0xC028| & ECDHE-RSA-AES256-SHA384 & TLSv1.2 & ECDH & RSA & AES(256) (CBC) & SHA384 \\
160 \verb|0x009F| & DHE-RSA-AES256-GCM-SHA384 & TLSv1.2 & DH & RSA & AESGCM(256) & AEAD \\
161 \verb|0x006B| & DHE-RSA-AES256-SHA256 & TLSv1.2 & DH & RSA & AES(256) (CBC) & SHA256 \\
162 \verb|0x0088| & DHE-RSA-CAMELLIA256-SHA & SSLv3 & DH & RSA & Camellia(256) & SHA1 \\
163 \verb|0xC014| & ECDHE-RSA-AES256-SHA & SSLv3 & ECDH & RSA & AES(256) (CBC) & SHA1 \\
164 \verb|0x0039| & DHE-RSA-AES256-SHA & SSLv3 & DH & RSA & AES(256) (CBC) & SHA1 \\
165 \verb|0x0035| & AES256-SHA & SSLv3 & RSA & RSA & AES(256) (CBC) & SHA1 \\
170 \textbf{Compatibility}
172 Note that these cipher suites will not work with anything using Windows XP's
173 crypto stack (IE, Outlook), Java 6, Java 7 and Android 2.3. Java 7 could be
174 made compatible by installing the "Java Cryptography Extension (JCE) Unlimited
175 Strength Jurisdiction Policy Files"
176 (JCE) \footnote{\url{http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html}}.
177 We could not verify yet if installing JCE also fixes the Java 7
178 DH-parameter length limitation (1024 bit).
182 For a detailed explanation of the cipher suites chosen, please see
183 \ref{section:ChoosingYourOwnCipherSuites}. In short, finding the perfect cipher
184 string is impossible and must be a tradeoff. On the one hand
185 there are mandatory and optional ciphers defined in a few RFCs, on the other hand
186 there are clients and servers only implementing subsets of the specification.
188 Straight forward, we wanted strong ciphers, forward secrecy
189 \footnote{\url{http://nmav.gnutls.org/2011/12/price-to-pay-for-perfect-forward.html}}
190 and the most clients we could get while still having a cipher string that can be
191 used on older servers too (think OpenSSL 0.9.8). This cipher string is meant to be used
192 by copy and paste and needs to just work.
195 \item TLS1.2 is preferred over TLSv1.0/SSLv3 (while still providing a useable cipher
197 \item AES256 and CAMELLIA256 count as strong ciphers at the moment; preferrably in
199 \todo{add a reference here please}
200 \todo{Adi: add 128bit ciphers too} \\
201 \todo{Team: discuss ordering of keys (256 $\rightarrow$ 128 or vice versa?)}
202 \item DHE or ECDHE for forward secrecy
203 \item RSA as this will fit most of todays setup
204 \item AES256-SHA as a last ressort (with this cipher at the end, even systems with
205 very old versions of openssl like 0.9.8 will just work. Just forward secrecy
206 will not be used. On systems that do not support elliptic curves, that cipher
207 offers support for the Microsoft crypto libraries that only support ECDHE.
209 \todo{Adi: review "justification" when next section is written}
213 \subsection{Known insecure and weak cipher suites}
214 \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!}
216 Ciphers with 112bit or less are considered weak and aren't recommended. Note that
217 \texttt{3DES} provides only 112bit of security
218 \footnote{\url{http://csrc.nist.gov/publications/PubsSPs.html\#800-57-part1}}.
220 \subsection{Compatibility}
221 \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.}
224 \subsection{Choosing your own cipher suites}
225 \label{section:ChoosingYourOwnCipherSuites}
227 \todo{ Adi... you want to describe how to make your own selection of cipher suites here.}
229 SSL/TLS cipher suites consist of a key exchange mechanism, an authentication, a
230 stream cipher (or a block cipher with a chaining mode) and a message authentication
233 Many of those mechanisms are interchangeable like the key exchange in this example:
234 \texttt{ECDHE-RSA-AES256-GCM-SHA384} and \texttt{DHE-RSA-AES256-GCM-SHA384}.
235 To provide a decent level of security, all algorithms need to be safe (subject to
236 the disclaimer in section \ref{section:disclaimer}).
238 Note: There are some very weak cipher suites in about every crypto library, most of
239 them for historic reasons like the crypto export embargo
240 \footnote{\url{http://en.wikipedia.org/wiki/Export_of_cryptography_in_the_United_States}}.
241 For the following chapter support of those is assumed to be disabled by having
242 \texttt{!EXP:!LOW:!NULL} as part of the cipher string.
244 \todo{Team: do we need references for all cipher suites considered weak?}
246 \subsubsection{key exchange}
248 Many algorithms allow a secure key exchange. Among those are RSA, DSA, DH, EDH, ECDSA,
249 ECDH, EECDH and a few others. During the key exchange, keys for authentication and for
250 encryption are exchanged. For RSA and DSA those keys are the same.
253 \begin{tabular}{| l | l | l | l |}
255 & \textbf{Key} & \textbf{\cellcolor{orange}EC} & \textbf{\cellcolor{green}ephemeral} \\ \cmidrule(lr){1-4}
256 \cellcolor{red} RSA & RSA & \cellcolor{green}no & \cellcolor{red} no \\
257 \cellcolor{red} DH & RSA & \cellcolor{green}no & \cellcolor{red} no \\
258 \cellcolor{green} EDH & RSA & \cellcolor{green}no & \cellcolor{green} yes \\
259 \cellcolor{red} ECDH & both & \cellcolor{orange}yes & \cellcolor{red} no \\
260 \cellcolor{orange} EECDH & both & \cellcolor{orange}yes & \cellcolor{green} yes \\
261 \cellcolor{red} DSA & DSA & \cellcolor{green}no & \cellcolor{red} no \\
262 \cellcolor{red} ECDSA & DSA & \cellcolor{orange}yes & \cellcolor{red} no \\
267 %disabled: \texttt{!PSK:!SRP}
270 \textbf{Ephemeral Key Exchange} uses different keys for authentication (the server's RSA
271 key) and encryption (a randomly created key). This advantage is called ``Forward
272 Secrecy'' and means that even recorded traffic cannot be decrypted later when someone
273 gets the server key. \\
274 All ephemeral key exchange mechanisms base on Diffie-Hellman algorithm and require
275 pre-generated Diffe-Hellman parameter (which allow fast ephemeral key generation). It
276 is important to note that the Diffie-Hellman parameters need to be at least as strong
277 (speaking in number of bits) as the RSA host key. \todo{TODO: reference!}
280 \textbf{Elliptic Curves}\ref{section:EllipticCurveCryptography} required by current TLS
281 standards only consist of the so-called NIST-curves (\texttt{secp256r1} and
282 \texttt{secp384r1}) which may be weak because the parameters that led to their generation
283 weren't properly explained (by the NSA). \\
284 Disabling support for Elliptic Curves leads to no ephemeral key exchange being available
285 for the Windows platform. When you decide to use Elliptic Curves despite the uncertainty,
286 make sure to at least use the stronger curve of the two supported by all clients
287 (\texttt{secp384r1}).
290 Other key exchange mechanisms like Pre-Shared Key (PSK) or Secure Remote Password
291 (SRP) are irrelevant for regular SSL/TLS use.
293 \subsubsection{authentication}
295 RSA, DSA, DSS, ECDSA, ECDH, FORTEZZA(?).
297 Other authentication mechanisms like Pre Shared Keys aren't used in SSL/TLS: \texttt{!PSK:!aNULL}
299 \subsubsection{encryption}
301 AES, CAMELLIA, SEED, ARIA(?), FORTEZZA(?)...
303 Other ciphers like IDEA, RC2, RC4, 3DES or DES are weak and therefor not recommended:
304 \texttt{!DES:!3DES:!RC2:!RC4:!eNULL}
306 \subsubsection{message authentication}
308 SHA-1 (SHA), SHA-2 (SHA256, SHA384), AEAD
310 Note that SHA-1 is considered broken and should not be used. SHA-1 is however a the
311 only still available message authentication mechanism supporting TLS1.0/SSLv3. Without
312 SHA-1 most clients will be locked out.
314 Other hash functions like MD2, MD4 or MD5 are unsafe and broken: \texttt{!MD2:!MD4:!MD5}
316 \subsubsection{combining cipher strings}
317 %% reference 'man ciphers' and 'openssl ciphers' and show some simple examples
318 %% VERY IMPORTANT: hint at the IANA-list and the differences in implementations
320 \todo{ Adi... The text below was simply the old text, still left here for reference.}
322 %%% NOTE: we do not need to list this all here, can move to an appendix
323 %At the time of this writing, SSL is defined in RFCs:
326 %\item RFC2246 - TLS1.0
328 %\item RFC4132 - Camelia
329 %\item RFC4162 - SEED
331 %\item RFC4346 - TLS 1.1
333 %\item RFC4785 - PSK\_NULL
334 %\item RFC5246 - TLS 1.2
335 %\item RFC5288 - AES\_GCM
336 %\item RFC5289 - AES\_GCM\_SHA2\_ECC
337 %\item RFC5430 - Suite B
338 %\item RFC5487 - GCM\_PSK
339 %\item RFC5489 - ECDHE\_PSK
340 %\item RFC5932 - Camelia
341 %\item RFC6101 - SSL 3.0
342 %\item RFC6209 - ARIA
343 %\item RFC6367 - Camelia
344 %\item RFC6655 - AES\_CCM
345 %\item RFC7027 - Brainpool Curves
348 \subsubsection{Overview of SSL Server settings}
351 Most Server software (Webservers, Mail servers, etc.) can be configured to prefer certain cipher suites over others.
352 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.
354 Following Ivan Ristic's adivce we arrived at a categorisation of cipher suites.
357 \begin{tabular}{lllll}
358 \cmidrule[\heavyrulewidth]{2-5}
359 & \textbf{Version} & \textbf{KeyEx} & \textbf{Cipher} & \textbf{MAC} \\\cmidrule(lr){2-5}
360 \cellcolor{green}prefer & TLS 1.2 & DHE\_DSS & AES\_256\_GCM & SHA384 \\
361 & & DHE\_RSA & AES\_256\_CCM & SHA256 \\
362 & & ECDHE\_ECDSA & AES\_256\_CBC & \\
363 & & ECDHE\_RSA & & \\
365 \cellcolor{orange}consider & TLS 1.1 & DH\_DSS & AES\_128\_GCM & SHA \\
366 & TLS 1.0 & DH\_RSA & AES\_128\_CCM & \\
367 & & ECDH\_ECDSA & AES\_128\_CBC & \\
368 & & ECDH\_RSA & CAMELLIA\_256\_CBC & \\
369 & & RSA & CAMELLIA\_128\_CBC & \\
372 & SSL 3.0 & NULL & NULL & NULL \\
373 & & DH\_anon & RC4\_128 & MD5 \\
374 & & ECDH\_anon & 3DES\_EDE\_CBC & \\
377 \cellcolor{blue}{\color{white}special }
378 & & PSK & CAMELLIA\_256\_GCM & \\
379 & & DHE\_PSK & CAMELLIA\_128\_GCM & \\
380 & & RSA\_PSK & ARIA\_256\_GCM & \\
381 & & ECDHE\_PSK & ARIA\_256\_CBC & \\
382 & & & ARIA\_128\_GCM & \\
383 & & & ARIA\_128\_CBC & \\
385 \cmidrule[\heavyrulewidth]{2-5}
389 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.
391 %% NOTE: s/forward secrecy/perfect forward secrecy???
393 Note that the entries marked as ``special'' are cipher suites which are not common to all clients (webbrowsers etc).
396 \subsubsection{Tested clients}
398 Next we tested the cipher suites above on the following clients:
400 %% NOTE: we need to test with more systems!!
402 \item Chrome 30.0.1599.101 Mac OS X 10.9
403 \item Safari 7.0 Mac OS X 10.9
404 \item Firefox 25.0 Mac OS X 10.9
405 \item Internet Explorer 10 Windows 7
406 \item Apple iOS 7.0.3
410 The result of testing the cipher suites with these clients gives us a preference order as shown in table \ref{table:prefOrderCipherSuites}.
411 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.
415 \begin{tabular}{cllcccc}
417 \textbf{Pref} & \textbf{Cipher Suite} & \textbf{ID} & \multicolumn{4}{l}{\textbf{Supported by}}\\
419 & \textbf{OpenSSL Name} & & Chrome & FF & IE & Safari \\
421 \phantom{0}1 & \verb|TLS_DHE_RSA_WITH_AES_256_GCM_SHA384| & \verb|0x009f| & \no & \no & \no & \no \\
422 & \verb|DHE-RSA-AES256-GCM-SHA384| & & &&&\\\rowcolor{lightlightgray}
423 \phantom{0}2 & \verb|TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384| & \verb|0xC024| & \no & \no & \no & \yes \\\rowcolor{lightlightgray}
424 & \verb|ECDHE-ECDSA-AES256-SHA384| & & &&&\\
425 \phantom{0}3 & \verb|TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384| & \verb|0xC028| & \no & \no & \no & \yes \\
426 & \verb|ECDHE-RSA-AES256-SHA384| & & &&&\\\rowcolor{lightlightgray}
427 \phantom{0}4 & \verb|TLS_DHE_RSA_WITH_AES_256_CBC_SHA256| & \verb|0x006B| & \yes & \no & \no & \yes \\\rowcolor{lightlightgray}
428 & \verb|DHE-RSA-AES256-SHA256| & & &&&\\
429 \phantom{0}5 & \verb|TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA| & \verb|0xC00A| & \yes & \yes & \yes & \yes \\
430 & \verb|ECDHE-ECDSA-AES256-SHA| & & &&&\\\rowcolor{lightlightgray}
431 \phantom{0}6 & \verb|TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA| & \verb|0xC014| & \yes & \yes & \yes & \yes \\\rowcolor{lightlightgray}
432 & \verb|ECDHE-RSA-AES256-SHA| & & &&&\\
433 \phantom{0}7 & \verb|TLS_DHE_RSA_WITH_AES_256_CBC_SHA| & \verb|0x0039| & \yes & \yes & \no & \yes \\
434 & \verb|DHE-RSA-AES256-SHA| & & &&&\\\rowcolor{lightlightgray}
435 \phantom{0}8 & \verb|TLS_DHE_DSS_WITH_AES_256_CBC_SHA| & \verb|0x0038| & \no & \yes & \yes & \no \\\rowcolor{lightlightgray}
436 & \verb|DHE-DSS-AES256-SHA| & & &&&\\
437 \phantom{0}9 & \verb|TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA| & \verb|0x0088| & \no & \yes & \no & \no \\
438 & \verb|DHE-RSA-CAMELLIA256-SHA| & & &&&\\\rowcolor{lightlightgray}
439 \phantom{}10 & \verb|TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA| & \verb|0x0087| & \no & \yes & \no & \no \\\rowcolor{lightlightgray}
440 & \verb|DHE-DSS-CAMELLIA256-SHA| & & &&&\\
443 \caption{Preference order of cipher suites. All suites are supported by OpenSSL.}
444 \label{table:prefOrderCipherSuites}
447 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.
448 If unsure, remove the cipher suites starting with ECDHE in the table above.
451 Based on this ordering, we can now define the corresponding settings for servers. We will start with the most common web servers.