æ»æè ããã³é²åŸ¡è
ã¢ã«ãŽãªãºã ã«ç§»ããããã·ã¥ã¹ããŒã ãæ§ç¯ããåã«ãWebãµãŒãã¹ã®ã»ãã¥ãªãã£ã§èªåãäœãä¿è·ããŠãããããã¹ã¯ãŒãããã·ã¥ãã©ã®ãããªåœ¹å²ãæããã¹ãããäžè¬çã«ç解ããå¿ èŠããããŸãã éåžžãã·ããªãªã¯ãæ»æè ãè匱æ§ã®ãã§ãŒã³ãä»ããŠWebãµãŒãã¹ïŒãŸãã¯è€æ°ã®WebãµãŒãã¹ïŒãç ŽãããŠãŒã¶ãŒããŒã¿ããŒã¹ã«ã¢ã¯ã»ã¹ããããã«ãã¹ã¯ãŒãããã·ã¥ã確èªããããŒã¿ããŒã¹ããã³ããã GPU ïŒããã³ãŸãã«ã FPGAãšASIC ïŒã
ãã®å Žåãé²åŸ¡åŽã¯äœãããŸããïŒ ãŸãããã¹ã¯ãŒãããã·ã¥ã䟵害ããããŠãŒã¶ãŒãéä¿¡ããæ¥ç¶ãããé»è©±ãã¡ãŒã«ãªã©ã䜿çšããŠãã¹ã¯ãŒãã®å€æŽãšè¿œå ã®èªèšŒã匷å¶ããŸãããã®å Žåãé©åãªããã·ã¥ã¢ã«ãŽãªãºã ã¯çœå®³ã®èŠæš¡ãç解ããå¿ èŠãªãã¹ãŠãèµ·åããæéãäžããŸããã®çµæããŠãŒã¶ãŒã¢ã«ãŠã³ããæ»æè ã«ãã£ããã£ãããã®ãé²ããŸãã
ããŒããŠã§ã¢
äžã§èª¬æããããã«ãæ»æè ã¯GPUãFPGAãASICãªã©ã®æ©åšã䜿çšããŠèšç®ãé«éåã§ããŸãã ç§ã®æèŠã§ã¯ãéåžžã«å€ãã®äººã ãæå·é貚ãã€ãã³ã°ã3次å ã²ãŒã ãªã©ã«èå³ãæã£ãŠããããããã®ãªã¹ãã®äžã§æãå±éºãªã®ã¯GPUã§ããGPUã¯ãã¹ã¯ãŒãããã·ã¥ã®æŽçãéå§ããæºåãã§ããŠããŸãã ãŸããFPGAã¯åºãæ®åããŠããããé«äŸ¡ã§ããããããã°ããŒãã®æ©èœãååã§ãªãããšãå€ããèªå® ã§äœããã¯ãã ä»ãããã®ã¯éåžžéçŸå®çã§ãïŒé«åšæ³¢ãã¯ãã ä»ãå質ã®èŠä»¶ã®å¢å ãªã©ïŒã ãããŠæåŸã«ãASICã«ã¯ããªãã®æè³ãèšèšãçç£ãµã€ã¯ã«ã®ç«ã¡äžããå¿ èŠã§ãã å€ãã®å Žåãããã¯æ»æè ããµãŒãã¹ããããã³ã°ããããšã§ååŸã§ããæ å ±ã®ã³ã¹ããããé«äŸ¡ã«ãªããŸãã
ããŠãé²åŸ¡åŽã¯éåžžãWebã¢ããªã±ãŒã·ã§ã³ãå®è¡ãããµãŒããŒCPUã䜿çšããŸãã ãµãŒããŒCPUã«ã¯å€ãã®ã³ã¢ïŒãã ãGPUããå°ããïŒã倧ããªL3ãã£ãã·ã¥ãªã©ããããŸãããããã£ãŠãããã·ã¥ã¢ã«ãŽãªãºã ãéçºããéã®æ確ãªã¢ã€ãã¢ã¯ãCPUåãã«æé©åããGPUãFPGAãããã³ASICã§ããããé ãããããšã§ãã ãããã®æžéæ¹æ³ã®äžã§ã次ã®ãã®ãåºå¥ã§ããŸãã
1.倧éã®RAMã®äœ¿çšïŒGPUå ±æã¡ã¢ãªã§ã¯å¶éãããã°ããŒãã«ã¡ã¢ãªãžã®ç§»åã¯éåžžã«ãé«äŸ¡ãã§ããFPGAããã³ASICã§ã¯ãå€éšã¡ã¢ãªãã¯ãã ä»ãããå¿ èŠããããåè·¯å šäœã®ã³ã¹ããã¢ã¯ã»ã¹é 延ãªã©ã®å¢å ã«ã€ãªãããŸãïŒæéãšã¡ã¢ãªã®ãã¬ãŒããªãïŒããããã¡ã¢ãªããŒãã¢ã«ãŽãªãºã ïŒã
2. L1ãã£ãã·ã¥ã«åãŸãå°ããªã¡ã¢ãªé åã®ã©ã³ãã ã¢ãã¬ã¹ã§ã®å°éã®ããŒã¿ã®èªã¿åã/èšé²ã®äœ¿çšïŒGPUã°ããŒãã«ã¡ã¢ãªãã4ãã€ããèªã¿åãããšãããšãå®éã«ã¯32ãã€ããèªã¿åãããGPUãã¡ã¢ãªãã¹ã浪費ããŸãïŒ ïŒ
3.ä¹ç®æŒç®MULã䜿çšããŸãã CPUã§ã¯ããªãã»ãããADDãªã©ã®éåžžã®æäœãšåããããé«éã§ãããFPGAããã³ASICã§ã¯ãããè€éãªæ§æãããŒã¿åŠçã®å€§ããªé 延ãªã©ã«ã€ãªãããŸãã
4.ããããåœä»€ã¬ãã«ã®äžŠååŠçãšããã·ã¥ã¢ã«ãŽãªãºã SIMDã«é©ããèšèšã䜿çšããŸãã ææ°ã®CPUã¯ãSSE2ãSSSE3ãAVX2ãªã©ã®ããŸããŸãªé«åºŠãªåœä»€ã»ãããæèŒããŠãããããäžåºŠã«è€æ°ã®æäœãå®è¡ããèšç®ãå€§å¹ ã«é«éåã§ããŸãã
ãªã¹ããããææ³ã¯ããã¹ãŠã®ã¢ã«ãŽãªãºã ã§äœ¿çšãããããã§ã¯ãããŸããã ãã®ããã Argon2 ïŒ ãã¹ã¯ãŒãããã·ã¥ã³ã³ããã£ã·ã§ã³ã®åè ïŒã§ã¯ã2ã€ç®ãé€ãäžèšã®ãã¹ãŠã®ææ³ã䜿çšãããŸãã PHCã³ã³ãã¹ãã§ç¹å¥ãªè©äŸ¡ãåããYescrypt㯠ã4ã€ã®ææ³ãã¹ãŠã䜿çšããŸãïŒãã ããç¹å¥ãªæäœã¢ãŒããæå¹ã«ããå¿ èŠããããŸãïŒã
Argon2ãéžæããã®ã¯ããã®ã¢ã«ãŽãªãºã ãååã«ç 究ãããŠãããç解ãšå®è£ ãç°¡åã§ãx64ãšSIMDã«æé©åãããŠããããã§ãã
èšç®äžã®DoSåé¡
ã¢ã«ãŽãªãºã ãåäœäžã«å€§éã®ã¡ã¢ãªã䜿çšããäžå®ã®CPUæéãæ¶è²»ããããšãä¿èšŒãããŠããå Žåãå°ããªRPSãWebãµãŒãã¹ãç¡å¹ã«ãããããŠãŒã¶ãŒãžã®å¿çãå€§å¹ ã«é ããããããå¯èœæ§ãããå Žåããã©ã¡ãŒã¿ãŒã®è»œçãªéžæã¯èšç®äžã®DoSç¶æ³ã«ã€ãªããå¯èœæ§ããããŸãã çŸå®ã«ã¯ãç¶æ³ããæãåºãæ¹æ³ã¯å€ããããŸããã ãããã®ããã€ãã次ã«ç€ºããŸãã
1.ãåé¡ãéã§åããã-WebãµãŒãã¹ãæ©èœããå€ãã®ãµãŒããŒãè¿œå ããŸãã ããæå³ã§ã¯ãããã¯é©åãªè² è·åæ£ã§èšç®DoSã«å¯ŸåŠããã®ã«åœ¹ç«ã¡ãŸããããã®æ¹æ³ã§ã¯ãŠãŒã¶ãŒãžã®é·ãåçã®åé¡ã¯è§£æ±ºããŸããã ã€ãŸãã倧éã®ãªãœãŒã¹ãè¿œå ããŠãå¿çæéã¯ççž®ããããã¯ã©ã¹ã¿ãŒãããã®ããŒã¯RPSãå¢å ããã ãã§ãã ãæ³åã®ãšãããããã¯ç§ãã¡ã®ããæ¹ã§ã¯ãããŸããã
2.ããã·ã¥ã¢ã«ãŽãªãºã ã³ãŒãã®æ倧æé©åã SIMDåœä»€ã®äœ¿çšãªã©ã
3.䜿çšãããŠããã¢ã«ãŽãªãºã ãã©ã¡ãŒã¿ã蚱容å¯èœãªã¬ãã«ã«æžãããŸã-ãã¹ã¯ãŒãããã·ã¥ã¹ããŒã å šäœã®ã¬ãã«ã§ããŸããŸãªç·©åçãè¿œå ããŸãã
æããã«ãæåŸã®2ã€ã®ãã€ã³ãã¯å®è¡ãã䟡å€ããããŸãã é«æ§èœãããã»ã©éèŠã§ã¯ãªãå Žåãæé©åãããããŒãžã§ã³ã®ã¢ã«ãŽãªãºã ã䜿çšãããšãããå€ãã®ãã©ã¡ãŒã¿ãŒã䜿çšã§ãããããGPUãFPGAãASICã§ãã¹ã¯ãŒãã䞊ã¹æ¿ããããšãããã«é£ãããªããŸãã ãŸãããã¹ã¯ãŒãããã·ã¥ã¹ããŒã ã®ã¬ãã«ã§ç·©åçãè¿œå ãããšãããã·ã¥ããŒã¹ã«å¯Ÿãããªãã©ã€ã³æ»æãäžå¯èœïŒãŸãã¯å°ãªããšãå®è¡ãå°é£ïŒã«ãªããæ»æè ããããã¯ãŒã¯äžã«ããå Žåã«ã®ã¿ããã·ã¥ããœãŒãã§ãããããæ€åºãšèª¿æ»ã容æã«ãªããŸãäºä»¶ã
ãããã³ã«ã¬ãã«ã®ç·©å
çŸåšãããã·ã¥ã¹ããŒã ã¬ãã«ã®ç·©åçã¯äœã§ããïŒ
1.ããŒã«ã«ãã©ã¡ãŒã¿ïŒããŒã«ã«ãã©ã¡ãŒã¿ïŒã®äœ¿çšã ãã®ã¢ã€ãã¢ã¯éåžžã«åçŽã§ã-ã¢ã«ãŽãªãºã ã«ç§å¯ãã©ã¡ãŒã¿ãŒãè¿œå ããå¿ èŠããããŸããããã¯ããŒã¿ããŒã¹ã§ã¯ãªããã¢ããªã±ãŒã·ã§ã³ïŒããšãã°ãç°å¢å€æ°ïŒã«ä¿åãããŸãã ãããã£ãŠãæ»æè ããã¹ã¯ãŒãããã·ã¥ã䜿çšããŠããŒã¿ããŒã¹ã«ã¢ã¯ã»ã¹ããã ãã§ã¯äžååã§ããã¢ããªã±ãŒã·ã§ã³ãç Žæããå¿ èŠããããŸãã ãŸããããŒã¿ããŒã¹ç®¡çè ã¯ãGPUã䜿çšããŠèªå® ã§ããã·ã¥ããã³ãããŠæ¥œããããšãã§ããŸããã
2.ãã¹ã¯ãŒããããã·ã¥ãããšãã«å€§ããªROMïŒèªã¿åãå°çšã¡ã¢ãªïŒã䜿çšããŠãããããå€ãæ··åããŸãã ãã®ã¢ã€ãã¢ã¯ã倧èŠæš¡ãªãã¹ã¯ãŒãããã·ã¥ã®ããã®ã¢ã«ãŽãªãºã ã®é©å¿ã®1ã€ãšããŠYescryptã«ãã£ãŠææ¡ãããŸããã å®éã100 GBçšåºŠã®ROMã䜿çšããå Žåããããçãããšã¯å°é£ã§ããCPUããã°ããæ€çŽ¢ããã«ã¯ã100 GB以äžã®ã¡ã¢ãªãåãããµãŒããŒãå¿ èŠã§ãã GPUãFPGAãããã³ASICã§ã¯ããã¹ãŠãäœéã«ãªããŸããããã¯ã倧ããªROMã䜿çšããã ãã§ãªããããã·ã¥ã¢ã«ãŽãªãºã ãæé©åããŠããããã®ã¿ã€ãã®æ©åšãªã©ã§äœéã«ãªãããã§ããã¢ã€ãã¢ã®æ¬ ç¹ã¯ããã¹ãŠãè¡ãå¿ èŠãããããšã§ããã®å€§ããªROMã§ç掻ããæéã¯ãããããããããªããããšã¯ãªãã§ãããã
3. CryptoAnchorsã䜿çšãã-1ã€ã®æäœã®ã¿ãå®è¡ããå°ããªãã€ã¯ããµãŒãã¹ïŒ HRFãªã©ã®ç§å¯éµã䜿çšããŠPRFã䜿çšããŸãã ç§å¯éµã¯ãã€ã¯ããµãŒãã¹ã«ä¿åããã決ããŠæ®ãããŸããã ã¢ã€ãã¢ã®æ¬è³ªã¯ããã€ã¯ããµãŒãã¹ãå°ããã·ã³ãã«ã§ãããšããããšã§ãã ç£æ»ã¯ç°¡åã§ããããã³ã°ã¯éåžžã«é£ãããããããã䜿çšãããšããªãã©ã€ã³æ»æããªã³ã©ã€ã³æ»æã«å€ããããšãã§ããŸãã ã€ãŸããããã·ã¥ããŒã¹ãæ»æããã«ã¯ãæ»æè ã¯ãããã¯ãŒã¯å ã«ãšã©ãŸãããã®ãã€ã¯ããµãŒãã¹ã«ãªã¯ãšã¹ããéä¿¡ããå¿ èŠããããŸãã
CryptoAnchorsã®ã¢ã€ãã¢ã¯ã Passwords OnionãšåŒã°ããFacebookãã¹ã¯ãŒãããã·ã¥ã¹ããŒã ã§äœ¿çšãããŸãããã€ã³ãã©ã¹ãã©ã¯ãã£ã®ä»ã®éšåã§ã䜿çšã§ããŸã ã
4.ããããéšåçå¿åŽåPRFã®äœ¿çš ïŒå®éãããã¯ãã©ã°ã©ã3ã®äžéšã§ãïŒã HMACã®ãããªãã®ã§CryptoAnchorsã䜿çšããå Žåãç§å¯éµã䟵害ããããšãã«å€æŽãããšããåé¡ããããŸãã ãã®åé¡ã解決ãã1ã€ã®æ¹æ³ã¯ãå¥ã®HMACã¬ã€ã€ãŒãäœæããããšã§ããããã«ãããããŸããŸãªäžäŸ¿ãçããŸãã ããã«ãåŸæ¥ã®CryptoAnchorsã®å Žåããã®ãã€ã¯ããµãŒãã¹ã¯ãã¢ããªã±ãŒã·ã§ã³ãéä¿¡ãããã¹ãŠã®ããã·ã¥ãåç §ããŸãã ã€ãŸãããµãŒãã¹ããããã³ã°ãããå Žåãæ»æè ã¯ããã·ã¥ãçŽç²ãªåœ¢ã§åéãããªãã©ã€ã³æ»æãè¡ãããšãã§ããŸãã ããã2ã€ã®åé¡ã解決ããããã«ãCornellTechã®ç 究è ã¯ã billinearãã¢ãªã³ã°ã«åºã¥ããéšåçå¿åŽ PRFã®äœ¿çšãææ¡ããŸããã ãã®èšèšã«ãããç§å¯éµãå€æŽããåãŠãŒã¶ãŒã®ãªã¯ãšã¹ãæ°ã®ãã®ã³ã°ãšå¶éãæŽçã§ããŸãã åæã«ããã€ã¯ããµãŒãã¹ã¯ããã·ã¥ãå¹³æã§è¡šç€ºããŸããã 詳ããã¯åœŒãã®èšäºãã芧ãã ãã ã
ã€ãŸããã¢ããªã±ãŒã·ã§ã³ã¯ãã¹ã¯ãŒããããã·ã¥ãããã©ã€ã³ãã䜿çšããŠããããã¹ã¯ãããã¹ã¯ããããã¹ã¯ãŒãããŠãŒã¶ãŒID tãšãšãã«ãã€ã¯ããµãŒãã¹ã«æž¡ããšããèãæ¹ã§ãã ãã€ã¯ããµãŒãã¹ã¯ãããã ããç¥ã£ãŠããããŒkã䜿çšããŠãããã®å€ã«billinearãã¢ãªã³ã°ãé©çšããçµæãã¢ããªã±ãŒã·ã§ã³ã«è»¢éããŸããã¢ããªã±ãŒã·ã§ã³ã¯ããã©ã€ã³ã解é€ïŒãã¹ã¯è§£é€ïŒãé©çšããçµæãããŒã¿ããŒã¹ã«ä¿åãããŠãããã®ãšæ¯èŒã§ããŸãã billinearãã¢ãªã³ã°ã®ç·åœ¢æ§ã«ãããPOPRFã䜿çšãããã€ã¯ããµãŒãã¹ã¯ãããŒãæŽæ°ããããã®ããŒã¯ã³ãã¢ããªã±ãŒã·ã§ã³ã«æäŸã§ããã¢ããªã±ãŒã·ã§ã³ã¯ããŒã¿ããŒã¹ãééããŠã¬ã³ãŒããæŽæ°ã§ããŸãã
ããã©ãŒãã³ã¹ã®æé©åã Argonische-Argon2ã®å®è£
GitHubã«ã¯Argon2ã¢ã«ãŽãªãºã ã®å ¬åŒå®è£ ããããŸããã
âmarch=native
ã䜿çšããŸããç°ãªãããã»ããµã¢ãã«ã䜿çšããããã
Illegal instruction
é€ããµãŒãã¹
âmarch=native
ããŸãããã®èšå®ã«ãããã³ã³ãã€ã©ã¯ã¢ã»ã³ããªãå®è¡ãããããã»ããµã¢ãã«ã®ã³ãŒããæé©åããŸãã æã移æ€æ§ã®é«ãã¢ã»ã³ããªæ§æãäœæãããšãå¯èœãªããã©ãŒãã³ã¹ã®15ã20ïŒ ã®éïŒAVX2ã®å Žåã¯æ倧65ïŒ ïŒã倱ãããŸãã ãããã£ãŠãArgon2ã¢ã«ãŽãªãºã ã®å®è£ ãäœæããŸãããããã«ãããã³ãŒããå®è¡ãããCPUã®æ©èœãæ倧åã§ããŸãã
å®è£ ã§ã¯ãã©ã³ã¿ã€ã CPUãã£ã¹ããããšåŒã°ããææ³ã䜿çšããŸãã ãã®æ¬è³ªã¯ãã¢ã«ãŽãªãºã ã³ãŒãã§ã©ã€ãã©ãªãåæåãããšãã«
cpuid
åœä»€ãå®è¡ãããçŸåšã®CPUã§ãµããŒããããŠããé«åºŠãªåœä»€ã»ããã決å®ããã察å¿ããæé©åãåããã³ãŒããã©ã³ããéžæãããããšã§ãã ã©ã€ãã©ãªã«ã¯ãSSE2ãSSSE3ãSSE4.1ãAVX2åœä»€ã»ããçšã«æé©åãããã³ãŒããå«ãŸããŠããŸãã ãã©ã¡ãŒã¿ãŒ
p=1,m=2048,t=1
Argon2dã§ã®ããã©ãŒãã³ã¹ã®éãã¯ã以äžã®ã°ã©ãã§ç¢ºèªã§ããŸãã
Argon2ã¯Blake2Bã䜿çšããŠãããããäžèšã®åœä»€ã»ããçšã«æé©åãããããŒãã¹ãšããŠBlake2BãååŸããŸããã å éšçã«ã¯ã
SHA-1
ããã³
HMAC-SHA-1
è¿ éãã€å®å šãªä»£æ¿åãšããŠBlake2Bã䜿çšããããšããå§ãããŸãã ãã®ãããArgon2ã®å ¬åŒå®è£ ãšã®éãã¯æ¬¡ã®ãšããã§ãã
1. C ++ 14ããã³ãã«ãã·ã¹ãã ãšããŠã®cmakeã
2.ã©ã³ã¿ã€ã CPUãã£ã¹ãããã
3. SSE2ãSSSE3ãSSE4.1ãAVX2çšã«æé©åãããBlake2Bã
4. pthreadã§ã¯ãªãOpenMPãOpenMPããªãå Žåã¯ããã¹ãŠã®èšç®ãé çªã«å®è¡ãããŸãã
ãŸãããã®ããã»ã¹ã§ã¯ãAVX2åœä»€ã»ããçšã®Argon2ã®ããŒãžã§ã³ããŒãããäœæããPRãå ¬ââåŒãªããžããªã«éä¿¡ããŸãã ãããã§ãã¡ã³ãããŒãå€æŽãåãå ¥ããŸããã
äžè¬çã«ã倧èŠæš¡ã§è² è·ã®é«ããµãŒãã¹ã§ã®ãã¹ã¯ãŒãããã·ã¥ã®åé¡ã¯è§£æ±ºãããŸãã ããã解決ããã«ã¯ã次ã®ãã®ãå¿ èŠã§ãã
â¢ããã·ã¥ã¢ã«ãŽãªãºã ã®å®è£ ãé«éåããŸãã
â¢å¿çæéã®KPIã«åºã¥ããŠã¢ã«ãŽãªãºã ãã©ã¡ãŒã¿ãŒãéžæããŸãã
â¢ããã·ã¥ã¹ããŒã ãå€æŽããŠããªãã©ã€ã³æ»æããä¿è·ããŸãã
è¬èŸ
Solar Designer ïŒå¥åAlexander PeslyakïŒã«ã倧èŠæš¡ãªã€ã³ã¿ãŒãããäŒæ¥ã§ã®ãã¹ã¯ãŒãããã·ã¥ã®åé¡ã«é¢ããèšå€§ãªæ°ã®èããã¢ã€ãã¢ãå®éšãããã³æçãªè°è«ã«æè¬ããŸãã ãŸãããã¹ã¯ãŒãããã·ã¥ãžã®ããŸããŸãªã¢ãããŒãã®ããŸããŸãªã¢ã€ãã¢ãå ±åãã£ã¹ã«ãã·ã§ã³ãåæã«ã€ããŠDmitry Khovratovichã«æè¬ããŸãã Igor cerevra Klevanetsã«æ·±ãæè¬ããŸã ãCrev++ã¯ãC ++æšæºã«å€æŽãå ããéãArgon2ã®å®è£ ã®ã³ãŒããã¬ãã¥ãŒããã®ã«æéããããŸããã
䟿å©ãªãªã³ã¯
⢠GitHubã®Argonischeãããžã§ã¯ã
â¢ å ¬åŒãªããžããªArgon2
⢠Pythiaããã³Partial-Oblivious PRFã«é¢ããèšäº
⢠ã€ã³ãã«çµã¿èŸŒã¿é¢æ°ã¬ã€ã
⢠PASSïŒãšã³ã¿ãŒãã©ã€ãºãã¹ã¯ãŒã匷åã®åŒ·åãšæ°äž»å