A CLASSICAL INTRODUCTION to CRYPTOGRAPHY Applications for Communications Security a CLASSICAL INTRODUCTION to CRYPTOGRAPHY Applications for Communications Security
Total Page:16
File Type:pdf, Size:1020Kb
A CLASSICAL INTRODUCTION TO CRYPTOGRAPHY Applications for Communications Security A CLASSICAL INTRODUCTION TO CRYPTOGRAPHY Applications for Communications Security by Serge Vaudenay Swiss Federal Institute of Technologies (EPFL) Serge Vaudenay Ch. de Riant-Mont 4 CH-1023 Crissier Switzerland Library of Congress Cataloging-in-Publication Data A C.I.P. Catalogue record for this book is available from the Library of Congress. A CLASSICAL INTRODUCTION TO MODERN CRYPTOGRAPHY Applications for Communications Security by Serge Vaudenay Swiss Fédéralel Institute of Technologies (EPFL) ISBN-10: 0-387-25464-1 e-ISBN-10: 0-387-25880-9 ISBN-13: 978-0-387-25464-7 e-ISBN-13: 978-0-387-25880-5 Printed on acid-free paper. ¤ 2006 Springer Science+Business Media, Inc. All rights reserved. This work may not be translated or copied in whole or in part without the written permission of the publisher (Springer Science+Business Media, Inc., 233 Spring Street, New York, NY 10013, USA), except for brief excerpts in connection with reviews or scholarly analysis. Use in connection with any form of information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now know or hereafter developed is forbidden. The use in this publication of trade names, trademarks, service marks and similar terms, even if the are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. Printed in the United States of America. 9 8 7 6 5 4 3 2 1 SPIN 11357582, 11426141 springeronline.com To Christine and Emilien Contents Preamble .............................................. xv 1 Prehistory of Cryptography .............................. 1 1.1 Foundations of Conventional Cryptography .................... 1 1.1.1 The Origins of Cryptography ......................... 1 1.1.2 Key Words ........................................ 2 1.1.3 Transpositions, Substitutions, and Secret Keys ............ 4 1.1.4 Vernam Cipher .................................... 7 1.1.5 Enigma: Toward Industrial Cryptography ................ 8 1.2 Roots of Modern Cryptography ............................. 10 1.2.1 Cryptographic Problems: The Fundamental Trilogy ........ 10 1.2.2 Assumptions of Modern Cryptography .................. 11 1.2.3 Adversarial Models ................................. 12 1.2.4 Cryptography from Various Perspectives ................ 13 1.2.5 Methodology ...................................... 15 1.3 The Shannon Theory of Secrecy ............................ 15 1.3.1 Secrecy of Communication .......................... 15 1.3.2 Entropy ......................................... 17 1.3.3 Perfect Secrecy ................................... 18 1.3.4 Product Ciphers ................................... 19 1.4 Exercises ............................................... 19 2 Conventional Cryptography .............................. 21 2.1 The Data Encryption Standard (DES)......................... 22 2.2 DES Modes of Operation .................................. 25 2.2.1 Electronic Code Book (ECB) ......................... 25 2.2.2 Cipher Block Chaining (CBC) ........................ 26 2.2.3 Output Feedback (OFB) ............................. 27 2.2.4 Cipher Feedback (CFB) .............................. 29 2.2.5 Counter Mode (CTR) ............................... 30 2.3 Multiple Encryption ...................................... 30 2.3.1 Double Mode ...................................... 30 2.3.2 Triple Mode ....................................... 31 2.4 An Application of DES: UNIX Passwords ..................... 31 viii Contents 2.5 Classical Cipher Skeletons ................................. 32 2.5.1 Feistel Schemes .................................... 32 2.5.2 Lai–Massey Scheme ................................ 33 2.5.3 Substitution–Permutation Network ..................... 36 2.6 Other Block Cipher Examples .............................. 37 2.6.1 FOX: A Lai–Massey Scheme ........................ 37 2.6.2 CS-CIPHER: A Substitution–Permutation Network ....... 40 2.7 The Advanced Encryption Standard (AES) .................... 42 2.8 Stream Ciphers .......................................... 46 2.8.1 Stream Ciphers versus Block Ciphers ................... 46 2.8.2 RC4 ............................................. 46 2.8.3 A5/1: GSM Encryption .............................. 48 2.8.4 E0: Bluetooth Encryption ............................ 50 2.9 Brute Force Attacks ...................................... 51 2.9.1 Exhaustive Search .................................. 52 2.9.2 Dictionary Attack .................................. 53 2.9.3 Codebook Attack ................................... 54 2.9.4 Time–Memory Tradeoffs............................ 54 2.9.5 Meet-in-the-Middle Attack ........................... 59 2.10 Exercises ............................................... 60 3 Dedicated Conventional Cryptographic Primitives .............. 63 3.1 Cryptographic Hashing .................................... 63 3.1.1 Usage ............................................ 63 3.1.2 Threat Models ..................................... 64 3.1.3 From Compression to Hashing ........................ 65 3.1.4 Example of MD5 ................................... 66 3.1.5 Examples of SHA and SHA-1 ......................... 67 3.2 The Birthday Paradox ..................................... 70 3.3 A Dedicated Attack on MD4 .............................. 74 3.4 Message Authentication Codes .............................. 78 3.4.1 Usage ............................................ 78 3.4.2 Threat Model ...................................... 79 3.4.3 MAC from Block Ciphers: CBC-MAC .................. 80 3.4.4 Analysis of CBC-MAC ............................. 82 3.4.5 MAC from Stream Ciphers .......................... 86 3.4.6 MAC from Hash Functions: HMAC .................... 88 3.4.7 An Authenticated Mode of Operation ................... 90 3.5 Cryptographic Pseudorandom Generators ..................... 92 3.5.1 Usage and Threat Model ............................. 92 3.5.2 Congruential Pseudorandom Generator ................ 92 3.5.3 Practical Examples ................................. 93 3.6 Exercises ............................................... 95 Contents ix 4 Conventional Security Analysis ........................... 97 4.1 Differential Cryptanalysis ................................. 97 4.2 Linear Cryptanalysis ..................................... 103 4.3 Classical Security Strengthening ........................... 111 4.3.1 Nonlinearities .................................... 111 4.3.2 Characteristics and Markov Ciphers ................... 112 4.3.3 Theoretical Differential and Linear Cryptanalysis ........ 114 4.3.4 Ad hoc Construction ............................... 120 4.4 Modern Security Analysis ................................. 123 4.4.1 Distinguishability Security Model..................... 123 4.4.2 The Luby–Rackoff Result ........................... 125 4.4.3 Decorrelation ..................................... 126 4.5 Exercises ............................................... 132 5 Security Protocols with Conventional Cryptography ............. 135 5.1 Password Access Control .................................. 135 5.1.1 UNIX Passwords ................................... 136 5.1.2 Basic Access Control in HTTP ........................ 136 5.1.3 PAP Access Control in PPP ........................... 137 5.2 Challenge–Response Protocols .............................. 137 5.2.1 Digest Access Control in HTTP ....................... 138 5.2.2 CHAP Access Control in PPP ......................... 140 5.3 One-Time Password ...................................... 140 5.3.1 Lamport Scheme ................................... 140 5.3.2 S/Key and OTP .................................... 141 5.4 Key Distribution ......................................... 142 5.4.1 The Needham–Schroeder Authentication Protocol ......... 142 5.4.2 Kerberos ......................................... 143 5.4.3 Merkle Puzzles ................................... 145 5.5 Authentication Chains .................................... 145 5.5.1 Merkle Tree ...................................... 145 5.5.2 Timestamps and Notary ............................. 147 5.6 Wireless Communication: Two Case Studies ................... 148 5.6.1 The GSM Network ................................. 148 5.6.2 The Bluetooth Network .............................. 150 5.7 Exercises ............................................... 153 6 Algorithmic Algebra ................................... 155 6.1 Basic Group Theory ...................................... 155 6.1.1 Basic Set Theory ................................... 155 6.1.2 Groups ........................................... 157 6.1.3 Generating a Group, Comparing Groups ................ 158 6.1.4 Building New Groups ............................... 159 6.1.5 Fundamentals on Groups ............................. 159 x Contents 6.2 The Ring Zn ............................................ 160 6.2.1 Rings ............................................ 160 6.2.2 Definition of Zn .................................... 161 6.2.3 Additions, Multiplications, Inversion ................... 162 ∗ 6.2.4 The Multiplicative Group Zn ......................... 166 6.2.5 Exponentiation .................................... 167 6.2.6 Zmn: The Chinese Remainder Theorem ................. 167 6.3 The Finite Field Zp ....................................... 169 6.3.1 Basic Properties of Zp ............................... 169 6.3.2 Quadratic