Fred Drake | 295da24 | 1998-08-10 19:42:37 +0000 | [diff] [blame] | 1 | \section{\module{crypt} --- |
Fred Drake | f6863c1 | 1999-03-02 16:37:17 +0000 | [diff] [blame^] | 2 | Function used to check \UNIX{} passwords} |
Fred Drake | b91e934 | 1998-07-23 17:59:49 +0000 | [diff] [blame] | 3 | |
Fred Drake | f6863c1 | 1999-03-02 16:37:17 +0000 | [diff] [blame^] | 4 | \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 Drake | b91e934 | 1998-07-23 17:59:49 +0000 | [diff] [blame] | 10 | |
Guido van Rossum | 5c6e373 | 1996-04-10 16:18:20 +0000 | [diff] [blame] | 11 | |
Fred Drake | e2f194b | 1998-02-17 22:24:45 +0000 | [diff] [blame] | 12 | This module implements an interface to the \manpage{crypt}{3} routine, |
Guido van Rossum | 5c6e373 | 1996-04-10 16:18:20 +0000 | [diff] [blame] | 13 | which is a one-way hash function based upon a modified DES algorithm; |
Fred Drake | f086731 | 1997-12-29 17:31:22 +0000 | [diff] [blame] | 14 | see the \UNIX{} man page for further details. Possible uses include |
Guido van Rossum | 5c6e373 | 1996-04-10 16:18:20 +0000 | [diff] [blame] | 15 | allowing Python scripts to accept typed passwords from the user, or |
Fred Drake | f086731 | 1997-12-29 17:31:22 +0000 | [diff] [blame] | 16 | attempting to crack \UNIX{} passwords with a dictionary. |
Guido van Rossum | 5c6e373 | 1996-04-10 16:18:20 +0000 | [diff] [blame] | 17 | \index{crypt(3)} |
| 18 | |
Fred Drake | cce1090 | 1998-03-17 06:33:25 +0000 | [diff] [blame] | 19 | \begin{funcdesc}{crypt}{word, salt} |
Guido van Rossum | 5c6e373 | 1996-04-10 16:18:20 +0000 | [diff] [blame] | 20 | \var{word} will usually be a user's password. \var{salt} is a |
| 21 | 2-character string which will be used to select one of 4096 variations |
Fred Drake | e2f194b | 1998-02-17 22:24:45 +0000 | [diff] [blame] | 22 | of DES\indexii{cipher}{DES}. The characters in \var{salt} must be |
Fred Drake | f6863c1 | 1999-03-02 16:37:17 +0000 | [diff] [blame^] | 23 | either \character{.}, \character{/}, or an alphanumeric character. |
| 24 | Returns the hashed password as a string, which will be composed of |
| 25 | characters from the same alphabet as the salt. |
Guido van Rossum | 5c6e373 | 1996-04-10 16:18:20 +0000 | [diff] [blame] | 26 | \end{funcdesc} |
| 27 | |
| 28 | The module and documentation were written by Steve Majewski. |
| 29 | \index{Majewski, Steve} |