1 \section{Cipher suites}
2 \todo{team: section 8 is currently a bit messy. Re-do it}
4 Cipher suites are a combination of algorithms to provide for
5 Confidentiality, Integrity and Authenticity
6 \footnote{\url{http://en.wikipedia.org/wiki/Information\_security}} of
7 communication. For example: sending encrypted data over the wire does not
8 ensure that the data can not be modified (message integrity), similarly
9 encrypted data can be sent from an adversary. It is therefore paramount to
10 prove that data has been sent from the desired source (message authenticity).
11 This concept is known as authenticated encryption
12 \footnote{\url{http://en.wikipedia.org/wiki/Authenticated\_encryption}}
13 \footnote{\url{http://www.cs.jhu.edu/~astubble/dss/ae.pdf}}.
15 \subsection{Forward Secrecy}
16 Forward Secrecy or Perfect Forward Secrecy is a property of a cipher suite
17 that ensures confidentiality even if the server key has been compromised.
18 Thus if traffic has been recorded it can not be decrypted even if an adversary
19 has got hold of the decryption key
20 \footnote{\url{http://en.wikipedia.org/wiki/Forward\_secrecy}}
21 \footnote{\url{https://www.eff.org/deeplinks/2013/08/pushing-perfect-forward-secrecy-important-web-privacy-protection}}.
23 \subsection{Recommended cipher suites}
25 In principle, system administrators who want to improve their servers need to
26 make a hard decision between locking out some users while keeping very high
27 cipher suite security levels or supporting as many users as possible while
28 lowering some settings. \url{https://www.ssllabs.com/} gives administrators a
29 tool to test out different settings. The authors used ssllabs.com to arrive at
30 a set of cipher suites which we will recommend throught this document.
31 \textbf{Caution: these settings can only represent a subjective choice of the
32 authors at the time of this writing. It might be a wise choice to select your
33 own cipher suites based on the instructions in section
34 \ref{section:ChoosingYourOwnCipherSuites}}.
37 \subsubsection{Configuration A: strong ciphers, fewer clients}
39 At the time of this writing, we recommend the following set of strong cipher
40 suites which may be useful in an environment where you do not depend on many,
41 diverse external clients and where compatibility is not an issue. An example
42 of such an environment might be machine 2 machine communications or corporate
43 environments where you can define the software which must be used.
46 We arrived at this set of cipher suites by selecting
50 \item Perfect forward secrecy / ephemeral Diffie Hellman
51 \item strong Hashes (SHA-2)
52 \item GCM as chaining mode if possible
55 This results in the string:
57 \begin{lstlisting}[breaklines]
58 'EECDH+aRSA+AES256:EDH+aRSA+AES256:!SSLv3'
61 %$\implies$ resolves to
64 %openssl ciphers -V $string
71 \begin{tabular}{lllllll}
73 \textbf{ID} & \textbf{OpenSSL Name} & \textbf{Version} & \textbf{KeyEx} & \textbf{Auth} & \textbf{Cipher} & \textbf{Hash}\\\cmidrule(lr){1-7}
74 \verb|0xC030| & ECDHE-RSA-AES256-GCM-SHA384 & TLSv1.2 & ECDH & RSA & AESGCM(256) & AEAD \\
75 \verb|0xC028| & ECDHE-RSA-AES256-SHA384 & TLSv1.2 & ECDH & RSA & AES(256) & SHA384 \\
76 \verb|0x009F| & DHE-RSA-AES256-GCM-SHA384 & TLSv1.2 & DH & RSA & AESGCM(256) & AEAD \\
77 \verb|0x006B| & DHE-RSA-AES256-SHA256 & TLSv1.2 & DH & RSA & AES(256) & SHA256 \\
83 \textbf{Compatibility}
85 Only clients which support TLS1.2 are covered by these cipher suites (Chrome 30,
86 Win 7 and Win 8.1 crypto stack, Opera 17, OpenSSL $\ge$ 1.0.1e, Safari 6 / iOS
87 6.0.1, Safari 7 / OS X 10.9).
91 \subsubsection{Configuration B: weaker ciphers, many clients}
93 In this section we propose a slighly "weaker" set of cipher suites. There are
94 some known weaknesses of for example SHA-1 which is included in this set.
95 However, the advantage of this set of cipher suites is its wider compatibility
99 \textbf{In the following document, all further examples in this paper will use Configuration B}.
102 We arrived at this set of cipher suites by selecting
105 \item TLS 1.2, TLS 1.1, TLS 1.0
107 \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}
111 This results in the string:
113 \begin{lstlisting}[breaklines]
114 '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'
120 \begin{tabular}{lllllll}
122 \textbf{ID} & \textbf{OpenSSL Name} & \textbf{Version} & \textbf{KeyEx} & \textbf{Auth} & \textbf{Cipher} & \textbf{Hash}\\\cmidrule(lr){1-7}
123 \verb|0xC030| & ECDHE-RSA-AES256-GCM-SHA384 & TLSv1.2 & ECDH & RSA & AESGCM(256) & AEAD \\
124 \verb|0xC028| & ECDHE-RSA-AES256-SHA384 & TLSv1.2 & ECDH & RSA & AES(256) & SHA384 \\
125 \verb|0x009F| & DHE-RSA-AES256-GCM-SHA384 & TLSv1.2 & DH & RSA & AESGCM(256) & AEAD \\
126 \verb|0x006B| & DHE-RSA-AES256-SHA256 & TLSv1.2 & DH & RSA & AES(256) & SHA256 \\
127 \verb|0x0088| & DHE-RSA-CAMELLIA256-SHA & SSLv3 & DH & RSA & Camellia(256) & SHA1 \\
128 \verb|0xC014| & ECDHE-RSA-AES256-SHA & SSLv3 & ECDH & RSA & AES(256) & SHA1 \\
129 \verb|0x0039| & DHE-RSA-AES256-SHA & SSLv3 & DH & RSA & AES(256) & SHA1 \\
130 \verb|0x0035| & AES256-SHA & SSLv3 & RSA & RSA & AES(256) & SHA1 \\
135 \textbf{Compatibility}
137 Note that these cipher suites will not work with anything using Windows XP's
138 crypto stack (IE, Outlook), Java 6, Java 7 and Android 2.3. Java 7 could be
139 made compatible by installing the "Java Cryptography Extension (JCE) Unlimited
140 Strength Jurisdiction Policy Files"
141 (JCE) \footnote{\url{http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html}}.
142 We could not verify yet if installing JCE also fixes the Java 7
143 DH-parameter length limitation (1024 bit).
147 For a detailed explanation of the cipher suites chosen, please see
148 \ref{section:ChoosingYourOwnCipherSuites}. In short, finding the perfect cipher
149 string is impossible and must be a tradeoff. On the one hand
150 there are mandatory and optional ciphers defined in a few RFCs, on the other hand
151 there are clients and servers only implementing subsets of the specification.
153 Straight forward, we wanted strong ciphers, forward secrecy
154 \footnote{\url{http://nmav.gnutls.org/2011/12/price-to-pay-for-perfect-forward.html}}
155 and the most clients we could get while still having a cipher string that can be
156 used on older servers too (think OpenSSL 0.9.8). This cipher string is meant to be used
157 by copy and paste and needs to just work.
160 \item TLS1.2 is preferred over TLSv1.0/SSLv3 (while still providing a useable cipher
162 \item AES256 and CAMELLIA256 count as strong ciphers at the moment; preferrably in
164 \todo{add a reference here please}
165 \todo{Adi: add 128bit ciphers too} \\
166 \todo{Team: discuss ordering of keys (256 $\rightarrow$ 128 or vice versa?)}
167 \item DHE or ECDHE for forward secrecy
168 \item RSA as this will fit most of todays setup
169 \item AES256-SHA as a last ressort (with this cipher at the end, even systems with
170 very old versions of openssl like 0.9.8 will just work. Just forward secrecy
171 will not be used. On systems that do not support elliptic curves, that cipher
172 offers support for the Microsoft crypto libraries that only support ECDHE.
174 \todo{Adi: review "justification" when next section is written}
178 \subsection{Known insecure and weak cipher suites}
179 \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!}
181 Ciphers with 112bit or less are considered weak and aren't recommended. Note that
182 \texttt{3DES} provides only 112bit of security
183 \footnote{url{http://csrc.nist.gov/publications/PubsSPs.html\#800-57-part1}}.
185 \subsection{Compatibility}
186 \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.}
189 \subsection{Choosing your own cipher suites}
190 \label{section:ChoosingYourOwnCipherSuites}
192 \todo{ Adi... you want to describe how to make your own selection of cipher suites here.}
194 SSL/TLS cipher suites consist of a key exchange mechanism, an authentication, a
195 stream cipher (or a block cipher with a chaining mode) and a message authentication
198 Many of those mechanisms are interchangeable like the key exchange in this example:
199 \texttt{ECDHE-RSA-AES256-GCM-SHA384} and \texttt{DHE-RSA-AES256-GCM-SHA384}.
200 To provide a decent level of security, all algorithms need to be safe (subject to
201 the disclaimer in section \ref{section:disclaimer}).
203 Note: There are some very weak cipher suites in about every crypto library, most of
204 them for historic reasons like the crypto export embargo
205 \footnote{\url{http://en.wikipedia.org/wiki/Export_of_cryptography_in_the_United_States}}.
206 For the following chapter support of those is assumed to be disabled by having
207 \texttt{!EXP:!LOW:!NULL} as part of the cipher string.
209 \todo{Team: do we need references for all cipher suites considered weak?}
211 \subsubsection{key exchange}
213 Many algorithms allow a secure key exchange. Among those are RSA, DSA, DH, EDH, ECDSA,
214 ECDH, EECDH and a few others. During the key exchange, keys for authentication and for
215 encryption are exchanged. For RSA and DSA those keys are the same.
218 \begin{tabular}{| l | l | l | l |}
220 & \textbf{Key} & \textbf{\cellcolor{orange}EC} & \textbf{\cellcolor{green}ephemeral} \\ \cmidrule(lr){1-4}
221 \cellcolor{red} RSA & RSA & \cellcolor{green}no & \cellcolor{red} no \\
222 \cellcolor{red} DH & RSA & \cellcolor{green}no & \cellcolor{red} no \\
223 \cellcolor{green} EDH & RSA & \cellcolor{green}no & \cellcolor{green} yes \\
224 \cellcolor{red} ECDH & both & \cellcolor{orange}yes & \cellcolor{red} no \\
225 \cellcolor{orange} EECDH & both & \cellcolor{orange}yes & \cellcolor{green} yes \\
226 \cellcolor{red} DSA & DSA & \cellcolor{green}no & \cellcolor{red} no \\
227 \cellcolor{red} ECDSA & DSA & \cellcolor{orange}yes & \cellcolor{red} no \\
232 %disabled: \texttt{!PSK:!SRP}
235 \textbf{Ephemeral Key Exchange} uses different keys for authentication (the server's RSA
236 key) and encryption (a randomly created key). This advantage is called ``Forward
237 Secrecy'' and means that even recorded traffic cannot be decrypted later when someone
238 gets the server key. \\
239 All ephemeral key exchange mechanisms base on Diffie-Hellman algorithm and require
240 pre-generated Diffe-Hellman parameter (which allow fast ephemeral key generation). It
241 is important to note that the Diffie-Hellman parameters need to be at least as strong
242 (speaking in number of bits) as the RSA host key. \todo{TODO: reference!}
245 \textbf{Elliptic Curves}\ref{section:EllipticCurveCryptography} required by current TLS
246 standards only consist of the so-called NIST-curves (\texttt{secp256r1} and
247 \texttt{secp384r1}) which may be weak because the parameters that led to their generation
248 weren't properly explained (by the NSA). \\
249 Disabling support for Elliptic Curves leads to no ephemeral key exchange being available
250 for the Windows platform. When you decide to use Elliptic Curves despite the uncertainty,
251 make sure to at least use the stronger curve of the two supported by all clients
252 (\texttt{secp384r1}).
255 Other key exchange mechanisms like Pre-Shared Key (PSK) or Secure Remote Password
256 (SRP) are irrelevant for regular SSL/TLS use.
258 \subsubsection{authentication}
260 RSA, DSA, DSS, ECDSA, ECDH, FORTEZZA(?).
262 Other authentication mechanisms like Pre Shared Keys aren't used in SSL/TLS: \texttt{!PSK:!aNULL}
264 \subsubsection{encryption}
266 AES, CAMELLIA, SEED, ARIA(?), FORTEZZA(?)...
268 Other ciphers like IDEA, RC2, RC4, 3DES or DES are weak and therefor not recommended:
269 \texttt{!DES:!3DES:!RC2:!RC4:!eNULL}
271 \subsubsection{message authentication}
273 SHA-1 (SHA), SHA-2 (SHA256, SHA384), AEAD
275 Note that SHA-1 is considered broken and should not be used. SHA-1 is however a the
276 only still available message authentication mechanism supporting TLS1.0/SSLv3. Without
277 SHA-1 most clients will be locked out.
279 Other hash functions like MD2, MD4 or MD5 are unsafe and broken: \texttt{!MD2:!MD4:!MD5}
281 \subsubsection{combining cipher strings}
282 %% reference 'man ciphers' and 'openssl ciphers' and show some simple examples
283 %% VERY IMPORTANT: hint at the IANA-list and the differences in implementations
285 \todo{ Adi... The text below was simply the old text, still left here for reference.}
287 %%% NOTE: we do not need to list this all here, can move to an appendix
288 %At the time of this writing, SSL is defined in RFCs:
291 %\item RFC2246 - TLS1.0
293 %\item RFC4132 - Camelia
294 %\item RFC4162 - SEED
296 %\item RFC4346 - TLS 1.1
298 %\item RFC4785 - PSK\_NULL
299 %\item RFC5246 - TLS 1.2
300 %\item RFC5288 - AES\_GCM
301 %\item RFC5289 - AES\_GCM\_SHA2\_ECC
302 %\item RFC5430 - Suite B
303 %\item RFC5487 - GCM\_PSK
304 %\item RFC5489 - ECDHE\_PSK
305 %\item RFC5932 - Camelia
306 %\item RFC6101 - SSL 3.0
307 %\item RFC6209 - ARIA
308 %\item RFC6367 - Camelia
309 %\item RFC6655 - AES\_CCM
310 %\item RFC7027 - Brainpool Curves
313 \subsubsection{Overview of SSL Server settings}
316 Most Server software (Webservers, Mail servers, etc.) can be configured to prefer certain cipher suites over others.
317 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.
319 Following Ivan Ristic's adivce we arrived at a categorisation of cipher suites.
322 \begin{tabular}{lllll}
323 \cmidrule[\heavyrulewidth]{2-5}
324 & \textbf{Version} & \textbf{KeyEx} & \textbf{Cipher} & \textbf{MAC} \\\cmidrule(lr){2-5}
325 \cellcolor{green}prefer & TLS 1.2 & DHE\_DSS & AES\_256\_GCM & SHA384 \\
326 & & DHE\_RSA & AES\_256\_CCM & SHA256 \\
327 & & ECDHE\_ECDSA & AES\_256\_CBC & \\
328 & & ECDHE\_RSA & & \\
330 \cellcolor{orange}consider & TLS 1.1 & DH\_DSS & AES\_128\_GCM & SHA \\
331 & TLS 1.0 & DH\_RSA & AES\_128\_CCM & \\
332 & & ECDH\_ECDSA & AES\_128\_CBC & \\
333 & & ECDH\_RSA & CAMELLIA\_256\_CBC & \\
334 & & RSA & CAMELLIA\_128\_CBC & \\
337 & SSL 3.0 & NULL & NULL & NULL \\
338 & & DH\_anon & RC4\_128 & MD5 \\
339 & & ECDH\_anon & 3DES\_EDE\_CBC & \\
342 \cellcolor{blue}{\color{white}special }
343 & & PSK & CAMELLIA\_256\_GCM & \\
344 & & DHE\_PSK & CAMELLIA\_128\_GCM & \\
345 & & RSA\_PSK & ARIA\_256\_GCM & \\
346 & & ECDHE\_PSK & ARIA\_256\_CBC & \\
347 & & & ARIA\_128\_GCM & \\
348 & & & ARIA\_128\_CBC & \\
350 \cmidrule[\heavyrulewidth]{2-5}
354 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.
356 %% NOTE: s/forward secrecy/perfect forward secrecy???
358 Note that the entries marked as ``special'' are cipher suites which are not common to all clients (webbrowsers etc).
361 \subsubsection{Tested clients}
363 Next we tested the cipher suites above on the following clients:
365 %% NOTE: we need to test with more systems!!
367 \item Chrome 30.0.1599.101 Mac OS X 10.9
368 \item Safari 7.0 Mac OS X 10.9
369 \item Firefox 25.0 Mac OS X 10.9
370 \item Internet Explorer 10 Windows 7
371 \item Apple iOS 7.0.3
375 The result of testing the cipher suites with these clients gives us a preference order as shown in table \ref{table:prefOrderCipherSuites}.
376 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.
380 \begin{tabular}{cllcccc}
382 \textbf{Pref} & \textbf{Cipher Suite} & \textbf{ID} & \multicolumn{4}{l}{\textbf{Supported by}}\\
384 & \textbf{OpenSSL Name} & & Chrome & FF & IE & Safari \\
386 \phantom{0}1 & \verb|TLS_DHE_RSA_WITH_AES_256_GCM_SHA384| & \verb|0x009f| & \no & \no & \no & \no \\
387 & \verb|DHE-RSA-AES256-GCM-SHA384| & & &&&\\\rowcolor{lightlightgray}
388 \phantom{0}2 & \verb|TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384| & \verb|0xC024| & \no & \no & \no & \yes \\\rowcolor{lightlightgray}
389 & \verb|ECDHE-ECDSA-AES256-SHA384| & & &&&\\
390 \phantom{0}3 & \verb|TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384| & \verb|0xC028| & \no & \no & \no & \yes \\
391 & \verb|ECDHE-RSA-AES256-SHA384| & & &&&\\\rowcolor{lightlightgray}
392 \phantom{0}4 & \verb|TLS_DHE_RSA_WITH_AES_256_CBC_SHA256| & \verb|0x006B| & \yes & \no & \no & \yes \\\rowcolor{lightlightgray}
393 & \verb|DHE-RSA-AES256-SHA256| & & &&&\\
394 \phantom{0}5 & \verb|TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA| & \verb|0xC00A| & \yes & \yes & \yes & \yes \\
395 & \verb|ECDHE-ECDSA-AES256-SHA| & & &&&\\\rowcolor{lightlightgray}
396 \phantom{0}6 & \verb|TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA| & \verb|0xC014| & \yes & \yes & \yes & \yes \\\rowcolor{lightlightgray}
397 & \verb|ECDHE-RSA-AES256-SHA| & & &&&\\
398 \phantom{0}7 & \verb|TLS_DHE_RSA_WITH_AES_256_CBC_SHA| & \verb|0x0039| & \yes & \yes & \no & \yes \\
399 & \verb|DHE-RSA-AES256-SHA| & & &&&\\\rowcolor{lightlightgray}
400 \phantom{0}8 & \verb|TLS_DHE_DSS_WITH_AES_256_CBC_SHA| & \verb|0x0038| & \no & \yes & \yes & \no \\\rowcolor{lightlightgray}
401 & \verb|DHE-DSS-AES256-SHA| & & &&&\\
402 \phantom{0}9 & \verb|TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA| & \verb|0x0088| & \no & \yes & \no & \no \\
403 & \verb|DHE-RSA-CAMELLIA256-SHA| & & &&&\\\rowcolor{lightlightgray}
404 \phantom{}10 & \verb|TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA| & \verb|0x0087| & \no & \yes & \no & \no \\\rowcolor{lightlightgray}
405 & \verb|DHE-DSS-CAMELLIA256-SHA| & & &&&\\
408 \caption{Preference order of cipher suites. All suites are supported by OpenSSL.}
409 \label{table:prefOrderCipherSuites}
412 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.
413 If unsure, remove the cipher suites starting with ECDHE in the table above.
416 Based on this ordering, we can now define the corresponding settings for servers. We will start with the most common web servers.