Python 3.3 can't import Crypt

回眸只為那壹抹淺笑 提交于 2019-12-05 16:36:43
casevh

The crypt module is an interface to the Unix crypt library which is used for encrypting Unix passwords. It is documented as not being available on Windows. It is not a general purpose cryptography library.

If all you're looking for is an implementation of crypt(3), I've knocked up a pure-Python implementation here, ported from this public domain C implementation. It's pretty damn slow (about 2800 times slower than Python's built-in crypt on my machine, which is already about half the speed of OpenSSL's DES_crypt), but if you're just calculating the occasional hash, that shouldn't really be a problem.

Are you writing an imageboard, by any chance?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!