summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/crypt.3
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/gen/crypt.3')
-rw-r--r--lib/libc/gen/crypt.332
1 files changed, 25 insertions, 7 deletions
diff --git a/lib/libc/gen/crypt.3 b/lib/libc/gen/crypt.3
index 7ecf0cf..8e19bd9 100644
--- a/lib/libc/gen/crypt.3
+++ b/lib/libc/gen/crypt.3
@@ -29,9 +29,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)crypt.3 8.1.1.1 (Berkeley) 8/18/93
+.\" @(#)crypt.3 8.2 (Berkeley) 12/11/93
.\"
-.Dd August 18, 1993
+.Dd December 11, 1993
.Dt CRYPT 3
.Os
.Sh NAME
@@ -54,7 +54,7 @@
.Fn des_cipher "const char *in" "char *out" "long salt" "int count"
.Sh DESCRIPTION
The
-.Xr crypt
+.Fn crypt
function
performs password encryption.
It is derived from the
@@ -161,8 +161,9 @@ If the value of
is 0,
the argument
.Fa block
-is encrypted, otherwise it fails.
-The encryption is returned in the original
+is encrypted, otherwise it
+is decrypted.
+The encryption or decryption is returned in the original
array
.Fa block
after using the
@@ -188,7 +189,9 @@ significant bit in each character is ignored and the next 7 bits of each
character are concatenated to yield a 56-bit key.
The function
.Fn des_cipher
-encrypts the 64-bits stored in the 8 characters at
+encrypts (or decrypts if
+.Fa count
+is negative) the 64-bits stored in the 8 characters at
.Fa in
using
.Xr abs 3
@@ -223,12 +226,27 @@ They have been provided return values primarily to distinguish
implementations where hardware support is provided but not
available or where the DES encryption is not available due to the
usual political silliness.
+.Pp
+Use of
+.Fn crypt
+requires linking with the
+.Nm libcrypt
+library. The
+.Fn setkey ,
+.Fn encrypt ,
+.Fn des_setkey
+and
+.Fn des_cipher
+can be found in the
+.Nm libcipher
+library (the standard C library,
+.Nm libc ,
+only contains stubs to these routines).
.Sh SEE ALSO
.Xr login 1 ,
.Xr passwd 1 ,
.Xr getpass 3 ,
.Xr passwd 5
-.sp
.Rs
.%T "Mathematical Cryptology for Computer Scientists and Mathematicians"
.%A Wayne Patterson
OpenPOWER on IntegriCloud