Crypto-View

hyperchain/javasdk

Cryptographic posture

212 cryptographic locations: 27 already broken, 108 quantum-vulnerable, 32 reduced-margin, 31 undetermined, 14 quantum-safe

7 establish keys, so traffic protected by them and recorded today becomes readable once the algorithm falls. 5 imported cryptographic libraries are listed separately. 346 files analysed.

Quantum-vulnerable 108 Already broken 27 Reduced margin 32 Could not be determined 31 Quantum-safe 14
To address143
Key establishment7
Inventory only5
Total findings217
What was analysed
Branch release-1.4.0
Commit f0079eefedb9e1a9e223634e17116bbf9c013a6d chore(release): 1.4.3
Committed 2022-06-21 04:39 UTC
Scanned 2026-10-23 11:19 UTC 27 days ago
Coverage 346 files, 329 java
78 test files not scanned

Earlier scans of this repository

4 scans · compare any two
0 to 200 locations Already broken 13 → 27 (up 14) Quantum-vulnerable 85 → 108 (up 23) Reduced margin 15 → 32 (up 17) Could not be determined 27 → 31 (up 4) Quantum-safe 8 → 14 (up 6) The filled point is the scan you are reading.
Scanned Commit To address Key establishment
27 days ago this scan f0079eefedb9 release-1.4.0 143 7
28 days ago f0079eefedb9 release-1.4.0 140 7 Compare
28 days ago f0079eefedb9 release-1.4.0 117 4 Compare
29 days ago f0079eefedb9 release-1.4.0 87 4 Compare

A repository is scanned again when someone asks: Run a fresh scan.

List of cryptographic assets

DES Already broken 8 places See details

Classical public-key cipher through the JCA

`Cipher.getInstance()` with a transformation whose algorithm component is a public-key or legacy symmetric cipher. The transformation string is parsed into algorithm, mode and padding, so `RSA/ECB/PKCS1Padding` is separated from `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`.

This is already unsafe today, with no quantum computer involved. A 56-bit key is brute-forced classically in hours.

What to do. For RSA encryption, move to ML-KEM-768 and keep RSA-OAEP only as the classical half of a hybrid during transition.

  1. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:51 SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
  2. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:52 SecretKey securekey = keyFactory.generateSecret(desKey);
  3. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:53 Cipher cipher = Cipher.getInstance("DES");
  4. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:55 return cipher.doFinal(content);
  5. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:83 SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
  6. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:84 SecretKey securekey = keyFactory.generateSecret(desKey);
  7. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:85 Cipher cipher = Cipher.getInstance("DES");
  8. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:87 return cipher.doFinal(content);
java.cipher · CWE-327
3DES Already broken 4 places See details

Classical public-key cipher through the JCA

`Cipher.getInstance()` with a transformation whose algorithm component is a public-key or legacy symmetric cipher. The transformation string is parsed into algorithm, mode and padding, so `RSA/ECB/PKCS1Padding` is separated from `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`.

This is already unsafe today, with no quantum computer involved. Triple DES is withdrawn by NIST and limited by its 64-bit block, independent of quantum.

What to do. For RSA encryption, move to ML-KEM-768 and keep RSA-OAEP only as the classical half of a hybrid during transition.

  1. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:142 Cipher in = Cipher.getInstance("DESede/CBC/PKCS5Padding");
  2. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:144 return in.doFinal(content);
  3. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:161 Cipher out = Cipher.getInstance("DESede/CBC/PKCS5Padding");
  4. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:163 return out.doFinal(content);
java.cipher · CWE-327
MD5 Already broken 4 places See details

Hash algorithm through the JCA

`MessageDigest.getInstance()`. MD5 and SHA-1 are reported as already broken; SHA-256 is reported as a reduced margin rather than a defect.

This is already unsafe today, with no quantum computer involved. Practical chosen-prefix collisions exist; MD5 has no remaining security as a digest.

What to do. SHA-256 as the floor, SHA-384 where the digest protects something that must remain verifiable for decades.

  1. src/main/java/cn/hyperchain/sdk/common/utils/FileExtra.java:60 MessageDigest fileMD5 = MessageDigest.getInstance("MD5");
  2. src/main/java/cn/hyperchain/sdk/common/utils/FileExtra.java:61 MessageDigest blockMD5 = MessageDigest.getInstance("MD5");
  3. src/main/java/cn/hyperchain/sdk/common/utils/FileExtra.java:65 fileMD5.update(blockMD5.digest());
  4. src/main/java/cn/hyperchain/sdk/common/utils/FileExtra.java:69 return fileMD5.digest();
java.messagedigest · CWE-328
3DES Already broken 2 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

  1. src/main/java/cn/hyperchain/sdk/account/Account.java:214 privateKey = CipherUtil.decrypt3DES(privateKey, password);
  2. src/main/java/cn/hyperchain/sdk/account/Account.java:257 privateKey = CipherUtil.encrypt3DES(privateKey, password);
code.named-call
3DES Already broken 2 places See details

Key material constructed for a named algorithm

`new SecretKeySpec(bytes, "AES")` and the other key-spec constructors name the algorithm as an argument rather than through `getInstance()`. Code that wraps raw bytes into a key this way often never calls `getInstance()` at all, so the algorithm is invisible to a scan that only looks at the factories.

This wraps raw bytes into a key for a named algorithm. It is part of the same migration as whatever uses that key.

What to do. Wherever this key is used, the same migration applies as to the call that consumes it. Trace it to the operation and treat the two together.

  1. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:140 Key key = new SecretKeySpec(keyBytes, "DESede");
  2. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:159 Key key = new SecretKeySpec(keyBytes, "DESede");
java.keyspec · CWE-327
DES Already broken 2 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

  1. src/main/java/cn/hyperchain/sdk/account/Account.java:202 privateKey = CipherUtil.decryptDES(privateKey, password);
  2. src/main/java/cn/hyperchain/sdk/account/Account.java:245 privateKey = CipherUtil.encryptDES(privateKey, password);
code.named-call
DES Already broken 2 places See details

Key material constructed for a named algorithm

`new SecretKeySpec(bytes, "AES")` and the other key-spec constructors name the algorithm as an argument rather than through `getInstance()`. Code that wraps raw bytes into a key this way often never calls `getInstance()` at all, so the algorithm is invisible to a scan that only looks at the factories.

This wraps raw bytes into a key for a named algorithm. It is part of the same migration as whatever uses that key.

What to do. Wherever this key is used, the same migration applies as to the call that consumes it. Trace it to the operation and treat the two together.

  1. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:50 DESKeySpec desKey = new DESKeySpec(password.getBytes(Utils.DEFAULT_CHARSET));
  2. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:82 DESKeySpec desKey = new DESKeySpec(password.getBytes(Utils.DEFAULT_CHARSET));
java.keyspec · CWE-327
SHA-1 Already broken 2 places See details

