...">

Python 3.3 can't import crypt

When I type in Crypt on the command line, it says:

>>>import crypt Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python33\lib\crypt.py", line 3, in <module> import _crypt ImportError: No module named '_crypt' 
+4
source share
2 answers

The crypt module is the interface to the Unix crypt library , which is used to encrypt Unix passwords. It is documented as not available on Windows. This is not a general-purpose cryptographic library.

+9
source

If all you need is a crypt(3) implementation, I executed a pure-Python implementation here , ported this C public domain implementation from this . It's pretty damn slow (about 2800 times slower than the Python built-in crypt on my machine, which is already about half the speed of OpenSSL DES_crypt ), but if you just calculate a random hash, that should not really be a problem.

Are you writing a graphic block, by chance?

+4
source

All Articles