blob: 64a9bfcc56a24f6cbb2e140905fb20487871c2b9 [file] [log] [blame]
Fred Drakef0867311997-12-29 17:31:22 +00001\section{Built-in Module \sectcode{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 Drakeaf8a0151998-01-14 14:51:31 +00005This module implements an interface to the crypt(\strong{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 Drake19479911998-02-13 06:58:54 +000012\setindexsubitem{(in module crypt)}
Guido van Rossum5c6e3731996-04-10 16:18:20 +000013\begin{funcdesc}{crypt}{word\, salt}
14\var{word} will usually be a user's password. \var{salt} is a
152-character string which will be used to select one of 4096 variations
16of DES. The characters in \var{salt} must be either \code{.},
17\code{/}, or an alphanumeric character. Returns the hashed password
18as a string, which will be composed of characters from the same
19alphabet as the salt.
20\end{funcdesc}
21
22The module and documentation were written by Steve Majewski.
23\index{Majewski, Steve}