pycrypto
Cryptographic modules for Python.
What it is and what it does
PyCrypto is a collection of cryptographic primitives for Python, providing secure hash functions, symmetric ciphers (AES, DES), asymmetric algorithms (RSA, ElGamal), and a cryptographically secure random number generator. It was designed to make adding new cryptographic modules straightforward and was considered production-stable at release.
The package has been abandoned since 2014-06-20 and receives no maintenance. While it remains downloadable and installable, it carries four known security vulnerabilities and lacks support for modern Python versions and security practices. Installation requires a C compiler and Python development headers, adding friction to deployment.
Use it for:
- Legacy systems or applications that already depend on pycrypto and cannot be migrated to newer libraries.
- Educational projects learning cryptographic algorithms where the implementation details matter more than production security.
- Prototyping public-key algorithms in Python where arbitrary-length integer support is needed.
- Encrypting data in daemons or servers where mutual authentication between clients and servers is required.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides cryptographic hash functions (SHA256, RIPEMD160) and symmetric/asymmetric encryption algorithms (AES, DES, RSA, ElGamal) plus a cryptographically secure random number generator.
No. Do not install pycrypto for new projects. The package is abandoned, carries four known vulnerabilities (GHSA-6528-wvf6-f6qg, GHSA-cq27-v7xp-c356, PYSEC-2017-94, PYSEC-2018-97), and has not been maintained for 4438 days. High install friction compounds the risk. For legacy code only.
Install
pycrypto on PyPI
pip
pip install pycryptouv
uv add pycryptopoetry
poetry add pycryptoInstalling pycrypto
Before you install
High install friction: requires compilation of C extensions. Package is abandoned as of 2014-06-20 with no maintenance for 4438 days. Strongly consider using actively maintained alternatives instead.
License in practice
Public domain license permits unrestricted use, modification, and distribution without attribution requirements.
Quickstart
pip install pycrypto==2.6.1
from Crypto.Hash import SHA256
hash = SHA256.new()
hash.update(b'message')
print(hash.digest())
Requires C compiler and Python development headers (python-dev on Debian/Ubuntu, python2-devel on Red Hat). Will fail to build on systems without compilation tools.
Verify before relying
- Whether the 4 known vulnerabilities (GHSA-6528-wvf6-f6qg, GHSA-cq27-v7xp-c356, PYSEC-2017-94, PYSEC-2018-97) remain exploitable in version 2.6.1.
- Current status of Python 3 compatibility given the package's age and evolution since first release 2010-12-17.
- Whether compilation succeeds on modern systems with current toolchains.
- Availability of drop-in replacement packages for new projects.
Package facts
| License | Public domain (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 4,438 days since the last release |
| First released | |
| Downloads | 8,514,383/month — #1,613 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | 4 — GHSA-6528-wvf6-f6qg, GHSA-cq27-v7xp-c356, PYSEC-2017-94, PYSEC-2018-97 |
Evidence: pycrypto-2.6.1.tar.gz
Tags
More Cryptography packages
Certifi provides Mozilla's curated collection…
copyleft · top 100 on PyPI
cryptographycryptography provides cryptographic recipes and…
permissive · top 100 on PyPI
rsaPure-Python RSA encryption, decryption,…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
azure-identityProvides Microsoft Entra ID token-based…
unclear · top 1,000 on PyPI
PyNaClPyNaCl provides Python bindings to libsodium…
permissive · top 1,000 on PyPI
pycryptodomexPyCryptodomex provides low-level cryptographic…
permissive · top 1,000 on PyPI
sslcryptoProvides AES, ECIES, and ECDSA cryptographic…
unclear · top 15,000 on PyPI
pyAesCryptEncrypts and decrypts files and binary streams…
permissive · top 15,000 on PyPI
pqcryptoProvides Python bindings to post-quantum…
permissive · top 15,000 on PyPI
py3rijndaelpy3rijndael provides a pure-Python…
permissive · top 15,000 on PyPI
pysnmpcryptoProvides stronger cryptographic algorithms for…
permissive · top 15,000 on PyPI
pyaesPure-Python implementation of AES encryption…
permissive · top 5,000 on PyPI
oscryptooscrypto provides TLS sockets, key generation,…
permissive · top 1,000 on PyPI
lightpheLightPHE provides a Python library implementing…
permissive · top 15,000 on PyPI
unicryptoProvides a unified interface to cryptographic…
unclear · top 15,000 on PyPI