PyCryptodome is a self-contained Python package of low-level cryptographic primitives.
It supports Python 2.7, Python 3.5 and newer, and PyPy.
The installation procedure depends on the package you want the library to be in. PyCryptodome can be used as:
an almost drop-in replacement for the old PyCrypto library. You install it with:
pip install pycryptodome
In this case, all modules are installed under the Crypto
package.
One must avoid having both PyCrypto and PyCryptodome installed at the same time, as they will interfere with each other.
This option is therefore recommended only when you are sure that
the whole application is deployed in a virtualenv
.
a library independent of the old PyCrypto. You install it with:
pip install pycryptodomex
In this case, all modules are installed under the Cryptodome
package.
PyCrypto and PyCryptodome can coexist.
For faster public key operations in Unix, you should install GMP in your system.
PyCryptodome is a fork of PyCrypto. It brings the following enhancements with respect to the last official version of PyCrypto (2.6.1):
PyCryptodome is not a wrapper to a separate C library like OpenSSL. To the largest possible extent, algorithms are implemented in pure Python. Only the pieces that are extremely critical to performance (e.g. block ciphers) are implemented as C extensions.
For more information, see the homepage.
For security issues, please send an email to [email protected].
All the code can be downloaded from GitHub.