crypt.3 (69028) | crypt.3 (70419) |
---|---|
1.\" FreeSec: libcrypt for NetBSD 2.\" 3.\" Copyright (c) 1994 David Burren 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: --- 13 unchanged lines hidden (view full) --- 22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" SUCH DAMAGE. 29.\" | 1.\" FreeSec: libcrypt for NetBSD 2.\" 3.\" Copyright (c) 1994 David Burren 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: --- 13 unchanged lines hidden (view full) --- 22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" SUCH DAMAGE. 29.\" |
30.\" $FreeBSD: head/lib/libcrypt/crypt.3 69026 2000-11-22 09:23:54Z ru $ | 30.\" $FreeBSD: head/lib/libcrypt/crypt.3 70419 2000-12-28 10:32:02Z peter $ |
31.\" 32.\" Manual page, using -mandoc macros 33.\" 34.Dd January 19, 1997 35.Dt CRYPT 3 36.Os "FreeSec 1.0" 37.Sh NAME 38.Nm crypt --- 140 unchanged lines hidden (view full) --- 179.Bl -tag -offset indent 180.It Cm "$3$thesalt$rest" 181.El 182.Pp 183.Ss "Traditional" crypt: 184.Pp 185The algorithm used will depend upon whether 186.Fn crypt_set_format | 31.\" 32.\" Manual page, using -mandoc macros 33.\" 34.Dd January 19, 1997 35.Dt CRYPT 3 36.Os "FreeSec 1.0" 37.Sh NAME 38.Nm crypt --- 140 unchanged lines hidden (view full) --- 179.Bl -tag -offset indent 180.It Cm "$3$thesalt$rest" 181.El 182.Pp 183.Ss "Traditional" crypt: 184.Pp 185The algorithm used will depend upon whether 186.Fn crypt_set_format |
187has been called and whether 188.Tn DES 189is installed or not. If 190.Tn DES 191is installed and | 187has been called and whether a global default format has been specified. 188Unless a global default has been specified or |
192.Fn crypt_set_format | 189.Fn crypt_set_format |
193has not set the format to something else, it will be used. 194Otherwise, the best algorithm is used, which is currently | 190has set the format to something else, the best algorithm is used 191which is currently |
195.\" 196.\" NOTICE: Also make sure to update this 197.\" 198MD5. 199.Pp 200How the salt is used will depend upon the algorithm for the hash. For 201best results, specify at least two characters of salt. 202.Pp --- 8 unchanged lines hidden (view full) --- 211.Ql des 212and 213.Ql md5 . 214.Pp 215The 216.Fn crypt_set_format 217function sets the default encoding format according to the supplied 218.Fa string . | 192.\" 193.\" NOTICE: Also make sure to update this 194.\" 195MD5. 196.Pp 197How the salt is used will depend upon the algorithm for the hash. For 198best results, specify at least two characters of salt. 199.Pp --- 8 unchanged lines hidden (view full) --- 208.Ql des 209and 210.Ql md5 . 211.Pp 212The 213.Fn crypt_set_format 214function sets the default encoding format according to the supplied 215.Fa string . |
216.Pp 217The global default format can be set using the 218.Pa /etc/auth.conf 219file using the 220.Ql crypt_format 221property. |
|
219.Sh RETURN VALUES 220.Pp 221.Fn crypt 222returns a pointer to the encrypted value on success, and NULL on failure. 223Note: this is not a standard behaviour, AT&T 224.Fn crypt 225will always return a pointer to a string. 226.Pp 227.Fn crypt_set_format 228will return 1 if the supplied encoding format was valid. 229Otherwise, a value of 0 is returned. 230.Sh SEE ALSO 231.Xr login 1 , 232.Xr passwd 1 , | 222.Sh RETURN VALUES 223.Pp 224.Fn crypt 225returns a pointer to the encrypted value on success, and NULL on failure. 226Note: this is not a standard behaviour, AT&T 227.Fn crypt 228will always return a pointer to a string. 229.Pp 230.Fn crypt_set_format 231will return 1 if the supplied encoding format was valid. 232Otherwise, a value of 0 is returned. 233.Sh SEE ALSO 234.Xr login 1 , 235.Xr passwd 1 , |
236.Xr auth_getval 3 , |
|
233.Xr cipher 3 , 234.Xr getpass 3 , | 237.Xr cipher 3 , 238.Xr getpass 3 , |
239.Xr auth.conf 5 , |
|
235.Xr passwd 5 , 236.Sh BUGS 237The 238.Fn crypt 239function returns a pointer to static data, and subsequent calls to 240.Fn crypt 241will modify the same data. Likewise, 242.Fn crypt_set_format --- 29 unchanged lines hidden --- | 240.Xr passwd 5 , 241.Sh BUGS 242The 243.Fn crypt 244function returns a pointer to static data, and subsequent calls to 245.Fn crypt 246will modify the same data. Likewise, 247.Fn crypt_set_format --- 29 unchanged lines hidden --- |