OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man3 / crypt.3
1 .\" Michael Haardt (michael@cantor.informatik.rwth.aachen.de)
2 .\"     Sat Sep  3 22:00:30 MET DST 1994
3 .\"
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
8 .\"
9 .\" The GNU General Public License's references to "object code"
10 .\" and "executables" are to be interpreted as the output of any
11 .\" document formatting or typesetting system, including
12 .\" intermediate and printed output.
13 .\"
14 .\" This manual is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 .\" GNU General Public License for more details.
18 .\"
19 .\" You should have received a copy of the GNU General Public
20 .\" License along with this manual; if not, write to the Free
21 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
22 .\" USA.
23 .\"
24 .\" Sun Feb 19 21:32:25 1995, faith@cs.unc.edu edited details away
25 .\"
26 .\" TO DO: This manual page should go more into detail how DES is perturbed,
27 .\" which string will be encrypted, and what determines the repetition factor.
28 .\" Is a simple repetition using ECB used, or something more advanced?  I hope
29 .\" the presented explanations are at least better than nothing, but by no
30 .\" means enough.
31 .\"
32 .\" added _XOPEN_SOURCE, aeb, 970705
33 .\" added GNU MD5 stuff, aeb, 011223
34 .\"
35 .\" Japanese Version Copyright (c) 1998 Hiroaki Nagoya and MAEHARA Kouichi all rights reserved.
36 .\" Translated Sun Sep 27 JST 1998 by Hiroaki Nagoya <nagoya@cc.hit-u.ac.jp> and MAEHARA Kouichi <maeharak@kw.netlaputa.ne.jp>
37 .\" Updated 2002-01-19 by Kentaro Shirakata <argrath@ub32.org>
38 .\" Updated 2007-01-01 by Kentaro Shirakata <argrath@ub32.org>
39 .\" Updated 2008-07-30 by Kentaro Shirakata <argrath@ub32.org>
40 .\" Updated 2009-09-28 by Kentaro Shirakata <argrath@ub32.org>
41 .\"
42 .\"WORD: encryption °Å¹æ²½
43 .\"WORD: key ¸°
44 .\" "
45 .TH CRYPT 3 2008-08-25 "" "Linux Programmer's Manual"
46 .\"O .SH NAME
47 .SH Ì¾Á°
48 .\"O crypt, crypt_r \- password and data encryption
49 crypt, crypt_r \- ¥Ñ¥¹¥ï¡¼¥É¤È¥Ç¡¼¥¿¤Î°Å¹æ²½
50 .\"O .SH SYNOPSIS
51 .SH ½ñ¼°
52 .nf
53 .B #define _XOPEN_SOURCE
54 .br
55 .B #include <unistd.h>
56 .sp
57 .BI "char *crypt(const char *" key ", const char *" salt );
58 .sp
59 .BI "char *crypt_r(const char *" key ", const char *" salt ,
60 .BI "              struct crypt_data *" data );
61 .fi
62 .sp
63 .\"O Link with \fI\-lcrypt\fP.
64 \fI\-lcrypt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
65 .\"O .SH DESCRIPTION
66 .SH ÀâÌÀ
67 .\"O .BR crypt ()
68 .\"O is the password encryption function.
69 .\"O It is based on the Data Encryption
70 .\"O Standard algorithm with variations intended (among other things) to
71 .\"O discourage use of hardware implementations of a key search.
72 .BR crypt ()
73 ¤Ï¥Ñ¥¹¥ï¡¼¥É°Å¹æ²½´Ø¿ô¤Ç¤¢¤ë¡£
74 ¸°Ãµº÷¤Î¥Ï¡¼¥É¥¦¥§¥¢¤Ë¤è¤ë¼ÂÁõ¤ò˸¤²¤ë¤è¤¦¤Ë(¤½¤Î¾¤Ë¤â¤¤¤í¤¤¤í)
75 Êѹ¹¤·¤¿ Data Encryption Standard ¥¢¥ë¥´¥ê¥º¥à¤ò¸µ¤Ë¤·¤Æ¤¤¤ë¡£
76 .PP
77 .\"O .I key
78 .\"O is a user's typed password.
79 .I key
80 ¤Ï¥æ¡¼¥¶¤¬ÆþÎϤ¹¤ë¥Ñ¥¹¥ï¡¼¥É¤Ç¤¢¤ë¡£
81 .PP
82 .\"O .I salt
83 .\"O is a two-character string chosen from the set
84 .\"O [\fBa\fP\(en\fBzA\fP\(en\fBZ0\fP\(en\fB9./\fP].
85 .\"O This string is used to
86 .\"O perturb the algorithm in one of 4096 different ways.
87 .I salt
88 ¤Ï½¸¹ç
89 [\fBa\fP\(en\fBzA\fP\(en\fBZ0\fP\(en\fB9./\fP]
90 ¤«¤éÁª¤Ð¤ì¤¿ 2 Ê¸»ú¤Îʸ»úÎó¤Ç¤¢¤ë¡£
91 ¤³¤Îʸ»úÎó¤Ï¥¢¥ë¥´¥ê¥º¥à¤Î½ÐÎϤò 4096 Ä̤ê¤Ë¤«¤­Í𤹤Τ˻Ȥï¤ì¤ë¡£
92 .PP
93 .\"O By taking the lowest 7 bits of each of the first eight characters of the
94 .\"O .IR key ,
95 .\"O a 56-bit key is obtained.
96 .\"O This 56-bit key is used to encrypt repeatedly a
97 .\"O constant string (usually a string consisting of all zeros).
98 .\"O The returned
99 .\"O value points to the encrypted password, a series of 13 printable ASCII
100 .\"O characters (the first two characters represent the salt itself).
101 .\"O The return value points to static data whose content is
102 .\"O overwritten by each call.
103 .I key
104 ¤ÎºÇ½é¤Î 8 Ê¸»ú¤Î³Æʸ»ú¤«¤é²¼°Ì 7 ¥Ó¥Ã¥È¤ò¤È¤Ã¤Æ 56 ¥Ó¥Ã¥È¤Î¸°¤¬ÆÀ¤é¤ì¤ë¡£
105 ¤³¤Î 56 ¥Ó¥Ã¥È¤Î¸°¤ÏÆÃÄê¤Îʸ»úÎó(¤Õ¤Ä¤¦¤Ï¤¹¤Ù¤Æ 0 ¤Îʸ»úÎó)
106 ¤ò·«¤êÊÖ¤·°Å¹æ²½¤¹¤ë¤Î¤ËÍѤ¤¤é¤ì¤ë¡£
107 ÊÖ¤êÃͤϰŹ沽¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¡¢13 ¤Î°õ»ú²Äǽ¤Ê ASCII Ê¸»ú
108 ¤«¤é¤Ê¤ë(ºÇ½é¤Î 2 Ê¸»ú¤Ï salt ¤½¤Î¤â¤Î)¡£
109 ÊÖ¤êÃͤϡ¢´Ø¿ô¸Æ½Ð¤·¤Î¤¿¤Ó¤Ë¾å½ñ¤­¤µ¤ì¤ëÀÅŪ¤Ê¥Ç¡¼¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
110 .PP
111 .\"O Warning: The key space consists of
112 .\"O .if t 2\s-2\u56\s0\d
113 .\"O .if n 2**56
114 .\"O equal 7.2e16 possible values.
115 .\"O Exhaustive searches of this key space are
116 .\"O possible using massively parallel computers.
117 .\"O Software, such as
118 .\"O .BR crack (1),
119 .\"O is available which will search the portion of this key space that is
120 .\"O generally used by humans for passwords.
121 .\"O Hence, password selection should,
122 .\"O at minimum, avoid common words and names.
123 .\"O The use of a
124 .\"O .BR passwd (1)
125 .\"O program that checks for crackable passwords during the selection process is
126 .\"O recommended.
127 ·Ù¹ð: ¸°¶õ´Ö¤Ï
128 .if t 2\s-2\u56\s0\d
129 .if n 2**56
130 = 7.2e16 ¤Î²Äǽ¤ÊÃͤ«¤éÀ®¤ë¡£
131 ¤³¤Î¸°¶õ´Ö¤ÎÁ´Ãµº÷¤Ï¶¯ÎϤÊÊÂÎó·×»»µ¡¤ò»È¤¨¤Ð²Äǽ¤Ç¤¢¤ë¡£¤Þ¤¿
132 .BR crack (1)
133 ¤Î¤è¤¦¤Ê¥½¥Õ¥È¥¦¥§¥¢¤Ï¤³¤Î¸°¶õ´Ö¤ÎÃæ¤Ç¡¢Â¿¤¯¤Î¿Í¤Ë¥Ñ¥¹¥ï¡¼¥É¤È¤·¤Æ
134 »È¤ï¤ì¤ë¤è¤¦¤Ê¸°¤Ë¤Ä¤¤¤Æ¤ÎÁ´Ãµº÷¤¬²Äǽ¤Ç¤¢¤ë¡£
135 ¤½¤ì¤æ¤¨¡¢¥Ñ¥¹¥ï¡¼¥É¤òÁªÂò¤¹¤ë¤È¤­¤Ë¤Ï¡¢¤¹¤¯¤Ê¤¯¤È¤â¡¢
136 °ìÈÌŪ¤Ë»È¤ï¤ì¤ëñ¸ì¤È̾Á°¤ÏÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£
137 .BR passwd (1)
138 ¤ò»È¤¦»þ¤Ë¤Ï¥¯¥é¥Ã¥¯¤µ¤ì¤¦¤ë¥Ñ¥¹¥ï¡¼¥É¤Ë¤Ä¤¤¤Æ¤Î¸¡ºº¤ò¤¹¤ë¤³¤È¤¬
139 ¿ä¾©¤µ¤ì¤ë¡£
140 .PP
141 .\"O The DES algorithm itself has a few quirks which make the use of the
142 .\"O .BR crypt ()
143 .\"O interface a very poor choice for anything other than password
144 .\"O authentication.
145 .\"O If you are planning on using the
146 .\"O .BR crypt ()
147 .\"O interface for a cryptography project, don't do it: get a good book on
148 .\"O encryption and one of the widely available DES libraries.
149 DES ¥¢¥ë¥´¥ê¥º¥à¤Ë¤Ï¤¤¤¯¤Ä¤«¤ÎÊʤ¬¤¢¤ê¡¢¤½¤ì¤Ë¤è¤Ã¤Æ¥Ñ¥¹¥ï¡¼¥Éǧ¾Ú°Ê³°¤Ë
150 .BR crypt ()
151 ¤ò»È¤¦¤Î¤Ï¤¿¤¤¤Ø¤ó¤è¤¯¤Ê¤¤ÁªÂò¤È¤Ê¤Ã¤Æ¤¤¤ë¡£¤â¤·
152 .BR crypt ()
153 ¤ò°Å¹æ¥×¥í¥¸¥§¥¯¥È¤Ë»È¤ª¤¦¤È¤¤¤¦°Æ¤ò¤â¤Ã¤Æ¤¤¤ë¤Ê¤é¤Ð¡¢¤½¤ì¤Ï¤ä¤á¤¿¤Û¤¦¤¬
154 ¤è¤¤¡£°Å¹æ²½¤Ë¤Ä¤¤¤Æ¤Î¤è¤¤ËܤÈï¤Ç¤âÆþ¼ê¤Ç¤­¤ë DES ¥é¥¤¥Ö¥é¥ê¤Î¤Ò¤È¤Ä¤ò
155 ¼ê¤Ë¤¤¤ì¤ë¤Ù¤­¤À¡£
156
157 .\"O .BR crypt_r ()
158 .\"O is a reentrant version of
159 .\"O .BR crypt ().
160 .\"O The structure pointed to by
161 .\"O .I data
162 .\"O is used to store result data and bookkeeping information.
163 .\"O Other than allocating it,
164 .\"O the only thing that the caller should do with this structure is to set
165 .\"O .I data->initialized
166 .\"O to zero before the first call to
167 .\"O .BR crypt_r ().
168 .BR crypt_r ()
169 ¤Ï
170 .BR crypt ()
171 ¤ÎºÆÆþ²ÄǽÈǤǤ¢¤ë¡£
172 .I data
173 ¤Ç¼¨¤µ¤ì¤ë¹½Â¤ÂΤϷë²Ì¥Ç¡¼¥¿¤ÎÊݸ¤È¾ðÊó¤Î´ÉÍý¤Ë»È¤ï¤ì¤ë¡£
174 ¤³¤Î¹½Â¤ÂΤËÂФ·¤Æ(¥á¥â¥ê¤ò³ä¤êÅö¤Æ¤ë¤³¤È°Ê³°¤Ë)¸Æ¤Ó½Ð¤·¸µ¤¬¤¹¤ë¤Ù¤­Í£°ì¤Î
175 ¤³¤È¤Ï¡¢
176 .BR crypt_r ()
177 ¤Î½é²ó¤Î¸Æ¤Ó½Ð¤·¤ÎÁ°¤Ë
178 .I data->initialized
179 ¤ò¥¼¥í¤Ë¤¹¤ë¤³¤È¤À¤±¤Ç¤¢¤ë¡£
180 .\"O .SH "RETURN VALUE"
181 .SH ÊÖ¤êÃÍ
182 .\"O On success, a pointer to the encrypted password is returned.
183 .\"O On error, NULL is returned.
184 À®¸ù¤Î¾ì¹ç¤Ë¤Ï¡¢°Å¹æ²½¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤¬ÊÖ¤µ¤ì¤ë¡£
185 ¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï NULL ¤¬ÊÖ¤µ¤ì¤ë¡£
186 .\"O .SH ERRORS
187 .SH ¥¨¥é¡¼
188 .TP
189 .B ENOSYS
190 .\"O The
191 .\"O .BR crypt ()
192 .\"O function was not implemented, probably because of U.S.A. export restrictions.
193 .BR crypt ()
194 ´Ø¿ô¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£Â¿Ê¬¥¢¥á¥ê¥«¤ÎÍ¢½Ðµ¬À©¤Î¤¿¤á¤Ë¡£
195 .\"O .\" This level of detail is not necessary in this man page. . .
196 .\" ¤³¤Î¥ì¥Ù¥ë¤Î¾ÜºÙ¤Ï¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤Ë¤ÏɬÍפʤ¤¤À¤í¤¦¡Ä
197 .\" (ÌõÃí: °Ê²¼¤Ï MAEHARA Kouichi <maeharak@kw.netlaputa.ne.jp> ¤µ¤ó¤ÎÌõ)
198 .\" .PP
199 .\"O .\" When encrypting a plain text P using DES with the key K results in the
200 .\"O .\" encrypted text C, then the complementary plain text P' being encrypted
201 .\"O .\" using the complementary key K' will result in the complementary encrypted
202 .\"O .\" text C'.
203 .\"ʿʸ P ¤ò¸° K ¤Ç¤â¤Ã¤Æ DES ¤òÍѤ¤¤Æ°Å¹æ²½¤·¤¿¤È¤­¤Î·ë²Ì¤Î°Å¹æʸ
204 .\"¤ò C ¤È¤¹¤ë¤Ê¤é¤Ð¡¢P ¤ËÂФ¹¤ë 2 ¤ÎÊä¿ôŪ¤Êʿʸ P' ¤ò¸° K
205 .\"¤ËÂФ¹¤ëƱÍͤËÊä¿ôŪ¤Ê¸° K' ¤òÍѤ¤¤Æ°Å¹æ²½¤¹¤ë¤È C ¤ËÂФ·¤Æ¤ä¤Ï¤êÊä
206 .\"¿ôŪ¤Ê°Å¹æʸ C' ¤È¤Ê¤ë¡£
207 .\".PP
208 .\"O .\" Weak keys are keys which stay invariant under the DES key transformation.
209 .\"O .\" The four known weak keys 0101010101010101, fefefefefefefefe,
210 .\"O .\" 1f1f1f1f0e0e0e0e and e0e0e0e0f1f1f1f1 must be avoided.
211 .\"DES ¤Ë¤è¤ë¸°¤ÎÊÑ·Á¤Ë¤ª¤¤¤Æ¡¢¾ï¤Ë¹¶·â¤ËÂФ·¤Æ¼å¤¤¸°¤¬Â¸ºß¤¹¤ë¡£¤è¤¯
212 .\"ÃΤé¤ì¤¿»Í¤Ä¤Î¼å¤¤¸°¤Ï 0101010101010101¡¢fefefefefefefefe¡¢
213 .\"1f1f1f1f0e0e0e0e¡¢e0e0e0e0f1f1f1f1 ¤Ç¤¢¤ê¤³¤ì¤é¤Î»ÈÍѤÏÈò¤±¤Ê¤±¤ì¤Ð
214 .\"¤Ê¤é¤Ê¤¤¡£
215 .\".PP
216 .\"O .\" There are six known half weak key pairs, which keys lead to the same
217 .\"O .\" encrypted data.  Keys which are part of such key clusters should be
218 .\"O .\" avoided.
219 .\"O .\" Sorry, I could not find out what they are.
220 .\"O .\""
221 .\"Ʊ°ì¤Î°Å¹æ²½·ë²Ì¤òƳ¤¤¤Æ¤·¤Þ¤¦Ï»ÁȤΤä¤ä¼å¤¤¸°¤â¤¢¤ë¡£¤³¤¦¤·¤¿¤¤¤¯
222 .\"¤Ä¤«¤Î¸°¤Î»ÈÍѤϤä¤Ï¤êÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£
223 .\"¿½¤·¤ï¤±¤Ê¤¤¤³¤È¤À¤¬¡¢¤³¤ì¤Ë¤É¤ó¤Ê¸°¤¬³ºÅö¤¹¤ë¤Î¤«¤ÏÄ´¤Ù¤­¤ì¤Ê¤«¤Ã
224 .\"¤¿¡£
225 .\".PP
226 .\"O .\" Heavily redundant data causes trouble with DES encryption, when used in the
227 .\"O .\" .I codebook
228 .\"O .\" mode that
229 .\"O .\" .BR crypt ()
230 .\"O .\" implements.  The
231 .\"O .\" .BR crypt ()
232 .\"O .\" interface should be used only for its intended purpose of password
233 .\"O .\" verification, and should not be used as part of a data encryption tool.
234 .\"¶Ëü¤Ë¾éĹ²½¤Ç¤¢¤ë¥Ç¡¼¥¿¤Ï¡¢
235 .\".BR crypt ()
236 .\"¤Î¤è¤¦¤Ë
237 .\".I "°Å¹æɽ(codebook)"
238 .\"¥â¡¼¥É¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë DES ¤Ë¤è¤ë°Å¹æ²½¤Ë¤ª¤¤¤Æ¤Ï¥È¥é¥Ö¥ë¤Î¤â¤È¤È¤Ê
239 .\"¤ë¡£
240 .\".BR crypt ()
241 .\"¤Ï¤½¤ÎÁÛÄêÄ̤ꡢ¥Ñ¥¹¥ï¡¼¥É¤Îǧ¾Ú¤ÎÌÜŪ¤Ë¤Î¤ßÍøÍѤ¹¤Ù¤­¤â¤Î¤Ç¤¢¤ê¡¢
242 .\"¥Ç¡¼¥¿¤Î°Å¹æ²½¥Ä¡¼¥ë¤È¤·¤ÆÍѤ¤¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
243 .\".PP
244 .\"O .\" The first and last three output bits of the fourth S-box can be
245 .\"O .\" represented as function of their input bits.  Empiric studies have
246 .\"O .\" shown that S-boxes partially compute the same output for similar input.
247 .\"O .\" It is suspected that this may contain a back door which could allow the
248 .\"O .\" NSA to decrypt DES encrypted data.
249 .\"Âè»Í S-box ¤Î¡¢ÀèƬ¤ÈËöÈø»°¤Ä¤Î½ÐÎÏ bit ·²¤Ï¡¢¤½¤ÎÆþÎÏ bit ·²¤Î´Ø¿ô
250 .\"¤È¤·¤Æɽ¤ï¤¹¤³¤È¤¬¤Ç¤­¤ë¡£¤³¤Î¤è¤¦¤Ê S-box ·²¤ÏƱ¤¸ÆþÎϤËÂФ·¤Æ¤ÏÉô
251 .\"ʬŪ¤ËƱ¤¸°Å¹æ²½·ë²Ì¤òÀ¸À®¤·¤Æ¤·¤Þ¤¦¤³¤È¤¬¼Â¸³¤Ë¤è¤Ã¤Æ¤¢¤­¤é¤«¤Ë¤µ
252 .\"¤ì¤Æ¤¤¤ë¡£¤³¤ì¤Ï¡¢¹ñ²È°ÂÁ´Êݾã¶É(NSA)¤¬ DES ¤Ë¤è¤ë°Å¹æ¥Ç¡¼¥¿¤Î²òÆɤò²Äǽ
253 .\"¤Ë¤¹¤ë¤¿¤á¤ËÀߤ±¤¿Î¢¸ý¤Ê¤Î¤Ç¤Ï¤Ê¤¤¤«¤Èµ¿¤ï¤ì¤Æ¤¤¤ë¡£
254 .\".PP
255 .\"O .\" Making encrypted data computed using crypt() publicly available has
256 .\"O .\" to be considered insecure for the given reasons.
257 .\"¤³¤¦¤¤¤Ã¤¿Íýͳ¤Ë¤è¤ê¡¢crypt() ¤ò»ÈÍѤ·¤¿°Å¹æ²½¥Ç¡¼¥¿¤ò¸ø³«¤¹¤ë¤³¤È
258 .\"¤Ï°ÂÁ´¤Ç¤Ï¤Ê¤¤¤Èǧ¼±¤¹¤ë¤Ù¤­¤Ê¤Î¤Ç¤¢¤ë¡£
259 .\"O .SH "CONFORMING TO"
260 .SH ½àµò
261 .BR crypt ():
262 SVr4, 4.3BSD, POSIX.1-2001.
263 .\"O .BR crypt_r ()
264 .\"O is a GNU extension.
265 .BR crypt_r ()
266 ¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ë¡£
267 .\"O .SH NOTES
268 .\"O .SS Glibc Notes
269 .SH Ãí°Õ
270 .SS glibc ¤Ç¤ÎÃí°Õ
271 .\"O The glibc2 version of this function supports additional
272 .\"O encryption algorithms.
273 ¤³¤Î´Ø¿ô¤Î glibc2 ÈǤÏÄɲäΰŹ沽¥¢¥ë¥´¥ê¥º¥à¤ËÂбþ¤·¤Æ¤¤¤ë¡£
274
275 .\"O If
276 .\"O .I salt
277 .\"O is a character string starting with the characters "$\fIid\fP$"
278 .\"O followed by a string terminated by "$":
279 ¤â¤·
280 .I salt
281 ¤Îʸ»úÎ󤬠"$\fIid\fP$" ¤Ç»Ï¤Þ¤Ã¤Æ¤¤¤Æ¡¢"$" ¤Ç½ª¤ï¤Ã¤Æ¤¤¤ëʸ»úÎó¤¬
282 ³¤¤¤Æ¤¤¤ë¾ì¹ç:
283 .RS
284
285 $\fIid\fP$\fIsalt\fP$\fIencrypted\fP
286
287 .RE
288 .\"O then instead of using the DES machine,
289 .\"O .I id
290 .\"O identifies the encryption method used and this then determines how the rest
291 .\"O of the password string is interpreted.
292 .\"O The following values of
293 .\"O .I id
294 .\"O are supported:
295 DES ¤ò»È¤¦Âå¤ï¤ê¤Ë¡¢
296 .I id
297 ¤Ç»ÈÍѤ¹¤ë°Å¹æ²½¼êË¡¤ò¼±Ê̤·¡¢¤³¤ì¤¬¥Ñ¥¹¥ï¡¼¥Éʸ»úÎó¤Î»Ä¤ê¤ÎÉôʬ¤ò²ò¼á¤¹¤ë
298 ÊýË¡¤ò·èÄꤹ¤ë¡£
299 .I id
300 ¤ÎÃͤȤ·¤Æ¡¢°Ê²¼¤ÎÃͤËÂбþ¤·¤Æ¤¤¤ë:
301 .RS
302 .TS
303 l l.
304 ID  | Method
305 _
306 1   | MD5
307 .\"O 2a  | Blowfish (not in mainline glibc; added in some
308 .\"O     | Linux distributions)
309 2a  | Blowfish (ËÜή¤Î glibc ¤Ë¤ÏÆþ¤Ã¤Æ¤¤¤Ê¤¤;
310     | ¤¤¤¯¤Ä¤«¤Î Linux ¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤ÇÄɲ䵤ì¤Æ¤¤¤ë)
311 .\" openSUSE has Blowfish, but AFAICS, this option is not supported
312 .\" natively by glibc -- mtk, Jul 08
313 .\"
314 .\" md5 | Sun MD5
315 .\" glibc doesn't appear to natively support Sun MD5; I don't know
316 .\" if any distros add the support.
317 .\"O 5   | SHA-256 (since glibc 2.7)
318 .\"O 6   | SHA-512 (since glibc 2.7)
319 5   | SHA-256 (glibc 2.7 °Ê¹ß)
320 6   | SHA-512 (glibc 2.7 °Ê¹ß)
321 .TE
322 .RE
323
324 .\"O So $5$\fIsalt\fP$\fIencrypted\fP is an SHA-256 encoded
325 .\"O password and $6$\fIsalt\fP$\fIencrypted\fP is an
326 .\"O SHA-512 encoded one.
327 ½¾¤Ã¤Æ¡¢$5$\fIsalt\fP$\fIencrypted\fP ¤Ï SHA-256 ¤Ç¥¨¥ó¥³¡¼¥É¤µ¤ì¤¿
328 ¥Ñ¥¹¥ï¡¼¥É¤Ç¤¢¤ê¡¢$6$\fIsalt\fP$\fIencrypted\fP ¤Ï SHA-512 ¤Ç
329 ¥¨¥ó¥³¡¼¥É¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤Ç¤¢¤ë¡£
330
331 .\"O "\fIsalt\fP" stands for the up to 16 characters
332 .\"O following "$\fIid\fP$" in the salt.
333 .\"O The encrypted part of the password string is the actual computed password.
334 .\"O The size of this string is fixed:
335 "\fIsalt\fP" ¤Ï salt ¤Ë¤ª¤±¤ë "$\fIid\fP$" ¤Ë°ú¤­Â³¤¯ 16 Ê¸»ú°Ê²¼¤Î
336 ʸ»úÎó¤Ç¤¢¤ë¡£
337 ¥Ñ¥¹¥ï¡¼¥Éʸ»úÎó¤Î°Å¹æ²½Éôʬ¤Ï¼ÂºÝ¤Ë·×»»¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤Ç¤¢¤ë¡£
338 ¤³¤Îʸ»úÎó¤Î¥µ¥¤¥º¤Ï¸ÇÄê¤Ç¤¢¤ë:
339 .TS
340 l l.
341 MD5     | 22 characters
342 SHA-256 | 43 characters
343 SHA-512 | 86 characters
344 .TE
345
346 .\"O The characters in "\fIsalt\fP" and "\fIencrypted\fP" are drawn from the set
347 .\"O The characters in "<salt>" and "<encoded>" are drawn from the set
348 .\"O [\fBa\fP\(en\fBzA\fP\(en\fBZ0\fP\(en\fB9./\fP].
349 "\fIsalt\fP" ¤È "\fIencrypted\fP" ¤Îʸ»ú¤Ï
350 [\fBa\fP\(en\fBzA\fP\(en\fBZ0\fP\(en\fB9./\fP] ¤Î½¸¹ç¤«¤é
351 Áª¤Ð¤ì¤ë¡£
352 .\"O In the SHA implementation the entire
353 .\"O .I key
354 .\"O is significant (instead of only the first
355 .\"O 8 bytes).
356 SHA ¼ÂÁõ¤Ç¤Ï¡¢(ºÇ½é¤Î 8 Ê¸»ú¤Ç¤Ï¤Ê¤¯)
357 .I ¥­¡¼
358 Á´ÂΤ¬°ÕÌ£¤¬¤¢¤ë¡£
359 .\"O .SH "SEE ALSO"
360 .SH ´ØÏ¢¹àÌÜ
361 .BR login (1),
362 .BR passwd (1),
363 .BR encrypt (3),
364 .BR getpass (3),
365 .BR passwd (5),
366 .BR feature_test_macros (7)