Hash algorithm through the JCA

`MessageDigest.getInstance()`. MD5 and SHA-1 are reported as already broken; SHA-256 is reported as a reduced margin rather than a defect.

This is already unsafe today, with no quantum computer involved. SHAttered and subsequent work produced practical collisions; NIST withdrew SHA-1 in 2030 guidance and it is already unacceptable for signatures.

What to do. SHA-256 as the floor, SHA-384 where the digest protects something that must remain verifiable for decades.

  1. src/main/java/cn/hyperchain/sdk/crypto/HashUtil.java:67 messageDigest = MessageDigest.getInstance("SHA-1");
  2. src/main/java/cn/hyperchain/sdk/crypto/HashUtil.java:69 encodeData = messageDigest.digest();
java.messagedigest · CWE-328
SHA-1 Already broken 1 place See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

  1. src/main/java/cn/hyperchain/sdk/common/utils/ProofValidation.java:105 byte[] bs = HashUtil.sha1(ByteUtil.fromHex(buffer.toString()));
code.named-call
EC Quantum-vulnerable 6 places See details

Algorithm named in a setting

A setting whose name says it holds an algorithm, given a literal that names one: `withOaepPaddingDigestAlgorithm("SHA-512")`, `signatureAlgorithm = "SHA256withRSA"`, `"digestAlgorithm": "SHA-256"`. The algorithm never reaches a `getInstance()` in this file - it is carried to one somewhere else, often through configuration - so a scan that only reads the factories cannot see it at all.

Something here is configured to use a named algorithm. The code that uses it may be somewhere else entirely, but this is the line that decides which algorithm it is.

