11

Cryptography and Network Security - KopyKitab · 2018-10-01 · CRYPTOGRAPHY AND NETWORK SECURITY PRAKASH C. GUPTA Former Head Department of Information Technology Maharashtra Institute

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Cryptography and Network Security - KopyKitab · 2018-10-01 · CRYPTOGRAPHY AND NETWORK SECURITY PRAKASH C. GUPTA Former Head Department of Information Technology Maharashtra Institute
Page 2: Cryptography and Network Security - KopyKitab · 2018-10-01 · CRYPTOGRAPHY AND NETWORK SECURITY PRAKASH C. GUPTA Former Head Department of Information Technology Maharashtra Institute

Cryptography and Network Security

Page 3: Cryptography and Network Security - KopyKitab · 2018-10-01 · CRYPTOGRAPHY AND NETWORK SECURITY PRAKASH C. GUPTA Former Head Department of Information Technology Maharashtra Institute
Page 4: Cryptography and Network Security - KopyKitab · 2018-10-01 · CRYPTOGRAPHY AND NETWORK SECURITY PRAKASH C. GUPTA Former Head Department of Information Technology Maharashtra Institute

CRYPTOGRAPHY AND

NETWORK SECURITY

PRAKASH C. GUPTAFormer Head

Department of Information TechnologyMaharashtra Institute of Technology

Pune

Delhi-1100922015

Page 5: Cryptography and Network Security - KopyKitab · 2018-10-01 · CRYPTOGRAPHY AND NETWORK SECURITY PRAKASH C. GUPTA Former Head Department of Information Technology Maharashtra Institute

CRYPTOGRAPHY AND NETWORK SECURITYPrakash C. Gupta

© 2015 by PHI Learning Private Limited, Delhi. All rights reserved. No part of this book may be reproduced in any form, by mimeograph or any other means, without permission in writing from the publisher.

ISBN-978-81-203-5045-8

The export rights of this book are vested solely with the publisher.

Published by Asoke K. Ghosh, PHI Learning Private Limited, Rimjhim House, 111, Patparganj Industrial Estate, Delhi-110092 and Printed by Mohan Makhijani at Rekha Printers Private Limited, New Delhi-110020.

Page 6: Cryptography and Network Security - KopyKitab · 2018-10-01 · CRYPTOGRAPHY AND NETWORK SECURITY PRAKASH C. GUPTA Former Head Department of Information Technology Maharashtra Institute

v

Contents

Preface .....................................................................................................................................xviiAbbreviations ............................................................................................................................ xix

1. Introduction to Network Security ................................................................................1–11

1.1 Security Goals ...............................................................................................................1 1.1.1 The Cast .............................................................................................................1 1.1.2 Adversarial Attacks ...........................................................................................2 1.2 Security Services ..........................................................................................................4 1.3 Security Mechanisms .....................................................................................................5 1.4 Organization of the Book .............................................................................................8 1.5 Summing Up ................................................................................................................10 Recommended Reading.........................................................................................................10 Problems 11

2. Mathematical Foundations I (Modular Arithmetic) ................................................12–22

2.1 Modular Arithmetic .....................................................................................................12 2.1.1 Modulo Operator .............................................................................................12 2.1.2 Set of Residues ................................................................................................13 2.1.3 Congruence ......................................................................................................13 2.1.4 Modular Arithmetic Operations .....................................................................14 2.1.5 Properties of Modular Arithmetic for Integers in Zn ....................................14 2.1.6 Properties of Modular Arithmetic for Integers in Z ......................................14 2.2 Additive Inverse ..........................................................................................................15 2.2.1 Encryption and Decryption Using Additive Inverse ......................................15 2.3 Multiplicative Inverse ..................................................................................................16 2.3.1 Encryption and Decryption Using Multiplicative Inverse .............................16 2.4 Matrices........................................................................................................................17 2.4.1 Modular Arithmetic of Matrices .....................................................................17

