Description
PyCrypto before 2.6 does not produce appropriate prime numbers when using an ElGamal scheme to generate a key, which reduces the signature space or public key space and makes it easier for attackers to conduct brute force attacks to obtain the private key.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 6.0 | python-crypto | 2.1.0-2+squeeze1 | DSA-2502-1 |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | pycrypto | < 2.6 | 2.6 | GHSA-v367-p58w-98h5 |
Advisories 1
- DSA-2502-1 python-crypto - programming error Debian Security (DSA / DLA) · Mar 9, 2026
References
- DSA-2502 vendor-advisory
- 82279 vdb-entry
- FEDORA-2012-8470 vendor-advisory
- https://github.com/Legrandin/pycrypto/commit/9f912f13df99ad3421eff360d6a62d7dbec755c2
- MDVSA-2012:117 vendor-advisory
- 53687 vdb-entry
- https://bugs.launchpad.net/pycrypto/+bug/985164
- FEDORA-2012-8392 vendor-advisory
- 49263 third-party-advisory
- FEDORA-2012-8490 vendor-advisory
- [oss-security] 20120524 CVE-2012-2417 - PyCrypto <= 2.5 insecure ElGamal key generation mailing-list
- openSUSE-SU-2012:0830 vendor-advisory
- pycrypto-keys-weak-security(75871) vdb-entry
- https://github.com/dlitz/pycrypto/blob/373ea760f21701b162e8c4912a66928ee30d401a/ChangeLog