CVE-2016-1000343: Weak Private Key Generation in Bouncy Castle JCE Provider
Summary
CVE-2016-1000343: In the Bouncy Castle JCE Provider version 1.55 and earlier the DSA key pair generator generates a weak private key if used with default values. Affects org.bouncycastle:bcprov-jdk14 versions < 1.56. Fixed in 1.56. How to fix ↓
Also tracked for
- bouncycastle · Debian:11
The same CVE-2016-1000343 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The Bouncy Castle JCE Provider is a Java library that provides cryptographic services. It includes implementations of various cryptographic algorithms, including DSA (Digital Signature Algorithm). The DSA key pair generator in versions 1.55 and earlier of the Bouncy Castle JCE Provider generates a weak private key when used with default values. If the key pair generator is not explicitly initialized with DSA parameters, it assumes a 1024-bit key size. This vulnerability can lead to the generation of insecure private keys.
Vulnerability Detail
The DSA key pair generator in Bouncy Castle JCE Provider versions 1.55 and earlier generates a weak private key if used with default values. This means that applications using these versions may generate insecure private keys when using the DSA algorithm. The vulnerability arises from the generator assuming a 1024-bit key size if not explicitly initialized with DSA parameters. Attackers could potentially exploit this weakness to compromise the security of cryptographic operations relying on DSA keys.
How To Fix
Latest published version: 1.86 as of 22 Oct 2026
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
1.56
This is the first release that contains the fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If upgrading to the fixed version is not immediately feasible, a workaround is to explicitly pass DSA parameters to the key pair generator. By providing appropriate parameters, the generator will not default to a 1024-bit key size and will generate secure private keys. Here is an example code snippet in Java:
DSAParameterSpec dsaParams = new DSAParameterSpec(p, q, g);
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("DSA", "BC");
keyPairGenerator.initialize(dsaParams);
KeyPair keyPair = keyPairGenerator.generateKeyPair();
Note that the values of p, q, and g should be replaced with appropriate DSA parameters.
Conclusion
The Bouncy Castle JCE Provider versions 1.55 and earlier suffer from a vulnerability in the DSA key pair generator, which generates weak private keys if used with default values. This can lead to the compromise of cryptographic operations relying on DSA keys. To mitigate this vulnerability, it is recommended to upgrade to version 1.56 or later of the Bouncy Castle JCE Provider. Alternatively, developers can apply a workaround by explicitly passing DSA parameters to the key pair generator. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for org.bouncycastle:bcprov-jdk14 →
FAQ
This vulnerability can lead to the generation of weak and insecure private keys when using the DSA algorithm in Bouncy Castle JCE Provider versions 1.55 and earlier. Attackers could potentially exploit these weak keys to compromise the security of cryptographic operations relying on DSA keys.
You can use the Vulert Playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Simply provide your pom.xml file, and Vulert will analyze your dependencies and alert you if any of them include the vulnerable versions of the Bouncy Castle JCE Provider.
Yes, the vulnerability has been fixed in version 1.56 of the Bouncy Castle JCE Provider. It is recommended to upgrade to this version or later to ensure secure private key generation.
Yes, if upgrading to the fixed version is not immediately feasible, you can apply a workaround by explicitly passing DSA parameters to the key pair generator. This will prevent the generator from defaulting to a 1024-bit key size and generate secure private keys.
There are no known exploits of this vulnerability at the moment. However, it is important to address the vulnerability promptly to prevent potential security breaches.
Related vulnerabilities
Recent vulnerabilities recorded for org.bouncycastle:bcprov-jdk14.