Crypto-View

andy-goryachev/PasswordSafe

Cryptographic posture

181 cryptographic locations: 4 already broken, 22 quantum-vulnerable, 23 reduced-margin, 23 undetermined, 109 quantum-safe

11 establish keys, so traffic protected by them and recorded today becomes readable once the algorithm falls. 701 files analysed.

Quantum-vulnerable 22 Already broken 4 Reduced margin 23 Could not be determined 23 Quantum-safe 109
To address23
Key establishment11
Inventory only0
Total findings181
What was analysed
Branch master
Commit 3e58901fcc4130d2423e7aeeace541999cfd6937 2023.0720.2241
Committed 2023-07-21 05:46 UTC
Scanned 2026-10-22 16:06 UTC 28 days ago
Coverage 701 files, 686 java
12 test files not scanned

Earlier scans of this repository

4 scans · compare any two
0 to 200 locations Already broken 0 → 4 (up 4) Quantum-vulnerable 24 → 22 (down 2) Reduced margin 22 → 27 (up 5) Could not be determined 22 → 21 (down 1) Quantum-safe 69 → 105 (up 36) The filled point is the scan you are reading.
Scanned Commit To address Key establishment
27 days ago 3e58901fcc41 master 25 11 Compare
28 days ago this scan 3e58901fcc41 master 23 11
28 days ago 3e58901fcc41 master 22 11 Compare
29 days ago 3e58901fcc41 master 12 12 Compare

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

List of cryptographic assets

RSAES-PKCS1 Already broken Recorded traffic 4 places See details

RSA through the BouncyCastle low-level API

A BouncyCastle RSA engine or key-pair generator. These classes bypass the JCA algorithm strings, so they are invisible to a scan that only reads `getInstance()` arguments.

This is already unsafe today, with no quantum computer involved. PKCS#1 v1.5 encryption padding is vulnerable to Bleichenbacher oracles today, and the underlying RSA is broken by Shor.

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

  1. src/goryachev/crypto/Crypto.java:330 PKCS1Encoding rsa = new PKCS1Encoding(new RSAEngine());
  2. src/goryachev/crypto/Crypto.java:336 byte[] encrypted = rsa.processBlock(k, 0, k.length);
  3. src/goryachev/crypto/Crypto.java:348 PKCS1Encoding rsa = new PKCS1Encoding(new RSAEngine());
  4. src/goryachev/crypto/Crypto.java:351 byte[] decrypted = rsa.processBlock(b, 0, b.length);
java.bouncycastle.rsa · CWE-327
RSA Quantum-vulnerable Recorded traffic 5 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/goryachev/crypto/Crypto.java:146 return new RSAPublicKey(k.getModulus(), k.getPublicExponent());
  2. src/goryachev/crypto/Crypto.java:160 return new RSAPrivateKey
  3. src/goryachev/crypto/Crypto.java:176 return new RSAPublicKey(k.getModulus(), k.getExponent());
  4. src/goryachev/crypto/Crypto.java:201 RSAPrivateKey k = RSAPrivateKey.getInstance(x);
  5. src/goryachev/crypto/Crypto.java:228 RSAPublicKey k = RSAPublicKey.getInstance(x);
code.named-call
RSASSA-PKCS1-SHA256 Quantum-vulnerable 4 places See details

RSA through the BouncyCastle low-level API

A BouncyCastle RSA engine or key-pair generator. These classes bypass the JCA algorithm strings, so they are invisible to a scan that only reads `getInstance()` arguments.

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. The v1.5 signature scheme of RFC 8017 section 8.2 has no classical break of its own; RSA-PSS is preferred for new work, but the quantum exposure is the same for both.

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

  1. src/goryachev/crypto/Crypto.java:308 RSADigestSigner signer = new RSADigestSigner(new SHA256Digest());
  2. src/goryachev/crypto/Crypto.java:311 if(!signer.verifySignature(sig))
  3. src/goryachev/crypto/Crypto.java:321 RSADigestSigner signer = new RSADigestSigner(new SHA256Digest());
  4. src/goryachev/crypto/Crypto.java:324 return signer.generateSignature();
