Thuat Toan RSA

Embed Size (px)

Text of Thuat Toan RSA

  • 7/22/2019 Thuat Toan RSA

    1/16

    N H M 1 2 :

    1 . V N G C I P

    2 . N I N H T T I P

    3 . N G U Y N V N T O N

    THUT TON M HARSA

    16/06/2014

    1

    Nhm 12 - lp KHMT4 - k3

    AN TON V BO MT

    THNG TIN

    GV hng dn: Thc s Th Minh Nguyt

  • 7/22/2019 Thuat Toan RSA

    2/16

    - Thutton cRon Rivest,AdiShamir v Len Adleman

    (R.S.A) m t ln u tin vonm1977

    THUT TON M HA RSA

    1. Gii thiu chung

    16/06/2014

    2

    Nhm 12 - lp KHMT4 - k3

    - Trc,vo nm1973, Clifford Cocks - mtnh ton

    hcngiAnhm tmtthutton tngt.- Nhng ti thi im th thut ton ny khng khthi v cha bao gic thc nghim

  • 7/22/2019 Thuat Toan RSA

    3/16

    1. bo mt cao (ngha l gii m c m khng bit kho

    mt th phi tn hng triu nm).

    2. Thao tc nhanh(thao tc m ho v gii mtn t thi gian).

    3. Dng chung c.4. C ng dng rng ri.

    5. C th dng xc nh ch nhn (dng lm ch k in t).

    16/06/2014Nhm 12 - lp KHMT4 - k3

    3

    THUT TON M HA RSA

    Thut ton m ha RSA tho mn 5 yu cu ca mt hm hin i:

  • 7/22/2019 Thuat Toan RSA

    4/16

    THUT TON M HA RSA

    Thutton RSA c hai Kha:

    - Kha cng khai (Public key):

    c cng b rng ri cho mingiv cdng m ha

    - Kha bmt(Private key):

    Nhng thng tin c m habng kha cng khai ch c thc gii m bng kha b mttngng

    2. M t hot ng

    16/06/2014

    4

    Nhm 12 - lp KHMT4 - k3

  • 7/22/2019 Thuat Toan RSA

    5/16

    16/06/2014Nhm 12 - lp KHMT4 - k3

    5

    THUT TON M HA RSA

    2. M t hot ng(tip)Chn p,q nguyn t

    Tnh n =p*q

    Tnh (n) = (p-1)(q-1)

    e

    Chn kha ring dd

    Chn kha cng khai e(0< e < (n)) (e< >(n))

    Bn m C

    Bn r m

    Bn r gc m

    nmc e mod

    ncm d mod1

    ed

  • 7/22/2019 Thuat Toan RSA

    6/16

    2.1 To kha

    THUT TON M HA RSA

    L thuytBc 1:B (ngi nhn) to hai s nguyn tlnngunhin pv q

    Bc 2: tnh n=p*qv (n) = (p-1)(q-1)

    Bc 3: chn mt s ngu nhin e(0< e< (n)) sao cho CLN(e,(n))=1

    Bc 4: tnh bng cch dng

    thut ton EuclideTm s t nhinx sao cho

    Bc 5:- nv elm kho cng khai (public key),- dlm kho b mt (pivate key).

    V d:Bc 1: Chn s 23v 41(hai s ny l 2 s nguyn t)Bc 2: n = 23 * 41 = 943

    (n) = 22 * 40 = 880Bc 3:chn e= 7 v CLN(7, 880)=1

    Bc 4: => 7d=1+880x

    =>d= 503 vx = 4

    Bc 5:- n = 943 v e = 7

    - d = 503

    16/06/2014

    6

    Nhm 12 - lp KHMT4 - k3

    1 ed

    e

    nxd

    1)(*

    e

    nxd

    1)(*

  • 7/22/2019 Thuat Toan RSA

    7/16

    THUT TON M HA RSA

    16/06/2014

    7

    Nhm 12 - lp KHMT4 - k3

    2.2 M ho v gii m

    nmce

    mod

    Bc1: A nhnkho cng khai caB.

    Bc 2: A biu din thng tin cn gi

    thnh sm (0 m = 35

    943mod357c

    545c

    ncm d mod 943mod545

    503m

  • 7/22/2019 Thuat Toan RSA

    8/16

    - an ton cah thngRSA da trn 2 vn : biton phn tch ra thasnguyn t cc snguyn ln

    v bi ton RSA.- V vymunxy dnghRSA an ton th n=p*qphi

    l mtsln,khng c khnngphn tch n vmt tnh ton. m bo an ton nn chn ccsnguyntpv qt100 chstrln.

    - Diylbngthigian phn tch m RSA

    16/06/2014Nhm 12 - lp KHMT4 - k3

    8

    THUT TON M HA RSA

    3. an ton m ha RSA

  • 7/22/2019 Thuat Toan RSA

    9/16

    16/06/2014Nhm 12 - lp KHMT4 - k3

    9

    S cc ch s trong

    s c phn tch

    Thi gian phn tch

    50 4 gi

    75 104 gi

    100 74 nm

    200 4000 nm

    300 500.000 nm

    500 4x 10^25 nm

    THUT TON M HA RSA

    3. an ton m ha RSA(tip)

  • 7/22/2019 Thuat Toan RSA

    10/16

    16/06/2014Nhm 12 - lp KHMT4 - k3

    10

    THUT TON M HA RSA

    3. an ton m ha RSA(tip)-Cch thc phn phi kha cng khai l mt trong nhng yu tquyt nh i vi an ton ca RSA.-Vn ny ny sinh ra 1 l hng gi l Man-in-the-middle attack

    (tn cng vo gia)- Khi A v B trao i thng tin th C c th gi cho A mt kha

    bt k A tin rng l kha cng khai ca B gi.- Sau C s gii m v nh cp c thng tin. ng thi m

    ha li thng tin theo kha cng khai ca B v gi li cho B.- V nguyn tc, c A v B u khng pht hin c s canthip ca C

  • 7/22/2019 Thuat Toan RSA

    11/16

    16/06/2014Nhm 12 - lp KHMT4 - k3

    11

  • 7/22/2019 Thuat Toan RSA

    12/16

    16/06/2014Nhm 12 - lp KHMT4 - k3

    12

    THUT TON M HA RSA

    - Thng tin truynitrn mngcngcnthitphicxc nhnngigi.

    - Cc vnbntruyntrn mng(didngsho) cnphic chk cangigixc nhntrch nhimcangigi.

    - Chk dng yl mtdy bitv cgilchk int.

    - Mi ngi cn 1 cp kha gm kha cng khai & kha bmt.

    Kha b mt dng to chk s(CKS)

    kha cng khai dng thm nh CKS-> xc thc

    4. ng dng ca RSA vo ch k in t

  • 7/22/2019 Thuat Toan RSA

    13/16

    16/06/2014Nhm 12 - lp KHMT4 - k3

    13

    Bntm lc

    Hm bm

    Gn vithng ip d liu

    M ha

    Thng ip d liu

    Kha b mt

    Ch k s

    Thng ip d liuc k s

    THUT TON M HA RSA

    4.1 To ch k s

  • 7/22/2019 Thuat Toan RSA

    14/16

    16/06/2014Nhm 12 - lp KHMT4 - k3

    14

    Bntm lc

    Hm bm

    Tch

    Gii m Thng ip d liu

    Kha cng khai

    Ch k s

    Thng ip d liuc k s

    Gii m c ?

    Khng ng ngi gi

    Bntm lc

    Ging nhau ?

    Ni dung thng ip b thay i

    Ni dung thng iptan vn

    THUT TON M HA RSA

    4.1 Thm nh ch k s

  • 7/22/2019 Thuat Toan RSA

    15/16

    Ti liu tham kho

    Wikipedia Gio trnh An ton bo mt thng tin

    thongtincongnghe.com

    Internet

    16/06/2014Nhm 12 - lp KHMT4 - k3

    15

  • 7/22/2019 Thuat Toan RSA

    16/16

    16/06/2014Nhm 12 - lp KHMT4 - k3

    16