"""CFFI based implementation of the crypt module"""importsysimportcffiffi=cffi.FFI()ffi.cdef('char *crypt(char *word, char *salt);')try:lib=ffi.dlopen('crypt')exceptOSError:raiseImportError('crypt not available')defcrypt(word,salt):res=lib.crypt(word,salt)ifnotres:returnNonereturnffi.string(res)