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