&KỉệQJ &DFKHặPDặWPDì +HặPDặWPDìểRL[ỉQJ *LệLWKLHặX &DFJLDíLWKXDặWPDặWPDìểRL[ỉQJODFDFJLDíLWKXDặWVỉíGXẹQJFXQJPRặWNKRDEẽPDặW FKRWDFYXẹPDìKRDYDWDFYXẹJLDíLPDì9ẽGXẹQKỉFDFJLDíLWKXDặWWKD\WKHYDKRDQYễJLDíL WKXDặW '(6g ảẵ ểD\ WD FKẩ WẻP KLHầX JLDíL WKXDặW '(6 'DWD (QFU\SWLRQ 6WDQGDUG OD JLDíL WKXDặWPDặWPDìểRL[ỉQJểỉệẹFVỉíGXẹQJSKRầELHQQKDW *LDíLWKXDặW'(6'DWD(QFU\SWLRQ6WDQGDUG 9DRQDèP1DWLRQDO%XUHDXRIVWDQGDUGểDìểỉDUDFKXDầQ'(6ểHầVỉíGXẹQJ FKRFDFỉQJGXẹQJệí0\ì'(6PDìKRDFDFNKRLGDWDELWVYệLNKRDELWV*LDíLWKXDặW GXQJểHầPDìKRDODQJLDíLPDìểỉệẹFPRWDíWRPWDậWQKỉKẻQK 7UỉệFWLHQELWLQSXW7ểỉệẹFKRDQYễEệíLSKHSKRDQYễKRDQYễNKệíLểRặQJ,3YệL 7R ,376DXNKLTXDYRQJODSPRLYRQJVỉíGXẹQJPRặWNKRDELWểỉệẹFWDẹRUDWỉ NKRDLQSXWELWVYệLWDFểRặQJFXíDKDP)QRểỉệẹFKRDQYễEDấQJSKHSKRDQYễểDíR,3 ểHầWDẹRUDELWRXWSXWFXRLFXQJ,3YD,3 ểỉệẹFFKRWURQJFDFEDíQJEDíQJDYDEDíQJ E&DFEDíQJQD\ểỉệẹFểRẹFWỉWUDLVDQJSKDíLWỉWUHQ[XRQJGỉệLWKHRGDẹQJ 7 W W gW ặ7 W W ggW DXWLHQNKRL7 ểỉệẹFWDFKWKDQKKDLNKRLWUDLYDSKDíLPRLNKRLELWV 7 / 5 YệL/ W gW 5 W gW ảẵYRQJODSWKỉLL/ L 5 L 5 L / L )5 L . L WURQJểROD SKHSFRặQJH[FOXVLYHBRUYD. L ODNKRDELWVảẵYRQJODSFXRLFXQJFDFQKDQKWUDLYD SKDíLNKRQJểRầLFKRFKRQKDXYẻYDặ\LQSXWFXíD,3 OD5 / +DP)YD6BER[HVKẻQK 7UỉệFWLHQ5 L ểỉệẹFPệíURặQJWKDQKNKRLELWV(5 L YệL(ODEDíQJOỉẹDFKRẹQELW ểỉệẹFFKRWURQJEDíQJ6DXểRWKỉẹFKLHặQSKHS;25(5 L YệL. L YDNHWTXDíểỉệẹFWDFK WKDQKNKRLELWWỉ% WệL% (5 L . L % % % 0RLNKRL% M VDXểRểỉệẹFểỉDYDRPRặWKDP6 M 6ER[6 M % M WUDíYHPRặWNKRLELW EDíQJ&DFNKRLQD\ểỉệẹFQRLODẹLYDNKRLNHWTXDí ELWểỉệẹFKRDQYễEDấQJSKHS3 EDíQJ )5 L . L 36 % g6 % +RDẹWểRặQJFXíD6ER[VRQJX\HQWỉệQJỉQJYệLE E VHìFKRẹQ5RZWURQJEDíQJFRQ VRQJX\HQWỉệQJỉQJYệLE E E E VHìFKRẹQ&ROXPQ*LDWUễFXíD6 M % M ểỉệẹFFKRẹQVHìODPRặW VRQJX\HQELWệíYễWUẽ5RZYD&ROXPQểR 7ẽQKNKRDKẻQK '(6WDẹRUDNKRDPRLNKRDFKLHXGDLELWWỉPRặWNKRDLQSXWELWGXQJFKR YRQJODS/ỉXểRWẽQKWRDQNKRDểỉệẹFFKRWURQJKẻQK .KRDLQSXWODPRặWNKRLELWYệLELWSDULW\WDẹLFDFYễWUẽg3HUPXWDWLRQ 3&VHìORDẹLERíFDFELWSDULW\YDVHìKRDQYễELWFRQODẹLWKHREDíQJ.HWTXDí3&. VDXểRểỉệẹFFKLDWKDQKKDLSKDQ& YD' PRLSKDQELW.KRD. L GXQJWURQJYRQJWKỉL ểỉệẹFWDẹRUDWỉ& L YD' L WKHRTX\WDậFQKỉVDXWURQJFDFYRQJYD& L YD' L ểỉệẹFTXD\YRQJPRặWEẽWTXDWUDLWURQJFDFYRQJFRQODẹLWKẻểỉệẹFTXD\YRQJKDLEẽWTXD WUDL4XDSKHSTXD\YRQJQD\& L YD' L VHìểỉệẹFELHQểRầLWKDQK& L YD' L +RDQYễ& L YD ' L WKHREDíQJ6DXNKLKRDQYễ& L ERíTXDFDFEẽWWDẹRWKDQKQỉìDWUDLFXíD. L EẽWFRQ' L ERíểLFDFEẽWWDẹRUDQỉìDSKDíLFXíD. L EẽW*KHSQỉìDWUDL YDQỉìDSKDíLWDẹRUDNKRD. L EẽW *LDíLPDì 4XDWUẻQKJLDíLPDìểỉệẹFWKỉẹFKLHặQWKHRFXQJJLDíLWKXDặWQD\WKHRWKỉWỉẹQJỉệẹFODẹL QKỉVDX,3 ODểDíRFXíD,3YDệíYRQJODSWKỉLVỉíGXẹQJNKRD. L . ệíYRQJODSểDXWLHQ . ệíYRQJODSFXRLFXQJYD 5 L / L / L 5 L )/ L . L Input .KÖÝLWDÑRKRDÛQYÔ L 1 =Ro Ro + F + F + F ³DÝRNKÖÝLWDÑRKRÛDQYÔ 2XWSXW Lo R 1 = Lo + F(R 1 ,K 1 ) L 15 = R 14 R 2 = L 1 + F(R 1 ,K 2 )L 2 = R 1 R 15 = L 14 + F(R 14 ,K 15 ) + F R 16 = L 15 + F(R 15 ,K 16 ) L 16 = R 15 1,2,3, . 64 1,2,3, . 64 1,2,3, . 32 K 1 K 2 Kn K 16 Hình 1: Encryption computation 1,2,3, . 32 &KRÑQKRÛDQYÔ /HIW6KLIW /HIW6KLIW /HIW6KLIW/HIW6KLIW /HIW6KLIW /HIW6KLIW &KRÑQKRÛDQYÔ &KRÑQKRDÛQYÔ &KRÑQKRDÛQYÔ 1,2,3, . 64 1,2,3, . 28 1,2,3, . 28 K 1 Kn K 16 +ÎQK Key Schedule Calculation Key Key Key C 1 D 1 Cn Dn C 16 D 16 S 1 S 2 S 3 S 6 S 5 S 7 S 4 S 8 P 32 bits + E 48 bits K ( 48 bits ) 5 ELWV Hình 3 : Calculation of f(R,K) 6 4 %DÝQJD%DÝQJKRDÛQYÔÓDÂXWLHÄQ,3 %DÝQJE%DÝQJKRDÛQYÔFXRÃLFXÚQJ,3 %DÝQJ%DÝQJFKRÑQEÏW( %DÝQJ%DÝQJKRDÛQYÔ3 %DÝQJ%DÝQJKRDÛQYÔNKRÛD3& %DÝQJ%DÝQJKRDÛQYÔNKRÛD3& &ROXPQ 5RZ%R[ 6 6 6 6 6 6 6 6 %DÝQJ%DÝQJFKRÑQ6ER[H[ '(6,Q(OHFWURQLF&RGH%RRN0RGH(&% ảẵPRGHQD\FDFNKRLGDWDGỉệLGDẹQJURíFOHDUWH[WểỉệẹFểỉDYDRLQSXWFXíD'(6 &DFNKRLNHWTXDíGỉệLGDẹQJPDặWPDìFLSKHUWH[WFRWKHầểỉệẹFVỉíGXẹQJFKRFDFỉQJGXẹQJ NKDF4XDWUẻQKELHQểRầLGLHQUDQKỉVDXKẻQK &OHDUWH[Wặ,QSXWEORFNặ'(6ặ2XWSXWEORFNặ&LSKHUWH[W (&%HQFU\SWLRQ (&%GHFULSWLRQ +ẻQK(OHFWURQLF&RGHERRN0RGH(&% '(6,Q&LSKHU%ORFN&KDLQLQJ0RGH&%& .KRLGDWDFDQPDìKRDểỉệẹFFKLDWKDQKFDFNKRL% % g% Q YệLNẽFKWKỉệFPRL NKRLODELWV9HFWệNKệíLWDẹR,9ELWVểỉệẹFFKRẹQ6ệểRPDặWPDìểỉRẹFFKRWURQJKẻQK 4XDWUẻQKPDìKRD ,9% & &OHDUWH[W ' ' ' ,QSXWEORFN , , g, '(6HQFU\SW 2XWSXWEORFN 2 2 g2 &LSKHUWH[W & & g& &OHDUWH[W ' ' ' &LSKHUWH[W & & g& ,QSXWEORFN , , g, '(6GHFU\SW 2XWSXWEORFN 2 2 g2 0Dì KRD & ⊕% & Q& Q ⊕% Q & Q 4XDÛWUÎQKJLDÝLPD× & ,9⊕% ,9⊕% ⊕,9 % & & ⊕% & ⊕% ⊕& % & Q & Q ⊕% Q & Q ⊕% Q ⊕& Q % Q +ÎQK&LSKHU%ORFN&KDLQLQJ&%&PRGH *LDÝL PD× ,9 % % % 3 Time = 1 Time = 2 Time = n + + + ,,, '(6HQFU\ '(6HQFU\ '(6HQFU\ & & & Q . , , , '(6GHFU\ '(6GHFU\ '(6GHFU\ ,9 + + + % % % 3 . . 0D×KRÛD *LDÝLPD× +HặPDặWPDìEDWểRL[ỉQJ *LệLWKLHặX 6ỉẹSKDWWULHầQFXíDPDặWPDìNKRDFRQJNKDLODUDWOệQYDFROHìFKẽQKQRWDẹRUDFXRặF FDFKPDẹQJWURQJWRDQERặOễFKVỉíFXíDPDặWPDìNKRD 1KỉìQJJLDíLWKXDặWNKRDFRQJNKDLểHXGỉẹDWUHQQKỉìQJKDPWRDQKRẹFKệQODQKỉìQJ SKHSWKD\WKHYDKRDQYễWURQJPDặWPDìNKRDFRầểLHầQ4XDQWURẹQJKệQPDặWPDìNKRDFRQJ NKDLFRWẽQKFKDWEDWểRL[ỉQJEDRJRPYLHặFVỉíGXẹQJNKRDULHQJELHặWWỉệQJSKDíQYệLPDì KRDTXLỉệFFRWẽQKểRL[ỉQJPDFKẩVỉẹGXẹQJNKRD9LHặFVỉíGXẹQJNKRDFRWDPTXDQ WURẹQJVDXVDậFWURQJOếQKYỉẹFFDQWẽQKEẽPDặWSKDQERNKRDYDVỉẹFKỉQJWKỉẹF 0RặWVRTXDQQLHặPVDLOLHQTXDQểHQPDìKRDNKRDFRQJNKDL 0DìKRDNKRDFRQJNKDLWKẻEDíRPDặWểRLYệLQKDSKDQWẽFKPDặWPDìKệQODPDì KRDTXLỉệF7KDặWUDWẽQKEDíRPDặWFXíDEDWN\VệểRPDìKRDQDRểHXSKXẹWKXRặFYDRFKLHX GDLFXíDNKRDYDYLHặFWẽQKWRDQểHầJLDíLTX\HWYLHặFEHíNKRD 0DìKRDNKRDFRQJNKDLFRPXẹFWLHXFKXQJN\ìWKXDặWểỉệẹFWKỉẹFKLHặQEDấQJPDì KRDTXLỉệFORLWKệL1JỉệẹFODẹLEệLYẻYLHặFWẽQKWRDQểỉệẹFểDWKDQJểDXWURQJVệểRPDì KRDNKRDFRQJNKDLFKRQHQGỉệQJQKỉNKRQJWKHầWKD\WUỉệFNKDíQDèQJ[Dí\UDUDấQJPDì KRDTXLỉệFVHìEễERíUệL0RặWWURQJQKỉìQJQJỉệLểDìNKDPSKDUDPDìKRDNKRDFRQJNKDL ểDìSKDWELHầXu+DẹQFKHFXíDPDặWPDìNKRDFRQJNKDLểHầTXDíQO\NKRDYDVỉíGXẹQJFKỉìN\ ODKDXQKỉểỉệẹFFKDSQKDặQSKRầELHQv &RFDíPJLDFUDấQJVỉẹSKDQERNKRDWKẻNKRQJTXDQWURẹQJWURQJNKLVỉíGXẹQJPDì KRDNKRDFRQJNKDLVRVDQKWKẻFệFKHEDậWWD\WUệíQJDẹLKệQEDRJRPQKỉìQJWUXQJWDP SKDQERNKRDFKRPDìKRDTXLỉệF7KDặWUDYDLNKXRQGDẹQJJLDRWKỉFODFDQWKLHWQRL FKXQJEDRJRPWDFQKDQWUXQJWDPYDQKỉìQJWKXíWXẹFOLHQTXDQWKẻNKRQJểệQJLDíQPD FXìQJNKRQJKLHặXTXDíKệQ\HXFDXFKRYLHặFPDìKRDNKRDFRQJNKDLQD\ /\WKX\HWYHPDặWPDìNKRDFRQJNKDL .KDLQLHặPPDặWPDìNKRDFRQJNKDLểDìWDẹRUDVỉẹFRJDậQJểHầJLDíLTX\HWYDQểH NKRNKDèQQKDWWURQJPDìNKRDTXLỉệFểRODVỉẹSKDQERNKRDYDFKỉìN\VR 7URQJPDìKRDTXLỉệFVỉẹSKDQERNKRD\HXFDXKRDFODKDLQJỉệLWUX\HQWKRQJ FXQJVKDUHWKDPJLDPRặWNKRDPDEDấQJFDFKQDRểRểDìểỉệẹFSKDQERWệLKRẹKRDFODVỉí GXẹQJFKXQJPRặWWUXQJWDPSKDQERNKRD:KLWILHOG'LIILHPRặWWURQJQKỉìQJQJỉệLNKDP . 9ẻS_Q7KHRểễQKO)HUPDWWDFR S PRGS 'RS_%QHQFKXQJWDFRD PRGSWURQJEỉệF 9ẻWKHệíEỉệFS_DYDS_QQHQQHXG JFGDQWKẻG S 7URQJJLDíLWKXDặWQDFR%SKHSWẽQKPRGXODUEDấQJOXìWKỉDPRLSKHSểRLKRíL