java.bouncycastle.rsa · CWE-327
RSA Quantum-vulnerable Recorded traffic 2 places See details

RSA through the BouncyCastle low-level API

A BouncyCastle RSA engine or key-pair generator. These classes bypass the JCA algorithm strings, so they are invisible to a scan that only reads `getInstance()` arguments.

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 for encryption, ML-DSA-65 for signatures.

  1. src/goryachev/crypto/Crypto.java:294 RSAKeyPairGenerator g = new RSAKeyPairGenerator();
  2. src/goryachev/crypto/Crypto.java:297 AsymmetricCipherKeyPair kp = g.generateKeyPair();
java.bouncycastle.rsa · CWE-327
PBKDF2 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/goryachev/memsafecrypto/bc/SCrypt.java:81 CByteArray bytes = SingleIterationPBKDF2(P, S, p * MFLenBytes);
  2. src/goryachev/memsafecrypto/bc/SCrypt.java:112 return SingleIterationPBKDF2(P, bytes, dkLen);
code.named-call
SHA-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.

  1. src/goryachev/common/util/GUID.java:21 CDigest d = CDigest.sha256();
  2. src/goryachev/common/util/GUID.java:52 CDigest d = CDigest.sha256();
code.named-call
SHA-256 Reduced margin 1 place 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/goryachev/common/util/CDigest.java:22 IMessageDigest md = IMessageDigest.getInstance("SHA-256");
java.messagedigest · CWE-328
SHA-256 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.

code.implementation
AES-EAX Reduced margin 12 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/goryachev/crypto/eax/EAXCipher.java:21 EAXBlockCipher cipher = new EAXBlockCipher(new AESEngine());
  2. src/goryachev/crypto/eax/EAXCipher.java:33 cipher.doFinal(out, off);
  3. src/goryachev/crypto/eax/EAXCipher.java:46 EAXBlockCipher cipher = new EAXBlockCipher(new AESEngine());
  4. src/goryachev/crypto/eax/EAXCipher.java:58 cipher.doFinal(out, off);
  5. src/goryachev/crypto/eax/EAXDecryptStream.java:36 this.cipher = new EAXBlockCipher(new AESEngine());
  6. src/goryachev/crypto/eax/EAXDecryptStream.java:111 int n = cipher.doFinal(out, 0);
  7. src/goryachev/crypto/eax/EAXEncryptStream.java:31 this.cipher = new EAXBlockCipher(new AESEngine());
  8. src/goryachev/crypto/eax/EAXEncryptStream.java:76 int n = cipher.doFinal(out, 0);
  9. src/goryachev/crypto/MemCrypt.java:33 EAXBlockCipher cipher = new EAXBlockCipher(new AESEngine());
  10. src/goryachev/crypto/MemCrypt.java:51 cipher.doFinal(out, off);
  11. src/goryachev/crypto/MemCrypt.java:64 EAXBlockCipher cipher = new EAXBlockCipher(new AESEngine());
  12. src/goryachev/crypto/MemCrypt.java:80 cipher.doFinal(out, off);
java.bouncycastle.symmetric
SHA-256 Reduced margin 4 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. 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 long-lived. MD5 and SHA-1 need replacing now.

  1. src/goryachev/crypto/Crypto.java:308 RSADigestSigner signer = new RSADigestSigner(new SHA256Digest());
  2. src/goryachev/crypto/Crypto.java:321 RSADigestSigner signer = new RSADigestSigner(new SHA256Digest());
  3. src/goryachev/crypto/MemCrypt.java:94 SHA256Digest d = new SHA256Digest();
  4. src/goryachev/crypto/MemCrypt.java:103 d.doFinal(b, 0);
