blob: 1702324c508cc02b695fdeb2f74b6536335c515e [file] [log] [blame]
Fred Drake295da241998-08-10 19:42:37 +00001\section{\module{crypt} ---
2 The \cfunction{crypt()} function used to check \UNIX{} passwords.}
Fred Drakeb91e9341998-07-23 17:59:49 +00003\declaremodule{builtin}{crypt}
4
5\modulesynopsis{The \cfunction{crypt()} function used to check \UNIX{} passwords.}
6
Guido van Rossum5c6e3731996-04-10 16:18:20 +00007
Fred Drakee2f194b1998-02-17 22:24:45 +00008This module implements an interface to the \manpage{crypt}{3} routine,
Guido van Rossum5c6e3731996-04-10 16:18:20 +00009which is a one-way hash function based upon a modified DES algorithm;
Fred Drakef0867311997-12-29 17:31:22 +000010see the \UNIX{} man page for further details. Possible uses include
Guido van Rossum5c6e3731996-04-10 16:18:20 +000011allowing Python scripts to accept typed passwords from the user, or
Fred Drakef0867311997-12-29 17:31:22 +000012attempting to crack \UNIX{} passwords with a dictionary.
Guido van Rossum5c6e3731996-04-10 16:18:20 +000013\index{crypt(3)}
14
Fred Drakecce10901998-03-17 06:33:25 +000015\begin{funcdesc}{crypt}{word, salt}
Guido van Rossum5c6e3731996-04-10 16:18:20 +000016\var{word} will usually be a user's password. \var{salt} is a
172-character string which will be used to select one of 4096 variations
Fred Drakee2f194b1998-02-17 22:24:45 +000018of DES\indexii{cipher}{DES}. The characters in \var{salt} must be
19either \code{.}, \code{/}, or an alphanumeric character. Returns the
20hashed password as a string, which will be composed of characters from
21the same alphabet as the salt.
Guido van Rossum5c6e3731996-04-10 16:18:20 +000022\end{funcdesc}
23
24The module and documentation were written by Steve Majewski.
25\index{Majewski, Steve}