1 /* cryptmodule.c - by Steve Majewski
12 static PyObject
*crypt_crypt(self
, args
)
13 PyObject
*self
, *args
;
16 extern char * crypt();
18 if (!PyArg_Parse(args
, "(ss)", &word
, &salt
)) {
21 return PyString_FromString( crypt( word
, salt
) );
25 static char crypt_crypt__doc__
[] = "\
26 crypt(word, salt) -> string\n\
27 word will usually be a user's password. salt is a 2-character string\n\
28 which will be used to select one of 4096 variations of DES. The characters\n\
29 in salt must be either \".\", \"/\", or an alphanumeric character. Returns\n\
30 the hashed password as a string, which will be composed of characters from\n\
31 the same alphabet as the salt.";
34 static PyMethodDef crypt_methods
[] = {
35 {"crypt", crypt_crypt
, 0, crypt_crypt__doc__
},
36 {NULL
, NULL
} /* sentinel */
42 Py_InitModule("crypt", crypt_methods
);