java.bouncycastle.digest · CWE-328
PBKDF2-HMAC-SHA256 Reduced margin 1 place See details

Password hashing or key derivation

A `SecretKeyFactory` for PBKDF2, or a BouncyCastle password KDF. Not a quantum exposure, and part of a complete inventory.

This is how passwords are stored. Quantum computers do not meaningfully weaken it.

What to do. PBKDF2 needs a high iteration count. Argon2 through BouncyCastle is stronger.

  1. src/goryachev/memsafecrypto/bc/SCrypt.java:124 PKCS5S2ParametersGenerator pGen = new PKCS5S2ParametersGenerator(new SHA256Digest());
java.kdf
unknown Could not be determined 2 places See details

Algorithm chosen at runtime

`KeyPairGenerator.getInstance(x)`, `Mac.getInstance(lookup(key))` and the other JCA factories, where the argument is a variable or a call. The algorithm cannot be resolved without running the program, so this is reported as an unknown rather than assumed to be classical; what the factory does - sign, tag, digest - is still reported, and so are the lines that use the object.

This code picks its encryption method while it runs, so a scan cannot tell which one it ends up using. Somebody has to check the configuration.

What to do. Trace the value to its configuration source and record the concrete algorithm in the cryptographic inventory by hand.

  1. src/goryachev/common/util/api/IMessageDigest.java:32 MessageDigest md = MessageDigest.getInstance(algorithm);
  2. src/goryachev/common/util/api/IMessageDigest.java:56 return md.digest();
java.keypairgenerator.variable · CWE-327
XSalsa20 Quantum-safe 26 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/goryachev/memsafecrypto/salsa/XSalsa20Poly1305DecryptStream.java:29 private XSalsa20Engine xsalsa20 = new XSalsa20Engine();
  2. src/goryachev/memsafecrypto/salsa/XSalsa20Poly1305DecryptStream.java:66 xsalsa20.processBytes(subkey, 0, subkey.length(), subkey, 0);
  3. src/goryachev/memsafecrypto/salsa/XSalsa20Poly1305DecryptStream.java:154 xsalsa20.processBytes(buf, 0, rd, out, 0);
  4. src/goryachev/memsafecrypto/salsa/XSalsa20Poly1305EncryptStream.java:21 private XSalsa20Engine engine = new XSalsa20Engine();
  5. src/goryachev/memsafecrypto/salsa/XSalsa20Poly1305EncryptStream.java:58 engine.processBytes(subkey, 0, XSalsaTools.KEY_LENGTH_BYTES, subkey, 0);
  6. src/goryachev/memsafecrypto/salsa/XSalsa20Poly1305EncryptStream.java:80 engine.processBytes(out, 0, 1, out, 1);
  7. src/goryachev/memsafecrypto/salsa/XSalsa20Poly1305EncryptStream.java:92 engine.processBytes(b, off + pos, sz, out, 0);
  8. src/goryachev/memsafecrypto/salsa/XSalsaOutputStream.java:33 this.engine = new XSalsa20Engine();
  9. src/goryachev/memsafecrypto/salsa/XSalsaOutputStream.java:64 engine.processBytes(buf, off + offset, sz, buffer, 0);
  10. src/goryachev/memsafecrypto/salsa/XSalsaRandomAccessFile.java:41 this.engine = new XSalsa20Engine();
  11. src/goryachev/memsafecrypto/salsa/XSalsaRandomAccessFile.java:71 engine.processBytes(buffer, 0, rd, buf, off);
  12. src/goryachev/memsafecrypto/salsa/XSalsaRandomAccessFile.java:180 engine.processBytes(buf, off + offset, sz, buffer, 0);
  13. src/goryachev/memsafecrypto/salsa/XSalsaTools.java:29 XSalsa20Engine engine = new XSalsa20Engine();
  14. src/goryachev/memsafecrypto/salsa/XSalsaTools.java:50 engine.processBytes(input, 0, length, out, offset);
  15. src/goryachev/memsafecrypto/salsa/XSalsaTools.java:67 XSalsa20Engine engine = new XSalsa20Engine();
  16. src/goryachev/memsafecrypto/salsa/XSalsaTools.java:88 engine.processBytes(cleartext, 0, cleartext.length(), out, outOffset);
  17. src/goryachev/memsafecrypto/salsa/XSalsaTools.java:105 XSalsa20Engine engine = new XSalsa20Engine();
  18. src/goryachev/memsafecrypto/salsa/XSalsaTools.java:126 engine.processBytes(input, offset, length, out, 0);
  19. src/goryachev/memsafecrypto/salsa/XSalsaTools.java:143 XSalsa20Engine engine = new XSalsa20Engine();
  20. src/goryachev/memsafecrypto/salsa/XSalsaTools.java:165 engine.processBytes(ciphertext, offset, length, dec, 0);
  21. src/goryachev/memsafecrypto/salsa/XSalsaTools.java:190 XSalsa20Engine engine = new XSalsa20Engine();
  22. src/goryachev/memsafecrypto/salsa/XSalsaTools.java:217 engine.processBytes(subkey, 0, KEY_LENGTH_BYTES, subkey, 0);
  23. src/goryachev/memsafecrypto/salsa/XSalsaTools.java:235 engine.processBytes(input, inputOffset, inputLength, out, 0);
  24. src/goryachev/memsafecrypto/salsa/XSalsaTools.java:267 XSalsa20Engine engine = new XSalsa20Engine();
  25. src/goryachev/memsafecrypto/salsa/XSalsaTools.java:294 engine.processBytes(subkey, 0, subkey.length(), subkey, 0);
  26. src/goryachev/memsafecrypto/salsa/XSalsaTools.java:315 engine.processBytes(input, inputOffset, len, out, 0);
