CRYPTOG
NETWORK SECURITY
PRINCIPLES AND PRACTICES
FOURTH EDITION
William Stallings
Prentice Hall
'jKfetMHKi^^RIJ^jiBWfcMF «MMr""'-^.; <-^Lä£?^96SB^H B H I H I H ^ H • • ••"
CONTENTS
Notation xi Preface xiii Chapter 0 0.1 0.2 0.3 Chapter 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 i Reader's Guide 1Outline of This Book 2 Roadmap 2
Internet and Web Resources 4
Introduction 6
Security Trends 9
The OSI Security Architecture 12 Security Attacks 13
Security Services 16 Security Mechanisms 19
A Model for Network Security 22 Recommended Reading and Web Sites 24 Key Terms, Review Questions, and Problems 25
PART O N E S Y M M E T R I C C I P H E R S 26 Chapter 2 2.1 2.2 2.3 2.4 2.5 2.6 2.7 Chapter 3 3.1 3.2 3.3 3.4 3.5 3.6 3.7 Chapter 4 4.1 4.2 4.3 4.4 4.5 4.6
Classical Encryption Techniques 28
Symmetrie Cipher Model 30 Substitution Techniques 35 Transposition Techniques 49 R o t o r Machines 51
Steganography 53
Recommended Reading and Web Sites 55 Key Terms, Review Questions, and Problems 56
Block Ciphers and the Data Encryption Standard 62
Block Cipher Principles 64 The Data Encryption Standard 72 TheStrength ofDES 82
Differential and Linear Cryptanalysis 83 Block Cipher Design Principles 86 Recommended Reading 90
Key Terms, Review Questions, and Problems 90
Finite Fields 95
Groups, Rings, and Fields 97 Modular Anthmetic 101 The Euclidean Algorithm 107 Finite Fields of the Form GF(p) 109 Polynomial Arithmetic 113
Finite Fields of the Form GF(2") 119
v i CONTENTS
4.7 Recommended Reading and Web Sites 129
4.8 Key Terms, Review Questions, and Problems 130
Chapter 5 Advanced Encryption Standard 134 5.1 Evaluation Criteria for AES 135
5.2 TheAES Cipher 140
5.3 Recommended Reading and Web Sites 160 5.4 Key Terms, Review Questions, and Problems 161
Appendix 5A Polynomials with CoefFicients in GF(28) 163
Appendix 5B Simplified AES 165
Chapter 6 More on S y m m e t r i e Ciphers 174 6.1 Multiple Encryption andTriple DES 175
6.2 Block Cipher Modes of Operation 181 6.3 Stream Ciphers and R C 4 189
6.4 Recommended Reading and Web Site 194 6.5 Key Terms, Review Questions, and Problems 194
Chapter 7 Confidentiality Using Symmetrie Encryption 199 7.1 Placement of Encryption Function 201
7.2 Traffic Confidentiality 209
7.3 Key Distribution 210
7.4 Random Number Generation 218
7.5 Recommended Reading and Web Sites 227 7.6 Key Terms, Review Questions, and Problems 228
P A R T T W O P U B L I C - K E Y E N C R Y P T I O N A N D H A S H F U N C T I O N S 232 Chapter 8 Introduction to N u m b e r Theory 234
8.1 Prime Numbers 236
8.2 Fermat's and Euler's Theorems 238 8.3 Testing for Primality 242
8.4 The Chinese Remainder Theorem 245 8.5 Discrete Logarithms 247
8.6 Recommended Reading and Web Site 253 8.7 Key Terms, Review Questions, and Problems 254
Chapter 9 Public-Key Cryptography and R S A 257 9.1 Principles of Public-Key Cryptosystems 259
9.2 The RSA Algonthm 268
9.3 Recommended Reading and Web Site 280 9.4 Key Terms, Review Questions, and Problems 281
Appendix 9A Proof of the RSA Algorithm 285 Appendix 9B The Complexity of Algorithms 286
Chapter 10 Key Management; Other Public-Key Cryptosystems 289 10.1 Key Management 290
10.2 Diffie-Hellman Key Exchange 298
10.3 Elliptic Curve Arithmetic 301 10.4 Elliptic Curve Cryptography 310
10.5 Recommended Reading and Web Site 313 10.6 KeyTerms, Review Questions, and Problems 314 Chapter 11 Message Authentication and Hash Functions 317
11.1 Authentication Requirements 319 11.2 Authentication Functions 320 11.3 Message Authentication Codes 331 11.4 Hash Functions 334
11.5 Security of Hash Functions and MACs 340 11.6 Recommended Reading 344
11.7 KeyTerms, Review Questions, and Problems 344
Appendix I I A Mathematical Basis of the Birthday Attack 346
Chapter 12 Hash and MAC Algorithms 351 12.1 Secure Hash Algorithm 353 12.2 Whirlpool 358
12.3 H M A C 368 12.4 CMAC 372
12.5 Recommended Reading and Web Sites 374 12.6 KeyTerms, Review Questions, and Problems 375
Chapter 13 Digital Signatures and Authentication Protocols 377 13.1 Digital Signatures 378
13.2 Authentication Protocols 382 13.3 Digital Signature Standard 390
13.4 Recommended Reading and Web Sites 393 13.5 KeyTerms, Review Questions, and Problems 393
PART T H R E E N E T W O R K S E C U R I T Y A P P L I C A T I O N S 398 Chapter 14 Authentication Applications 400
14.1 Kerberos 401
14.2 X.509 Authentication Service 419 14.3 Public-Key Infrastructure 428
14.4 Recommended Reading and Web Sites 430 14.5 KeyTerms, Review Questions, and Problems 431
Appendix 14A Kerberos Encryption Techniques 433
Chapter 15 Electronic Mail Security 436 15.1 Pretty Good Privacy 438 15.2 S/MIME 457
15.3 Recommended Web Sites 474
15.4 KeyTerms, Review Questions, and Problems 474
Appendix 15A Data Compression Using ZIP 475 Appendix 15B Radix-64 Conversion 478
Appendix 1 5C PGP Random Number Generation 479
Chapter 16 IP Security 483
16.1 IP Security Overview 485 16.2 IP Security Architecture 487
Vlll CONTENTS
16.3 Authentication Header 493 16.4 Encapsulating Security Payload 498 16.5 Combining Security Associations 503 16.6 Key Management 506
16.7 Recommended Reading and Web Site 516 16.8 Key Terms, Review Questions, and Problems 517
Appendix 16A Internetworking and Internet Protocols 518
Chapter 17 Web Security 527
17.1 Web Security Considerations 528
17.2 Secure Socket Layer and Transport Layer Security 531 17.3 Secure Electronic Transaction 549
17.4 Recommended Reading and Web Sites 560 17.5 Key Terms, Review Questions, and Problems 561 PART F O U R SYSTEM S E C U R I T Y 563
Chapter 18 Intruders 565 18.1 Intruders 567
18.2 Intrusion Detection 570 18.3 Password Management 582
18.4 Recommended Reading and Web Sites 591 18.5 Key Terms, Review Questions, and Problems 592
Appendix 18A The Base-Rate Fallacy 594
Chapter 19 Malicious Software 598 19.1 Viruses and Related Threats 599 19.2 Virus Countermeasures 610
19.3 Distributed Denial of Service Attacks 614 19.4 Recommended Reading and Web Sites 619 19.5 Key Terms, Review Questions, and Problems 620 Chapter 20 Firewalls 621
20.1 Firewall Design Principles 622 20.2 Trusted Systems 634
20.3 Common Criteria for Information Technology Security Evaluation 640 20.3 Recommended Reading and Web Sites 644
20.4 Key Terms, Review Questions, and Problems 645 A P P E N D I C E S 647
Appendix A Standards and Standards-Setting Organizations 647 A . l The Importance of Standards 648
A.2 Internet Standards and the Internet Society 649 A.3 National Institute of Standards and Technology 652
Appendix B Projects for Teaching Cryptography and Network Security 653 B . l Research Projects 654
B.2 Programming Projects 655 B.3 Laboratory Exercises 655
B.4 Writing Assignments 655 B.5 Reading/Report Assignments 656 Glossary 657 References 663 Index 673 O N L I N E A P P E N D I C E S williamstallings.com/Crypto/Crypto4e.html Appendix C Simplified D e s C.l Overview
C.2 S-DES Key Generation C.3 S-DES Key Encryption C.4 Analysis of Simplified DES
C.5 Relationship to DES Appendix D T h e Meaning o f m o d
D . l The Binary Operator mod
D.2 The Congruence Relation mod
Appendix E More on Simplified AES E . l Anthmetic in GF(24)
E.2 The Mix Column Function
Appendix F Knapsack Public-Key Algorithm F.l The Knapsack Problem
F.2 The Knapsack Cryptosystem F.3 Example
Appendix G Proof o f the Digital Signature Algorithm Appendix H T C P / I P and OSI
H . l Protocols and Protocol Architectures
H . l The T C P / O I P Protocol Architecture H . l The OSI Protocol Architecture