diff options
Diffstat (limited to 'src/lib/libc/crypt/crypt.3')
-rw-r--r-- | src/lib/libc/crypt/crypt.3 | 144 |
1 files changed, 0 insertions, 144 deletions
diff --git a/src/lib/libc/crypt/crypt.3 b/src/lib/libc/crypt/crypt.3 deleted file mode 100644 index 6a21571ddb..0000000000 --- a/src/lib/libc/crypt/crypt.3 +++ /dev/null | |||
@@ -1,144 +0,0 @@ | |||
1 | .\" $OpenBSD: crypt.3,v 1.46 2025/01/09 23:18:08 jsg Exp $ | ||
2 | .\" | ||
3 | .\" FreeSec: libcrypt | ||
4 | .\" | ||
5 | .\" Copyright (c) 1994 David Burren | ||
6 | .\" All rights reserved. | ||
7 | .\" | ||
8 | .\" Redistribution and use in source and binary forms, with or without | ||
9 | .\" modification, are permitted provided that the following conditions | ||
10 | .\" are met: | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
14 | .\" notice, this list of conditions and the following disclaimer in the | ||
15 | .\" documentation and/or other materials provided with the distribution. | ||
16 | .\" 4. Neither the name of the author nor the names of other contributors | ||
17 | .\" may be used to endorse or promote products derived from this software | ||
18 | .\" without specific prior written permission. | ||
19 | .\" | ||
20 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
21 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
22 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
23 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
24 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
25 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
26 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
27 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
28 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
30 | .\" SUCH DAMAGE. | ||
31 | .\" | ||
32 | .\" Manual page, using -mandoc macros | ||
33 | .\" | ||
34 | .Dd $Mdocdate: January 9 2025 $ | ||
35 | .Dt CRYPT 3 | ||
36 | .Os | ||
37 | .Sh NAME | ||
38 | .Nm crypt , | ||
39 | .Nm bcrypt_gensalt , | ||
40 | .Nm bcrypt | ||
41 | .Nd password hashing | ||
42 | .Sh SYNOPSIS | ||
43 | .In stdlib.h | ||
44 | .Pp | ||
45 | .In unistd.h | ||
46 | .Ft char * | ||
47 | .Fn crypt "const char *key" "const char *setting" | ||
48 | .In pwd.h | ||
49 | .Ft char * | ||
50 | .Fn bcrypt_gensalt "u_int8_t log_rounds" | ||
51 | .Ft char * | ||
52 | .Fn bcrypt "const char *key" "const char *salt" | ||
53 | .Sh DESCRIPTION | ||
54 | These functions are deprecated in favor of | ||
55 | .Xr crypt_checkpass 3 | ||
56 | and | ||
57 | .Xr crypt_newhash 3 . | ||
58 | .Pp | ||
59 | The | ||
60 | .Fn crypt | ||
61 | function performs password hashing. | ||
62 | Additional code has been added to deter key search attempts and to use | ||
63 | stronger hashing algorithms. | ||
64 | .Pp | ||
65 | The first argument to | ||
66 | .Fn crypt | ||
67 | is a NUL-terminated | ||
68 | string | ||
69 | .Fa key , | ||
70 | typically a user's typed password. | ||
71 | The second, | ||
72 | .Fa setting , | ||
73 | currently supports a single form. | ||
74 | If it begins | ||
75 | with a string character | ||
76 | .Pq Ql $ | ||
77 | and a number then a different algorithm is used depending on the number. | ||
78 | At the moment | ||
79 | .Ql $2 | ||
80 | chooses Blowfish hashing; see below for more information. | ||
81 | .Ss Blowfish crypt | ||
82 | The Blowfish version of crypt has 128 bits of | ||
83 | .Fa salt | ||
84 | in order to make building dictionaries of common passwords space consuming. | ||
85 | The initial state of the | ||
86 | Blowfish cipher is expanded using the | ||
87 | .Fa salt | ||
88 | and the | ||
89 | .Fa password | ||
90 | repeating the process a variable number of rounds, which is encoded in | ||
91 | the password string. | ||
92 | The maximum password length is 72. | ||
93 | The final Blowfish password entry is created by encrypting the string | ||
94 | .Pp | ||
95 | .Dq OrpheanBeholderScryDoubt | ||
96 | .Pp | ||
97 | with the Blowfish state 64 times. | ||
98 | .Pp | ||
99 | The version number, the logarithm of the number of rounds and | ||
100 | the concatenation of salt and hashed password are separated by the | ||
101 | .Ql $ | ||
102 | character. | ||
103 | An encoded | ||
104 | .Sq 8 | ||
105 | would specify 256 rounds. | ||
106 | A valid Blowfish password looks like this: | ||
107 | .Pp | ||
108 | .Dq $2b$12$FPWWO2RJ3CK4FINTw0Hi8OiPKJcX653gzSS.jqltHFMxyDmmQ0Hqq . | ||
109 | .Pp | ||
110 | The whole Blowfish password string is passed as | ||
111 | .Fa setting | ||
112 | for interpretation. | ||
113 | .Sh RETURN VALUES | ||
114 | The function | ||
115 | .Fn crypt | ||
116 | returns a pointer to the encrypted value on success, and | ||
117 | .Dv NULL | ||
118 | on failure. | ||
119 | .Sh SEE ALSO | ||
120 | .Xr encrypt 1 , | ||
121 | .Xr login 1 , | ||
122 | .Xr passwd 1 , | ||
123 | .Xr blowfish 3 , | ||
124 | .Xr crypt_checkpass 3 , | ||
125 | .Xr getpass 3 , | ||
126 | .Xr passwd 5 | ||
127 | .Sh HISTORY | ||
128 | An M-209 based | ||
129 | .Fn crypt | ||
130 | function appeared in | ||
131 | .At v3 . | ||
132 | A DES-based | ||
133 | .Fn crypt | ||
134 | first appeared in | ||
135 | .At v7 . | ||
136 | .Fn bcrypt | ||
137 | first appeared in | ||
138 | .Ox 2.1 . | ||
139 | .Sh BUGS | ||
140 | The | ||
141 | .Fn crypt | ||
142 | function returns a pointer to static data, and subsequent calls to | ||
143 | .Fn crypt | ||
144 | will modify the same object. | ||