java.bouncycastle.symmetric
BLAKE2b Quantum-safe 17 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.

No known quantum attack changes how strong this is. No known quantum algorithm changes the security margin.

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

  1. src/goryachev/memsafecrypto/bc/Argon2BytesGenerator.java:433 Blake2bDigest blake = new Blake2bDigest(outLen * 8);
  2. src/goryachev/memsafecrypto/bc/Argon2BytesGenerator.java:437 blake.doFinal(out, outOff);
  3. src/goryachev/memsafecrypto/bc/Argon2BytesGenerator.java:441 Blake2bDigest digest = new Blake2bDigest(blake2bLength * 8);
  4. src/goryachev/memsafecrypto/bc/Argon2BytesGenerator.java:447 digest.doFinal(outBuffer, 0);
  5. src/goryachev/memsafecrypto/bc/Argon2BytesGenerator.java:459 digest.doFinal(outBuffer, 0);
  6. src/goryachev/memsafecrypto/bc/Argon2BytesGenerator.java:467 digest = new Blake2bDigest(lastLength * 8);
  7. src/goryachev/memsafecrypto/bc/Argon2BytesGenerator.java:470 digest.doFinal(out, outPos);
  8. src/goryachev/memsafecrypto/bc/Argon2BytesGenerator.java:541 Blake2bDigest blake = new Blake2bDigest(ARGON2_PREHASH_DIGEST_LENGTH * 8);
  9. src/goryachev/memsafecrypto/bc/Argon2BytesGenerator.java:578 blake.doFinal(initialHashWithZeros, 0);
  10. src/goryachev/memsafecrypto/CDigestBlake2b.java:33 this.digest = new Blake2bDigest(bits);
  11. src/goryachev/memsafecrypto/CDigestBlake2b.java:58 digest.doFinal(out, 0);
  12. src/goryachev/memsafecrypto/util/MemCrypt.java:75 Blake2bDigest d = new Blake2bDigest(XSalsaTools.KEY_LENGTH_BYTES * 8);
  13. src/goryachev/memsafecrypto/util/MemCrypt.java:86 d.doFinal(b, 0);
  14. src/goryachev/password/data/v3/EncryptionHandlerV3.java:233 Blake2bDigest d = new Blake2bDigest(NONCE_SIZE_BYTES * 8);
  15. src/goryachev/password/data/v3/EncryptionHandlerV3.java:237 d.doFinal(out, 0);
  16. src/goryachev/password/data/v4/EncryptionHandlerV4.java:238 Blake2bDigest d = new Blake2bDigest(NONCE_SIZE_BYTES * 8);
  17. src/goryachev/password/data/v4/EncryptionHandlerV4.java:242 d.doFinal(out, 0);