Page 7: Cryptography and Network Security - KopyKitab · 2018-10-01 · CRYPTOGRAPHY AND NETWORK SECURITY PRAKASH C. GUPTA Former Head Department of Information Technology Maharashtra Institute

vi  Contents

2.5 Greatest Common Divisor (GCD) ..............................................................................18 2.5.1 Euclid’s Algorithm ..........................................................................................19 2.5.2 Bezout’s Identity..............................................................................................19 2.5.3 Extended Euclid’s Algorithm ..........................................................................20 2.6 Summing Up ................................................................................................................20 Recommended Reading.........................................................................................................21 Problems ...............................................................................................................................21

3. Classical Encryption Techniques ................................................................................23–36

3.1 Terminology of Cryptography ....................................................................................23 3.1.1 Symmetric-key and Asymmetric-key Encryption ...........................................24 3.1.2 Cryptanalysis ....................................................................................................25 3.2 Classical Encryption Methods .....................................................................................25 3.3 Substitution Ciphers ....................................................................................................25 3.3.1 Shift Cipher .....................................................................................................26 3.3.2 Monoalphabetic Substitution Cipher ...............................................................26 3.3.3 Statistical Attack ..............................................................................................27 3.3.4 Playfair Cipher .................................................................................................28 3.3.5 Hill Cipher .......................................................................................................29 3.4 Polyalphabetic Substitution Ciphers ...........................................................................30 3.4.1 Vigenere Cipher ...............................................................................................30 3.4.2 One-time Pad ...................................................................................................31 3.5 Transposition Ciphers ..................................................................................................31 3.6 Cryptanalytic Attacks ..................................................................................................32 3.6.1 Ciphertext-only Attack ....................................................................................32 3.6.2 Known-plaintext Attack...................................................................................33 3.6.3 Chosen-plaintext Attack ..................................................................................33 3.6.4 Chosen-ciphertext Attack ................................................................................33 3.7 Summing Up ................................................................................................................33 Recommended Reading.........................................................................................................34 Problems ...............................................................................................................................35

4. Symmetric-key Ciphers I (Data Encryption Standard) ...........................................37–55

4.1 Block Ciphers ..............................................................................................................37 4.2 Block Ciphers Using Multiple Rounds ......................................................................39 4.2.1 Diffusion and Confusion .................................................................................41 4.2.2 Structure of Round Function R ......................................................................41 4.2.3 Feistel Cipher Structure ...................................................................................42 4.3 Data Encryption Standard (DES) ................................................................................44 4.3.1 Scrambling Function g ....................................................................................46 4.3.2 Round Key Generation ....................................................................................48 4.3.3 Weak and Semi-weak Keys ............................................................................49 4.3.4 Strength of DES ..............................................................................................49

Page 8: Cryptography and Network Security - KopyKitab · 2018-10-01 · CRYPTOGRAPHY AND NETWORK SECURITY PRAKASH C. GUPTA Former Head Department of Information Technology Maharashtra Institute

Contents  vii

4.3.5 Double DES .....................................................................................................50 4.3.6 Triple DES .......................................................................................................51 4.4 Summing Up ................................................................................................................52 Recommended Reading.........................................................................................................53 Problems ...............................................................................................................................53

5. Mathematical Foundations II (Finite Fields) ............................................................56–71

5.1 Binary Operation .........................................................................................................56 5.1.1 Properties of Binary Operation .......................................................................57 5.2 Group ...........................................................................................................................57 5.2.1 Cyclic Group ...................................................................................................58 5.2.2 Abelian Group .................................................................................................58 5.3 Ring ..............................................................................................................................59 5.3.1 Commutative Ring ...........................................................................................60 5.4 Field .............................................................................................................................60 5.4.1 Galois Finite Fields .........................................................................................61 5.4.2 Finite Fields of Type GF(p) ...........................................................................62 5.4.3 Finite Fields of Type GF(2n) ..........................................................................62 5.5 Algebraic Polynomial ..................................................................................................63 5.5.1 Polynomials over a Field ................................................................................63 5.5.2 Representation of Binary Data by Polynomials .............................................63 5.5.3 Set of Polynomials ..........................................................................................64 5.5.4 Modular Arithmetic for Set of Polynomials ..................................................64 5.5.5 Irreducible Polynomial ....................................................................................65 5.5.6 Finite Field GF(2n) ..........................................................................................66 5.5.7 Generator for GF(2n) .......................................................................................68 5.6 Summing Up ................................................................................................................69 Recommended Reading.........................................................................................................70 Problems ...............................................................................................................................71

