Guido van Rossum | e47da0a | 1997-07-17 16:34:52 +0000 | [diff] [blame] | 1 | \section{Built-in Module {\tt crypt}} |
| 2 | \label{module-crypt} |
Guido van Rossum | 5c6e373 | 1996-04-10 16:18:20 +0000 | [diff] [blame] | 3 | \bimodindex{crypt} |
| 4 | |
| 5 | This module implements an interface to the crypt({\bf 3}) routine, |
| 6 | which is a one-way hash function based upon a modified DES algorithm; |
| 7 | see the Unix man page for further details. Possible uses include |
| 8 | allowing Python scripts to accept typed passwords from the user, or |
| 9 | attempting to crack Unix passwords with a dictionary. |
| 10 | \index{crypt(3)} |
| 11 | |
Fred Drake | 4b3f031 | 1996-12-13 22:04:31 +0000 | [diff] [blame] | 12 | \renewcommand{\indexsubitem}{(in module crypt)} |
Guido van Rossum | 5c6e373 | 1996-04-10 16:18:20 +0000 | [diff] [blame] | 13 | \begin{funcdesc}{crypt}{word\, salt} |
| 14 | \var{word} will usually be a user's password. \var{salt} is a |
| 15 | 2-character string which will be used to select one of 4096 variations |
| 16 | of DES. The characters in \var{salt} must be either \code{.}, |
| 17 | \code{/}, or an alphanumeric character. Returns the hashed password |
| 18 | as a string, which will be composed of characters from the same |
| 19 | alphabet as the salt. |
| 20 | \end{funcdesc} |
| 21 | |
| 22 | The module and documentation were written by Steve Majewski. |
| 23 | \index{Majewski, Steve} |