NSec 4.0.1 - Symmetric Encryption

  • View
    226

  • Download
    0

Embed Size (px)

Text of NSec 4.0.1 - Symmetric Encryption

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    1/64

    NETWORK SECURITY

    SYMMETRIC ENCRYPTION

    11

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    2/64

    Hai k thut m ha ch yu

    M ha i xng

    o Bn gi v bn nhn s dng chung mt kha

    o Cn gi l

    o M ha truyn thng

    o M ha kha ring / kha n / kha b mt

    o L k thut m ha duy nht trc nhng nm 70

    o Hin vn cn c dng rt ph bin

    M ha kha cng khai (bt i xng)o Mi bn s dng mt cp kha

    o Mt kha cng khai + Mt kha ring

    o Cng b chnh thc nm 1976

    An ninh Mng 22

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    3/64

    Mt s cch phn loi khc

    Theo phng thc x l

    o M ha khi

    o Mi ln x l mt khi nguyn bn v to ra khi bn m tng ng (chnghn 64 hay 128 bit)

    o

    M ha lungo X l d liu u vo lin tc (chng hn mi ln 1 bit)

    Theo phng thc chuyn i

    o M ha thay th

    o Chuyn i mi phn t nguyn bn thnh mt phn t bn m tng ng

    o M ha hon v

    o B tr li v tr cc phn t trong nguyn bn

    33

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    4/64

    M hnh h m ha i xng

    An ninh Mng 44

    Kha b mt dng chungbi bn gi v bn nhn

    Kha b mt dng chungbi bn gi v bn nhn

    Gii thut m ha Gii thut gii m

    Nguyn bnu vo

    Nguyn bnu ra

    Bn m

    truyn i

    M ha

    Y = EK(X)

    Gii m

    X = DK(Y)

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    5/64

    M hnh h m ha i xng

    Gm c 5 thnh phno Nguyn bn

    o Gii thut m ha

    o Kha b mto Bn m

    o Gii thut gii m

    An ninh ph thuc vo s b mt ca kha,khng ph thuc vo s b mt ca gii thut

    An ninh Mng 55

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    6/64

    Ph m

    L n lc gii m vn bn c m hakhng bit trc kha b mt

    C hai phng php ph m

    o Vt cno Th tt c cc kha c th

    o Thm m

    o Khai thc nhng nhc im ca gii thut

    o Da trn nhng c trng chung ca nguyn bn hoc mt scp nguyn bn - bn m mu

    An ninh Mng 66

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    7/64

    Phng php ph m vt cn

    V l thuyt c th th tt c cc gi tr khacho n khi tm thy nguyn bn t bn m

    Da trn gi thit c th nhn bit c nguyn

    bn cn tm Tnh trung bnh cn th mt na tng s cc

    trng hp c th

    Thc t khng kh khi nu di kha ln

    An ninh Mng 77

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    8/64

    Thi gian tm kim trung bnh

    An ninh Mng 88

    Kch thckha (bit)

    S lng kha Thi gian cn thit

    (1 gii m/s)

    Thi gian cn thit

    (106 gii m/s)

    32

    56

    128

    168

    26 k t

    (hon v)

    232 = 4,3 x 109

    256 = 7,2 x1016

    2128 = 3,4 x1038

    2168 = 3,7 x

    1050

    26! = 4 x 1026

    231 s = 35,8 pht

    255 s = 1142 nm2127 s = 5,4 x 1024nm

    2167 s = 5,9 x 1036nm

    2 x 1026 s =

    6,4 x 1012nm

    2,15 ms

    10,01 gi5,4 x 1018 nm

    5,9 x 1030 nm

    6,4 x 106 nm

    Tui v tr : ~ 1010 nmKha DES di 56 bitKha AES di 128+ bit

    Kha 3DES di 168 bit

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    9/64

    Cc k thut thm m

    Ch c bn mo Ch bit gii thut m ha v bn m hin c

    Bit nguyn bn

    o

    Bit thm mt s cp nguyn bn - bn m Chn nguyn bn

    o Chn 1 nguyn bn, bit bn m tng ng

    Chn bn m

    o Chn 1 bn m, bit nguyn bn tng ng

    Chn vn bn

    o Kt hp chn nguyn bn v chn bn m

    An ninh Mng 99

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    10/64

    An ninh h m ha

    An ninh v iu kino Bn m khng cha thng tin xc nh duy nht nguyn

    bn tng ng, bt k vi s lng bao nhiu v tc mytnh th no

    o

    Ch h m ha n mt ln l an ninh v iu kin An ninh tnh ton

    o Tha mn mt trong hai iu kin

    o Chi ph ph m vt qu gi tr thng tin

    o Thi gian ph m vt qu tui th thng tin

    o Thc t tha mn hai iu kin

    o Khng c nhc im

    o Kha c qu nhiu gi tr khng th th ht

    An ninh Mng 1010

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    11/64

    M ha thay th c in

    Cc ch ci ca nguyn bn c thay th bicc ch ci khc, hoc cc s, hoc cc khiu

    Nu nguyn bn c coi nh mt chui bit ththay th cc mu bit trong nguyn bn bng ccmu bit ca bn m

    An ninh Mng 1111

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    12/64

    H m ha Caesar

    H m ha thay th xut hin sm nht & n gin nht

    S dng u tin bi Julius Caesar vo mc ch quns

    Dch chuyn xoay vng theo th t ch ci

    o Kha k l s bc dch chuyn

    o Vi mi ch ci ca vn bn

    o t p = 0 nu ch ci l a, p = 1 nu ch ci l b,...

    o

    M ha : C = E(p) = (p + k) mod 26o Gii m : p = D(C) = (C - k) mod 26

    V d : M ha "meet me after class" vi k = 3

    An ninh Mng 1212

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    13/64

    Ph m h m ha Caesar

    Phng php vt cno Kha ch l mt ch ci (hay mt s gia 1 v 25)

    o Th tt c 25 kha c th

    o D dng thc hin

    Ba yu t quan trng

    o Bit trc cc gii thut m ha v gii m

    o Ch c 25 kha th

    o

    Bit v c th d dng nhn ra c ngn ng ca nguyn bn V d : Ph m "GCUA VQ DTGCM"

    An ninh Mng 1313

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    14/64

    H m ha n bng

    Thay mt ch ci ny bng mt ch ci khc theo trtt bt k sao cho mi ch ci ch c mt thay th duynht v ngc li

    Kha di 26 ch ci

    V d

    o Kha

    a b c d e f g h i j k l m n o p q r s t u v w x y z

    M N B V C X Z A S D F G H J K L P O I U Y T R E W Qo Nguyn bn

    i love you

    An ninh Mng 1414

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    15/64

    Ph m h m ha n bng

    Phng php vt cno Kha di 26 k t

    o S lng kha c th = 26! = 4 x 1026

    o Rt kh thc hin

    Khai thc nhng nhc im ca gii thut

    o Bit r tn s cc ch ci ting Anh

    o C th suy ra cc cp ch ci nguyn bn - ch ci bn m

    o

    V d : ch ci xut hin nhiu nht c th tng ng vi 'e'o C th nhn ra cc b i v b ba ch ci

    o V d b i : 'th', 'an', 'ed'

    o V d b ba : 'ing', 'the', 'est'

    An ninh Mng 1515

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    16/64

    Cc tn s ch ci ting Anh

    Nguyn i Th An ninh Mng 1616

    Tnstngi(%)

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    17/64

    V d ph m h n bng

    Cho bn mUZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ

    VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX

    EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ

    Tnh tn s ch ci tng i on P l e, Z l t

    on ZW l th v ZWP l the

    Tip tc on v th, cui cng c

    it was disclosed yesterday that several informal but

    direct contacts have been made with political

    representatives of the viet cong in moscow

    An ninh Mng 1717

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    18/64

    H m ha Playfair (1)

    H m ha nhiu cho Gim bt tng quan cu trc gia bn m v

    nguyn bn bng cch m ha ng thi nhiu chci ca nguyn bn

    S dng 1 ma trn ch ci 5x5 xy dng trnc s 1 t kha

    o in cc ch ci ca t kha (b cc ch trng)

    o in nt ma trn vi cc ch khc ca bng ch cio I v J chim cng mt ca ma trn

    An ninh Mng 1818

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    19/64

    H m ha Playfair (2)

    V d ma trn vi t kha MONARCHY M O N A R

    C H Y B D

    E F G I/J K

    L P Q S T U V W X Z

    M ha 2 ch ci mt lc

    o Nu 2 ch ging nhau, tch ra bi 1 ch in thm

    o

    Nu 2 ch nm cng hng, thay bi cc ch bn phio Nu 2 ch nm cng ct, thay bi cc ch bn di

    o Cc trng hp khc, mi ch ci c thay bi ch ci khc cnghng, trn ct ch ci cng cp

    An ninh Mng 1919

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    20/64

    Ph m h m ha Playfair

    An ninh m bo hn nhiu h m ha nch

    C 26 x 26 = 676 cp ch ci

    o

    Vic gii m tng cp kh khn hno Cn phn tch 676 tn s xut hin thay v 26

    Tng c qun i Anh, M s dng rng ri

    Bn m vn cn lu li nhiu cu trc canguyn bn

    Vn c th ph m c v ch c vi trm cpch ci cn gii m

    An ninh Mng 2020

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    21/64

    H m ha Vigenre

    L mt h m ha a bng

    o S dng nhiu bng m ha

    o Kha gip chn bng tng ng vi mi ch ci

    Kt hp 26 h Ceasar (bc dch chuyn 0 - 25)

    o Kha K = k1k2...kd gm d ch ci s dng lp i lp li vi cc chci ca vn bn

    o Ch ci th i tng ng vi h Ceasar bc chuyn i

    V d

    o Kha : deceptivedeceptivedeceptive

    o Nguyn bn : wearediscoveredsaveyourself

    o Bn m : ZICVTWQNGRZGVTWAVZHCQYGLMGJ

    An ninh Mng 2121

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    22/64

    Ph m h m ha Vigenre

    Phng php vt cn

    o Kh thc hin, nht l nu kha gm nhiu ch ci

    Khai thc nhng nhc im ca gii thut

    o Cu trc ca nguyn bn c che y tt hn h Playfair

    nhng khng hon ton bin mto Ch vic tm di kha sau ph m tng h Ceasar

    o Cch tm di kha

    o Nu di kha nh so vi di vn bn, c th pht hin 1 dy vnbn lp li nhiu ln

    o Khong cch gia 2 dy vn bn lp l 1 bi s ca di kha

    o T suy ra di kha

    An ninh Mng 2222

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    23/64

    H m ha kha t ng

    Vigenre xut t kha khng lp li m c gnvo u nguyn bn

    o Nu bit t kha s gii m c cc ch ci u tin

    o S dng cc ch ci ny lm kha gii m cc ch cc tip

    theo,...

    V d :

    o Kha : deceptivewearediscoveredsav

    o nguyn bn : wearediscoveredsaveyourself

    o M ha : ZICVTWQNGKZEIIGASXSTSLVVWLA

    Vn c th s dng k thut thng k ph m

    o Kha v nguyn bn c cng tn s cc ch ci

    An ninh Mng 2323

  • 8/2/2019 NSec 4.0.1 - Symmetric Encryption

    24/64

    n mt ln

    L h m ha thay th khng th ph c

    xut bi Joseph Mauborgne

    Kha ngu nhin, di bng di vn bn, ch sdng mt ln

    Gia nguyn bn v bn m khng c bt k quan hno v

Search related