java.bouncycastle.digest · CWE-328
CSPRNG Quantum-safe 13 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/goryachev/common/util/GUID.java:50 new SecureRandom().nextBytes(b);
  2. src/goryachev/crypto/Crypto.java:291 SecureRandom rnd = new SecureRandom();
  3. src/goryachev/crypto/EntropyGathererBase.java:40 jvmRandom = new SecureRandom();
  4. src/goryachev/crypto/EntropyGathererBase.java:58 random.addSeedMaterial(jvmRandom.generateSeed(256));
  5. src/goryachev/crypto/EntropyGathererBase.java:63 random.addSeedMaterial(jvmRandom.nextLong());
  6. src/goryachev/crypto/EntropyGathererBase.java:144 return new SecureRandom(spi, provider) { };
  7. src/goryachev/crypto/MemCrypt.java:36 new SecureRandom().nextBytes(nonce);
  8. src/goryachev/crypto/MemCrypt.java:123 return new SecureRandom().nextInt() & 0xff;
  9. src/goryachev/memsafecrypto/bc/CryptoServicesRegistrar.java:34 SecureRandom tmp = new SecureRandom();
  10. src/goryachev/memsafecrypto/CRandomSpi.java:28 SecureRandom r = new SecureRandom();
  11. src/goryachev/memsafecrypto/CRandomSpi.java:29 generator.addSeedMaterial(r.generateSeed(256));
  12. src/goryachev/memsafecrypto/util/MemCrypt.java:31 CUtils.nextBytes(new SecureRandom(), nonce);
  13. src/goryachev/memsafecrypto/util/MemCrypt.java:107 return new SecureRandom().nextInt() & 0xff;
java.rng
Poly1305 Quantum-safe 8 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.

java.bouncycastle.mac
Argon2 Quantum-safe 6 places See details

Password hashing or key derivation

A `SecretKeyFactory` for PBKDF2, or a BouncyCastle password KDF. Not a quantum exposure, and part of a complete inventory.

This is how passwords are stored. Quantum computers do not meaningfully weaken it.

What to do. PBKDF2 needs a high iteration count. Argon2 through BouncyCastle is stronger.

  1. src/goryachev/password/data/v4/EncryptionHandlerV4.java:87 Argon2Parameters mp = new Argon2Parameters.Builder(ARGON_TYPE).
  2. src/goryachev/password/data/v4/EncryptionHandlerV4.java:98 Argon2BytesGenerator ms = new Argon2BytesGenerator();
  3. src/goryachev/password/data/v4/EncryptionHandlerV4.java:100 ms.generateBytes(pw, key);
  4. src/goryachev/password/data/v4/EncryptionHandlerV4.java:176 Argon2Parameters mp = new Argon2Parameters.Builder(ARGON_TYPE).
  5. src/goryachev/password/data/v4/EncryptionHandlerV4.java:187 Argon2BytesGenerator ms = new Argon2BytesGenerator();
  6. src/goryachev/password/data/v4/EncryptionHandlerV4.java:189 ms.generateBytes(pw, key);
java.kdf
HMAC Quantum-safe 6 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.

