blob: 8e9a7d31317a794951b650f900be3bf2b7293737 [file] [log] [blame]
Fred Drake3a0351c1998-04-04 07:23:21 +00001\section{Built-in Module \module{crypt}}
Guido van Rossume47da0a1997-07-17 16:34:52 +00002\label{module-crypt}
Guido van Rossum5c6e3731996-04-10 16:18:20 +00003\bimodindex{crypt}
4
Fred Drakee2f194b1998-02-17 22:24:45 +00005This module implements an interface to the \manpage{crypt}{3} routine,
Guido van Rossum5c6e3731996-04-10 16:18:20 +00006which is a one-way hash function based upon a modified DES algorithm;
Fred Drakef0867311997-12-29 17:31:22 +00007see the \UNIX{} man page for further details. Possible uses include
Guido van Rossum5c6e3731996-04-10 16:18:20 +00008allowing Python scripts to accept typed passwords from the user, or
Fred Drakef0867311997-12-29 17:31:22 +00009attempting to crack \UNIX{} passwords with a dictionary.
Guido van Rossum5c6e3731996-04-10 16:18:20 +000010\index{crypt(3)}
11
Fred Drakecce10901998-03-17 06:33:25 +000012\begin{funcdesc}{crypt}{word, salt}
Guido van Rossum5c6e3731996-04-10 16:18:20 +000013\var{word} will usually be a user's password. \var{salt} is a
142-character string which will be used to select one of 4096 variations
Fred Drakee2f194b1998-02-17 22:24:45 +000015of DES\indexii{cipher}{DES}. The characters in \var{salt} must be
16either \code{.}, \code{/}, or an alphanumeric character. Returns the
17hashed password as a string, which will be composed of characters from
18the same alphabet as the salt.
Guido van Rossum5c6e3731996-04-10 16:18:20 +000019\end{funcdesc}
20
21The module and documentation were written by Steve Majewski.
22\index{Majewski, Steve}