.BR crypt ()
interface for a cryptography project, don't do it: get a good book on
encryption and one of the widely available DES libraries.
-
+.PP
.BR crypt_r ()
is a reentrant version of
.BR crypt ().
.SS Glibc notes
The glibc2 version of this function supports additional
encryption algorithms.
-
+.PP
If
.I salt
is a character string starting with the characters "$\fIid\fP$"
followed by a string terminated by "$":
.RS
-
+.PP
$\fIid\fP$\fIsalt\fP$\fIencrypted\fP
-
+.PP
.RE
then instead of using the DES machine,
.I id
6 | SHA-512 (since glibc 2.7)
.TE
.RE
-
+.PP
So $5$\fIsalt\fP$\fIencrypted\fP is an SHA-256 encoded
password and $6$\fIsalt\fP$\fIencrypted\fP is an
SHA-512 encoded one.
-
+.PP
"\fIsalt\fP" stands for the up to 16 characters
following "$\fIid\fP$" in the salt.
The encrypted part of the password string is the actual computed password.
SHA-256 | 43 characters
SHA-512 | 86 characters
.TE
-
+.sp 1
The characters in "\fIsalt\fP" and "\fIencrypted\fP" are drawn from the set
[\fBa\-zA\-Z0\-9./\fP].
In the MD5 and SHA implementations the entire