6. Symmetric-key Ciphers II (Advanced Encryption Standard) ................................72–86

6.1 Advanced Encryption Standard (AES) .......................................................................72 6.1.1 State Array and Word .....................................................................................73 6.1.2 Overall Structure of AES ................................................................................73 6.2 Encryption Round ........................................................................................................75 6.2.1 Substitute Bytes (SubBytes) Transformation ..................................................75 6.2.2 Shift Rows Transformation (ShiftRows) ........................................................77 6.2.3 Mix Columns Transformation (MixColumns) ................................................78 6.2.4 Add Round Key (AddRoundKey) ..................................................................78 6.3 Decryption Round........................................................................................................79 6.3.1 Inverse Shift Rows Transformation (InvShiftRows) ......................................80 6.3.2 Inverse Substitute Bytes Transformation (InvSubBytes) ...............................80 6.3.3 Inverse Mix Columns (InvMixColumns) ........................................................81

Page 9: Cryptography and Network Security - KopyKitab · 2018-10-01 · CRYPTOGRAPHY AND NETWORK SECURITY PRAKASH C. GUPTA Former Head Department of Information Technology Maharashtra Institute

viii  Contents

6.4 Key Expansion in AES ...............................................................................................82 6.4.1 Characteristic Features of the Key Expansion Algorithm .............................84 6.5 Security and Implementation Aspects of AES ...........................................................84 6.6 Summing Up ................................................................................................................84 Recommended Reading.........................................................................................................85 Problems ...............................................................................................................................85

7. Symmetric-key Ciphers III (Stream Ciphers, Modes of Operation) ....................... 87–108

7.1 Stream Ciphers ............................................................................................................87 7.2 Synchronous Stream Ciphers ......................................................................................88 7.2.1 Characteristic Features of Synchronous Stream Cipher ...............................90 7.3 Self Synchronizing Stream Cipher .............................................................................91 7.3.1 Characteristic Features of Self Synchronizing Stream Cipher ......................92 7.4 RC4 ..............................................................................................................................93 7.4.1 Analysis of RC4 ..............................................................................................95 7.5 Modes of Operation of Block Ciphers .......................................................................96 7.5.1 Electronic Codebook Mode (ECB) ...............................................................96 7.5.2 Cipher Block Chaining Mode (CBC) ...........................................................98 7.5.3 Cipher Feedback Mode (CFB) ......................................................................100 7.5.4 Output Feedback Mode (OFB) .....................................................................102 7.5.5 Counter Mode (CTR) ....................................................................................103 7.6 Summing Up ..............................................................................................................105 Recommended Reading.......................................................................................................106 Problems .............................................................................................................................106

8. Mathematical Foundations III (Prime Numbers) .................................................109–124

8.1 Prime, Coprime and Composite Numbers ................................................................109 8.1.1 Number of Primes .........................................................................................109 8.2 Fermat’s and Euler’s Theorems ................................................................................110 8.2.1 Fermat’s Little Theorem ...............................................................................110 8.2.2 Euler’s Totient Function ...............................................................................111 8.2.3 Euler’s Theorem ............................................................................................111 8.3 Testing for Primality .................................................................................................111 8.3.1 Divisibility Test .............................................................................................112 8.3.2 Fermat’s Primality Test .................................................................................112 8.3.3 Square Root Primality Test ...........................................................................112 8.3.4 Miller–Rabin Algorithm for Primality Testing ............................................113 8.3.5 AKS (Agrawal, Kayal, Saxena) Algorithm ..................................................115 8.4 Chinese Remainder Theorem (CRT) ........................................................................115 8.4.1 Applications of CRT in Cryptography .........................................................116 8.4.2 Quadratic Congruence ...................................................................................117 8.4.3 Quadratic Congruence Modulo a Prime p ...................................................117 8.4.4 Quadratic Congruence Modulo a Composite ...............................................118

