PyCrypto is a collection of cryptographic modules for Python, providing algorithms like AES, RSA, and hashing functions. Its last release was 2.6.1 in 2013. The library is unmaintained and is considered insecure for modern applications due to known vulnerabilities and lack of updates. Its development has ceased, with `pycryptodome` serving as its actively maintained successor and drop-in replacement.
pip install pycryptoVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to compute an MD5 hash using PyCrypto. Please be aware that PyCrypto is an unmaintained library with known security vulnerabilities. MD5 itself is cryptographically broken and should not be used for security-critical purposes. For new projects, `pycryptodome` or `cryptography` are recommended secure alternatives.
Migrate to `pycryptodome` (a drop-in replacement with identical API) or `cryptography` for secure, actively maintained cryptographic functionalities.
For Python 3, use `pycryptodome` which is Python 3 native and provides the same API. If forced to use PyCrypto in Python 3, consider specific forks or patched versions, and ensure all necessary build tools are installed.
Transition to modern, actively maintained libraries like `pycryptodome` or `cryptography` for current and future projects to ensure security and access to up-to-date cryptographic standards.
Uninstall any potentially conflicting packages (e.g., `pip uninstall pycrypto crypto pycryptodome`) and then install the actively maintained replacement: `pip install pycryptodome`.
On Debian/Ubuntu, install `build-essential` and `python3-dev` (or `python-dev` for Python 2) with `sudo apt-get install build-essential python3-dev`. On Windows, install Microsoft Visual C++ Build Tools. As PyCrypto is unmaintained, switching to `pycryptodome` is highly recommended, as it often provides pre-built wheels that bypass compilation issues.
This issue indicates a problem with the PyCrypto installation. The most reliable solution is to uninstall PyCrypto and install PyCryptodome (`pip install pycryptodome`), which is a drop-in replacement and generally more stable.
Upgrade to `pycryptodome` which offers broader algorithm support and explicitly specify the cipher mode when creating an AES object (e.g., `from Crypto.Cipher import AES; cipher = AES.new(key, AES.MODE_GCM, nonce=nonce)`). If using `AES.new(key)`, specify `AES.MODE_ECB` if that's the desired (but insecure) mode: `AES.new(key, AES.MODE_ECB)`.
No dependency data recorded yet.