Cryptography Forouzan

Embed Size (px)

Citation preview

  • 7/21/2019 Cryptography Forouzan

    1/56

    30.1

    Chapter 30Cryptography

    Copyright The McGraw-Hill Companies, Inc. Permission required or reproduction or display.

  • 7/21/2019 Cryptography Forouzan

    2/56

    30.2

    30-1 INTRODUCTION30-1 INTRODUCTION

    Let us introduce the issues involved in cryptography.Let us introduce the issues involved in cryptography.

    First, we need to define some terms; then we give someFirst, we need to define some terms; then we give some

    taxonomies.taxonomies.

    Definitions

    Two Categories

    Topics discussed in this section:To

    pics discussed in this section:

  • 7/21/2019 Cryptography Forouzan

    3/56

    30.3

    Figure 30.1 Cryptography components

  • 7/21/2019 Cryptography Forouzan

    4/56

    30.4

    Figure 30.1 Cryptography components

  • 7/21/2019 Cryptography Forouzan

    5/56

    30.5

    Figure 30.2 Categories of cryptography

  • 7/21/2019 Cryptography Forouzan

    6/56

    30.6

    Figure 30.3 Symmetric!ey cryptography

  • 7/21/2019 Cryptography Forouzan

    7/5630.7

    In symmetric-key cryptography, thesame key is used y the sender

    !"or encryption#

    and the recei$er !"or decryption#.

    %he key is shared.

    "ote

  • 7/21/2019 Cryptography Forouzan

    8/5630.&

    Figure 30.4 #symmetric!ey cryptography

  • 7/21/2019 Cryptography Forouzan

    9/5630.'

    Figure 30.5 $eys used in cryptography

  • 7/21/2019 Cryptography Forouzan

    10/5630.10

    Figure 30.6 Comparison %etween two categories of cryptography

  • 7/21/2019 Cryptography Forouzan

    11/5630.11

    30-2 SYMMETRIC-KEY CRYPTOGRAPHY30-2 SYMMETRIC-KEY CRYPTOGRAPHY

    Symmetric!ey cryptography started thousands of yearsSymmetric!ey cryptography started thousands of yearsago when people needed to exchange secrets &forago when people needed to exchange secrets &for

    example, in a war'. (e still mainly use symmetric!eyexample, in a war'. (e still mainly use symmetric!ey

    cryptography in our networ! security. )owever, today*scryptography in our networ! security. )owever, today*s

    ciphers are much more complex.ciphers are much more complex.

    Traditional Ciphers

    Simple odern Ciphersodern !ound Ciphers

    ode of "peration

    Topics discussed in this section:Topics discussed in this section:

  • 7/21/2019 Cryptography Forouzan

    12/5630.12

    Figure 30.# Traditional ciphers

  • 7/21/2019 Cryptography Forouzan

    13/5630.13

    ( sustitution cipher rep)aces onesymo) *ith another.

    "ote

  • 7/21/2019 Cryptography Forouzan

    14/5630.14

  • 7/21/2019 Cryptography Forouzan

    15/5630.15

    The following shows a plaintext and its correspondingciphertext. +s the cipher monoalpha%etic

    -xample /.0

    Solution

    The cipher is pro%a%ly monoalpha%etic %ecause %oth

    occurrences of L*s are encrypted as 1*s.

  • 7/21/2019 Cryptography Forouzan

    16/56

  • 7/21/2019 Cryptography Forouzan

    17/5630.17

    %he shi"t cipher is sometimes re"erred to

    as the Caesar cipher.

  • 7/21/2019 Cryptography Forouzan

    18/5630.1&

    4se the shift cipher with !ey 5 06 to encrypt the message

    7)-LL1.8

    Solution

    We encrypt one character at a time. Each character is

    shifted 15 characters down. Letter H is encrypted to W.

    Letter E is encrypted to T. The first L is encrypted to A.The second L is also encrypted to A. And O is encrypted

    to D. The cipher text is WTAAD.

    -xample /.

  • 7/21/2019 Cryptography Forouzan

    19/5630.1'

    4se the shift cipher with !ey 5 06 to decrypt the message

    7(T##9.8

    Solution

    We decrypt one character at a time. Each character is

    shifted 15 characters up. Letter W is decrypted to H.

    Letter T is decrypted to E. The first A is decrypted to L.The second A is decrypted to L. And, finally, D is

    decrypted to O. The plaintext isHELLO.

    -xample /.

  • 7/21/2019 Cryptography Forouzan

    20/56

    30.20

    ( transposition cipher reorders

    !permutes# symo)s in a )ock o"

    symo)s.

  • 7/21/2019 Cryptography Forouzan

    21/56

    30.21

    Figure 30.$ Transposition cipher

  • 7/21/2019 Cryptography Forouzan

    22/56

    30.22

    -ncrypt the message 7)-LL1 < 9-#=,8 using the !ey

    shown in Figure /.>.

    Solution

    We first remove the spaces in the message. We then divide

    the text into blocks of four characters. We add a bogus

    character Z at the end of the third block. The result isHELL OMYD EARZ. We create a three-block ciphertext

    ELHLMDOYAZER.

    -xample /.6

  • 7/21/2019 Cryptography Forouzan

    23/56

    30.23

    4sing -xample /.6, decrypt the message

    7-L)L91

  • 7/21/2019 Cryptography Forouzan

    24/56

    30.24

    Simple odern Ciphers

  • 7/21/2019 Cryptography Forouzan

    25/56

    30.25

    Figure 30.% @1= cipher

  • 7/21/2019 Cryptography Forouzan

    26/56

    30.26

    Figure 30.10 =otation cipher

  • 7/21/2019 Cryptography Forouzan

    27/56

    30.27

    Figure 30.11 S%ox

  • 7/21/2019 Cryptography Forouzan

    28/56

    30.2&

    Figure 30.12 A%oxes: straight, expansion, and compression

  • 7/21/2019 Cryptography Forouzan

    29/56

    30.2'

    odern =ound Ciphers

  • 7/21/2019 Cryptography Forouzan

    30/56

    30.30

    Figure 30.13 9-S

  • 7/21/2019 Cryptography Forouzan

    31/56

    30.31

    Figure 30.14 1ne round in 9-S ciphers

  • 7/21/2019 Cryptography Forouzan

    32/56

    30.32

    Figure 30.15 9-S function

  • 7/21/2019 Cryptography Forouzan

    33/56

    30.33

    Figure 30.16 Triple 9-S

  • 7/21/2019 Cryptography Forouzan

    34/56

    30.34

    Ta&le 30.1 #-S configuration

  • 7/21/2019 Cryptography Forouzan

    35/56

    30.35

    (+ has three di""erent con"igurations*ith respect to the numer o" rounds

    and key sie.

    "ote

  • 7/21/2019 Cryptography Forouzan

    36/56

    30.36

    Figure 30.1# #-S

  • 7/21/2019 Cryptography Forouzan

    37/56

    30.37

    Figure 30.1$ Structure of each round

  • 7/21/2019 Cryptography Forouzan

    38/56

    30.3&

    Figure 30.1% odes of operation for %loc! ciphers

  • 7/21/2019 Cryptography Forouzan

    39/56

    30.3'

    Figure 30.20 -lectronic Code Boo! mode &-CB'

  • 7/21/2019 Cryptography Forouzan

    40/56

    30.40

    Figure 30.20 -lectronic Code Boo! mode &-CB'

  • 7/21/2019 Cryptography Forouzan

    41/56

    30.41

    Figure 30.21 Cipher Bloc! Chaining mode &CBC'

  • 7/21/2019 Cryptography Forouzan

    42/56

    30.42

    Figure 30.21 Cipher Bloc! Chaining mode &CBC'

  • 7/21/2019 Cryptography Forouzan

    43/56

    30.43

    Figure 30.22 Cipher FeedBac! mode &CFB'

  • 7/21/2019 Cryptography Forouzan

    44/56

    30.44

    Figure 30.22 Cipher FeedBac! mode &CFB'

  • 7/21/2019 Cryptography Forouzan

    45/56

    30.45

    Figure 30.23 1utput FeedBac! mode &1FB'

  • 7/21/2019 Cryptography Forouzan

    46/56

    30.46

    Figure 30.23 1utput FeedBac! mode &1FB'

  • 7/21/2019 Cryptography Forouzan

    47/56

    30.47

    30-3 ASYMMETRIC-KEY CRYPTOGRAPHY30-3 ASYMMETRIC-KEY CRYPTOGRAPHY

    #n asymmetric!ey &or pu%lic!ey' cipher uses two#n asymmetric!ey &or pu%lic!ey' cipher uses two!eys: one private and one pu%lic. (e discuss two!eys: one private and one pu%lic. (e discuss two

    algorithms: =S# and 9iffie)ellman.algorithms: =S# and 9iffie)ellman.

    !S'

    Diffie()ellman

    Topics discussed in this section:Topics discussed in this section:

  • 7/21/2019 Cryptography Forouzan

    48/56

    30.4&

    Figure 30.24 =ivest Shamir #dleman &=S#'

  • 7/21/2019 Cryptography Forouzan

    49/56

    30.4'

    In (, eand nare announced to thepu)ic/ dand are kept secret.

  • 7/21/2019 Cryptography Forouzan

    50/56

    30.50

  • 7/21/2019 Cryptography Forouzan

    51/56

    30.51

    -xample /.

  • 7/21/2019 Cryptography Forouzan

    52/56

    30.52

    Bo% chooses and 00 as p and D and calculates

    n 5 x 00 5 . The value of 5 & E 0' &00 E 0' or ?/.

    "ow he chooses two !eys, e and d. +f he chooses e to %e

    0, then d is . "ow imagine #lice sends the plaintext 6

    to Bo%. She uses the pu%lic !ey 0 to encrypt 6.

    -xample /.

    -xample /. &continued'

  • 7/21/2019 Cryptography Forouzan

    53/56

    30.53

    -xample /. &continued'

    Bo% receives the ciphertext 2? and uses the private !ey to decipher the ciphertext:

    The plaintext 6sent %y #lice is received as plaintext 6%yBo%.

  • 7/21/2019 Cryptography Forouzan

    54/56

    30.54

  • 7/21/2019 Cryptography Forouzan

    55/56

    30.55

    %he symmetric !shared# key in the

    i""ie-e))man protoco) is

    gymod p.

    "ote

    Arocedure

  • 7/21/2019 Cryptography Forouzan

    56/56