Tls Performance
Total Page:16
File Type:pdf, Size:1020Kb
TLS PERFORMANCE Masterarbeit zur Erlangung des akademischen Grades Master of Science Verfasser: Richard Fussenegger, BSc Vorgelegt am FH-Masterstudiengang MultiMediaTechnology, Fachhochschule Salzburg Begutachtet durch: Dipl.-Ing. Dr. Peter Meerwald (Betreuer) Mag. (FH) Hannes Moser (Zweitgutachter) Thal, 1. Juni 2015 I Eidesstattliche Erklärung Hiermit versichere ich, Richard Fussenegger, geboren am 27. Juni 1985 in Bregenz, dass ich die Grundsätze wissenschaftlichen Arbeitens nach bestem Wissen und Gewissen einge- halten habe und die vorliegende Masterarbeit von mir selbstständig verfasst wurde. Zur Erstellung wurden von mir keine anderen als die angegebenen Quellen und Hilfsmittel verwendet. Ich versichere, dass ich die Masterarbeit weder im In- noch Ausland bisher in ir- gendeiner Form als Prüfungsarbeit vorgelegt habe und dass diese Arbeit mit der den BegutachterInnen vorgelegten Arbeit übereinstimmt. Thal, am 1. Juni 2015 1210695017 Richard Fussenegger Personenkennzeichen II Kurzfassung Verschlüsselte Kommunikation ist ein Muss im Internet, die neuen Protokolle SPDY und HTTP/2 verpflichten quasi sogar dazu. Eine wichtige Frage die bleibt, ist, wie stark die Verschlüsselung sich auf die Leistung der Webkommunikation auswirkt. Vor etwas mehr als zehn Jahren variierte der Mehraufwand für den Einsatz von Transport Layer Security (TLS) zwischen einem Faktor von 3,5 und 9 gegenüber einer unverschlüsselten Kommunikation. Die Anforderungen an verschlüsselte Kommunikation sind in den letzten Jahren stark angestiegen und sehr viele Verfahren haben sich als unsicher und problematisch erwiesen. Schlüssellängen sind angewachsen und aufwendigere Verfahren kommen zum Einsatz für den Schlüsselaustausch. Es stellt sich somit die Frage ob schnellere Hardware, Webser- ver, Algorithmen und Implementierungen – wie damals angenommen – den Mehraufwand verschwindend gering machen, oder gegenwärtige Technologien nicht mit den erhöhten Anforderungen mithalten können. Dies wird anhand von einer umfangreichen Leistungs- messung evaluiert. Dabei soll im Besonderen der tatsächliche Einfluss von TLS ermittelt werden. Schlagwörter: Leistung, Sicherheit, Webserver, WWW, Internet, TLS, SSL III Abstract Encrypted communication is a must in the Internet, the new protocols SPDY and HTTP/2 quasi oblige it. An important question that remains is how strong the encryption affects the performance of the web communication. Little more than a decade ago, the overhead for the usage of Transport Layer Security (TLS) varied between a factor of 3.5 and 9 compared to an unencrypted communication. The requirements for encrypted communications have increased in recent years, and many algorithms have proven to be insecure and problematic. Key lengths have grown, and more elaborate methods are necessary for key exchange. The question arises whether faster hardware, web servers, algorithms and implementations —as assumed back then—can make the overhead negligible, or if current technology is not able to keep up with the elevated requirements. This will be evaluated on the basis of extensive performance tests. Special focus lies on determining the actual influence of TLS. Keywords: Performance, Security, Web Server, WWW, Internet, TLS, SSL IV Acknowledgment First, and foremost, I would like to thank my girlfriend for her sustainable support and her unconditional love. I would also like to thank my advisor PhD Peter Meerwald for being extremely compan- ionable, patient, and of great help while compiling my thesis. CONTENTS V Contents 1 Introduction 1 1.1 Contribution .................................. 3 1.2 Outline ..................................... 3 1.3 Preliminary Remarks .............................. 4 2 Methods 5 2.1 Physical Limitations and Networking Primer ................. 5 2.1.1 Latency ................................. 6 2.1.2 Throughput ............................... 9 2.1.3 Quality of Service ........................... 10 2.2 Internet Core Networking ........................... 11 2.2.1 TCP/IP ................................. 13 2.2.2 Flow Control .............................. 14 2.2.3 Slow-Start ................................ 16 2.2.4 Congestion Avoidance ......................... 19 2.2.5 Head-of-Line Blocking ......................... 20 2.3 Hypertext Transfer Protocol .......................... 21 2.3.1 HTTP/0.9: One-Line Prototype .................... 21 2.3.2 HTTP/1.0: Common Usage ...................... 22 2.3.3 HTTP/1.1: First Standard ....................... 23 2.3.4 HTTP/2: Next Generation ....................... 29 2.4 Cryptography Primer .............................. 33 2.4.1 Random Number Generators ..................... 33 2.4.2 Hash Functions ............................. 34 2.4.3 Symmetric Cryptography ....................... 35 2.4.4 Message Authentication Codes .................... 37 2.4.5 Asymmetric Cryptography ....................... 38 2.4.6 Digital Signatures ........................... 39 2.4.7 Choosing Key Sizes ........................... 40 2.4.8 Perfect Forward Secrecy ........................ 40 2.4.9 Post-Quantum ............................. 42 2.5 Transport Layer Security ............................ 42 2.5.1 Cipher Suites .............................. 44 CONTENTS VI 2.5.2 Negotiation Phase ........................... 44 2.5.3 SSL & PCT: Encrypt the Web .................... 48 2.5.4 TLS 1.0: Open Standard ........................ 49 2.5.5 TLS 1.1: Improving Security ...................... 49 2.5.6 TLS 1.2: Current Standard ...................... 50 2.5.7 TLS 1.3: Next Generation ....................... 50 2.6 TLS Extensions and Related Technologies . 54 2.6.1 Session Tickets ............................. 54 2.6.2 HTTP Strict Transport Security ................... 55 2.6.3 False Start ............................... 55 2.6.4 Public Key Infrastructure ....................... 57 2.6.5 Web Servers ............................... 59 2.6.6 Security Libraries ............................ 60 2.7 Previous and Related Work .......................... 60 2.7.1 Historic Work .............................. 61 2.7.2 Current Work .............................. 63 2.7.3 The Cost of the “S” in HTTPS .................... 64 2.7.4 Ongoing Work ............................. 66 2.8 Benchmarking Approaches ........................... 67 2.8.1 Performance Tests ........................... 67 2.8.2 Page Timing Tests ........................... 69 2.8.3 Other Approaches ........................... 70 3 Results 71 3.1 Setup ...................................... 71 3.1.1 Server .................................. 73 3.1.2 Client .................................. 78 3.1.3 HTTP Archives ............................. 84 3.2 Analysis ..................................... 86 3.2.1 Convergence .............................. 87 3.2.2 Outliers ................................. 92 3.2.3 TLS Impact ............................... 92 3.3 Session Ticket Key Rotation .......................... 99 3.3.1 Naive Approach .............................100 3.3.2 Improved Approach . 101 CONTENTS VII 4 Discussion & Outlook 107 List of Figures 109 List of Listings 110 List of Tables 111 Acronyms 117 References 118 Glossary 146 Appendices 147 A Test System 147 B Analysis Source Code 150 C License 155 C.1 Using Creative Commons Public Licenses . 155 C.2 Legal Code ...................................156 C.2.1 Definitions ...............................156 C.2.2 Scope ..................................157 C.2.3 License Conditions . 158 C.2.4 Sui Generis Database Rights . 159 C.2.5 Disclaimer of Warranties and Limitation of Liability . 160 C.2.6 Term and Termination . 160 C.2.7 Other Terms and Conditions . 161 C.2.8 Interpretation ..............................161 C.3 Creative Commons Notice . 161 1 INTRODUCTION 1 1 Introduction Performance and security are both crucial parts of any application. But a secure operation comes with additional costs. A simple example would be a safe compared with a wallet. The safe has high security, but it takes a long time to get the money. The wallet has little security, but it takes a short time to get the money. This effect is true for almost every operation. The problem is that most web applications cannot afford long processing times. Research suggests that website performance is the most important key factor for users (Podjarny 2010; Everts 2014). One result of this user preference is that most web servers are still configured to handle connections over insecure communication channels under the pretext of efficiency arguments. Only 0.5 %1 of all websites were offering encrypted transactions in 2013, and the HTTP Archive statistic reports that 16 % of all websites they observed during their elicitation in May 2015 were performed over a secured channel (HTTP Archive 2015). However, the world at large knows by now that security is very important in the World Wide Web (WWW) for various reasons. In the past, the topic of security was ignored by the public, despite the fact that devel- opers, hackers, and organizations were appealing urgently to improve security (Sebayang 2013; EFF 2011). This changed in the year 2013 when the mass media started to report on the National Security Agency (NSA) leakages made public by Edward Snowden (Gidda 2013). Many espionage activities from various intelligence agencies around the world are now being revealed at a constant rate (Holland 2014), and at the same time cybercrime is increasing (Brandt 2014). Transport Layer Security (TLS) was specifically designed to provide secure commu- nication over an insecure