java.bouncycastle.mac
DRBG Quantum-safe 5 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/goryachev/crypto/EntropyGathererBase.java:42 random = new DigestRandomGenerator(new SHA512Digest());
  2. src/goryachev/crypto/EntropyGathererBase.java:70 random.nextBytes(bytes);
  3. src/goryachev/memsafecrypto/CRandomSpi.java:25 generator = new DigestRandomGenerator(new Blake2bDigest(512));
  4. src/goryachev/memsafecrypto/CRandomSpi.java:66 generator.nextBytes(bytes);
  5. src/goryachev/memsafecrypto/CRandomSpi.java:72 generator.nextBytes(bytes);
java.rng
XSalsa20-Poly1305 Quantum-safe 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/goryachev/password/data/v3/EncryptionHandlerV3.java:101 CByteArray enc = XSalsaTools.encryptXSalsa20Poly1305(key, CByteArray.readOnly(nonce), container);
  2. src/goryachev/password/data/v3/EncryptionHandlerV3.java:188 CByteArray decrypted = XSalsaTools.decryptXSalsa20Poly1305(key, CByteArray.readOnly(nonce), input);
  3. src/goryachev/password/data/v4/EncryptionHandlerV4.java:102 CByteArray enc = XSalsaTools.encryptXSalsa20Poly1305(key, CByteArray.readOnly(nonce), container);
  4. src/goryachev/password/data/v4/EncryptionHandlerV4.java:193 CByteArray decrypted = XSalsaTools.decryptXSalsa20Poly1305(key, CByteArray.readOnly(nonce), input);
code.named-call
scrypt Quantum-safe From a constant 4 places See details

Password hashing or key derivation

A `SecretKeyFactory` for PBKDF2, or a BouncyCastle password KDF. Not a quantum exposure, and part of a complete inventory.

This is how passwords are stored. Quantum computers do not meaningfully weaken it.

What to do. PBKDF2 needs a high iteration count. Argon2 through BouncyCastle is stronger.

  1. src/goryachev/password/data/v2/EncryptionHandlerV2.java:86 CByteArray key = SCrypt.generate(pw, salt, n, r, p, KEY_SIZE_BYTES);
  2. src/goryachev/password/data/v2/EncryptionHandlerV2.java:174 CByteArray key = SCrypt.generate(pw, salt, n, r, p, KEY_SIZE_BYTES);
  3. src/goryachev/password/data/v3/EncryptionHandlerV3.java:98 CByteArray key = SCrypt.generate(pw, salt, n, r, p, KEY_SIZE_BYTES);
  4. src/goryachev/password/data/v3/EncryptionHandlerV3.java:183 CByteArray key = SCrypt.generate(pw, salt, n, r, p, KEY_SIZE_BYTES);
java.kdf
Argon2id Quantum-safe 2 places See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

  1. src/goryachev/memsafecrypto/bc/Argon2BytesGenerator.java:263 parameters.getType() == Argon2Parameters.ARGON2_id &&
  2. src/goryachev/password/data/v4/EncryptionHandlerV4.java:40 public static final int ARGON_TYPE = Argon2Parameters.ARGON2_id;
code.algorithm-constant
Poly1305 Quantum-safe 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.

code.implementation
SHA-512 Quantum-safe 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.

No known quantum attack changes how strong this is. No known quantum algorithm changes the security margin.

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

  1. src/goryachev/common/util/CDigest.java:29 IMessageDigest md = IMessageDigest.getInstance("SHA-512");
  2. src/goryachev/password/data/DataFile.java:12 public static final String ALGORITHM_HASH = "SHA-512";
java.messagedigest · CWE-328
XSalsa20 Quantum-safe 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/goryachev/memsafecrypto/util/MemCrypt.java:38 XSalsaTools.encryptXSalsa20(key, nonce, data, out, XSalsaTools.NONCE_LENGTH_BYTES, data.length());
  2. src/goryachev/memsafecrypto/util/MemCrypt.java:61 XSalsaTools.decryptXSalsa20(key, nonce, XSalsaTools.NONCE_LENGTH_BYTES, decryptedLength, data, out);
