blob: 8a4ec92752b361b34f199bb93285e24c2dbed203 [file] [log] [blame]
Guido van Rossume47da0a1997-07-17 16:34:52 +00001\section{Built-in Module {\tt crypt}}
2\label{module-crypt}
Guido van Rossum5c6e3731996-04-10 16:18:20 +00003\bimodindex{crypt}
4
5This module implements an interface to the crypt({\bf 3}) routine,
6which is a one-way hash function based upon a modified DES algorithm;
7see the Unix man page for further details. Possible uses include
8allowing Python scripts to accept typed passwords from the user, or
9attempting to crack Unix passwords with a dictionary.
10\index{crypt(3)}
11
Fred Drake4b3f0311996-12-13 22:04:31 +000012\renewcommand{\indexsubitem}{(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}