What to do. Find what consumes the setting. The migration belongs to that operation; this line is where the choice is actually written down, and usually where it is easiest to change.

  1. src/main/java/cn/hyperchain/sdk/account/PKIAccount.java:49 if (!this.cert.getPublicKey().getAlgorithm().equals("EC")) {
  2. src/main/java/cn/hyperchain/sdk/account/PKIAccount.java:74 if (!this.cert.getPublicKey().getAlgorithm().equals("EC")) {
  3. src/main/java/cn/hyperchain/sdk/crypto/jce/ECKeyFactory.java:10 public static final String ALGORITHM = "EC";
  4. src/main/java/cn/hyperchain/sdk/crypto/jce/ECKeyPairGenerator.java:14 public static final String ALGORITHM = "EC";
  5. src/main/java/cn/hyperchain/sdk/service/impl/AccountServiceImpl.java:148 if (cert.getPublicKey().getAlgorithm().equals("EC")) {
  6. src/main/java/cn/hyperchain/sdk/service/impl/AccountServiceImpl.java:194 if (cert.getPublicKey().getAlgorithm().equals("EC")) {
config.algorithm-setting · CWE-327
ECDSA Quantum-vulnerable 6 places See details

Classical signature algorithm through the JCA

`Signature.getInstance()` with a classical algorithm. The digest and the key algorithm are split out of the JCA name, so `SHA1withRSA` reports both the broken digest and the quantum-vulnerable key.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. ML-DSA-65 (FIPS 204). Where the verifier cannot be changed, sign twice and publish both signatures.

  1. src/main/java/cn/hyperchain/sdk/crypto/cert/CertKeyPair.java:65 ecdsaSign = Signature.getInstance("SHA256withECDSA", new BouncyCastleProvider());
  2. src/main/java/cn/hyperchain/sdk/crypto/cert/CertKeyPair.java:68 byte[] signature = ecdsaSign.sign();
  3. src/main/java/cn/hyperchain/sdk/crypto/jce/ECSignatureFactory.java:10 public static final String RAW_ALGORITHM = "NONEwithECDSA";
  4. src/main/java/cn/hyperchain/sdk/crypto/jce/ECSignatureFactory.java:20 return Signature.getInstance(RAW_ALGORITHM);
  5. src/main/java/cn/hyperchain/sdk/crypto/jce/ECSignatureFactory.java:28 return Signature.getInstance(RAW_ALGORITHM, provider);
  6. src/main/java/cn/hyperchain/sdk/crypto/jce/ECSignatureFactory.java:36 return Signature.getInstance(RAW_ALGORITHM, provider);
java.signature · CWE-327
ECDSA-P256secg/secp256r1 Quantum-vulnerable 6 places See details

Elliptic-curve cryptography through BouncyCastle

A BouncyCastle elliptic-curve class. `ECDHBasicAgreement` in particular is key establishment and carries harvest-now-decrypt-later exposure.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. ML-DSA-65 for signatures, ML-KEM-768 for key establishment.

  1. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/R1Util.java:59 ECKeyPairGenerator keyGen = new ECKeyPairGenerator();
  2. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/R1Util.java:61 return keyGen.generateKeyPair();
  3. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/R1Util.java:103 ECDSASigner signer = new ECDSASigner(new HMacDSAKCalculator(new SHA256Digest()));
  4. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/R1Util.java:106 BigInteger[] components = signer.generateSignature(srcData);
  5. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/R1Util.java:159 ECDSASigner signer = new ECDSASigner();
  6. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/R1Util.java:163 return signer.verifySignature(sourceData, sign.r, sign.s);
java.bouncycastle.ec · CWE-327
Ed25519255-bitother/Ed25519 Quantum-vulnerable 6 places See details

Edwards-curve signatures through BouncyCastle

Ed25519 or Ed448 through BouncyCastle. Edwards curves are modern and well built, and Shor breaks them exactly as it breaks every other discrete-logarithm scheme.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. ML-DSA-65 (FIPS 204).

  1. src/main/java/cn/hyperchain/sdk/crypto/ed25519/ED25519Util.java:23 Ed25519Signer signer = new Ed25519Signer();
  2. src/main/java/cn/hyperchain/sdk/crypto/ed25519/ED25519Util.java:28 return signer.generateSignature();
  3. src/main/java/cn/hyperchain/sdk/crypto/ed25519/ED25519Util.java:53 Ed25519Signer signer = new Ed25519Signer();
  4. src/main/java/cn/hyperchain/sdk/crypto/ed25519/ED25519Util.java:56 return signer.verifySignature(signature);
  5. src/main/java/cn/hyperchain/sdk/service/impl/AccountServiceImpl.java:106 Ed25519KeyPairGenerator ed25519KeyPairGenerator = new Ed25519KeyPairGenerator();
  6. src/main/java/cn/hyperchain/sdk/service/impl/AccountServiceImpl.java:108 keyPair = ed25519KeyPairGenerator.generateKeyPair();
java.bouncycastle.eddsa · CWE-327
EC Quantum-vulnerable From a constant 5 places See details

Classical key pair generated through the JCA

`KeyPairGenerator.getInstance()` with a classical algorithm. The concrete family and, where an `initialize()` call is close enough to read, the key size are resolved from the source and reported on the finding.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. An elliptic-curve key pair. The source does not say whether it signs or agrees a shared secret, and the curve alone cannot: the same curve serves both.

What to do. Generate the classical key alongside an ML-KEM or ML-DSA key and carry both until relying parties accept the post-quantum one.

  1. src/main/java/cn/hyperchain/sdk/crypto/jce/ECKeyPairGenerator.java:38 INSTANCE = KeyPairGenerator.getInstance(ALGORITHM);
  2. src/main/java/cn/hyperchain/sdk/crypto/jce/ECKeyPairGenerator.java:49 return Holder.INSTANCE.generateKeyPair();
  3. src/main/java/cn/hyperchain/sdk/crypto/jce/ECKeyPairGenerator.java:54 final KeyPairGenerator gen = KeyPairGenerator.getInstance(ALGORITHM, provider);
  4. src/main/java/cn/hyperchain/sdk/crypto/jce/ECKeyPairGenerator.java:66 final KeyPairGenerator gen = KeyPairGenerator.getInstance(ALGORITHM, provider);
  5. src/main/java/cn/hyperchain/sdk/crypto/jce/ECKeyPairGenerator.java:78 final KeyPairGenerator gen = KeyPairGenerator.getInstance(ALGORITHM, provider);
java.keypairgenerator · CWE-327
SM2 Quantum-vulnerable 5 places See details

Elliptic-curve cryptography through BouncyCastle

A BouncyCastle elliptic-curve class. `ECDHBasicAgreement` in particular is key establishment and carries harvest-now-decrypt-later exposure.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer. SM2 is an elliptic-curve scheme and falls with the rest.

What to do. ML-DSA-65 for signatures, ML-KEM-768 for key establishment.

  1. src/main/java/cn/hyperchain/sdk/crypto/sm/sm2/SM2Util.java:25 public static final SM2P256V1Curve CURVE = new SM2P256V1Curve();
  2. src/main/java/cn/hyperchain/sdk/crypto/sm/sm2/SM2Util.java:72 SM2Signer signer = new SM2Signer();
  3. src/main/java/cn/hyperchain/sdk/crypto/sm/sm2/SM2Util.java:76 return signer.generateSignature();
  4. src/main/java/cn/hyperchain/sdk/crypto/sm/sm2/SM2Util.java:136 SM2Signer signer = new SM2Signer();
  5. src/main/java/cn/hyperchain/sdk/crypto/sm/sm2/SM2Util.java:139 return signer.verifySignature(signature);
java.bouncycastle.ec · CWE-327
ECsecg/secp256k1 Quantum-vulnerable 4 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

  1. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/ECKey.java:174 pub = ECKeyFactory.getInstance(SpongyCastleProvider.getInstance()).generatePublic(new ECPublicKeySpec(this.pub, CURVE_SPEC));
  2. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/ECKey.java:203 final KeyPairGenerator keyPairGen = ECKeyPairGenerator.getInstance(provider, secureRandom);
  3. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/ECKey.java:204 final KeyPair keyPair = keyPairGen.generateKeyPair();
  4. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/ECKey.java:273 return ECKeyFactory
code.named-call
ECDSA-secp256k1secg/secp256k1 Quantum-vulnerable 4 places See details

Elliptic-curve cryptography through BouncyCastle

A BouncyCastle elliptic-curve class. `ECDHBasicAgreement` in particular is key establishment and carries harvest-now-decrypt-later exposure.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer. Bitcoin-family keys are additionally exposed because public keys are published on-chain, so the attacker does not have to wait for a signature.

What to do. ML-DSA-65 for signatures, ML-KEM-768 for key establishment.

  1. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/ECKey.java:763 ECDSASigner signer = new ECDSASigner(new HMacDSAKCalculator(new SHA256Digest()));
  2. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/ECKey.java:766 BigInteger[] components = signer.generateSignature(input);
  3. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/ECKey.java:988 ECDSASigner signer = new ECDSASigner();
  4. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/ECKey.java:992 return signer.verifySignature(data, signature.r, signature.s);
java.bouncycastle.ec · CWE-327
SM2 Quantum-vulnerable 4 places See details

Classical signature algorithm through the JCA

`Signature.getInstance()` with a classical algorithm. The digest and the key algorithm are split out of the JCA name, so `SHA1withRSA` reports both the broken digest and the quantum-vulnerable key.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer. SM2 is an elliptic-curve scheme and falls with the rest.

What to do. ML-DSA-65 (FIPS 204). Where the verifier cannot be changed, sign twice and publish both signatures.

  1. src/main/java/cn/hyperchain/sdk/crypto/sm/sm2/SM2Util.java:92 Signature signature = Signature.getInstance("SM3withSM2", "BC");
  2. src/main/java/cn/hyperchain/sdk/crypto/sm/sm2/SM2Util.java:95 return signature.sign();
  3. src/main/java/cn/hyperchain/sdk/crypto/sm/sm2/SM2Util.java:107 Signature signature = Signature.getInstance("SM3withSM2", "BC");
  4. src/main/java/cn/hyperchain/sdk/crypto/sm/sm2/SM2Util.java:110 return signature.verify(encSignature);
java.signature · CWE-327
EC Quantum-vulnerable From a constant 3 places See details

Classical key material handled through the JCA

`KeyFactory.getInstance()` for a classical algorithm. This indicates the code parses or produces keys of that family, which is a migration surface even where it does no cryptography itself.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. An elliptic-curve key pair. The source does not say whether it signs or agrees a shared secret, and the curve alone cannot: the same curve serves both.

What to do. Include this code path in the inventory: it has to accept post-quantum key encodings before the keys themselves can change.

  1. src/main/java/cn/hyperchain/sdk/crypto/jce/ECKeyFactory.java:23 INSTANCE = KeyFactory.getInstance(ALGORITHM);
  2. src/main/java/cn/hyperchain/sdk/crypto/jce/ECKeyFactory.java:36 return KeyFactory.getInstance(ALGORITHM, provider);
  3. src/main/java/cn/hyperchain/sdk/crypto/jce/ECKeyFactory.java:44 return KeyFactory.getInstance(ALGORITHM, provider);
java.keyfactory · CWE-327
ECDH Quantum-vulnerable Recorded traffic From a constant 3 places See details

Classical key agreement through the JCA

`KeyAgreement.getInstance()` with ECDH, DH or XDH. Key agreement is the highest-priority class of finding: traffic recorded today is decrypted once the key exchange is broken.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. ML-KEM-768 (FIPS 203), or a hybrid X25519+ML-KEM-768 construction that keeps the classical guarantee while adding the quantum one.

  1. src/main/java/cn/hyperchain/sdk/crypto/jce/ECKeyAgreement.java:20 return KeyAgreement.getInstance(ALGORITHM);
  2. src/main/java/cn/hyperchain/sdk/crypto/jce/ECKeyAgreement.java:28 return KeyAgreement.getInstance(ALGORITHM, provider);
  3. src/main/java/cn/hyperchain/sdk/crypto/jce/ECKeyAgreement.java:36 return KeyAgreement.getInstance(ALGORITHM, provider);
java.keyagreement · CWE-327
ECDH-secp256k1secg/secp256k1 Quantum-vulnerable Recorded traffic 3 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

  1. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/ECKey.java:913 final KeyAgreement agreement = ECKeyAgreement.getInstance(this.provider);
  2. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/ECKey.java:916 ECKeyFactory.getInstance(this.provider)
  3. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/ECKey.java:919 return new BigInteger(1, agreement.generateSecret());
code.named-call
SM2 Quantum-vulnerable 3 places See details

Algorithm named in a setting

A setting whose name says it holds an algorithm, given a literal that names one: `withOaepPaddingDigestAlgorithm("SHA-512")`, `signatureAlgorithm = "SHA256withRSA"`, `"digestAlgorithm": "SHA-256"`. The algorithm never reaches a `getInstance()` in this file - it is carried to one somewhere else, often through configuration - so a scan that only reads the factories cannot see it at all.

Something here is configured to use a named algorithm. The code that uses it may be somewhere else entirely, but this is the line that decides which algorithm it is.

What to do. Find what consumes the setting. The migration belongs to that operation; this line is where the choice is actually written down, and usually where it is easiest to change.

  1. src/main/java/cn/hyperchain/sdk/crypto/cert/CertUtils.java:138 if (tmpCert.getPublicKey().getAlgorithm().equals("SM2")) {
  2. src/main/java/cn/hyperchain/sdk/crypto/cert/CertUtils.java:176 if (tmpCert.getPublicKey().getAlgorithm().equals("SM2")) {
  3. src/main/java/cn/hyperchain/sdk/crypto/cert/SM2Priv.java:21 public String getAlgorithm() {
config.algorithm-setting · CWE-327
ECsecg/secp256k1 Quantum-vulnerable 2 places See details

Algorithm named in a setting

A setting whose name says it holds an algorithm, given a literal that names one: `withOaepPaddingDigestAlgorithm("SHA-512")`, `signatureAlgorithm = "SHA256withRSA"`, `"digestAlgorithm": "SHA-256"`. The algorithm never reaches a `getInstance()` in this file - it is carried to one somewhere else, often through configuration - so a scan that only reads the factories cannot see it at all.

Something here is configured to use a named algorithm. The code that uses it may be somewhere else entirely, but this is the line that decides which algorithm it is.

What to do. Find what consumes the setting. The migration belongs to that operation; this line is where the choice is actually written down, and usually where it is easiest to change.

  1. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/ECKey.java:239 return privKey instanceof ECPrivateKey || privKey.getAlgorithm().equals("EC");
  2. src/main/java/cn/hyperchain/sdk/crypto/jce/ECAlgorithmParameters.java:12 public static final String ALGORITHM = "EC";
config.algorithm-setting · CWE-327
EC256-bitsecg/secp256k1 Quantum-vulnerable 2 places See details

Key type chosen by a setting

A named curve written as a string - `elliptic_curve="secp256r1"`, `"P-384"` in a list of accepted curves - or an RSA key size in a setting that names RSA (`rsa_key_size=2048`). The curve is reported as ECDSA where the file signs, ECDH where it agrees keys, and EC where it does both or neither.

This setting picks the kind of key the software makes.

What to do. The setting is where the key type changes; keep the list short so a post-quantum option can be added in one place.

  1. src/main/java/cn/hyperchain/sdk/crypto/jce/ECAlgorithmParameters.java:13 public static final String CURVE_NAME = "secp256k1";
  2. src/main/java/cn/hyperchain/sdk/crypto/jce/ECKeyPairGenerator.java:15 public static final String CURVE_NAME = "secp256k1";
code.curve
ECDH-secp256k1secg/secp256k1 Quantum-vulnerable 2 places See details

Elliptic-curve cryptography through BouncyCastle

A BouncyCastle elliptic-curve class. `ECDHBasicAgreement` in particular is key establishment and carries harvest-now-decrypt-later exposure.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. ML-DSA-65 for signatures, ML-KEM-768 for key establishment.

  1. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/ECKey.java:908 final ECDHBasicAgreement agreement = new ECDHBasicAgreement();
  2. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/ECKey.java:910 return agreement.calculateAgreement(new ECPublicKeyParameters(otherParty, CURVE));
java.bouncycastle.ec · CWE-327
ECDSA-secp256k1secg/secp256k1 Quantum-vulnerable 2 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

  1. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/ECKey.java:770 final Signature ecSig = ECSignatureFactory.getRawInstance(provider);
  2. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/ECKey.java:773 final byte[] derSignature = ecSig.sign();
code.named-call
SM2 Quantum-vulnerable 2 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

code.named-call
SM2oscaa/SM2 Quantum-vulnerable 2 places See details

Elliptic-curve cryptography through BouncyCastle

A BouncyCastle elliptic-curve class. `ECDHBasicAgreement` in particular is key establishment and carries harvest-now-decrypt-later exposure.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer. SM2 is an elliptic-curve scheme and falls with the rest.

What to do. ML-DSA-65 for signatures, ML-KEM-768 for key establishment.

  1. src/main/java/cn/hyperchain/sdk/crypto/sm/sm2/SM2Util.java:44 ECKeyPairGenerator keyGen = new ECKeyPairGenerator();
  2. src/main/java/cn/hyperchain/sdk/crypto/sm/sm2/SM2Util.java:46 return keyGen.generateKeyPair();
java.bouncycastle.ec · CWE-327
secp256k1256-bitsecg/secp256k1 Quantum-vulnerable From a constant 2 places See details

Named elliptic curve requested

`ECGenParameterSpec` names a curve explicitly. Every standardised prime curve is broken by Shor regardless of its size, so a larger curve is not a mitigation.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer. Bitcoin-family keys are additionally exposed because public keys are published on-chain, so the attacker does not have to wait for a signature.

What to do. ML-DSA-65 for signatures, ML-KEM-768 for key establishment.

java.eccurve · CWE-327
ECsecg/secp256k1 Quantum-vulnerable From a constant 1 place See details

Classical key material handled through the JCA

`KeyFactory.getInstance()` for a classical algorithm. This indicates the code parses or produces keys of that family, which is a migration surface even where it does no cryptography itself.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. An elliptic-curve key pair. The source does not say whether it signs or agrees a shared secret, and the curve alone cannot: the same curve serves both.

What to do. Include this code path in the inventory: it has to accept post-quantum key encodings before the keys themselves can change.

  1. src/main/java/cn/hyperchain/sdk/crypto/jce/ECAlgorithmParameters.java:26 INSTANCE = AlgorithmParameters.getInstance(ALGORITHM);
java.keyfactory · CWE-327
EC256-bitsecg/secp256r1 Quantum-vulnerable 1 place See details

Key type chosen by a setting

A named curve written as a string - `elliptic_curve="secp256r1"`, `"P-384"` in a list of accepted curves - or an RSA key size in a setting that names RSA (`rsa_key_size=2048`). The curve is reported as ECDSA where the file signs, ECDH where it agrees keys, and EC where it does both or neither.

This setting picks the kind of key the software makes.

What to do. The setting is where the key type changes; keep the list short so a post-quantum option can be added in one place.

  1. src/main/java/cn/hyperchain/sdk/crypto/jce/ECKeyPairGenerator.java:16 public static final String CURVE_NAMER1 = "secp256r1";
code.curve
EC256-bitsecg/secp256r1 Quantum-vulnerable From a constant 1 place See details

Named elliptic curve requested

`ECGenParameterSpec` names a curve explicitly. Every standardised prime curve is broken by Shor regardless of its size, so a larger curve is not a mitigation.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. An elliptic-curve key pair. The source does not say whether it signs or agrees a shared secret, and the curve alone cannot: the same curve serves both.

What to do. ML-DSA-65 for signatures, ML-KEM-768 for key establishment.

java.eccurve · CWE-327
ECDH Quantum-vulnerable Recorded traffic 1 place See details

Algorithm named in a setting

A setting whose name says it holds an algorithm, given a literal that names one: `withOaepPaddingDigestAlgorithm("SHA-512")`, `signatureAlgorithm = "SHA256withRSA"`, `"digestAlgorithm": "SHA-256"`. The algorithm never reaches a `getInstance()` in this file - it is carried to one somewhere else, often through configuration - so a scan that only reads the factories cannot see it at all.

Something here is configured to use a named algorithm. The code that uses it may be somewhere else entirely, but this is the line that decides which algorithm it is.

What to do. Find what consumes the setting. The migration belongs to that operation; this line is where the choice is actually written down, and usually where it is easiest to change.

  1. src/main/java/cn/hyperchain/sdk/crypto/jce/ECKeyAgreement.java:10 public static final String ALGORITHM = "ECDH";
config.algorithm-setting · CWE-327
ECDSA Quantum-vulnerable 1 place See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

code.named-call
ECDSA256-bitsecg/secp256r1 Quantum-vulnerable 1 place See details

Elliptic-curve cryptography through BouncyCastle

A BouncyCastle elliptic-curve class. `ECDHBasicAgreement` in particular is key establishment and carries harvest-now-decrypt-later exposure.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. ML-DSA-65 for signatures, ML-KEM-768 for key establishment.

  1. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/R1Util.java:45 X9ECParameters params = SECNamedCurves.getByName("secp256r1");
java.bouncycastle.ec · CWE-327
ECDSA Quantum-vulnerable 1 place See details

Algorithm named in a setting

A setting whose name says it holds an algorithm, given a literal that names one: `withOaepPaddingDigestAlgorithm("SHA-512")`, `signatureAlgorithm = "SHA256withRSA"`, `"digestAlgorithm": "SHA-256"`. The algorithm never reaches a `getInstance()` in this file - it is carried to one somewhere else, often through configuration - so a scan that only reads the factories cannot see it at all.

Something here is configured to use a named algorithm. The code that uses it may be somewhere else entirely, but this is the line that decides which algorithm it is.

What to do. Find what consumes the setting. The migration belongs to that operation; this line is where the choice is actually written down, and usually where it is easiest to change.

  1. src/main/java/cn/hyperchain/sdk/crypto/jce/ECSignatureFactory.java:10 public static final String RAW_ALGORITHM = "NONEwithECDSA";
config.algorithm-setting · CWE-327
SM2 Quantum-vulnerable 1 place See details

Private key read or written as PEM

`new JcaPEMKeyConverter().getPrivateKey(..)`, a `PEMKeyPair` read from a `PEMParser`, or a `JcaPKCS8Generator`. The algorithm is the key's; where every other use in the file is one key type, the finding is named for it.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer. SM2 is an elliptic-curve scheme and falls with the rest.

What to do. Find where the key file lives and how it is protected. It is re-issued when the algorithm changes.

  1. src/main/java/cn/hyperchain/sdk/crypto/cert/CertUtils.java:55 PEMKeyPair pemPair = (PEMKeyPair) pemRd.readObject();
java.private-key
SM2 Quantum-vulnerable 1 place See details

Algorithm named by its object identifier

A quoted OID from the algorithm registries: `'1.2.840.113549.1.1.11'` (sha256WithRSA), `'2.16.840.1.101.3.4.2.1'` (SHA-256), `'1.2.840.10045.3.1.7'` (P-256), `'1.2.156.10197.1.301'` (SM2). Code that builds or parses ASN.1 - PDF and CMS signing, certificate handling, PKCS#11 - names its algorithms this way, and an OID is exact.

This line names an algorithm by its registered number.

What to do. The migration belongs to the operation the OID selects; the table it sits in is usually where a post-quantum OID gets added.

  1. src/main/java/cn/hyperchain/sdk/crypto/cert/SM2Priv.java:10 public static final String SM2OID = "1.2.156.10197.1.301";
code.oid
secp256k1256-bitsecg/secp256k1 Quantum-vulnerable 1 place See details

Elliptic-curve cryptography through BouncyCastle

A BouncyCastle elliptic-curve class. `ECDHBasicAgreement` in particular is key establishment and carries harvest-now-decrypt-later exposure.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer. Bitcoin-family keys are additionally exposed because public keys are published on-chain, so the attacker does not have to wait for a signature.

What to do. ML-DSA-65 for signatures, ML-KEM-768 for key establishment.

  1. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/ECKey.java:118 X9ECParameters params = SECNamedCurves.getByName("secp256k1");
java.bouncycastle.ec · CWE-327
TLS-1.2 Quantum-vulnerable 1 place See details

TLS used in code

A TLS connection, context or setting made in code: `SSLContexts.createDefault()`, `SSLSocketFactory.getDefault()`, `setEnabledProtocols()`, `setEnabledCipherSuites()`, `startHandshake()`, Go `tls.VersionTLS12` and `tls.Dial()`, Python `ssl.create_default_context()`, Node `tls.connect()`, and version names such as `"TLSv1.2"`. Every TLS key exchange in general use is classical, so recorded traffic is exposed.

This code opens or configures an encrypted connection. Its key exchange is the part a future quantum computer breaks, which exposes traffic recorded today.

What to do. TLS 1.3 everywhere, then a hybrid group such as X25519MLKEM768 as the platform offers it.

  1. src/main/java/cn/hyperchain/sdk/common/utils/HttpsUtils.java:85 sslContext = SSLContext.getInstance("TLSv1.2");
tls.protocol · CWE-757
AES Reduced margin 4 places See details

Classical public-key cipher through the JCA

`Cipher.getInstance()` with a transformation whose algorithm component is a public-key or legacy symmetric cipher. The transformation string is parsed into algorithm, mode and padding, so `RSA/ECB/PKCS1Padding` is separated from `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`.

A quantum computer weakens this but does not break it. Increasing the key or digest size restores the margin. Grover's algorithm halves the effective strength; the parameter, not the design, is the problem. The key size was not visible at this call site, so the weaker case is assumed.

What to do. For RSA encryption, move to ML-KEM-768 and keep RSA-OAEP only as the classical half of a hybrid during transition.

  1. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:104 Cipher in = Cipher.getInstance("AES/CBC/PKCS5Padding");
  2. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:106 return in.doFinal(content);
  3. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:123 Cipher out = Cipher.getInstance("AES/CBC/PKCS5Padding");
  4. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:125 return out.doFinal(content);
java.cipher · CWE-327
SHA-256 Reduced margin 3 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

  1. src/main/java/cn/hyperchain/sdk/account/Account.java:161 if (!addressHex.equals(ByteUtil.toHex((HashUtil.sha2_256omit12(ed25519PublicKeyParameters.getEncoded()))))) {
  2. src/main/java/cn/hyperchain/sdk/crypto/HashUtil.java:54 byte[] hash = sha2_256(input);
  3. src/main/java/cn/hyperchain/sdk/service/impl/AccountServiceImpl.java:119 address = HashUtil.sha2_256omit12(publicKey);
code.named-call
SHA-256 Reduced margin 3 places See details

Hash algorithm through the JCA

`MessageDigest.getInstance()`. MD5 and SHA-1 are reported as already broken; SHA-256 is reported as a reduced margin rather than a defect.

A quantum computer weakens this but does not break it. Increasing the key or digest size restores the margin. Pre-image resistance falls to about 128 bits of quantum work. Adequate for most uses; SHA-384 restores the full margin where a signature must last decades.

What to do. SHA-256 as the floor, SHA-384 where the digest protects something that must remain verifiable for decades.

  1. src/main/java/cn/hyperchain/sdk/crypto/cert/CertKeyPair.java:65 ecdsaSign = Signature.getInstance("SHA256withECDSA", new BouncyCastleProvider());
  2. src/main/java/cn/hyperchain/sdk/crypto/HashUtil.java:44 messageDigest = MessageDigest.getInstance("SHA-256");
  3. src/main/java/cn/hyperchain/sdk/crypto/HashUtil.java:46 encodeData = messageDigest.digest();
java.messagedigest · CWE-328
SM4 Reduced margin 3 places See details

Cipher transformation named away from the call

A JCA transformation string - `algorithm/mode/padding` - written somewhere other than a `getInstance()` argument, which is how a codebase that centralises its cryptography passes the choice to a helper. The string is unambiguous wherever it appears: nothing but a transformation is spelled that way.

This names an encryption method as text, and passes it to code elsewhere that does the work. It is the same choice, made in a different place.

What to do. The same migration applies as to the call that consumes it. Move the constant and the call together, so the inventory keeps naming the algorithm after the change.

  1. src/main/java/cn/hyperchain/sdk/crypto/sm/sm4/SM4Util.java:27 public static final String ALGORITHM_NAME_CBC_PADDING = "SM4/CBC/PKCS5Padding";
  2. src/main/java/cn/hyperchain/sdk/crypto/sm/sm4/SM4Util.java:40 Cipher cipher = generateCbcCipher(ALGORITHM_NAME_CBC_PADDING, Cipher.ENCRYPT_MODE, getSM4Password(key), iv);
  3. src/main/java/cn/hyperchain/sdk/crypto/sm/sm4/SM4Util.java:65 Cipher cipher = generateCbcCipher(ALGORITHM_NAME_CBC_PADDING, Cipher.DECRYPT_MODE, getSM4Password(key), deIV);
java.transformation · CWE-327
AES Reduced margin 2 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

  1. src/main/java/cn/hyperchain/sdk/account/Account.java:208 privateKey = CipherUtil.decryptAES(privateKey, password);
  2. src/main/java/cn/hyperchain/sdk/account/Account.java:251 privateKey = CipherUtil.encryptAES(privateKey, password);
code.named-call
AES Reduced margin 2 places See details

Key material constructed for a named algorithm

`new SecretKeySpec(bytes, "AES")` and the other key-spec constructors name the algorithm as an argument rather than through `getInstance()`. Code that wraps raw bytes into a key this way often never calls `getInstance()` at all, so the algorithm is invisible to a scan that only looks at the factories.

This wraps raw bytes into a key for a named algorithm. It is part of the same migration as whatever uses that key.

What to do. Wherever this key is used, the same migration applies as to the call that consumes it. Trace it to the operation and treat the two together.

  1. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:102 Key key = new SecretKeySpec(keyBytes, "AES");
  2. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:121 Key key = new SecretKeySpec(keyBytes, "AES");
java.keyspec · CWE-327
Keccak-256 Reduced margin 2 places See details

Algorithm implemented in the repository

A class named for the algorithm it is, rather than one that calls a library: NTLM's `class MD4`, a bundled `class Sha256`, `class SCrypt`, `class Ed25519Java`. Cryptography the project carries itself is cryptography nobody else patches.

This project carries its own copy of an encryption or hashing method.

What to do. Prefer the platform's or a maintained library's implementation, and record why this one exists if it has to stay.

  1. src/main/java/cn/hyperchain/sdk/crypto/cryptohash/Keccak256.java:38 public class Keccak256 extends KeccakCore {
  2. src/main/java/cn/hyperchain/sdk/crypto/cryptohash/KeccakCore.java:38 abstract class KeccakCore extends DigestEngine {
code.implementation
Keccak-256 Reduced margin 2 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

code.named-call
Keccak-512 Reduced margin 1 place See details

Algorithm implemented in the repository

A class named for the algorithm it is, rather than one that calls a library: NTLM's `class MD4`, a bundled `class Sha256`, `class SCrypt`, `class Ed25519Java`. Cryptography the project carries itself is cryptography nobody else patches.

This project carries its own copy of an encryption or hashing method.

What to do. Prefer the platform's or a maintained library's implementation, and record why this one exists if it has to stay.

  1. src/main/java/cn/hyperchain/sdk/crypto/cryptohash/Keccak512.java:38 public class Keccak512 extends KeccakCore {
code.implementation
SM4 Reduced margin From a constant 1 place See details

Classical public-key cipher through the JCA

`Cipher.getInstance()` with a transformation whose algorithm component is a public-key or legacy symmetric cipher. The transformation string is parsed into algorithm, mode and padding, so `RSA/ECB/PKCS1Padding` is separated from `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`.

A quantum computer weakens this but does not break it. Increasing the key or digest size restores the margin. Grover's algorithm halves the effective strength; the parameter, not the design, is the problem.

What to do. For RSA encryption, move to ML-KEM-768 and keep RSA-OAEP only as the classical half of a hybrid during transition.

  1. src/main/java/cn/hyperchain/sdk/crypto/sm/sm4/SM4Util.java:75 Cipher cipher = Cipher.getInstance(algorithmName, BouncyCastleProvider.PROVIDER_NAME);
java.cipher · CWE-327
SM4 Reduced margin From a constant 1 place See details

Key material constructed for a named algorithm

`new SecretKeySpec(bytes, "AES")` and the other key-spec constructors name the algorithm as an argument rather than through `getInstance()`. Code that wraps raw bytes into a key this way often never calls `getInstance()` at all, so the algorithm is invisible to a scan that only looks at the factories.

This wraps raw bytes into a key for a named algorithm. It is part of the same migration as whatever uses that key.

What to do. Wherever this key is used, the same migration applies as to the call that consumes it. Trace it to the operation and treat the two together.

  1. src/main/java/cn/hyperchain/sdk/crypto/sm/sm4/SM4Util.java:76 Key sm4Key = new SecretKeySpec(key, ALGORITHM_NAME);
java.keyspec · CWE-327
AES-CTR Reduced margin 3 places See details

Symmetric cipher through BouncyCastle

A BouncyCastle symmetric engine or mode. Symmetric encryption is not broken by a quantum computer, so these are inventoried rather than flagged - but a complete cryptographic inventory has to contain them, and the mode is where AES-256 or a 64-bit block shows up.

This is the kind of encryption that quantum computers do not break. It is listed so the inventory is complete.

What to do. Use a 256-bit key. No change of algorithm is required unless the engine is DES, RC4 or Blowfish.

  1. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/ECKey.java:948 SICBlockCipher ctrEngine = new SICBlockCipher(engine);
  2. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/ECKey.java:958 ctrEngine.processBlock(cipher, i, out, i);
  3. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/ECKey.java:968 ctrEngine.processBlock(tmpBlock, 0, tmpBlock, 0);
java.bouncycastle.symmetric
SM3 Reduced margin 2 places See details

Hash algorithm through the JCA

`MessageDigest.getInstance()`. MD5 and SHA-1 are reported as already broken; SHA-256 is reported as a reduced margin rather than a defect.

A quantum computer weakens this but does not break it. Increasing the key or digest size restores the margin. Grover's algorithm halves the effective strength; the parameter, not the design, is the problem.

What to do. SHA-256 as the floor, SHA-384 where the digest protects something that must remain verifiable for decades.

  1. src/main/java/cn/hyperchain/sdk/crypto/sm/sm2/SM2Util.java:92 Signature signature = Signature.getInstance("SM3withSM2", "BC");
  2. src/main/java/cn/hyperchain/sdk/crypto/sm/sm2/SM2Util.java:107 Signature signature = Signature.getInstance("SM3withSM2", "BC");
java.messagedigest · CWE-328
SM3 Reduced margin 2 places See details

Digest through BouncyCastle

A BouncyCastle digest class. The digest name is read from the class, so `MD5Digest` and `SHA512Digest` are the same rule with opposite conclusions.

A quantum computer weakens this but does not break it. Increasing the key or digest size restores the margin. Grover's algorithm halves the effective strength; the parameter, not the design, is the problem.

What to do. SHA-256 as the floor, SHA-384 where the digest protects something long-lived. MD5 and SHA-1 need replacing now.

java.bouncycastle.digest · CWE-328
AES Reduced margin 1 place See details

Symmetric cipher through BouncyCastle

A BouncyCastle symmetric engine or mode. Symmetric encryption is not broken by a quantum computer, so these are inventoried rather than flagged - but a complete cryptographic inventory has to contain them, and the mode is where AES-256 or a 64-bit block shows up.

This is the kind of encryption that quantum computers do not break. It is listed so the inventory is complete.

What to do. Use a 256-bit key. No change of algorithm is required unless the engine is DES, RC4 or Blowfish.

  1. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/ECKey.java:947 AESFastEngine engine = new AESFastEngine();
java.bouncycastle.symmetric
X.509 Could not be determined 4 places See details

X.509 certificate handled in code

A certificate, signing request or revocation list loaded, parsed or created: `x509.load_pem_x509_certificate()`, `x509.ParseCertificate()`, `CertificateFactory.generateCertificate()`, `new X509Certificate()`. Certificates are the longest-lived cryptographic artefacts most systems own.

This code reads or builds a digital identity document. Its key, and how long it stays valid, decide when it has to be replaced.

What to do. Shorten certificate lifetimes now, so re-issuing with a post-quantum key is routine rather than an incident.

  1. src/main/java/cn/hyperchain/sdk/common/utils/HttpsUtils.java:123 CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
  2. src/main/java/cn/hyperchain/sdk/common/utils/HttpsUtils.java:129 keyStore.setCertificateEntry(certificateAlias, certificateFactory.generateCertificate(certificate));
  3. src/main/java/cn/hyperchain/sdk/common/utils/HttpsUtils.java:262 final CertificateFactory factory = CertificateFactory.getInstance("X.509");
  4. src/main/java/cn/hyperchain/sdk/common/utils/HttpsUtils.java:263 return (X509Certificate) factory.generateCertificate(new ByteArrayInputStream(certBytes));
x509.certificate
PKCS12 Could not be determined 3 places See details

Key store holding classical key material

`KeyStore.getInstance("JKS"|"PKCS12"|"BCFKS")`. The store format itself is not the issue; it is the inventory point where the classical private keys of this application live.

This is the application's key cupboard. It is worth knowing what is in it before planning any replacement.

What to do. Record which keys this store holds. A key store is where a migration either happens or silently does not.

  1. src/main/java/cn/hyperchain/sdk/crypto/cert/CertUtils.java:102 KeyStore ks = KeyStore.getInstance("PKCS12", "BC");
  2. src/main/java/cn/hyperchain/sdk/crypto/cert/CertUtils.java:130 KeyStore ks = KeyStore.getInstance("PKCS12");
  3. src/main/java/cn/hyperchain/sdk/crypto/cert/CertUtils.java:168 KeyStore ks = KeyStore.getInstance("PKCS12");
java.keystore
X.509 Could not be determined 2 places See details

Certificate signed or verified

A certificate or signing request is signed - `x509.CreateCertificate()`, a pyca `builder.sign()`, a Bouncy Castle `certBuilder.build(signer)` - or its signature or chain is checked: `CheckSignature()`, `Verify(x509.VerifyOptions{})`, `CertPathValidator`, `is_signature_valid`. The algorithm is the signing key's.

This code puts a signature on a digital identity document, or checks one.

What to do. Find the key behind the signature. Issuing certificates is where an ML-DSA key eventually goes, and the relying parties that verify them have to accept it first.

  1. src/main/java/cn/hyperchain/sdk/common/utils/HttpsUtils.java:140 trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
  2. src/main/java/cn/hyperchain/sdk/common/utils/HttpsUtils.java:177 TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
x509.signature
JKS Could not be determined 1 place See details

Key store holding classical key material

`KeyStore.getInstance("JKS"|"PKCS12"|"BCFKS")`. The store format itself is not the issue; it is the inventory point where the classical private keys of this application live.

This is the application's key cupboard. It is worth knowing what is in it before planning any replacement.

What to do. Record which keys this store holds. A key store is where a migration either happens or silently does not.

  1. src/main/java/cn/hyperchain/sdk/common/utils/HttpsUtils.java:215 final KeyStore keystore = KeyStore.getInstance("JKS");
java.keystore
KeyStore Could not be determined 1 place See details

Key store holding classical key material

`KeyStore.getInstance("JKS"|"PKCS12"|"BCFKS")`. The store format itself is not the issue; it is the inventory point where the classical private keys of this application live.

This is the application's key cupboard. It is worth knowing what is in it before planning any replacement.

What to do. Record which keys this store holds. A key store is where a migration either happens or silently does not.

  1. src/main/java/cn/hyperchain/sdk/common/utils/HttpsUtils.java:124 KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
java.keystore
CSPRNG Quantum-safe 11 places See details

Random number generation

`SecureRandom`. A platform CSPRNG is not a quantum exposure; it is recorded because an inventory that omits the randomness source is incomplete. `SHA1PRNG` is named explicitly where it appears, since it is a legacy algorithm even though its output is adequate.

This is where the software gets its random numbers. Quantum computers do not weaken it.

What to do. No action. Prefer the platform default over naming an algorithm.

  1. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:49 SecureRandom random = new SecureRandom();
  2. src/main/java/cn/hyperchain/sdk/crypto/CipherUtil.java:81 SecureRandom random = new SecureRandom();
  3. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/ECKey.java:122 secureRandom = new SecureRandom();
  4. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/R1Util.java:49 secureRandom = new SecureRandom();
  5. src/main/java/cn/hyperchain/sdk/crypto/ed25519/ED25519Util.java:24 CipherParameters param = new ParametersWithRandom(keyPair.getPrivate(), new SecureRandom());
  6. src/main/java/cn/hyperchain/sdk/crypto/sm/sm2/SM2Util.java:42 SecureRandom random = new SecureRandom();
  7. src/main/java/cn/hyperchain/sdk/crypto/sm/sm2/SM2Util.java:73 CipherParameters param = new ParametersWithRandom(keyPair.getPrivate(), new SecureRandom());
  8. src/main/java/cn/hyperchain/sdk/crypto/sm/sm4/SM4Util.java:83 Random random = SecureRandom.getInstance("SHA1PRNG");
  9. src/main/java/cn/hyperchain/sdk/crypto/sm/sm4/SM4Util.java:85 random.nextBytes(result);
  10. src/main/java/cn/hyperchain/sdk/service/impl/AccountServiceImpl.java:99 ecKey = new ECKey(new SecureRandom());
  11. src/main/java/cn/hyperchain/sdk/service/impl/AccountServiceImpl.java:107 ed25519KeyPairGenerator.init(new Ed25519KeyGenerationParameters(new SecureRandom()));
java.rng
HMAC-SHA256 Quantum-safe 2 places See details

Message authentication code through BouncyCastle

A BouncyCastle MAC: `HMac` over a digest, `CMac` or `GMac` over a block cipher, `Poly1305`. The digest or cipher it is built on is read from the construction, so `new HMac(new SHA256Digest())` is HMAC-SHA-256.

This checks that data has not been tampered with. Quantum computers do not break it.

What to do. No change of algorithm is needed; keep keys at 256 bits.

  1. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/ECKey.java:763 ECDSASigner signer = new ECDSASigner(new HMacDSAKCalculator(new SHA256Digest()));
  2. src/main/java/cn/hyperchain/sdk/crypto/ecdsa/R1Util.java:103 ECDSASigner signer = new ECDSASigner(new HMacDSAKCalculator(new SHA256Digest()));
java.bouncycastle.mac

Cryptographic assets

Algorithm Assessment What it means Occurrences
EC Quantum-vulnerable An elliptic-curve key pair. The source does not say whether it signs or agrees a shared secret, and the curve alone cannot: the same curve serves both. 25
unknown Could not be determined The algorithm could not be established from the source - chosen at runtime, or decided somewhere this scan does not reach. 25
RSA Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. 24
SM2 Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. SM2 is an elliptic-curve scheme and falls with the rest. 18
ECDSA Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. 15
AES Reduced margin Grover's algorithm halves the effective strength; the parameter, not the design, is the problem. The key size was not visible at this call site, so the weaker case is assumed. 12
DES Already broken A 56-bit key is brute-forced classically in hours. 12
CSPRNG Quantum-safe A cryptographically secure random number generator provided by the platform. Not weakened by a quantum computer. 11
ECDH Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. 9
secp256k1 Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. Bitcoin-family keys are additionally exposed because public keys are published on-chain, so the attacker does not have to wait for a signature. 9
3DES Already broken Triple DES is withdrawn by NIST and limited by its 64-bit block, independent of quantum. 8
X.509 Could not be determined An X.509 certificate, signing request or revocation list, or a signature over one. The algorithm is the key's, which this code does not name. 6
Ed25519 Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. 6
SHA-256 Reduced margin Pre-image resistance falls to about 128 bits of quantum work. Adequate for most uses; SHA-384 restores the full margin where a signature must last decades. 6
SM4 Reduced margin Grover's algorithm halves the effective strength; the parameter, not the design, is the problem. 5
Keccak-256 Reduced margin Grover's algorithm halves the effective strength; the parameter, not the design, is the problem. 5
MD5 Already broken Practical chosen-prefix collisions exist; MD5 has no remaining security as a digest. 4
SM3 Reduced margin Grover's algorithm halves the effective strength; the parameter, not the design, is the problem. 4
SHA-1 Already broken SHAttered and subsequent work produced practical collisions; NIST withdrew SHA-1 in 2030 guidance and it is already unacceptable for signatures. 3
TLS Quantum-vulnerable Every TLS cipher suite in general use negotiates a classical key exchange, so a recorded session is decryptable once that exchange falls. 2
HMAC Quantum-safe A keyed MAC is not affected by Shor and only marginally by Grover. 2
ML-KEM-768 Quantum-safe No known quantum algorithm changes the security margin. 1

Imported cryptographic libraries

Library Files
org.bouncycastle BouncyCastle, whose low-level API bypasses the JCA algorithm strings. It has shipped ML-KEM and ML-DSA since 1.79 24
javax.net.ssl the TLS client and server 1
java.security the JCA 21
org.bouncycastle.pqc BouncyCastle's post-quantum algorithms 1