Professional Documents
Culture Documents
INTRODUCTION TO
CRYPTOGRAPHY
WITH MATHEMATICAL FOUNDATIONS AND COMPUTER IMPLEMENTATIONS
Alexander
Stanoyevitch
CRC Press
Taylor & Francis Group
Boca Raton CRC Press is an London New York
Taylor
& Francis
A CHAPMAN
Contents
Dependency Acknowledgments
1
Chart
Concepts
4
Functions
Functions, Bijections
7 12
25
Chapter 1 Computer Implementations and Exercises 35 Vector/String Conversions 35 Integer/Text Conversions 36 Programming Basic Ciphers with Integer Arithmetic 38 Computer-Generated Random Numbers 39 2
43
43 46
Relatively Prime Integers Algorithm 47 The Euclidean Algorithm 48 Modular Arithmetic and Congruences 52
Modular Integer Systems Modular Inverses 60 58
Extended Euclidean Algorithm 61 Solving Linear Congruences 64 Summary of Procedure for Solving the Single 66 Linear Congruence (Equation 2.2)
The Chinese Remainder Theorem
67
and Exercises
Chapter Chapter
2 Exercises 2
71 85
Computer Implementations
viii
Contents
The Evolution of
Ancient Codes Affine Nulls 91 Formal Definition of
Codemaking
a
until the
94
Computer Era
91
Cryptosystem
Ciphers Steganography
102
96 100
109 110
Enigma Cycles (Cyclic Permutations) 114 Dissection of the Enigma Machine into Permutations Special Properties of All Enigma Machines 126 Chapter 3 Exercises 127 Chapter 3 Computer Implementations and Exercises Computer Representations of Permutations 140
Matrices and the Hill
The of Matrix Matrix
119
136
Cryptosystem
146 149
145
a 145 Anatomy Addition, Subtraction, and Scalar Multiplication Matrix Multiplication 147
Multiplication Is Associative
151
149
Invertible
a
(Square) Matrix
153 155
Square Matrix
2 Matrices
Transpose of a Matrix 156 Modular Integer Matrices 156 The Classical Adjoint (for Matrix Inversions)
The Hill
159
Cryptosystem
162 174
Chapter 4 Exercises 166 Chapter 4 Computer Implementations and Exercises 5 The Evolution of
Codebreaking until
181
the
Computer
Era
181
The Demise of the Vigenere Cipher 187 The Babbage/Kasiski Attack 188 The Friedman Attack The Index of Coincidence 192 193 193
Expected Values of the Index of Coincidence How Enigmas Were Attacked 201
German Usage Protocols for Enigmas The Polish Codebreakers 203 205 202
Rejewski's Attack
203
Invariance of Cycle Decomposition Form Alan Turing and Bletchley Park 206
Chapter Chapter
5 5
Exercises
208
and Exercises 214
Computer Implementations
Contents
ix
Programs to Aid in Frequency Analysis 214 Programs to Aid in the Babbage/Kasiski Attack 215 Programs Related to the Friedman Attack 218 6
....
221
Integers
in Different Bases
224
Algorithm
with Base b
Expansions
Multiplication
Algorithm in Base b
239
Expansions Expansions
237
248
251
The Evolution of
Computers into Cryptosystems 251 Adopted to Fulfill an Important Need 252 The XOR Operation 254 Feistel Cryptosystems 255
A Scaled-Down Version of DES DES 265
272
258
274
Cipherblock Chaining (CBC) Mode 275 Cipher Feedback (CFB) Mode 276 Output Feedback (OFB) Mode 278 Chapter 7 Exercises 279 Chapter 7 Computer Implementations and Exercises
8
286
293
Modular Orders of Invertible Modular 302 304 Existence of Primitive Roots Order of Powers Formula Prime Number Generation Fermat's 305 308 309 311 312
a
Integers
301
304
Primality
Test
Factoring Enhancement
315
Contents
316 325
Key Cryptography
Analogy
for
a
An Informal
Public
One-Way Functions
The Diffie-Hellman
333
Logarithm Problem 334 Key Exchange 336 The Quest for a Complete Public Key Cryptosystem The RSA Cryptosystem 338 Digital Signatures and Authentication 343
The EIGamal Cryptosystem 345 Digital Signatures with EIGamal 347
337
Knapsack Problems
349 352
Security Guarantee for RSA 357 Chapter 9 Exercises 360 Chapter 9 Computer Implementations and Exercises
10 Finite Fields in
369
General,
377
377
ZplX]
Vector
Polynomials with Coefficients in Zp 385 Polynomials in ZP[X] 386 Representation of Polynomials 387
a
the
ZP[X)
Is
Ring
388
Divisibility in 1P[X] 389 The Division Algorithm for ZP[X] 391 Congruences in ZP[X] Modulo a Fixed Polynomial Building Finite Fields from ZP[X] 396
The Fields GF(24) and GF(28)
10 Exercises
395
399
Polynomials
404 411
Chapter
406
and Exercises
417
Replacement
to DES
417
Nibbles
421
Decryption in the Scaled-Down Version of AES Byte Representation and Arithmetic 432 Encryption Algorithm 435
429
The AES
Contents
xi
The AES
Decryption Algorithm
of the AES 11 440 441
439
Security Chapter 12
Chapter 11 Exercises
Computer Implementations
and Exercises
445
Elliptic
Elliptic
Curve
Cryptography
the Real Numbers 452 454
451
Curves 458
over
The Addition
Groups Elliptic Curves over Zp 460 The Variety of Sizes of Modular Elliptic Curves 462 The Addition Operation for Elliptic Curves over %p 463 The Discrete Logarithm Problem on Modular Elliptic Curves 466 467 An Elliptic Curve Version of the Diffie-Hellman Key Exchange Fast Integer Multiplication of Points on Modular Elliptic Curves 470 Representing Plaintexts on Modular Elliptic Curves 471 473 An Elliptic Curve Version of the EIGamal Cryptosystem A Factoring Algorithm Based on Elliptic Curves 475 Chapter 12 Exercises 477 Chapter 12 Computer Implementations and Exercises 483
Appendices Appendix A:
Sets and Basic
489
Counting Principles
491
Concepts and Notations for Sets 491 Two Basic Counting Principles 495
Appendix
B:
501
509
Appendix C: Solutions
Chapter Chapter Chapter Chapter Chapter Chapter Chapter Chapter
Chapter
2: 3:
4:
to All
515
1: An Overview of the
5: 6:
8: 9:
Chapter 7:
Subject 515 Divisibility and Modular Arithmetic 517 The Evolution of Codemaking until the Computer Era 522 Matrices and the Hill Cryptosystem 526 The Evolution of Codebreaking until the Computer Era 530 Representation and Arithmetic of Integers in Different Bases 536 Block Cryptosystems and the Data Encryption Standard (DES) 540 545 Some Number Theory and Algorithms Public Key Cryptography 550
General, and GF(28) in Particular
554 560
Chapter Chapter
xii
Contents
Appendix
Exercises.
Chapter Chapter Chapter Chapter Chapter Chapter Chapter Chapter Chapter Chapter Chapter Chapter
1
2
3 4
5 6
7
8
9 10 11 12
609
611
Appendix E: Suggestions
Synopsis
615
for Further
615 615
Reading
615
History of Cryptography
Mathematical Foundations
616
619
623
Algorithms
625
Subject Index
627