OSDN Git Service

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