ãã®ä»ã®ãµã€ã¯ã«èšäº
AESæšæºã«é¢ãããã®ãããªè©³çŽ°ãªããã¹ããå ¬éããåæ©ã¯ãæå·åã¢ã«ãŽãªãºã ã®ç¬ç«ãããœãããŠã§ã¢å®è£ ãéçºããã ãã§ãªããæå·ã«å¯Ÿããæœåšçãªæå·è§£ææ»æã®ã¢ã«ãŽãªãºã ãäœæãããã€ãŸããããŒãç¥ããªããŠãæå·æã埩å·åããã®ã«ååãªã詳现ã«ãããç解ããæ©äŒãæäŸããããšã§ã...
ãããã¯ãŒã¯ã§å©çšã§ãããããã®åºçç©ã¯ããããã®ç®æšãéæããŠããããå°é家ã®ãã¬ãŒãã³ã°ã®éçšã§ç§ã䜿çšããããšã¯ã§ããŸããã
æå·ã®äž»ãªå€ãïŒãŸãã¯å€ãïŒèŠä»¶ã®1ã€ã¯ããªãŒãã³ãªïŒç 究ã«ã¢ã¯ã»ã¹å¯èœãªïŒæå·åã¢ã«ãŽãªãºã ãäœæããæå·ããŒãé€ããã¹ãŠïŒã¢ãŒãããããã³ã«ãªã©ïŒãã©ããããããšã§ããéèŠãªã®ã¯ã誰ãããå³æ Œãªç§å¯ãå®ãããšã§ãããã®å ŽåãããŒã¯ãç§å¯ãã«åé¡ããå¿ èŠã¯ãããŸããããã®ãããªæ¡ä»¶ã®éçã¯ãæå·æã®åä¿¡è ã ããéµãææããããšã§ãããååãšããŠã圌èªèº«ããããèšå®ããå¿ èŠããããŸãã
察称æå·åã·ã¹ãã ã®å Žåããã®æ¡ä»¶ã¯å®çŸã§ããŸããããããŠãããã¯é察称ïŒ2ããŒïŒã·ã¹ãã ãšå¯Ÿç§°ã·ã¹ãã ã®æ ¹æ¬çãªéãã§ãããéèŠãªæ å ±æŒæŽ©ã®åå ãå¯äžã®ãã®ã§ã¯ãªãå¯èœæ§ããããŸãã AESã¯RIJNDAELæå·ã®åçŽåãããããŒãžã§ã³ã§ãããããã§ã¯ä»£ããã«å®å šããŒãžã§ã³ã䜿çšããããšã«æ³šæããŠãã ããã
AES (Key Schedule).
ã¡ãã»ãŒãžãæå·åãããšãã«éµãéžæããããšã¯ã責任ã®ããäœæ¥ã§ããäžè¬çãªã¢ãããŒãã¯ãå€æ¬¡å ãã¯ãã«ç©ºéã®ã©ã³ãã ãã€ããªãã¯ãã«ãéžæãããéµã«äœ¿çšãããããšã§ããå€ãã®æå·åã¢ã«ãŽãªãºã ãšæå·ã¯ã匱ãéµãŸãã¯ç¡å¹ãªéµã®ååšã«ãã£ãŠç¹åŸŽä»ããããããšãå€ããæå·ã®éçºäžãŸãã¯è¿œå ã®ç 究äžã®æäœäžã«æããã«ãããŸããèè ãŸãã¯æå·åŠè ã¢ããªã¹ãã«ããã¢ã«ãŽãªãºã ããããã£ãŠãããã«é¢ããåºçç©ã
次ã«ãããã¯ããŒçææé ã«å¶éã課ããŸããããã¯ããããè€éã«ããã®ã§æãŸãããããŸãããæå·åã«é¢ããæ°åŠçåºç€ã¯ãéµãçæããããã®æ°åŠçåºç€ãšéåžžã«äŒŒãŠããããããã«ã€ããŠè©³ããã¯ããã¡ããã芧ãã ããã
éžæããããã€ããªãã¯ãã«ã¯æå·éµãšåŒã°ãã4x4 = 16ãã€ãã®ãæ£æ¹åœ¢ãã«å€æãããŸãã次ã«ãããã§è©³çŽ°ã«èª¬æããæå·å/埩å·åããã»ã¹ã§äœ¿çšããã2ã€ã®ç¹å¥ãªæé ã䜿çšããŠãã©ãŠã³ãããŒããããã圢æãããŸãã
1ã€ã®æé ã¯ããŒæ¡åŒµãšåŒã°ãããã1ã€ã®æé ã¯ã©ãŠã³ãããŒéžæãšåŒã°ããŸããåºå®é·ã®éžæãããã©ã³ãã ãã€ããªãã¯ãã«ãå±éãããŸããä¹±æ°ãžã§ãã¬ãŒã¿ã®éžæã泚ææ·±ãæ€èšãããã¹ãããŠæ¿èªããããšãéèŠã§ãã
ããŒæ¡åŒµ
å ã®ïŒéžæãããïŒããŒãæ¡åŒµããããšã®æå³ã¯ããããéãããã¯ïŒå32ãããïŒã«åå²ããããããåã©ãŠã³ãã§åãé·ãã®å€ãã®æ°ãããããã¯ãçæããããšã§ãã
ãããã£ãŠãéžæããïŒ128ãããïŒæå·éµãAES = 2b 7e 15 16 28 ae d2 a6 ab f7 15 88 09 cf 4f 3cãšããŸããããã¯ãNk = 4ã®å Žåã4ãã€ãã®ãããã¯ã§è¡šãããåæã©ãŠã³ãæ¡åŒµã¯w [0 ] = 2b7e1516; w [1] = 28aed2a6; w [2] = abf71588; w [3] = 09cf4f3cã QCããŒãã«ã®w [i]èšå·ãi = 0ïŒ1ïŒ43ã¯ãã©ãŠã³ãããŒã®4ãã€ãã®åã瀺ããŸãã
æå·åã»ãã·ã§ã³ã¯ãæçŽãªã©ã®ã¡ãã»ãŒãžã®æºåãšã¢ã«ãŽãªãºã å€æã§ããæåã®ãããè¡šçŸã®ããã¹ãã¯ãåºå®é·ã®Nb = 128ã192ããŸãã¯256ãããã®ãããã¯ã«åå²ãããŸãã AESã§ã¯ããããã¯é·ã¯128ãããã®ã¿ã§ãã
次ã«ãåãããã¯ã¯æ£æ¹åœ¢ãŸãã¯ïŒ4è¡ã®é·æ¹åœ¢ïŒã§è¡šãããåºå®æ°ã®ã©ãŠã³ãNr = NrïŒNbãNkïŒã«å¯ŸããŠåå¥ã«æå·åãããŸããããã¯ã2ã€ã®å€æ°ã®é¢æ°ã§ãããããã¯ã®é·ãNbãšããŒã®é·ãNkã¯ãç¬ç«ããŠå€ãåãããšãã§ããŸãã 128ã192ã256ãããã
æå·åããŒãéžæããŠãããããã·ãŒã±ã³ã¹èªäœã«å¶éã¯ãããŸããã Nrã©ãŠã³ãã®ããããã¯ãäºåã«äœæãããããŸãã¯çŽæ¥èšç®ãããç¬èªã®ã©ãŠã³ãããŒ{w [i]}ã䜿çšããŸãã
ã©ãŠã³ãããŒã¯ãããŒæ¡åŒµæé ãšã©ãŠã³ãããŒéžææé ãå«ãç¹å¥ãªã¢ã«ãŽãªãºã ã䜿çšããŠãæå·åããŒããçæãããŸãããããã®æé ããã€ãã¹ããŠã©ãŠã³ãããŒãçŽæ¥æå®ããããšã¯ã§ããŸããã
æåã®æé ã®æ¬è³ªãšç®çã¯ãæå®ããããœãŒã¹æå·åããŒãããé·ãæ¡åŒµããŒïŒæ¡åŒµããŒïŒã«å€æããããšã§ããã©ãŠã³ãããŒãéžæãããæ¡åŒµããŒã®ãããã®ç·æ°ã¯ãç©K = NkïŒNr + 1ïŒã«ãã£ãŠæ±ºãŸããŸããããŒãããã¯ã®ãããæ°ã¯ãã©ãŠã³ãã®æ°ã«1ãå ããæ°ã§ä¹ç®ãããŸãã
äŸ1ã Nb = Nk = 4ãšãããšã4Ã32 = 128ãããã®é·ãã®ãããã¯ãäžãããã次ã«Nr = 10ã«ãªããŸãã
æ¡åŒµéµã®ãããé·K = 128â11 = 1408ãããã
2çªç®ã®æé ïŒã©ãŠã³ãããŒéžæïŒã¯ã32Nkãã€ãŸãæ¡åŒµããŒããã®4ã€ã®32ãããã¯ãŒãã®é 次éžæã§ããã€ãŸããæåã®ã©ãŠã³ãããŒã¯æåã«æ°ãã圢æãããNkã¯ãŒãã§è¡šããã2çªç®ã®ã©ãŠã³ãããŒã¯æ¬¡ã®Nkã¯ãŒãã§è¡šãããŸããæçµã©ãŠã³ããŸã§ã
äŸ2ãåãåæããŒã¿ïŒåã®äŸãåç §ïŒã§ãæ¡åŒµããŒã®ãã€ãåäœã®å šé·ã«ã¯ãNkïŒNr + 1ïŒ= 4â11 = 44ã®4ãã€ãã¯ãŒãWïŒiïŒã
i = 0ïŒ1ïŒNkïŒNr + 1ïŒ-1ãå«ãŸããŸãã QCããŒãã«ã®è¡ã¯èªç¶æ°ã§çªå·ä»ããããŸããæå·éµãå«ã4è¡ïŒ0ã1ã2ã3ã®çªå·ãä»ããŠããïŒã¯QCããŒãã«ã«å«ãŸããŠããªããããæåã®è¡ã«ã¯4ã®çªå·ãä»ããããŠããŸãã
10ã©ãŠã³ããã¹ãŠã®ããŒãã«æå·éµAESïŒä»¥äžã®ããŒãã«QCãåç §ïŒã
ããŒãã«ã®è¡ã¯ã°ã«ãŒãã«åããããŸãïŒå4è¡ïŒãåã°ã«ãŒãã§ã¯ããã¹ãŠã®ãã£ãŒã«ãã1è¡ã ãã§åããããŸãã次ã®3è¡ã§ã¯ã極å€ïŒå·Šãšå³ïŒãã£ãŒã«ãã®ã¿ãå ¥åãããŠããŸãã次ã®è¡ãšåŸç¶ã®2è¡ã®å·ŠåŽã®ãã£ãŒã«ãïŒtempïŒã«ã¯ããã®äžã®è¡ã®å³åŽã®ãã£ãŒã«ãããååŸããå€ãå«ãŸããŠããŸãã
æåã®è¡ã«QCããŒãã«ã®çªå·i = 4ãå ¥åããäŸãæããŸããããå·Šã®å-æåã®0ã1ã2ã3ã®å€ã¯ããŒãã«ã«å«ãŸããŠããªããããçŸåšã®è¡çªå·ã¯å€ïŒ4ïŒã§å§ãŸããŸããäžè¬ã«ãã€ã³ããã¯ã¹ïŒè¡çªå·ïŒiã¯ã32ãããã®åèš44ã¯ãŒãã§ãå€i = 0ïŒ1ïŒNkïŒNr + 1ïŒ-1ãŸãã¯i = 0ïŒ1ïŒ43ãè¶ ããŸããäžæ
ã³ã©ã å€w [i-1] = 09cf4f3cãé 眮ãããããŒããŒã·ã§ã³ïŒ1ãã€ãã®åŸªç°ã·ããïŒRotWordïŒïŒã«ãã£ãŠãå€CF4F3C09ãååŸãããŸããããã¯3çªç®ã®åã«é 眮ãããŸãã4çªç®ã®åã«ã¯ã8A84EB01ã3çªç®ã®åã®å€ã®SubBytesã®ãã€ãã眮ãæããçµæãå«ãŸããŠããŸããã€ãŸãCFâ8A; 4Fâ84; 3CâEB; 09â01 => 8A84EB01ã
è¡šã®5çªç®ã®åã®4çªç®ã®è¡ã«ã¯ãRcon [i / Nk]ãšããå€ãå ¥åãããŸããããã¯ãRconïŒJïŒ= 01000000ãj = [i / Nk] = 2 j-1 = 2 0 = 1ïŒã®åŒã§èšç®ãããå®æ°ã§ããå€01 00 00 00ã¯4ãã€ãã¯ãŒãããæžã蟌ãŸãããã®æåã®ãã€ãã¯2 0 = 1ã§ãã 0000 0001 2ããã®32ãããã¯ãŒãã®æ®ãã®ãã€ãã¯ãŒãã§ãã
å6ã®ãã£ãŒã«ãã«ã¯ã4çªç®ãš5çªç®ã®ãã£ãŒã«ãã®åèšïŒXORïŒ8A84EB01 + 01000000 = 8B84EB01ãå«ãŸããŸãã
å7ã®ãã£ãŒã«ãã«ã¯ãW [i-Nk] = W [4-4] = W [0] = 2B7E1516ãå«ãŸããŸãã
å8ã®ãã£ãŒã«ãã«ã¯ãå6ãš7ã®ãã£ãŒã«ãã®åèšãå«ãŸããŠããŸãW [i = 4] =884EB01+ 2B7E1516 = A0FAFE17;
ãããŠä»ã詳现ã«ããããŠè©³çŽ°ãšãšãã«ãç§ãã¡ã¯ååä»ãæç¶ããæ€èšããŸãã
äž»ãªæ¡åŒµæé
å ã®æå·éµããæ¡åŒµéµãçæããæé ã詳ããèŠãŠã¿ãŸãããã圢åŒçã«ã¯ãæ¡åŒµããŒWã¯ãäžé£ã®ãããã¯W [i]ãi = 0ïŒ1ïŒNkïŒNr + 1ïŒ-1ãKKããŒãã«ã®æåŸã®åã«å«ãŸãã4ãã€ãã¯ãŒãïŒäžžããŒïŒã§èšè¿°ãããŸããåèªã¯å ã®ããŒãè¡šããŸããã€ãŸãã
W = {W [0]ãW [1]ãW [2]ãW [3]ãW [4]ã...ãW [K-1]}
åŸç¶ã®içªç®åèªã¯ãåèšãXORã§ããåŒã«åŸã£ãŠãåã®åèªããååž°çã«åœ¢æãããŸãã
ã
ã€ã³ããã¯ã¹ãNkã®åæ°ã§ããããŒã¯ãŒãW [i]ã®å ŽåãW [i-1]ã®å€ã¯ãXORæŒç®ãå®è¡ããåã«è¿œå ã®å€æãè¡ãããŸãããã®å€æã¯æ¬¡ã®ããã«èª¬æãããŸãã
å€æã®èª¬æã«ã¯é¢æ°ãå«ãŸããŠããŸãã
RotWordïŒïŒ-èŠå
{aïŒ0ïŒaïŒ1ïŒaïŒ2ïŒaïŒ3ïŒ} ãã32ãããã¯ãŒãaïŒ0ïŒaïŒ1ïŒaïŒ2ïŒaïŒ3ïŒã®ãã€ã埪ç°ã·ããâ{a ïŒ3ïŒaïŒ0ïŒaïŒ1ïŒaïŒ2ïŒ};
SubWordïŒïŒ-aïŒjïŒãSubBytesïŒïŒé¢æ°ã®Sãããã¯ã®èŠçŽ ã«çœ®ãæããŸããããšãã°ããã€ãïŒafïŒã¯Sãããã¯ã®ãã€ãsïŒaãfïŒã«çœ®ãæããããŸããã¢ã¯ã·ã§ã³ã¯ã¡ãã»ãŒãžãåŠçãããšããšåãã§ã
Rcon [j]-XORé ã¯2 j-1ã«çããã
Nbã®åæ°ãéžæããããã®å€ã¯é¢æ°SubWordïŒïŒãRotWordïŒïŒãRconïŒïŒã䜿çšããŠåœ¢æãããŸããäœçœ®W [0] âW [3]ã¯æå®ãããåæããŒã¿ã«åŸã£ãŠå ¥åãããåŸç¶ã®ãã¹ãŠã¯W [i]ã®æ¯çã«åŸã£ãŠèšç®ãããŸãã
ã©ãŠã³ãããŒã®éžæ
ã©ãŠã³ãããŒã®éžæïŒRoundKeySelectionïŒãçªå·rã®çŸåšã®ã©ãŠã³ããã©ãŠã³ãããŒã¯{W [NbïŒrïŒ-1]ã...ãW [NbïŒr + 1ïŒ-1]}ã
r = 1ïŒ1ïŒNrãšããŠéžæãããŸãã
ããã§ãäžè¬çãªæå·åã¢ã«ãŽãªãºã ã¯ãå€æ°ã»ããNbãNkãNrã®ããŸããŸãªããªã¢ã³ããæäŸããããšã«æ³šæããŠãã ãããåºå®ãªãã·ã§ã³ã®ç¹å®ã®å®è£ ã§ã¯ãå€§å¹ ã«ç°¡ç¥åã§ããŸããã©ãŠã³ãããŒã¯ãªã³ã¶ãã©ã€ã§èšç®ã§ããã·ãŒã±ã³ã¹Wå šäœãæ ŒçŽããããã«å€§éã®ã¡ã¢ãªãå¿ èŠãšããŸãããNkã¯ãŒãã®ãããã¡ã«å¶éã§ããŸãã
äŸ3ãäžããããçè«çåœé¡ãæ°å€äŸã§èª¬æããŸãããã以åãšåæ§ã«ãNb = Nk = 4ãNr = 10ãšããŸããæå·éµã¯ã16é²æ°ã®ã·ãŒã±ã³ã¹K = 2b7e1516 282ed2a6 abf71588 09cf4f3cã®åœ¢åŒã§äžããããŸãã
ã¢ãŒããã¯ãã£ã®ãæ£æ¹åœ¢ããšãã€ãæåã®èšç®ã¯ã次ã®è¡šã§å®çŸ©ãããŠããŸãã
å·Šã®åãããŒãã«ã«è¿œå ãããŸãã-ã©ãŠã³ãã®æ°ïŒrïŒ
æåã®è¡r = 1ãi = 4ãåã®ãã€ãW [i-1] = W [3]ã3çªç®ã®åã«æžã蟌ãŸããŸããKæå·éµã®æåŸã®ãã€ããã€ã³ããã¯ã¹i = 4ã¯Nk = 4ã®åæ°ã§ãããããå6ã«ïŒRconïŒJïŒ= 01000000ãj = [i / Nk] = 2 j-1 = 2 0 = 1ïŒå€01 00 00 00 4- ãæžã蟌ã¿ãŸãxãã€ãã¯ãŒãããã®æåã®ãã€ãã¯2 0 = 1ãã€ãŸã 0000 0001ããã®32ãããã¯ãŒãã®æ®ãã®ãã€ãã¯ãŒãã§ãã
è¡šã®4åç®ã«ãåã®åã®å€ãå ¥åããŸããã1ãã€ãå·Šã«åŸªç°ã·ããããŸãïŒåèªã®å転-RotWordïŒã 5çªç®ã®åã«ã¯ãåã®åã®å€ãS-ãããã¯ããã®ãã€ãå€ã§ãã€ã眮æããçµæãå«ãŸããŠããŸãïŒSubWordé¢æ°-ãã€ã眮æïŒããã®åŸãå5ãš6ã®å 容ã®mod2å ç®ïŒXORïŒ8a84eb01 + 0100 0000 = 8b84eb01ãå®è¡ãããåèšã®çµæãå7ã«å ¥åãããŸãã
ãã€ã0000 0001 2 = 01 ã®ãã€ããªè¡šçŸã§ã¯ã16ã®æäžäœããããå³åŽã«ãããŸãã
å8ã«ã¯ãã¯ãŒãW [i-Nk] = W [0]ã®å€ãå«ãŸããŸãïŒæåã®è¡ã®å Žåãããã¯æå·åããŒW [0]ã®æåïŒå·Šãã€ãïŒã®4ãã€ãã¯ãŒãã®å€ã§ãïŒãXORæŒç®ã«ãã£ãŠè¿œå ãããŸã8b 84 eb 01+ 2b 7e 15 16 = a0 fa fe 17ã7åã®ã³ã³ãã³ããåèšã®çµæïŒå9ïŒã¯ãæåã®ã©ãŠã³ãã®ã©ãŠã³ãããŒã®4ã€ã®4ãã€ãã¯ãŒãã®æåã®ãã®ã§ãã
æåã®ã©ãŠã³ãã®ã©ãŠã³ãããŒã®ä»ã®3ã¯ãŒãã¯ã埪ç°ã·ããã眮æãããã³Rcon [j]ã®é¢æ°ã䜿çšããã«åœ¢æãããŸããããã¯ããããã®æ°ãNkã®åæ°ã§ã¯ãªãããã§ããå9ã®å 容ã¯ãããŒãã«ã®æ¬¡ã®è¡ã®3çªç®ã®åã«è»¢éãããŸãã
Rconã®å®çŸ©[j]ããã®æé ã¯ãç¹å¥ãªã¢ã«ãŽãªãºã ã«åŸã£ãŠå®è¡ãããŸãããã®ã¢ã¯ã·ã§ã³ã«ã€ããŠã¯ãäŸãæããŠèª¬æããŸãã Rcon [j]é¢æ°ã®åŒæ°jã¯æŽæ°ã§ãããå€æ°iã®çŸåšã®å€ïŒããŒã¯ãŒãã®æ°ïŒã«ãã£ãŠæ±ºå®ãããŸããæããã«ã
j = 1ã2ã3ãâŠi = Nkã2Nkã3NkãâŠã®å Žåã
ãã®äŸã®Nkã¯4ã§ãããããi = 4ã8ã12ã«å¯ŸããŠjã®æŽæ°å€ããããŸããããã«ãåæŽæ°jã«å¯ŸããŠãRcon [j] = 2 j-1 = 1ã2ã4ã8ã16 ã...ã§ãã
Rcon [j]ãäœGFïŒ2 8ïŒã®èŠçŽ ã§ããéããåå¢ã¯æå¹ã§ãã
i> 32ã®å Žåãj> 8ã«ãªããŸãããã£ãŒã«ãå€ã®å€ã¯ãã£ãŒã«ãã«è¿ãããå¿ èŠããããŸããããã¯ãäœRcon [j]ïŒmodÏïŒxïŒïŒã®èŠçŽ ã®å€é åŒè¡šçŸãåæžããããšã«ãã£ãŠéæãããŸãã
å®æœäŸ4... i = 32ã36ã40ãšããŸãã次ã«j = 8ã9ã10ãšããŸãããããã®å€ã¯ãã£ãŒã«ãã®å€åŽã«ãããŸããããããÏïŒxïŒãæ³ãšããçž®å°ã«ãã£ãŠãã£ãŒã«ãã«æ»ããå¿ èŠãªå€ãèšç®ããŸãã
Rcon [j]ã®å¯Ÿå¿ããå€ãå®çŸ©ããŸããèšç®çµæãè¡šã«ãŸãšããŸãã
ããã§ãã©ãŠã³ãAESæå·éµãçæããæé ã®ç¢ºèªã¯å®äºã§ãã