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