OpenIDã®ã»ãã¥ãªãã£ã¢ãã«ã«ã¤ãã¦
ã¯ããã«
åèªèº«ãã»ãã¥ãªãã£ã«å¯¾ããæå·åã®ç¥èã足ããªãéããã®ã§ãããã§æãåã£ã¦ã¾ã¨ãã¦ã¿ããã¨æãã¾ãã
- HMAC-SHA1
- Diffie-Hellmanéµå ±æ
ã«ã¤ãã¦ä¸»ã«è¿°ã¹ã¾ãã
ç¾ä»£ã®æå·åæè¡ã«ã¤ã㦠(via: wikipedia)
ç¾ä»£ã®æå·ã£ã¦ã®ã¯æ¦ãï¼ãã¿ã¼ã³ããç¡ãã¦ã
ã£ã¦å¥´ã§ãã
å ±ééµã£ã¦ã®ã¯ä»£è¡¨çãªã®ã¯ãã¹ã¯ã¼ãèªè¨¼ãªããã¯ããã§ããã¼ã¿ãéä¿¡ããå´(æ¦ããµã¼ãã¼ã¨ã)ã¨ãã¼ã¿ãåä¿¡ããå´(ã¦ã¼ã¶ã¼)ã¯å ±ã«åãå ±ééµã§ãããã¹ã¯ã¼ããç¥ã£ã¦ãã£ã¦ã±âã¹ããããDESã¨ãAESã使ããã¾ãã
å ¬ééµã»ç§å¯éµã£ã¦ã®ã¯sshã§ã®å ¬ééµèªè¨¼ã§ã使ããã¦ããããã«ããã¼ã¿ã®æå·åã«å ¬ééµã使ãããã¼ã¿ã®è¤ååã«ç§å¯éµã使ããå¾ã£ã¦ç¹å®ã®ãã¼ã¿ãè¤ååºæ¥ãã®ã¯ç§å¯éµãææãã¦ãã人ã®ã¿å¯è½ã ã£ã¦äºã«ãªãã¾ããRSAã ã¨ãDSAã使ããã¦ã¾ãã
HMAC-SHA1
MACã£ã¦ãªãã ãï¼ã
ããããã°è¯ãèããã©ä½è
ãã£ã¦ã®ã¯èª¿ã¹ãäºãç¡ãã£ãã®ã§ã調ã¹ã¦ã¿ã¾ããã
MACã¨ã¯Message Authentication Codeã®ç¥ã§ã
ãã¡ãã»ã¼ã¸ãå§ç¸®ãããããªãã®ã§ãããã·ã¥é¢æ°ã«ãã£ã¦çæãããã¡ãã»ã¼ã¸ã«ä»å¸¯ããããåä¿¡è ã¯éä¿¡è ã¨åãããã»ã¹ã§ãããçæããã¡ãã»ã¼ã¸ã«ä»å¸¯ããããã¨ã«ãã£ã¦ãéä¿¡éä¸ã®æ¹ãããªã©ããã§ãã¯ãããã¨ãã§ããã ãç§å¯ã®å ±æéµãæã£ãéä¿¡è ã®MACã¨åä¿¡è ãåä¿¡ããã¨ãã«çæããMACãä¸è´ããªãå ´åã¯ãã¡ãã»ã¼ã¸çè´ã»æ¹ããã®æãããããéã«ä¸è´ããå ´åã¯æ¹ããã®æãããªãã¨ã»ã¼æå®ã§ããä»çµã¿ã¨ãªã£ã¦ããã
ã¨ããããã«ãå ±æéµãæã£ãåä¿¡å´ãéä¿¡å´åæ¹ãããã¼ã¿ã®ããåãã®ä¸ã§æ¹ãããè¡ããã¦ããªãäºãä¿è¨¼ããçºã«è¡ããã§ãã¯ãµã ã¿ãããªãã®ã£ã¦äºã§ããããªãã»ã©ã¼ã
HMAC
keyed-Hashing for Message Authentication Codeã®ç¥ã
HMAC(Keyed-Hashing for Message Authentication code)ã¨ã¯ãMAC(Message Authentication Code)ã®ä¸ã¤ã§ãããã·ã¥é¢æ°ã使ã£ã¦ç§å¯éµã¨çµã¿åããã¦è¨ç®ããMACã§ããã
ä»»æã®ããã·ã¥é¢æ°ãé©ç¨å¯è½ã§SHA1ã¨ãMD5ã¨ãå©ç¨åºæ¥ã¦ãHMAC-SHA1, HMAC-MD5ã¨å¼ã°ããã
ç§å¯éµã¨å
±ã«ç¨ããããã®ããã½ã§ããã
Diffel-Hellmanéµå ±æ
DHéµäº¤æã¨ãDHéµå ±æã¿ãããªè¨ãæ¹ããããäºãããã
Diffie-Hellmanéµå ±æï¼ããã£ã¼ã»ãã«ãã³ãããããããï¼ããããã¯Diffie-Hellmanéµäº¤æï¼-ããããããï¼ã¨ã¯ãäºåã®ç§å¯ã®å ±æç¡ãã«ãçè´ã®å¯è½æ§ã®ããéä¿¡è·¯ã使ã£ã¦ãæå·éµã®å ±æãå¯è½ã«ããæå·ãããã³ã«ã§ããããã®éµã¯ãå ±ééµæå·æ¹å¼ã®éµã¨ãã¦ä½¿ç¨å¯è½ã§ããã
ã¨ã¦ãéè¦ãªã®ã¯ããçè´ã®å¯è½æ§ãããéä¿¡çµè·¯ãã§ããæå·éµ(å
±ééµ)ã®å
±æãå¯è½ãã£ã¦äºã§ããã
ä»åã¿ãããªOpenIDã§ã®Consumer-IdPéã®éä¿¡ã«ããã¦ãhttpã§POSTãã¦ã¾ããã©ãæ¬æ¥ã¯SSLã¨ãã§ãéä¿¡çµè·¯èªä½ãã»ãã¥ã¢ã«ãããã ãããã©ã
httpã§ä»®ã«æ¼ãã¦ãOKãªãã¦ä»çµã¿ãããã®ã¯å
¨ç¶ç¥ããªãã£ãã
å®éã®å 容ã§ããã©ã
ãã®ãããã³ã«ã¯éä¿¡ãè¡ããã2è ããåã å ¬ééµã¨ç§å¯éµãç¨æããå ¬ééµã®ã¿ãå ¬éãããããã¦ããäºãã«ç§å¯ã®å¤ããä½æããããã¼ã¿ãç¸æã«éä¿¡ããåèªãèªåã®ç§å¯éµã¨åä¿¡ãããã¼ã¿ããå ±ééµãä½æã§ããæ¹æ³ã§ããã第ä¸è ãéåä¿¡ããããã¼ã¿ãçè´ãã¦ãéµãçæãããã¨ãã§ããªãæã«ç¹å¾´ãããã
ã¤ã¾ãããããäºãA-Béã§éä¿¡ãè¡ãããã¨ã
ããã¦ããäºãã®å
¬ééµã交æãåãã
ãäºãã®ãã¼ã¿ã®ããã¨ãã§ã¯ãä¾ãã°BããAã«ä½ããéä¿¡ããå ´åãBã¯Aããåãåã£ãAã®å
¬ééµãæã£ã¦ãã¼ã¿ã®æå·åãããAã¯ãã®ãã¼ã¿ãåä¿¡ãã¦ãèªåã®ç§å¯éµã§è¤åãããã£ã¦ããæ¹ãåããã
ãããäºãã«ä¿è¨¼ãããã®ã§ãå ±ééµã®åã渡ããé常ã«ã»ãã¥ã¢ã«åºæ¥ã¾ããã£ã¦äºã«ãªããåãï¼
ã¾ã¨ã
ã¨è¨ã訳ã§Consumer-IdPéã§ã¯(ä»»æã§ã¯ãããã©)DHéµå ±æã«ãããäºãã®ä¿¡é ¼æ§ã確ç«ããã¦ã¦ãããã«ã¯HMAC-SHA1ã«ãã£ã¦äºãã®MACå¤ã®ç¢ºèªãè¡ã£ã¦ãã®ã§ãã»ãã¥ãªãã£çã«ããªãå ãç¶æ ã«ãªã£ã¦ãã£ã¦è¨ããã¨æãã¾ãã
ãµã ãè¦æåéã ãããããã®ã