code.named-call
Argon2 Quantum-safe 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.

code.implementation
Argon2i Quantum-safe 1 place See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

  1. src/goryachev/memsafecrypto/bc/Argon2BytesGenerator.java:261 (parameters.getType() == Argon2Parameters.ARGON2_i) ||
code.algorithm-constant
BLAKE2b Quantum-safe 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.

code.implementation
BLAKE2b Quantum-safe 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
BLAKE2b-512 Quantum-safe 1 place 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.

No known quantum attack changes how strong this is. No known quantum algorithm changes the security margin.

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

  1. src/goryachev/memsafecrypto/CRandomSpi.java:25 generator = new DigestRandomGenerator(new Blake2bDigest(512));
java.bouncycastle.digest · CWE-328
HKDF Quantum-safe 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.

code.implementation
HMAC Quantum-safe 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.

code.implementation
HMAC-SHA512 Quantum-safe 1 place See details

Message authentication code through the JCA

`Mac.getInstance()`. HMAC is not broken by Shor and is only marginally affected by Grover; it is inventoried, not flagged, unless the underlying digest is broken.

This is a fingerprint used to prove a message was not altered. Quantum computers do not break it.

What to do. No action beyond avoiding HmacMD5 and HmacSHA1.

  1. src/goryachev/password/data/DataFile.java:10 public static final String ALGORITHM_HMAC = "HmacSHA512";
java.mac
SHA-512 Quantum-safe 1 place 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.

No known quantum attack changes how strong this is. No known quantum algorithm changes the security margin.

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

  1. src/goryachev/crypto/EntropyGathererBase.java:42 random = new DigestRandomGenerator(new SHA512Digest());
java.bouncycastle.digest · CWE-328
Salsa20 Quantum-safe 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.

code.implementation
XSalsa20 Quantum-safe 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.

code.implementation
scrypt Quantum-safe 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.

code.implementation

Cryptographic assets

Algorithm Assessment What it means Occurrences
XSalsa20 Quantum-safe No known quantum algorithm changes the security margin. 29
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. 23
BLAKE2 Quantum-safe No known quantum algorithm changes the security margin. 20
RSA Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. 18
CSPRNG Quantum-safe A cryptographically secure random number generator provided by the platform. Not weakened by a quantum computer. 13
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
Argon2 Quantum-safe The current recommended password hashing function. Not affected by Shor, and memory-hard against Grover. 10
Poly1305 Quantum-safe No known quantum algorithm changes the security margin. 10
HMAC Quantum-safe A keyed MAC is not affected by Shor and only marginally by Grover. 8
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. 8
DRBG Quantum-safe No known quantum algorithm changes the security margin. 5
scrypt Quantum-safe No known quantum algorithm changes the security margin. 5
RSAES-PKCS1v15 Already broken PKCS#1 v1.5 encryption padding is vulnerable to Bleichenbacher oracles today, and the underlying RSA is broken by Shor. 4
RSASSA-PKCS1v15 Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. The v1.5 signature scheme of RFC 8017 section 8.2 has no classical break of its own; RSA-PSS is preferred for new work, but the quantum exposure is the same for both. 4
XSalsa20-Poly1305 Quantum-safe No known quantum algorithm changes the security margin. 4
PBKDF2 Reduced margin Not broken by a quantum computer, but weak against modern GPU cracking at low iteration counts, which is a present-day concern. 3
SHA-512 Quantum-safe No known quantum algorithm changes the security margin. 3
HKDF Quantum-safe No known quantum algorithm changes the security margin. 1
Salsa20 Quantum-safe No known quantum algorithm changes the security margin. The XSalsa20 and XChaCha20 variants share this property. 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 11
java.security the JCA 21