Page 10: Cryptography and Network Security - KopyKitab · 2018-10-01 · CRYPTOGRAPHY AND NETWORK SECURITY PRAKASH C. GUPTA Former Head Department of Information Technology Maharashtra Institute

Contents  ix

8.5 Discrete Logarithm ....................................................................................................119 8.5.1 Multiplicative Group .....................................................................................119 8.5.2 Multiplicative Group G = {Z*

p , } .............................................................120 8.5.3 Discrete Logarithm over G = {Zp

*, } .........................................................121 8.5.4 Properties and Applications of Discrete Logarithm .....................................122 8.6 Summing Up ..............................................................................................................122 Recommended Reading.......................................................................................................123 Problems .............................................................................................................................123

9. Asymmetric-key Cryptosystems ..............................................................................125–144

9.1 Asymmetric-Key Cryptography ................................................................................125 9.1.1 Requirements for Asymmetric-key Cryptography ........................................126 9.1.2 Asymmetric-key Cryptography vs. Symmetric-key Cryptography ..............127 9.2 RSA Cryptosystem ....................................................................................................128 9.2.1 RSA Algorithm ..............................................................................................128 9.2.2 Proof of RSA Algorithm ...............................................................................129 9.2.3 Security of RSA Cryptosystem .....................................................................130 9.2.4 RSA Implementation .....................................................................................134 9.2.5 Applications of RSA .....................................................................................134 9.3 Rabin Cyptosystem ....................................................................................................134 9.3.1 Algorithm of Rabin Cryptosystem ..............................................................135 9.3.2 Security of Rabin Cryptosystem ...................................................................136 9.3.3 Operational Aspects of Rabin Cryptosystem ...............................................137 9.4 ElGamal Cryptosystem ..............................................................................................137 9.4.1 Algorithm of ElGamal Cryptosystem ..........................................................137 9.4.2 Operational Aspects of ElGamal Cryptosystem ...........................................138 9.4.3 Security of ElGamal ......................................................................................139 9.4.4 Generalized ElGamal Cryptosystem ............................................................139 9.4.5 Applications of ElGamal Cryptosystem ......................................................140 9.5 Summing Up ..............................................................................................................140 Recommended Reading.......................................................................................................141 Problems .............................................................................................................................142

10. Elliptic Curve Cryptography.................................................................................145–158

10.1 Elliptic Curve .........................................................................................................145 10.1.1 Elliptic Curve as an Abelian Group ........................................................146 10.1.2 Algebraic Expression for 2P ....................................................................147 10.2 Elliptic Curves over Zp ..........................................................................................147 10.2.1 Ep(a, b) as Cyclic Group ..........................................................................149 10.3 Elliptic Curves over Galois Field GF(2n) .............................................................150 10.3.1 E2n (a, b) as Cyclic Group ......................................................................151 10.4 Elliptic Curve Cryptography (ECC) ......................................................................152 10.4.1 ElGamal Asymmetric-key Cryptosystem Using ECC .............................152 10.4.2 Diffie–HellmanSecretKeyExchangeUsingECC .................................154

Page 11: Cryptography and Network Security - KopyKitab · 2018-10-01 · CRYPTOGRAPHY AND NETWORK SECURITY PRAKASH C. GUPTA Former Head Department of Information Technology Maharashtra Institute

Cryptography And Network Security

Publisher : PHI Learning ISBN : 9788120350458 Author : GUPTA, PRAKASHC.

Type the URL : http://www.kopykitab.com/product/7669

Get this eBook

30%OFF