crypt






crypt − ãã¹ã¯ã¼ãã¨ãã¼ã¿ã®æå·å

#include<unistd.h>

, const char *char *crypt(const char *key

crypt ã¯ãã¹ã¯ã¼ãæå·åé¢æ°ã§ããã
éµæ¢ç´¢ã®ãã¼ãã¦ã§ã¢ã«ããå®è£ã妨ããããã«(ãã®ä»ã«ããããã) å¤æ´ãã
Data Encryption Standard ã¢ã«ã´ãªãºã ãåã«ãã¦ããã

     key ã¯ã¦ã¼ã¶ãå¥åãããã¹ã¯ã¼ãã§ããã

     salt ã¯éå [azAZ09./] ããé¸ã°ãã2æåã®æååã§ããã ãã®æå‐
åã¯ã¢ã«ã´ãªãºã ã®åºåã4096éãã«ããä¹±ãã®ã«ä½¿ãããã

     ã®åæåããä¸ä½7ããããã¨ã£ã¦56ãããã®éµãå¾ãããã
ãã®56ãããã®éµã¯ç¹å®ã®æåå(ãµã¤ãã¯ãã¹ã¦0ã®æåå)
ãç¹°ãè¿ãæå·åããã®ã«ç¨ããããã
è¿ãå¤ã¯æå·åããããã¹ã¯ã¼ãã¸ã®ãã¤ã³ã¿ã§ã 13ã®å°åå¯è½ãª ASCII æå‐
ãããªã (æåã®2æåã¯saltãã®ãã®)ã
è¿ãå¤ã¯ãé¢æ°å¼åºããã¨ã«ä¸æ¸ããããéçãªãã¼ã¿ã¸ã®ãã¤ã³ã¿ã§ããã

     è¦å: éµç©ºé㯠2**56 = 7.2e16 ã®å¯è½ãªå¤ããæãã
ãã®éµç©ºéã®å¨æ¢ç´¢ã¯å¼·åãªä¸¦åè¨ç®æ©ã使ãã°å¯è½ã§ãããã¾ã
ã®ãããªã½ããã¦ã§ã¢ã¯ãã®éµç©ºéã®ä¸‐
ã§ãå¤ãã®ã²ã¨ã«ãã¹ã¯ã¼ãã¨ãã¦ä½¿
ããããããªéµã«ã¤ãã¦ã®å¨æ¢ç´¢ãå¯è½ã§ããã
ããããããã¹ã¯ã¼ããé¸æããã¨ãã«ã¯ããããªãã¨ãã
ä¸è¬çã«ä½¿ãããåèªã¨ååã¯é¿ããã¹ãã§ããã
ã使ãæã«ã¯ã¯ã©ãã¯ãããããã¹ã¯ã¼ãã«ã¤ãã¦ã®æ¤æ»ããããã¨ã æ¨å¥¨ãããã

     DES
ã¢ã«ã´ãªãºã ã«ã¯ããã¤ãã®çããããããã«ãã£ã¦ãã¹ã¯ã¼ãèªè¨¼ä»¥å¤ã«
ã使ãã®ã¯ããã¸ããããªãé¸æã¨ãªã£ã¦ããããã ãæå·ãã‐
ã¸ã§ã¯ãã«ä½¿ããã¨ããæ¡ããã£ã¦ãããªãã°ã
ããã¯ãããã»ãããããæå·åã«ã¤ãã¦ã®ããæ¬ã¨
誰ã§å¥æã§ããDESã©ã¤ãã©ãªã®ã²ã¨ã¤ãæã«ãããã¹ãã ã

SVID, X/OPEN, BSD 4.3