Crypto-View

Peergos/Peergos

Cryptographic posture

525 cryptographic locations: 7 already broken, 92 quantum-vulnerable, 127 reduced-margin, 47 undetermined, 252 quantum-safe

45 establish keys, so traffic protected by them and recorded today becomes readable once the algorithm falls. 1 imported cryptographic library is listed separately. 1014 files analysed.

Quantum-vulnerable 92 Already broken 7 Reduced margin 127 Could not be determined 47 Quantum-safe 252
To address231
Key establishment45
Inventory only1
Total findings526
What was analysed
Branch master
Commit d8b413862d28ac9d5138b799ecc58a4336559929 Merge pull request #1506 from Peergos/fix/trustless-server
Committed 2026-10-21 22:48 UTC
Scanned 2026-10-22 16:10 UTC 28 days ago
Coverage 1014 files, 1002 java
184 test files not scanned

Earlier scans of this repository

4 scans · compare any two
0 to 500 locations Already broken 7 → 7 (unchanged) Quantum-vulnerable 22 → 92 (up 70) Reduced margin 10 → 161 (up 151) Could not be determined 17 → 47 (up 30) Quantum-safe 14 → 257 (up 243) The filled point is the scan you are reading.
Scanned Commit To address Key establishment
27 days ago 3a34dcf620fa master 265 45 Compare
28 days ago this scan d8b413862d28 master 231 45
28 days ago d8b413862d28 master 263 61 Compare
29 days ago f2cdc1955e60 42 24 Compare

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

List of cryptographic assets

MD5 Already broken 5 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/peergos/server/storage/S3BucketSync.java:103 MessageDigest md = MessageDigest.getInstance("MD5");
  2. src/peergos/server/storage/S3BucketSync.java:114 return ArrayOps.bytesToHex(md.digest());
  3. src/peergos/server/webdav/modeshape/webdav/WebDavServletBean.java:58 MD5_HELPER = MessageDigest.getInstance("MD5");
  4. src/peergos/server/webdav/ThumbnailCacheSeeder.java:154 byte[] digest = MessageDigest.getInstance("MD5").digest(s.getBytes(StandardCharsets.UTF_8));
  5. src/peergos/server/webdav/WebdavServer.java:118 digest.setAlgorithm("MD5");
java.messagedigest · CWE-328
MD5 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.

code.named-call
Ed25519255-bitother/Ed25519 Quantum-vulnerable 20 places See details

Ed25519 signatures through NaCl or libsodium

`crypto_sign`, `crypto_sign_open`, `crypto_sign_keypair` and their detached forms: Ed25519 in TweetNaCl, libsodium and PyNaCl.

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), hybrid with Ed25519 during transition.

  1. src/peergos/server/crypto/asymmetric/curve25519/Ed25519Java.java:12 return Futures.of(TweetNaCl.crypto_sign_open(signed, publicSigningKey));
  2. src/peergos/server/crypto/asymmetric/curve25519/Ed25519Java.java:17 return Futures.of(TweetNaCl.crypto_sign(message, secretSigningKey));
  3. src/peergos/server/crypto/asymmetric/curve25519/Ed25519Java.java:22 TweetNaCl.crypto_sign_keypair(pk, sk, true);
  4. src/peergos/server/crypto/asymmetric/curve25519/JdkEd25519.java:26 fallback.crypto_sign_keypair(pk, sk);
  5. src/peergos/server/crypto/asymmetric/curve25519/JdkEd25519.java:28 byte[] signed = jdk.crypto_sign(message, sk).join();
  6. src/peergos/server/crypto/asymmetric/curve25519/JdkEd25519.java:29 if (Arrays.equals(signed, fallback.crypto_sign(message, sk).join())
  7. src/peergos/server/crypto/asymmetric/curve25519/JdkEd25519.java:30 && Arrays.equals(message, jdk.crypto_sign_open(signed, pk).join()))
  8. src/peergos/server/crypto/asymmetric/curve25519/JdkEd25519.java:71 TweetNaCl.crypto_sign_keypair(pk, sk, true);
  9. src/peergos/server/crypto/JniTweetNacl.java:134 int res = impl.crypto_sign_open(message, message.length, signed, signed.length, publicSigningKey);
  10. src/peergos/server/crypto/JniTweetNacl.java:143 impl.crypto_sign(signedMessage, signedMessage.length, message, message.length, secretSigningKey);
  11. src/peergos/server/crypto/JniTweetNacl.java:149 impl.crypto_sign_keypair(pk, sk);
  12. src/peergos/server/ServerIdentity.java:102 crypto.signer.crypto_sign_keypair(pk, sk);
  13. src/peergos/shared/crypto/asymmetric/curve25519/Ed25519.java:20 return scriptJS.crypto_sign_open(signed, publicSigningKey);
  14. src/peergos/shared/crypto/asymmetric/curve25519/Ed25519.java:25 return scriptJS.crypto_sign(message, secretSigningKey);
  15. src/peergos/shared/crypto/asymmetric/curve25519/Ed25519.java:30 byte[][] bytes = scriptJS.crypto_sign_keypair(pk, sk);
  16. src/peergos/shared/crypto/asymmetric/curve25519/Ed25519PublicKey.java:53 return implementation.crypto_sign_open(signed, publicKey);
  17. src/peergos/shared/crypto/asymmetric/curve25519/Ed25519SecretKey.java:46 return implementation.crypto_sign(message, secretKey);
  18. src/peergos/shared/crypto/asymmetric/curve25519/Ed25519SecretKey.java:51 return implementation.crypto_sign(message, secretKey)
  19. src/peergos/shared/crypto/SigningKeyPair.java:89 signer.crypto_sign_keypair(publicSignBytes, secretSignBytes);
  20. src/peergos/shared/user/UserUtil.java:37 crypto.signer.crypto_sign_keypair(publicSignBytes, secretSignBytes);
nacl.sign · CWE-327
X25519255-bitother/Curve25519 Quantum-vulnerable Recorded traffic 18 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/peergos/server/apps/email/EmailBridgeClient.java:132 BoxingKeyPair tmp = BoxingKeyPair.randomCurve25519(crypto.random, crypto.boxer);
  2. src/peergos/server/apps/email/EmailBridgeClient.java:137 BoxingKeyPair tmp = BoxingKeyPair.randomCurve25519(crypto.random, crypto.boxer);
  3. src/peergos/server/Builder.java:77 Curve25519 boxer = new Curve25519Java();
  4. src/peergos/server/JavaCrypto.java:17 Curve25519 boxer = new Curve25519Java();
  5. src/peergos/shared/crypto/asymmetric/curve25519/Curve25519PublicKey.java:71 return new Curve25519PublicKey(key.value, provider, random);
  6. src/peergos/shared/crypto/asymmetric/curve25519/Curve25519SecretKey.java:60 return new Curve25519SecretKey(key.value, provider);
  7. src/peergos/shared/crypto/asymmetric/mlkem/HybridCurve25519MLKEMPublicKey.java:93 return new HybridCurve25519MLKEMPublicKey(curve25519, mlkem, crypto);
  8. src/peergos/shared/crypto/asymmetric/mlkem/HybridCurve25519MLKEMSecretKey.java:67 return new HybridCurve25519MLKEMSecretKey(curve25519, mlkem, crypto);
  9. src/peergos/shared/crypto/asymmetric/PublicBoxingKey.java:20 Curve25519(0x1),
  10. src/peergos/shared/crypto/asymmetric/PublicBoxingKey.java:21 HybridCurve25519MLKEM(0x2);
  11. src/peergos/shared/crypto/BoxingKeyPair.java:42 BoxingKeyPair curve25519 = randomCurve25519(crypto.random, crypto.boxer);
  12. src/peergos/shared/crypto/BoxingKeyPair.java:44 HybridCurve25519MLKEMPublicKey hybridPublic = new HybridCurve25519MLKEMPublicKey(
  13. src/peergos/shared/crypto/BoxingKeyPair.java:46 HybridCurve25519MLKEMSecretKey hybridSecret = new HybridCurve25519MLKEMSecretKey(
  14. src/peergos/shared/crypto/BoxingKeyPair.java:67 new Curve25519PublicKey(publicBoxBytes, boxer, random),
  15. src/peergos/shared/crypto/BoxingKeyPair.java:68 new Curve25519SecretKey(secretBoxBytes, boxer));
  16. src/peergos/shared/email/EmailClient.java:208 BoxingKeyPair encryptionKeys = BoxingKeyPair.randomCurve25519(crypto.random, crypto.boxer);
  17. src/peergos/shared/social/BlindFollowRequest.java:45 Futures.of(BoxingKeyPair.randomCurve25519(crypto.random, crypto.boxer)))
  18. src/peergos/shared/user/UserUtil.java:45 Futures.of(new BoxingKeyPair(new Curve25519PublicKey(publicBoxBytes, crypto.boxer, crypto.random), new Curve25519SecretKey(secretBoxBytes, crypto.boxer))) :
code.named-call
Ed25519255-bitother/Ed25519 Quantum-vulnerable 12 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/peergos/server/crypto/asymmetric/curve25519/JdkEd25519.java:23 JdkEd25519 jdk = new JdkEd25519();
  2. src/peergos/server/JavaCrypto.java:16 Ed25519 signer = JdkEd25519.orElse(new Ed25519Java());
  3. src/peergos/server/ServerIdentity.java:109 return Ed25519Kt.unmarshalEd25519PrivateKey(privateProto);
  4. src/peergos/server/ServerIdentity.java:143 nextPriv = Ed25519Kt.generateEd25519KeyPair().getFirst();
  5. src/peergos/shared/crypto/asymmetric/curve25519/Ed25519PublicKey.java:60 return new Ed25519PublicKey(key.value, provider);
  6. src/peergos/shared/crypto/asymmetric/curve25519/Ed25519SecretKey.java:59 return new Ed25519SecretKey(key.value, provider);
  7. src/peergos/shared/crypto/asymmetric/PublicSigningKey.java:17 Ed25519(0x1);
  8. src/peergos/shared/crypto/asymmetric/PublicSigningKey.java:67 return new Ed25519PublicKey(new byte[32], PublicSigningKey.PROVIDERS.get(PublicSigningKey.Type.Ed25519));
  9. src/peergos/shared/crypto/SigningKeyPair.java:92 new Ed25519PublicKey(publicSignBytes, signer),
  10. src/peergos/shared/crypto/SigningKeyPair.java:93 new Ed25519SecretKey(secretSignBytes, signer));
  11. src/peergos/shared/storage/IpnsEntry.java:25 Ed25519PublicKey pub = new Ed25519PublicKey(pubKeymaterial, crypto.signer);
  12. src/peergos/shared/user/UserUtil.java:42 SigningKeyPair signingKeyPair = new SigningKeyPair(new Ed25519PublicKey(publicSignBytes, crypto.signer), new Ed25519SecretKey(secretSignBytes, crypto.signer));
code.named-call
TLS Quantum-vulnerable Recorded traffic 7 places 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/peergos/server/UserService.java:210 sslContext.getSupportedSSLParameters().setCipherSuites(new String[]{
  2. src/peergos/server/UserService.java:223 SSLEngine engine = c.createSSLEngine();
  3. src/peergos/server/UserService.java:225 params.setCipherSuites(engine.getEnabledCipherSuites());
  4. src/peergos/server/UserService.java:226 params.setProtocols(engine.getEnabledProtocols());
  5. src/peergos/server/util/NettyPinnedHttps.java:56 SslContext sslCtx = SslContextBuilder.forClient().trustManager(BlockedCertificates.trustManager()).build();
  6. src/peergos/server/util/NettyPinnedHttps.java:157 SslContext sslCtx = SslContextBuilder.forClient().trustManager(BlockedCertificates.trustManager()).build();
  7. src/peergos/server/util/NettyPinnedHttps.java:255 SslContext sslCtx = SslContextBuilder.forClient().trustManager(BlockedCertificates.trustManager()).build();
tls.protocol · CWE-757
X25519-XSalsa20-Poly1305 Quantum-vulnerable Recorded traffic 6 places See details

X25519 key agreement through NaCl or libsodium

`crypto_box` and friends: an X25519 key agreement whose shared key encrypts with XSalsa20-Poly1305. The key agreement is what a quantum computer breaks, and recorded boxes are exposed.

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. A hybrid X25519+ML-KEM-768 key establishment.

  1. src/peergos/server/crypto/asymmetric/curve25519/Curve25519Java.java:10 return TweetNaCl.crypto_box_open(cipher, nonce, theirPublicBoxingKey, secretBoxingKey);
  2. src/peergos/server/crypto/asymmetric/curve25519/Curve25519Java.java:15 return TweetNaCl.crypto_box(message, nonce, theirPublicBoxingKey, ourSecretBoxingKey);
  3. src/peergos/shared/crypto/asymmetric/curve25519/Curve25519.java:19 return scriptJS.crypto_box_open(cipher, nonce, theirPublicBoxingKey, secretBoxingKey);
  4. src/peergos/shared/crypto/asymmetric/curve25519/Curve25519.java:24 return scriptJS.crypto_box(message, nonce, theirPublicBoxingKey, ourSecretBoxingKey);
  5. src/peergos/shared/crypto/asymmetric/curve25519/Curve25519PublicKey.java:53 return Futures.of(ArrayOps.concat(implementation.crypto_box(input, nonce, publicKey, from.getSecretBoxingKey()), nonce));
  6. src/peergos/shared/crypto/asymmetric/curve25519/Curve25519SecretKey.java:48 return Futures.of(implementation.crypto_box_open(cipher, nonce, from.getPublicBoxingKey(), secretKey));
nacl.box · CWE-327
Ed25519255-bitother/Ed25519 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.

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

  1. src/peergos/server/crypto/asymmetric/curve25519/JdkEd25519.java:42 Signature verifier = Signature.getInstance("Ed25519");
  2. src/peergos/server/crypto/asymmetric/curve25519/JdkEd25519.java:46 valid = verifier.verify(signed, 0, TweetNaCl.SIGNATURE_SIZE_BYTES);
  3. src/peergos/server/crypto/asymmetric/curve25519/JdkEd25519.java:58 Signature signer = Signature.getInstance("Ed25519");
  4. src/peergos/server/crypto/asymmetric/curve25519/JdkEd25519.java:62 return Futures.of(ArrayOps.concat(signer.sign(), message));
java.signature · CWE-327
TLS Quantum-vulnerable Recorded traffic 4 places See details

TLS cipher suite named in source

A cipher suite written into the code rather than into a configuration file - `TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256`, the OpenSSL spelling `ECDHE-RSA-AES128-GCM-SHA256`, or a TLS 1.3 suite. Each is reported as a setting of the TLS protocol and listed in its `cipherSuites`; RSA key transport and broken bulk ciphers are reported again, as `config.cipher-suite.weak`.

This code names the exact cryptography its TLS connections may use. Because the list is in the program rather than in a settings file, changing it needs a new release - which is the thing that makes a migration slow.

What to do. A hardcoded suite list ships with the binary and cannot be changed without a release, so move it to configuration first. The key exchange changes when the TLS library offers a hybrid group, not before.

  1. src/peergos/server/UserService.java:211 "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
  2. src/peergos/server/UserService.java:212 "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
  3. src/peergos/server/UserService.java:213 "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256",
  4. src/peergos/server/UserService.java:214 "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384"
config.cipher-suite · CWE-757
X25519255-bitother/Curve25519 Quantum-vulnerable Recorded traffic 4 places See details

X25519 key agreement through NaCl or libsodium

`crypto_box` and friends: an X25519 key agreement whose shared key encrypts with XSalsa20-Poly1305. The key agreement is what a quantum computer breaks, and recorded boxes are exposed.

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. A hybrid X25519+ML-KEM-768 key establishment.

  1. src/peergos/server/crypto/asymmetric/curve25519/Curve25519Java.java:20 TweetNaCl.crypto_box_keypair(pk, sk, true);
  2. src/peergos/shared/crypto/asymmetric/curve25519/Curve25519.java:29 byte[] bytes = scriptJS.crypto_box_keypair(pk, sk);
  3. src/peergos/shared/crypto/BoxingKeyPair.java:64 boxer.crypto_box_keypair(publicBoxBytes, secretBoxBytes);
  4. src/peergos/shared/user/UserUtil.java:40 crypto.boxer.crypto_box_keypair(publicBoxBytes, secretBoxBytes);
nacl.box · CWE-327
Ed25519255-bitother/Ed25519 Quantum-vulnerable 3 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/peergos/server/crypto/TweetNaCl.java:35 public static void crypto_sign_keypair(byte[] pk, byte[] sk, boolean isSeeded)
  2. src/peergos/server/crypto/TweetNaCl.java:1158 private static int crypto_sign(byte[] sm, byte[] m,int n,byte[] sk)
  3. src/peergos/server/crypto/TweetNaCl.java:1226 private static int crypto_sign_open(byte[] m, byte[] sm, int n, byte[] pk)
code.implementation
Ed25519255-bitother/Ed25519 Quantum-vulnerable 2 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. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

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/peergos/server/crypto/asymmetric/curve25519/JdkEd25519.java:43 verifier.initVerify(KeyFactory.getInstance("Ed25519")
  2. src/peergos/server/crypto/asymmetric/curve25519/JdkEd25519.java:59 signer.initSign(KeyFactory.getInstance("Ed25519")
java.keyfactory · CWE-327
TLS Quantum-vulnerable Recorded traffic 2 places See details

TLS context created in code

`SSLContext.getInstance()`. The protocol version is reported; the key exchange it negotiates is classical in every TLS 1.2 and 1.3 cipher suite available today.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Every TLS cipher suite in general use negotiates a classical key exchange, so a recorded session is decryptable once that exchange falls.

What to do. Keep TLS 1.3, and track the hybrid key-exchange groups as they reach the JDK. TLS is where harvest-now-decrypt-later exposure is largest.

  1. src/peergos/server/UserService.java:195 SSLContext sslContext = SSLContext.getInstance("TLS");
  2. src/peergos/server/util/BlockedCertificates.java:62 SSLContext context = SSLContext.getInstance("TLS");
java.sslcontext · CWE-757
X25519255-bitother/Curve25519 Quantum-vulnerable Recorded traffic 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/peergos/server/crypto/TweetNaCl.java:54 public static int crypto_box_keypair(byte[] y,byte[] x, boolean isSeeded)
  2. src/peergos/server/crypto/TweetNaCl.java:504 private static int crypto_scalarmult(byte[] q,byte[] n,byte[] p)
code.implementation
X25519-XSalsa20-Poly1305 Quantum-vulnerable Recorded traffic 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/peergos/server/crypto/TweetNaCl.java:580 private static int crypto_box(byte[] c,byte[] m,long d,byte[] nonce, byte[] theirPublicBoxingKey, byte[] ourSecretBoxingKey)
  2. src/peergos/server/crypto/TweetNaCl.java:587 private static int crypto_box_open(byte[] m,byte[] c,long d,byte[] n,byte[] y,byte[] x)
code.implementation
ECDSA-P256 Quantum-vulnerable 1 place See details

COSE algorithm identifier

A COSE algorithm named as an identifier or as its IANA registry number - `COSEAlgorithmIdentifier.ES256`, or `alg: -7` in a WebAuthn `pubKeyCredParams`. The names match JOSE's; the numbers are the registry's.

This is the list of signature algorithms a security key or a passkey is allowed to use. Every one available today is broken by a quantum computer, so the value of writing it down now is knowing where to look later.

What to do. No post-quantum COSE algorithm is registered for WebAuthn yet. Record the exposure and keep the list short, so there is less to change when one is.

  1. src/peergos/server/login/Webauthn.java:98 new EC2COSEKey(null, COSEAlgorithmIdentifier.ES256, null, Curve.SECP256R1, x, y, null));
cose.algorithm
Ed25519255-bitother/Ed25519 Quantum-vulnerable 1 place See details

COSE algorithm identifier

A COSE algorithm named as an identifier or as its IANA registry number - `COSEAlgorithmIdentifier.ES256`, or `alg: -7` in a WebAuthn `pubKeyCredParams`. The names match JOSE's; the numbers are the registry's.

This is the list of signature algorithms a security key or a passkey is allowed to use. Every one available today is broken by a quantum computer, so the value of writing it down now is knowing where to look later.

What to do. No post-quantum COSE algorithm is registered for WebAuthn yet. Record the exposure and keep the list short, so there is less to change when one is.

  1. src/peergos/server/login/Webauthn.java:104 new EdDSACOSEKey(null, COSEAlgorithmIdentifier.EdDSA, null, Curve.ED25519, Arrays.copyOfRange(rawD, 1017, 1017 + 32), null));
cose.algorithm
EdDSA 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.

  1. src/peergos/server/login/Webauthn.java:104 new EdDSACOSEKey(null, COSEAlgorithmIdentifier.EdDSA, null, Curve.ED25519, Arrays.copyOfRange(rawD, 1017, 1017 + 32), null));
code.named-call
SHA-256 Reduced margin 83 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/peergos/server/corenode/IpfsCoreNode.java:438 byte[] hash = hasher.sha256(ArrayOps.concat(proof.prefix, new CborObject.CborList(updatedChain).serialize())).join();
  2. src/peergos/server/corenode/MirrorCoreNode.java:544 if (! BatId.sha256(mirrorBat.bat, hasher).join().equals(mirrorBat.id()))
  3. src/peergos/server/corenode/MirrorCoreNode.java:564 if (! BatId.sha256(mirrorBat.bat, hasher).join().equals(mirrorBat.id()))
  4. src/peergos/server/corenode/MirrorCoreNode.java:670 byte[] supplied = hasher.sha256(ArrayOps.concat(suppliedBat.serialize(), salt)).join();
  5. src/peergos/server/corenode/MirrorCoreNode.java:671 byte[] expected = hasher.sha256(ArrayOps.concat(instanceBat.get().serialize(), salt)).join();
  6. src/peergos/server/corenode/MirrorCoreNode.java:740 if (! BatId.sha256(bat.bat, hasher).join().equals(bat.id()))
  7. src/peergos/server/corenode/SignUpFilter.java:86 byte[] hash = hasher.sha256(ArrayOps.concat(proof.prefix, new CborObject.CborList(Arrays.asList(chain)).serialize())).join();
  8. src/peergos/server/corenode/SignUpFilter.java:158 byte[] hash = hasher.sha256(ArrayOps.concat(proof.prefix, data)).join();
  9. src/peergos/server/crypto/hash/ScryptJava.java:37 byte[] hash = Hash.sha256(password.getBytes());
  10. src/peergos/server/crypto/hash/ScryptJava.java:65 byte[] hash = Hash.sha256(combined);
  11. src/peergos/server/crypto/hash/ScryptJava.java:84 return CompletableFuture.completedFuture(Hash.sha256(input));
  12. src/peergos/server/crypto/hash/ScryptJava.java:107 return Hash.sha256(stream, length)
  13. src/peergos/server/crypto/hash/ScryptJava.java:123 return sha256Chunks(fin, size, chunkSize);
  14. src/peergos/server/login/JdbcAccount.java:637 return Hash.sha256(BackupCodes.normalise(code).getBytes(StandardCharsets.UTF_8));
  15. src/peergos/server/LoginUpdate.java:50 byte[] boxerSha256 = crypto.hasher.sha256(boxer.publicBoxingKey.serialize()).join();
  16. src/peergos/server/net/StaticHandler.java:62 byte[] digest = Hash.sha256(data);
  17. src/peergos/server/net/StorageHandler.java:276 byte[] hash = hasher.sha256(data.get(i)).join();
  18. src/peergos/server/net/StorageHandler.java:337 byte[] hash = hasher.sha256(writes.blocks.get(i)).join();
  19. src/peergos/server/storage/AuthedStorage.java:88 return BatId.sha256(bat.get().bat, h).thenCompose(hashedBat -> {
  20. src/peergos/server/storage/LocalS3Handler.java:158 if (claimed != null && claimed.matches("[0-9a-fA-F]{64}") && ! claimed.equalsIgnoreCase(hex(sha256(body)))) {
  21. src/peergos/server/storage/LocalS3Handler.java:393 hex(sha256(canonicalRequest.getBytes(StandardCharsets.UTF_8)));
  22. src/peergos/server/storage/LocalS3Handler.java:475 return hex(sha256(data));
  23. src/peergos/server/storage/S3BlockStorage.java:1628 Multihash hash = new Multihash(Multihash.Type.sha2_256, Hash.sha256(data));
  24. src/peergos/server/storage/S3BlockStorage.java:1644 Multihash hash = new Multihash(Multihash.Type.sha2_256, Hash.sha256(data));
  25. src/peergos/server/storage/S3BlockStorage.java:2164 b -> ArrayOps.bytesToHex(Hash.sha256(b)),
  26. src/peergos/server/storage/S3BlockStorage.java:2165 b -> Base64.encodeBase64String(Hash.sha256(b)),
  27. src/peergos/server/storage/S3BucketSync.java:92 String contentHash = hashContent ? ArrayOps.bytesToHex(h.sha256(res).join()) : "UNSIGNED-PAYLOAD";
  28. src/peergos/server/storage/S3CborMirror.java:339 b -> ArrayOps.bytesToHex(Hash.sha256(b)),
  29. src/peergos/server/storage/S3CborMirror.java:340 b -> Base64.encodeBase64String(Hash.sha256(b)),
  30. src/peergos/server/storage/S3DeleteOld.java:122 b -> ArrayOps.bytesToHex(Hash.sha256(b)),
  31. src/peergos/server/storage/S3DeleteOld.java:123 b -> Base64.encodeBase64String(Hash.sha256(b)),
  32. src/peergos/server/storage/S3Exploration.java:86 b -> ArrayOps.bytesToHex(Hash.sha256(b)),
  33. src/peergos/server/storage/S3Exploration.java:87 b -> Base64.encodeBase64String(Hash.sha256(b)),
  34. src/peergos/server/storage/S3Exploration.java:199 b -> ArrayOps.bytesToHex(Hash.sha256(b)),
  35. src/peergos/server/storage/S3Exploration.java:200 b -> Base64.encodeBase64String(Hash.sha256(b)),
  36. src/peergos/server/storage/SecretLinkStorage.java:109 byte[] supplied = hasher.sha256(mirrorBat.serialize()).join();
  37. src/peergos/server/storage/SecretLinkStorage.java:111 byte[] expected = hasher.sha256(mirrorBats.get(mirrorBats.size() - 1).serialize()).join();
  38. src/peergos/server/sync/DirectorySync.java:135 return peergosDir.resolve("dir-sync-state-v3-" + ArrayOps.bytesToHex(Hash.sha256(linkPath + "///" + localDir)) + ".sqlite");
  39. src/peergos/server/sync/PairLogger.java:34 return ArrayOps.bytesToHex(Hash.sha256(linkPath + "///" + localDir));
  40. src/peergos/server/webauthn/LinuxSecurityKey.java:25 return Ctap2.makeCredential(key, sha256(clientDataJson), rpId, rpName, userId,
  41. src/peergos/server/webauthn/LinuxSecurityKey.java:36 return Ctap2.getAssertion(key, rpId, sha256(clientDataJson), allowedCredentials, deadline);
  42. src/peergos/shared/crypto/hash/Hasher.java:89 return sha256(input)
  43. src/peergos/shared/crypto/hash/Hasher.java:94 return sha256(input)
  44. src/peergos/shared/crypto/hash/Hash.java:20 Sha256 sha256 = new Sha256();
  45. src/peergos/shared/crypto/hash/Hash.java:22 byte[] hash = sha256.digest();
  46. src/peergos/shared/crypto/hash/Hash.java:33 Sha256 sha256 = new Sha256();
  47. src/peergos/shared/crypto/hash/ScryptJS.java:27 return scriptJS.sha256(input);
  48. src/peergos/shared/crypto/hash/ScryptJS.java:44 return scriptJS.sha256FileSection(jsReader,
  49. src/peergos/shared/crypto/hash/ScryptJS.java:47 return Hasher.super.sha256Section(reader, start, end);
  50. src/peergos/shared/crypto/hash/ScryptJS.java:89 return scriptJS.streamSha256(stream, (int) length)
  51. src/peergos/shared/inode/InodeFileSystem.java:293 Function<ByteArrayWrapper, CompletableFuture<byte[]>> keyHasher = b -> hasher.sha256(b.data);
  52. src/peergos/shared/inode/InodeFileSystem.java:305 Function<ByteArrayWrapper, CompletableFuture<byte[]>> keyHasher = b -> hasher.sha256(b.data);
  53. src/peergos/shared/io/ipfs/Multihash.java:22 sha2_256(0x12, 32),
  54. src/peergos/shared/NetworkAccess.java:792 .map(f -> hasher.sha256(f.data))
  55. src/peergos/shared/storage/auth/BatId.java:34 return h.sha256(b.secret)
  56. src/peergos/shared/storage/auth/S3Request.java:199 res.append(ArrayOps.bytesToHex(Hash.sha256(toCanonicalRequest().getBytes())));
  57. src/peergos/shared/storage/BlockWriteAuth.java:58 return hasher.sha256(bout.toByteArray());
  58. src/peergos/shared/storage/CachingVerifyingStorage.java:50 return hasher.sha256(data)
  59. src/peergos/shared/storage/ContentAddressedStorage.java:120 .map(b -> hasher.sha256(b).thenCompose(h -> signer.secret.signMessage(h)))
  60. src/peergos/shared/storage/ContentAddressedStorage.java:132 .map(b -> hasher.sha256(b).thenCompose(h -> signer.secret.signMessage(h)))
  61. src/peergos/shared/storage/ContentAddressedStorage.java:324 return hasher.sha256(input)
  62. src/peergos/shared/storage/HashVerifyingStorage.java:29 return hasher.sha256(data)
  63. src/peergos/shared/storage/LegacyBulkCommitter.java:115 .map(b -> hasher.sha256(b).thenCompose(h -> signer.secret.signMessage(h)))
  64. src/peergos/shared/storage/LocalOnlyStorage.java:36 h.sha256(data)
  65. src/peergos/shared/storage/LocalRamStorage.java:38 return Futures.combineAllInOrder(cborBlocks.stream().map(b -> h.sha256(b)
  66. src/peergos/shared/storage/WriterCommit.java:59 return hasher.sha256(bout.toByteArray());
  67. src/peergos/shared/user/fs/FileProperties.java:207 return h.sha256(ArrayOps.concat(streamSecret, currentMapKey))
  68. src/peergos/shared/user/fs/FileProperties.java:209 h.sha256(ArrayOps.concat(streamSecret, currentBat.get().secret))
  69. src/peergos/shared/user/fs/HashTree.java:103 return h.sha256(data);
  70. src/peergos/shared/user/fs/HashTree.java:117 return h.sha256Section(f, start, end);
  71. src/peergos/shared/user/fs/HashTree.java:197 return hasher.sha256(new CborObject.CborList(level1).serialize())
  72. src/peergos/shared/user/fs/HashTree.java:204 return hasher.sha256(new CborObject.CborList(level2).serialize())
  73. src/peergos/shared/user/fs/HashTree.java:211 return hasher.sha256(new CborObject.CborList(level3).serialize())
  74. src/peergos/shared/user/fs/HashTree.java:218 return hasher.sha256(new CborObject.CborList(level4).serialize())
  75. src/peergos/shared/user/fs/HashTree.java:280 .map(l1 -> h.sha256(l1.serialize()))
  76. src/peergos/shared/user/SecretLinkChamp.java:52 return hasher.sha256(copy);
  77. src/peergos/shared/user/UserContext.java:543 return BatId.sha256(mirror, crypto.hasher)
  78. src/peergos/shared/user/UserContext.java:553 return crypto.hasher.sha256(publicBoxingKey.serialize())
  79. src/peergos/shared/user/UserContext.java:1448 return BatId.sha256(mirror, crypto.hasher)
  80. src/peergos/shared/user/UserContext.java:1770 return crypto.hasher.sha256(rawBlock).thenCompose(blockHash -> {
  81. src/peergos/shared/user/UserContext.java:3439 return crypto.hasher.sha256(newBoxer.publicBoxingKey.serialize())
  82. src/peergos/shared/user/UserContext.java:3448 return crypto.hasher.sha256(newBoxer.publicBoxingKey.serialize())
  83. src/peergos/shared/user/WriterData.java:321 return network.hasher.sha256(followRequestReceiver.serialize());
code.named-call
SHA-256 Reduced margin 26 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/peergos/server/cfapi/CloudFilesMount.java:733 java.security.MessageDigest md = java.security.MessageDigest.getInstance("SHA-256");
  2. src/peergos/server/cfapi/CloudFilesMount.java:734 byte[] digest = md.digest(normalised.toString()
  3. src/peergos/server/crypto/hash/ScryptJava.java:158 MessageDigest chunkHash = MessageDigest.getInstance("SHA-256");
  4. src/peergos/server/crypto/hash/ScryptJava.java:165 chunkHashes.add(chunkHash.digest());
  5. src/peergos/server/crypto/hash/ScryptJava.java:166 chunkHash = MessageDigest.getInstance("SHA-256");
  6. src/peergos/server/crypto/hash/ScryptJava.java:176 chunkHashes.add(chunkHash.digest());
  7. src/peergos/server/login/LoginThrottle.java:265 return ArrayOps.bytesToHex(MessageDigest.getInstance("SHA-256").digest(in));
  8. src/peergos/server/storage/LocalS3Handler.java:464 return MessageDigest.getInstance("SHA-256").digest(data);
  9. src/peergos/server/storage/RAMStorage.java:272 MessageDigest md = MessageDigest.getInstance("SHA-256");
  10. src/peergos/server/storage/RAMStorage.java:274 return md.digest();
  11. src/peergos/server/sync/PeergosSyncFS.java:300 MessageDigest chunkHash = MessageDigest.getInstance("SHA-256");
  12. src/peergos/server/sync/PeergosSyncFS.java:308 chunkHashes.add(chunkHash.digest());
  13. src/peergos/server/sync/PeergosSyncFS.java:309 chunkHash = MessageDigest.getInstance("SHA-256");
  14. src/peergos/server/sync/PeergosSyncFS.java:319 chunkHashes.add(chunkHash.digest());
  15. src/peergos/server/util/BlockedCertificates.java:104 MessageDigest sha256 = MessageDigest.getInstance("SHA-256");
  16. src/peergos/server/util/BlockedCertificates.java:105 if (BLOCKED_CERTS.contains(ArrayOps.bytesToHex(sha256.digest(cert.getEncoded())).toUpperCase()))
  17. src/peergos/server/util/BlockedCertificates.java:107 return BLOCKED_KEYS.contains(ArrayOps.bytesToHex(sha256.digest(cert.getPublicKey().getEncoded())).toUpperCase());
  18. src/peergos/server/webauthn/LinuxSecurityKey.java:49 return MessageDigest.getInstance("SHA-256").digest(data);
  19. src/peergos/server/webauthn/WindowsSecurityKey.java:153 private static final String SHA_256 = "SHA-256";
  20. src/peergos/server/webdav/caldav/AppDataStore.java:509 MessageDigest digest = MessageDigest.getInstance("SHA-256");
  21. src/peergos/server/webdav/caldav/AppDataStore.java:516 return ArrayOps.bytesToHex(digest.digest()).substring(0, 32);
  22. src/peergos/shared/crypto/hash/Hash.java:11 public static final String HASH = "SHA-256";
  23. src/peergos/shared/crypto/hash/Hash.java:15 MessageDigest md = MessageDigest.getInstance(HASH);
  24. src/peergos/shared/crypto/hash/Hash.java:17 return md.digest();
  25. src/peergos/shared/crypto/hash/Hash.java:29 MessageDigest md = MessageDigest.getInstance(HASH);
  26. src/peergos/shared/crypto/hash/Hash.java:40 return CompletableFuture.completedFuture(md.digest());
java.messagedigest · CWE-328
Keccak-256 Reduced margin 12 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/peergos/server/crypto/asymmetric/mlkem/fips202/keccak/core/AbstractKeccakMessageDigest.java:23 this.keccakSponge = new KeccakSponge(params.getCapacityInBits(), params.getDomainPadding(), params.getDomainPaddingBitLength());
  2. src/peergos/server/crypto/asymmetric/mlkem/fips202/keccak/core/DuplexRandom.java:59 this.keccak1600 = new Keccak1600(capacityInBits);
  3. src/peergos/server/crypto/asymmetric/mlkem/fips202/keccak/core/Keccak1600.java:385 KeccakF1600_InitializeRoundConstants();
  4. src/peergos/server/crypto/asymmetric/mlkem/fips202/keccak/core/Keccak1600.java:386 KeccakF1600_InitializeRhoOffsets();
  5. src/peergos/server/crypto/asymmetric/mlkem/fips202/keccak/core/KeccakSponge.java:168 this.keccak1600 = new Keccak1600(params.getCapacityInBits());
  6. src/peergos/server/crypto/asymmetric/mlkem/fips202/keccak/core/KeccakSponge.java:174 this.keccak1600 = new Keccak1600(capacityInBits);
  7. src/peergos/server/crypto/asymmetric/mlkem/fips202/keccak/spi/Shake128StreamCipher.java:23 sponge = new KeccakSponge(XOFParameterSet.SHAKE128);
  8. src/peergos/server/crypto/asymmetric/mlkem/fips202/keccak/spi/Shake256StreamCipher.java:24 sponge = new KeccakSponge(XOFParameterSet.SHAKE256);
  9. src/peergos/server/crypto/asymmetric/mlkem/fips202/keccak/sponge/MimicloneKeccakSponge.java:36 return new MimicloneKeccakSponge(bitLength);
  10. src/peergos/server/crypto/asymmetric/mlkem/fips202/MimicloneFIPS202.java:10 return new MimicloneKeccak(permutation);
  11. src/peergos/server/crypto/asymmetric/mlkem/fips203/hash/MLKEMHash.java:55 shake128 = new KeccakSponge(XOFParameterSet.SHAKE128);
  12. src/peergos/server/crypto/asymmetric/mlkem/fips203/hash/MLKEMHash.java:58 shake256 = new KeccakSponge(XOFParameterSet.SHAKE256);
code.named-call
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.

code.named-call
PBKDF2 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
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
SHA3-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. 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/peergos/server/crypto/asymmetric/mlkem/fips203/hash/MLKEMHash.java:42 sha3Hash256 = MessageDigest.getInstance("SHA3-256");
java.messagedigest · CWE-328
SHAKE128 Reduced margin 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/peergos/server/crypto/asymmetric/mlkem/fips202/Constants.java:15 public static final String SHAKE128_STREAM_CIPHER = "SHAKE128";
config.algorithm-setting · CWE-327
X.509 Could not be determined 3 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/peergos/server/util/NettyPinnedHttps.java:56 SslContext sslCtx = SslContextBuilder.forClient().trustManager(BlockedCertificates.trustManager()).build();
  2. src/peergos/server/util/NettyPinnedHttps.java:157 SslContext sslCtx = SslContextBuilder.forClient().trustManager(BlockedCertificates.trustManager()).build();
  3. src/peergos/server/util/NettyPinnedHttps.java:255 SslContext sslCtx = SslContextBuilder.forClient().trustManager(BlockedCertificates.trustManager()).build();
x509.certificate
unknown Could not be determined 3 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.

java.keypairgenerator.variable · CWE-327
PKCS12 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/peergos/server/UserService.java:382 KeyStore ks = KeyStore.getInstance("PKCS12");
java.keystore
X.509 Could not be determined 1 place 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/peergos/server/util/BlockedCertificates.java:77 TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
x509.signature
CSPRNG Quantum-safe 74 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/peergos/server/apps/email/EmailBridgeClient.java:126 network, crypto, () -> false, x -> {}, crypto.random.randomBytes(32),
  2. src/peergos/server/corenode/MirrorCoreNode.java:669 byte[] salt = crypto.random.randomBytes(8);
  3. src/peergos/server/crypto/TweetNaCl.java:42 randombytes(sk, 32);
  4. src/peergos/server/crypto/TweetNaCl.java:57 randombytes(x,32);
  5. src/peergos/server/fuse/PeergosFS.java:621 context.crypto.random.randomBytes(32), Optional.empty(), Optional.of(Bat.random(context.crypto.random)),
  6. src/peergos/server/space/QuotaCLI.java:203 String token = ArrayOps.bytesToHex(crypto.random.randomBytes(32));
  7. src/peergos/server/storage/admin/QuotaAdmin.java:42 String token = ArrayOps.bytesToHex(rnd.randomBytes(32));
  8. src/peergos/shared/crypto/asymmetric/curve25519/Curve25519PublicKey.java:58 random.randombytes(nonce, 0, nonce.length);
  9. src/peergos/shared/crypto/asymmetric/mlkem/HybridCurve25519MLKEMPublicKey.java:44 byte[] curve25519SharedSecret = crypto.random.randomBytes(32);
  10. src/peergos/shared/crypto/BoxingKeyPair.java:57 random.randombytes(secretBoxBytes, 0, 32);
  11. src/peergos/shared/crypto/password/PasswordProtected.java:33 byte[] saltBytes = random.randomBytes(32);
  12. src/peergos/shared/crypto/random/SafeRandom.java:13 randombytes(res, 0, len);
  13. src/peergos/shared/crypto/random/SafeRandom.java:22 byte[] r = scriptJS.randombytes(len);
  14. src/peergos/shared/crypto/SigningKeyPair.java:83 random.randombytes(secretSignBytes, 0, 32);
  15. src/peergos/shared/crypto/symmetric/TweetNaClKey.java:68 random.randombytes(res, 0, res.length);
  16. src/peergos/shared/crypto/symmetric/TweetNaClKey.java:109 random.randombytes(key, 0, KEY_BYTES);
  17. src/peergos/shared/messaging/ChatController.java:224 context.crypto.random.randomBytes(RelativeCapability.MAP_KEY_LENGTH), Optional.empty(),
  18. src/peergos/shared/messaging/ChatController.java:306 crypto.random.randomBytes(32), Optional.empty(), Optional.of(Bat.random(crypto.random)), chatRoot.mirrorBatId());
  19. src/peergos/shared/messaging/Messenger.java:71 AsyncReader.build(new byte[0]), 0, network, crypto, () -> false, x -> {}, crypto.random.randomBytes(32),
  20. src/peergos/shared/messaging/Messenger.java:74 AsyncReader.build(new byte[16]), 16, network, crypto, () -> false, x -> {}, crypto.random.randomBytes(32),
  21. src/peergos/shared/messaging/Messenger.java:77 AsyncReader.build(rawChat), rawChat.length, network, crypto, () -> false, x -> {}, crypto.random.randomBytes(32),
  22. src/peergos/shared/messaging/Messenger.java:82 crypto.random.randomBytes(32), Optional.of(Bat.random(crypto.random)), updatedChatRoot.mirrorBatId()))
  23. src/peergos/shared/messaging/Messenger.java:136 rawChat.length, network, crypto, () -> false, x -> {}, crypto.random.randomBytes(32),
  24. src/peergos/shared/messaging/Messenger.java:147 crypto, () -> false, y -> {}, crypto.random.randomBytes(32),
  25. src/peergos/shared/messaging/Messenger.java:162 crypto, () -> false, y -> {}, crypto.random.randomBytes(32),
  26. src/peergos/shared/social/SocialFeed.java:374 crypto.random.randomBytes(RelativeCapability.MAP_KEY_LENGTH),
  27. src/peergos/shared/storage/auth/Bat.java:129 return new Bat(r.randomBytes(BAT_LENGTH));
  28. src/peergos/shared/user/App.java:428 return Multibase.encode(Multibase.Base.Base32, ctx.crypto.random.randomBytes(16));
  29. src/peergos/shared/user/fs/CapabilityStore.java:61 false, network, crypto, () -> false, x -> {}, crypto.random.randomBytes(32),
  30. src/peergos/shared/user/fs/cryptree/CryptreeNode.java:648 byte[] newMapKey = crypto.random.randomBytes(RelativeCapability.MAP_KEY_LENGTH);
  31. src/peergos/shared/user/fs/cryptree/CryptreeNode.java:748 Optional.of(crypto.random.randomBytes(32));
  32. src/peergos/shared/user/fs/cryptree/CryptreeNode.java:751 .orElseGet(() -> Futures.of(new Pair<>(crypto.random.randomBytes(RelativeCapability.MAP_KEY_LENGTH), Optional.of(Bat.random(crypto.random)))));
  33. src/peergos/shared/user/fs/cryptree/CryptreeNode.java:886 .orElseGet(() -> crypto.random.randomBytes(32)));
  34. src/peergos/shared/user/fs/cryptree/CryptreeNode.java:967 crypto.random.randomBytes(32), Optional.of(Bat.random(crypto.random)), nextSubfoldersKey);
  35. src/peergos/shared/user/fs/cryptree/CryptreeNode.java:1049 byte[] dirMapKey = desiredMapKey.orElseGet(() -> crypto.random.randomBytes(32)); // root will be stored under this in the tree
  36. src/peergos/shared/user/fs/cryptree/CryptreeNode.java:1053 RelativeCapability nextChunk = new RelativeCapability(Optional.empty(), crypto.random.randomBytes(32),
  37. src/peergos/shared/user/fs/cryptree/CryptreeNode.java:1368 crypto.random.randomBytes(RelativeCapability.MAP_KEY_LENGTH), Optional.of(Bat.random(crypto.random)), linkCap.rBaseKey);
  38. src/peergos/shared/user/fs/EncryptedCapability.java:67 int val = r.randomBytes(1)[0] & 0xFF;
  39. src/peergos/shared/user/fs/FileWrapper.java:684 .mapToObj(e -> new Location(owner(), writer(), random.randomBytes(32)))
  40. src/peergos/shared/user/fs/FileWrapper.java:709 network, crypto, () -> false, monitor, crypto.random.randomBytes(32), Optional.empty(),
  41. src/peergos/shared/user/fs/FileWrapper.java:886 crypto.random.randomBytes(32), Optional.of(Bat.random(crypto.random)), mirrorBatId());
  42. src/peergos/shared/user/fs/FileWrapper.java:897 crypto.random.randomBytes(32), Optional.of(Bat.random(crypto.random)), mirrorBatId());
  43. src/peergos/shared/user/fs/FileWrapper.java:941 network, crypto, isCancelled, monitor, crypto.random.randomBytes(32),
  44. src/peergos/shared/user/fs/FileWrapper.java:942 Optional.of(crypto.random.randomBytes(32)), Optional.of(Bat.random(crypto.random)), mirrorBatId()))
  45. src/peergos/shared/user/fs/FileWrapper.java:1051 crypto.random.randomBytes(32), Optional.of(Bat.random(crypto.random)), mirrorBat)
  46. src/peergos/shared/user/fs/FileWrapper.java:1442 crypto.random.randomBytes(32), Optional.empty(), Optional.of(Bat.random(crypto.random)), mirrorBat)
  47. src/peergos/shared/user/fs/FileWrapper.java:1466 now, now, false, Optional.empty(), Optional.of(crypto.random.randomBytes(32)), f.hash.map(t -> t.branch(0)));
  48. src/peergos/shared/user/fs/FileWrapper.java:1470 crypto.random.randomBytes(32)), Optional.of(Bat.random(crypto.random)), crypto.hasher);
  49. src/peergos/shared/user/fs/FileWrapper.java:1573 Supplier<Location> legacyLocs = () -> new Location(getLocation().owner, getLocation().writer, crypto.random.randomBytes(32));
  50. src/peergos/shared/user/fs/FileWrapper.java:1720 network, crypto, isCancelled, monitor, crypto.random.randomBytes(32), Optional.empty(),
  51. src/peergos/shared/user/fs/FileWrapper.java:1964 Optional.of(crypto.random.randomBytes(32));
  52. src/peergos/shared/user/fs/FileWrapper.java:2124 .orElseGet(() -> Futures.of(new Triple<>(crypto.random.randomBytes(32),
  53. src/peergos/shared/user/fs/FileWrapper.java:2740 byte[] newMapKey = crypto.random.randomBytes(32);
  54. src/peergos/shared/user/fs/FileWrapper.java:2768 () -> false, x -> {}, crypto.random.randomBytes(32), Optional.empty(),
  55. src/peergos/shared/user/fs/ResumeUploadProps.java:61 byte[] streamSecret = crypto.random.randomBytes(32);
  56. src/peergos/shared/user/fs/ResumeUploadProps.java:63 byte[] firstChunkMapKey = crypto.random.randomBytes(32);
  57. src/peergos/shared/user/fs/SecretLink.java:65 byte[] labelBytes = r.randomBytes(4);
  58. src/peergos/shared/user/fs/transaction/TransactionServiceImpl.java:61 crypto, () -> false, VOID_PROGRESS, crypto.random.randomBytes(32), Optional.empty(), Optional.of(Bat.random(crypto.random)), dir.mirrorBatId())
  59. src/peergos/shared/user/Groups.java:51 return "." + ArrayOps.bytesToHex(r.randomBytes(32));
  60. src/peergos/shared/user/IncomingCapCache.java:591 false, updatedRoot.version, c, network, crypto, () -> false, x -> {}, crypto.random.randomBytes(RelativeCapability.MAP_KEY_LENGTH),
  61. src/peergos/shared/user/IncomingCapCache.java:618 () -> false, x -> {}, crypto.random.randomBytes(RelativeCapability.MAP_KEY_LENGTH),
  62. src/peergos/shared/user/SecretGenerationAlgorithm.java:53 return ArrayOps.bytesToHex(rnd.randomBytes(32));
  63. src/peergos/shared/user/SharedWithCache.java:221 crypto.random.randomBytes(32), Optional.empty(), Optional.of(Bat.random(crypto.random)), parent.mirrorBatId())
  64. src/peergos/shared/user/UserContext.java:1868 byte[] rootMapKey = crypto.random.randomBytes(32); // root will be stored under this label
  65. src/peergos/shared/user/UserContext.java:1895 RelativeCapability.buildSubsequentChunk(crypto.random.randomBytes(32), Optional.of(Bat.random(crypto.random)), rootRKey);
  66. src/peergos/shared/user/UserContext.java:2247 crypto.random.randomBytes(32),
  67. src/peergos/shared/user/UserContext.java:2496 crypto.random.randomBytes(32), Optional.empty(), Optional.of(Bat.random(crypto.random)),
  68. src/peergos/shared/user/UserContext.java:2807 crypto.random.randomBytes(RelativeCapability.MAP_KEY_LENGTH),
  69. src/peergos/shared/user/UserContext.java:2825 crypto.random.randomBytes(RelativeCapability.MAP_KEY_LENGTH),
  70. src/peergos/shared/user/UserContext.java:3267 byte[] linkMapKey = crypto.random.randomBytes(RelativeCapability.MAP_KEY_LENGTH);
  71. src/peergos/shared/user/UserContext.java:3474 crypto.random.randomBytes(32), Optional.empty(), Optional.of(Bat.random(crypto.random)), mirrorBatId()));
  72. src/peergos/shared/user/UserContext.java:3846 crypto.random.randomBytes(RelativeCapability.MAP_KEY_LENGTH), Optional.of(Bat.random(crypto.random)), mirrorBatId());
  73. src/peergos/shared/user/UserContext.java:4033 Optional.empty(), true, network, crypto, () -> false, x -> {}, crypto.random.randomBytes(32),
  74. src/peergos/shared/user/UserUtil.java:30 byte[] secretBoxBytes = hasBoxer ? Arrays.copyOfRange(keyBytes, 32, 64) : crypto.random.randomBytes(32);
code.named-call
CSPRNG Quantum-safe From a constant 26 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/peergos/server/crypto/asymmetric/mlkem/MlkemSecureRandom.java:24 return SecureRandom.getInstance(SECURE_RBG_ALGO, secureParams);
  2. src/peergos/server/crypto/asymmetric/mlkem/MlkemSecureRandom.java:26 return SecureRandom.getInstanceStrong();
  3. src/peergos/server/crypto/asymmetric/mlkem/MlkemSecureRandom.java:32 return new SecureRandom();
  4. src/peergos/server/crypto/hash/lambdaworks/crypto/SCryptUtil.java:45 SecureRandom.getInstance("SHA1PRNG").nextBytes(salt);
  5. src/peergos/server/crypto/TweetNaCl.java:1261 return new SecureRandom();
  6. src/peergos/server/crypto/TweetNaCl.java:1266 prng.nextBytes(r);
  7. src/peergos/server/crypto/TweetNaCl.java:1272 prng.nextBytes(r);
  8. src/peergos/server/login/JdbcAccount.java:76 private final SecureRandom rnd = new SecureRandom();
  9. src/peergos/server/login/JdbcAccount.java:522 rnd.nextBytes(rawKey);
  10. src/peergos/server/login/JdbcAccount.java:524 rnd.nextBytes(credId);
  11. src/peergos/server/login/JdbcAccount.java:584 rnd.nextBytes(random);
  12. src/peergos/server/login/JdbcAccount.java:590 rnd.nextBytes(credId);
  13. src/peergos/server/login/JdbcAccount.java:775 rnd.nextBytes(challenge);
  14. src/peergos/server/login/LoginThrottle.java:67 private final SecureRandom rnd = new SecureRandom();
  15. src/peergos/server/login/LoginThrottle.java:110 rnd.nextBytes(raw);
  16. src/peergos/server/net/GcHandler.java:29 new SecureRandom().nextBytes(raw);
  17. src/peergos/server/net/LocalApiAuth.java:29 private static final SecureRandom rnd = new SecureRandom();
  18. src/peergos/server/net/LocalApiAuth.java:97 rnd.nextBytes(raw);
  19. src/peergos/server/net/MountConfigHandler.java:379 new SecureRandom().nextBytes(bytes);
  20. src/peergos/server/storage/FileBlockCache.java:32 private final SecureRandom rnd = new SecureRandom();
  21. src/peergos/server/storage/FileBlockCache.java:197 Path tmp = target.getParent().resolve(target.getFileName() + "-" + rnd.nextInt(Integer.MAX_VALUE) + ".tmp");
  22. src/peergos/server/storage/FileContentAddressedStorage.java:48 private final SecureRandom rnd = new SecureRandom();
  23. src/peergos/server/storage/FileContentAddressedStorage.java:462 Path tmp = parent.resolve(target.getFileName() + "-" + rnd.nextInt(Integer.MAX_VALUE) + ".tmp");
  24. src/peergos/server/util/Passwords.java:10 SecureRandom rnd = new SecureRandom();
  25. src/peergos/server/util/Passwords.java:12 .mapToObj(i -> WORDS.get(rnd.nextInt(WORDS.size())))
  26. src/peergos/server/webauthn/CtapHid.java:93 new SecureRandom().nextBytes(nonce);
java.rng
HMAC-SHA1 Quantum-safe Renamed import 24 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/peergos/server/login/AccountWithStorage.java:108 return target.enableTotpFactor(username, credentialId, code);
  2. src/peergos/server/login/AccountWithStorage.java:129 return target.addTotpFactor(username);
  3. src/peergos/server/login/JdbcAccount.java:387 validateTotpCode(username, credentialId, code);
  4. src/peergos/server/login/JdbcAccount.java:535 return Futures.of(new TotpKey(credId, rawKey));
  5. src/peergos/server/login/JdbcAccount.java:748 validateTotpCode(username, credentialId, code);
  6. src/peergos/server/login/LocalOnlyAccount.java:99 return target.addTotpFactor(username, auth);
  7. src/peergos/server/login/LocalOnlyAccount.java:119 return target.enableTotpFactor(username, credentialId, code, auth);
  8. src/peergos/server/login/VerifyingAccount.java:61 return target.addTotpFactor(username, auth);
  9. src/peergos/server/login/VerifyingAccount.java:68 return target.enableTotpFactor(username, credentialId, code, auth);
  10. src/peergos/server/net/AccountHandler.java:136 TotpKey res = account.addTotpFactor(username, auth).join();
  11. src/peergos/server/net/AccountHandler.java:145 boolean res = account.enableTotpFactor(username, credentialId, code, auth).join();
  12. src/peergos/server/net/MountConfigHandler.java:246 ? mountTotpResponder(config)
  13. src/peergos/server/net/MountConfigHandler.java:272 byte[] ours = config.totpCredentialIdBytes();
  14. src/peergos/server/net/MountConfigHandler.java:309 config.hasTotp() ? mountTotpResponder(config) : Main::getMfaResponseCLI;
  15. src/peergos/server/net/MountConfigHandler.java:316 return mountTotpResponder(config.totpCredentialIdBytes(), config.totpSecretBytes());
  16. src/peergos/server/net/MountConfigHandler.java:361 config.totpCredentialIdBytes(), context.signer).join();
  17. src/peergos/server/webdav/WebdavFileSystem.java:102 config.hasTotp() ? mountTotpResponder(config) : Main::getMfaResponseCLI;
  18. src/peergos/shared/login/mfa/TotpKey.java:35 return new TotpKey(new Base32().decode(base32credid), new Base32().decode(base32key));
  19. src/peergos/shared/login/OfflineAccountStore.java:71 return target.enableTotpFactor(username, credentialId, code, auth)
  20. src/peergos/shared/login/OfflineAccountStore.java:99 return target.addTotpFactor(username, auth);
  21. src/peergos/shared/user/ProxyingAccount.java:72 () -> local.addTotpFactor(username, auth),
  22. src/peergos/shared/user/ProxyingAccount.java:73 target -> p2p.addTotpFactor(target, username, auth)));
  23. src/peergos/shared/user/ProxyingAccount.java:137 () -> local.enableTotpFactor(username, credentialId, code, auth),
  24. src/peergos/shared/user/ProxyingAccount.java:138 target -> p2p.enableTotpFactor(target, username, credentialId, code, auth)));
code.named-call
BLAKE3 Quantum-safe 23 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/peergos/server/crypto/hash/ScryptJava.java:121 if (Chunk.usesBlake3(chunkSize))
  2. src/peergos/server/crypto/hash/ScryptJava.java:122 return blake3Chunks(fin, size, firstChunk, chunkSize, fileSize, hasher);
  3. src/peergos/server/sync/PeergosSyncFS.java:293 if (Chunk.usesBlake3(fileChunkSize))
  4. src/peergos/server/sync/PeergosSyncFS.java:294 return blake3Tree(reader, size, fileChunkSize);
  5. src/peergos/shared/crypto/hash/Hasher.java:39 return Futures.of(Blake3.hash(input));
  6. src/peergos/shared/crypto/hash/Hasher.java:71 .thenCompose(bytes -> blake3ChainingValue(bytes, startChunk));
  7. src/peergos/shared/crypto/hash/ScryptJS.java:52 return scriptJS.blake3(input);
  8. src/peergos/shared/crypto/hash/ScryptJS.java:57 return scriptJS.blake3ChainingValue(input, (int) (startChunk >> 32), (int) startChunk);
  9. src/peergos/shared/crypto/hash/ScryptJS.java:62 return blake3FileSection(reader, start, end, false, 0)
  10. src/peergos/shared/crypto/hash/ScryptJS.java:63 .orElseGet(() -> Hasher.super.blake3Section(reader, start, end));
  11. src/peergos/shared/crypto/hash/ScryptJS.java:68 return blake3FileSection(reader, start, end, true, startChunk)
  12. src/peergos/shared/crypto/hash/ScryptJS.java:69 .orElseGet(() -> Hasher.super.blake3SectionChainingValue(reader, start, end, startChunk));
  13. src/peergos/shared/crypto/hash/ScryptJS.java:81 return Optional.of(scriptJS.blake3FileSection(jsReader,
  14. src/peergos/shared/io/ipfs/Multihash.java:27 blake3(0x1e, 32);
  15. src/peergos/shared/user/fs/Blake3state.java:29 return new Blake3state(hash);
  16. src/peergos/shared/user/fs/HashTree.java:102 if (! Chunk.usesBlake3(chunkSize))
  17. src/peergos/shared/user/fs/HashTree.java:105 return h.blake3(data);
  18. src/peergos/shared/user/fs/HashTree.java:106 return h.blake3ChainingValue(data, chunkIndex * (chunkSize / Blake3.CHUNK_SIZE));
  19. src/peergos/shared/user/fs/HashTree.java:116 if (! Chunk.usesBlake3(chunkSize))
  20. src/peergos/shared/user/fs/HashTree.java:119 return h.blake3Section(f, start, end);
  21. src/peergos/shared/user/fs/HashTree.java:120 return h.blake3SectionChainingValue(f, start, end, chunkIndex * (chunkSize / Blake3.CHUNK_SIZE));
  22. src/peergos/shared/user/fs/HashTree.java:193 if (Chunk.usesBlake3(chunkSize))
  23. src/peergos/shared/user/fs/HashTree.java:194 return Futures.of(buildBlake3(chunkHashes));
code.named-call
scrypt Quantum-safe 22 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/peergos/server/Builder.java:63 return initCrypto(new ScryptJava(), Optional.empty());
  2. src/peergos/server/Builder.java:508 ScryptJava hasher = new ScryptJava();
  3. src/peergos/server/Builder.java:534 ScryptJava hasher = new ScryptJava();
  4. src/peergos/server/crypto/hash/lambdaworks/crypto/SCrypt.java:48 return native_library_loaded ? scryptN(passwd, salt, N, r, p, dkLen) : scryptJ(passwd, salt, N, r, p, dkLen);
  5. src/peergos/server/GcCLI.java:94 Crypto crypto = initCrypto(new ScryptJava(), a.getOptionalArg("native-tweetnacl-path").map(Paths::get));
  6. src/peergos/server/JavaCrypto.java:19 return Crypto.init(() -> new Crypto(random, new ScryptJava(), symmetricProvider, signer, boxer, javaMlkem));
  7. src/peergos/server/Main.java:670 Crypto crypto = initCrypto(new ScryptJava(), nativeLibPath);
  8. src/peergos/server/Main.java:683 ScryptJava hasher = new ScryptJava();
  9. src/peergos/server/Main.java:848 Crypto crypto = initCrypto(new ScryptJava(), nativeLibPath);
  10. src/peergos/server/Main.java:1397 ScryptJava hasher = new ScryptJava();
  11. src/peergos/shared/crypto/hash/ScryptJS.java:13 NativeScryptJS scriptJS = new NativeScryptJS();
  12. src/peergos/shared/Crypto.java:55 return init(() -> new Crypto(random, new ScryptJS(), symmetricProvider, signer, boxer, mlkem));
  13. src/peergos/shared/crypto/password/PasswordProtected.java:15 return new ScryptGenerator(ScryptGenerator.LOGIN_MEMORY_COST, 8, 1, 32, "");
  14. src/peergos/shared/NetworkAccess.java:230 ScryptJS hasher = new ScryptJS();
  15. src/peergos/shared/user/fs/EncryptedCapability.java:16 public static final ScryptGenerator LINK_KEY_GENERATOR = new ScryptGenerator(15, 8, 1, 32, "");
  16. src/peergos/shared/user/ScryptGenerator.java:44 return new ScryptGenerator(memoryCost, cpuCost, parallelism, 64, extraSalt);
  17. src/peergos/shared/user/ScryptGenerator.java:71 return new ScryptGenerator(memoryCost, cpuCost, parallelsm, outputBytes, extraSalt);
  18. src/peergos/shared/user/SecretGenerationAlgorithm.java:15 Scrypt(0x1);
  19. src/peergos/shared/user/SecretGenerationAlgorithm.java:41 return new ScryptGenerator(ScryptGenerator.LOGIN_MEMORY_COST, 8, 1, 64, generateSalt(rnd));
  20. src/peergos/shared/user/SecretGenerationAlgorithm.java:45 return new ScryptGenerator(ScryptGenerator.LOGIN_MEMORY_COST, 8, 1, 96, generateSalt(rnd));
  21. src/peergos/shared/user/SecretGenerationAlgorithm.java:49 return new ScryptGenerator(ScryptGenerator.LOGIN_MEMORY_COST, 8, 1, 64, "");
  22. src/peergos/shared/user/SecretGenerationAlgorithm.java:59 return new ScryptGenerator(scrypt.memoryCost, scrypt.cpuCost, scrypt.parallelism, scrypt.outputBytes, generateSalt(rnd));
code.named-call
ML-KEM-768 Quantum-safe 21 places See details

Post-quantum algorithm through BouncyCastle

A `org.bouncycastle.pqc` class. This is migration work already in progress and is recorded so the inventory shows what has been done, not only what is outstanding.

This is already a quantum-safe algorithm. It is listed so the report shows the work that has been completed.

What to do. None. Confirm the parameter set matches the required NIST category.

  1. src/peergos/server/crypto/asymmetric/mlkem/fips203/codec/MLKEMCodec.java:11 public class MLKEMCodec implements Codec {
  2. src/peergos/server/crypto/asymmetric/mlkem/fips203/decaps/mlkem/MLKEMDecapsulator.java:19 public class MLKEMDecapsulator implements peergos.server.crypto.asymmetric.mlkem.fips203.decaps.Decapsulator {
  3. src/peergos/server/crypto/asymmetric/mlkem/fips203/decaps/provider/MLKEMDecapsulatorProvider.java:13 public class MLKEMDecapsulatorProvider implements KEMSpi.DecapsulatorSpi {
  4. src/peergos/server/crypto/asymmetric/mlkem/fips203/decrypt/kpke/KPKEDecryptor.java:27 MLKEMCodec.create(parameterSet),
  5. src/peergos/server/crypto/asymmetric/mlkem/fips203/encaps/mlkem/MLKEMEncapsulation.java:9 public class MLKEMEncapsulation implements Encapsulation {
  6. src/peergos/server/crypto/asymmetric/mlkem/fips203/encaps/mlkem/MLKEMEncapsulator.java:14 public class MLKEMEncapsulator implements peergos.server.crypto.asymmetric.mlkem.fips203.encaps.Encapsulator {
  7. src/peergos/server/crypto/asymmetric/mlkem/fips203/encaps/provider/MLKEMEncapsulationProvider.java:6 public class MLKEMEncapsulationProvider implements KEMSpi.EncapsulatorSpi {
  8. src/peergos/server/crypto/asymmetric/mlkem/fips203/encrypt/kpke/KPKEEncryptor.java:35 MLKEMCodec.create(parameterSet),
  9. src/peergos/server/crypto/asymmetric/mlkem/fips203/hash/MLKEMHash.java:13 public class MLKEMHash implements Hash {
  10. src/peergos/server/crypto/asymmetric/mlkem/fips203/key/gen/mlkem/MLKEMKeyPairGenerator.java:21 public final class MLKEMKeyPairGenerator implements KeyPairGeneration {
  11. src/peergos/server/crypto/asymmetric/mlkem/fips203/key/gen/provider/MLKEMKeyGenerationProvider.java:9 public class MLKEMKeyGenerationProvider extends KeyPairGeneratorSpi {
  12. src/peergos/server/crypto/asymmetric/mlkem/fips203/key/mlkem/MLKEMDecapsulationKey.java:7 public class MLKEMDecapsulationKey implements DecapsulationKey {
  13. src/peergos/server/crypto/asymmetric/mlkem/fips203/key/mlkem/MLKEMEncapsulationKey.java:7 public class MLKEMEncapsulationKey implements EncapsulationKey {
  14. src/peergos/server/crypto/asymmetric/mlkem/fips203/key/mlkem/MLKEMKeyPair.java:9 public class MLKEMKeyPair implements KeyPair {
  15. src/peergos/server/crypto/asymmetric/mlkem/fips203/key/mlkem/MLKEMSharedSecretKey.java:7 public class MLKEMSharedSecretKey implements SharedSecretKey {
  16. src/peergos/server/crypto/asymmetric/mlkem/fips203/message/MLKEMCipherText.java:3 public class MLKEMCipherText implements CipherText {
  17. src/peergos/server/crypto/asymmetric/mlkem/fips203/MimicloneFIPS203.java:46 this.keyPairGenerator = MLKEMKeyPairGenerator.create(parameterSet);
  18. src/peergos/server/crypto/asymmetric/mlkem/fips203/provider/MimicloneSecurityProvider.java:35 case "ML-KEM-512": return MLKEMKeyGenerationProvider.getMLKEM512Provider();
  19. src/peergos/server/crypto/asymmetric/mlkem/fips203/provider/MLKEMProvider.java:10 public class MLKEMProvider implements KEMSpi {
  20. src/peergos/server/crypto/asymmetric/mlkem/fips203/transform/MLKEMTransformer.java:11 public class MLKEMTransformer implements Transformer {
  21. src/peergos/server/crypto/asymmetric/mlkem/JavaMlkem.java:36 EncapsulationKey publicKey = MLKEMEncapsulationKey.create(publicKeyBytes);
java.bouncycastle.pqc
HMAC-SHA256 Quantum-safe 9 places 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/peergos/server/crypto/hash/lambdaworks/crypto/SCrypt.java:86 Mac mac = Mac.getInstance("HmacSHA256");
  2. src/peergos/server/crypto/hash/lambdaworks/crypto/SCrypt.java:87 mac.init(new SecretKeySpec(passwd, "HmacSHA256"));
  3. src/peergos/server/crypto/hash/ScryptJava.java:90 String algorithm = "HMACSHA256";
  4. src/peergos/server/crypto/hash/ScryptJava.java:91 Mac mac = Mac.getInstance(algorithm);
  5. src/peergos/server/crypto/hash/ScryptJava.java:92 SecretKey secretKey = new SecretKeySpec(secretKeyBytes, algorithm);
  6. src/peergos/server/crypto/hash/ScryptJava.java:94 return Futures.of(mac.doFinal(message));
  7. src/peergos/server/storage/LocalS3Handler.java:456 Mac mac = Mac.getInstance("HmacSHA256");
  8. src/peergos/server/storage/LocalS3Handler.java:457 mac.init(new SecretKeySpec(key, "HmacSHA256"));
  9. src/peergos/server/storage/LocalS3Handler.java:458 return mac.doFinal(data);
java.mac
HMAC-SHA256 Quantum-safe 8 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/peergos/shared/crypto/hash/Hasher.java:103 return hmacSha256(salt, ikm)
  2. src/peergos/shared/crypto/hash/Hasher.java:104 .thenCompose(prk -> hmacSha256(prk, hmacInfo));
  3. src/peergos/shared/crypto/hash/ScryptJS.java:32 return scriptJS.hmacSha256(secretKey, message);
  4. src/peergos/shared/storage/auth/S3Request.java:186 return hasher.hmacSha256(("AWS4" + s3SecretKey).getBytes(), shortDate.getBytes())
  5. src/peergos/shared/storage/auth/S3Request.java:187 .thenCompose(dateKey -> hasher.hmacSha256(dateKey, policy.region.getBytes()))
  6. src/peergos/shared/storage/auth/S3Request.java:188 .thenCompose(dateRegionKey -> hasher.hmacSha256(dateRegionKey, "s3".getBytes()))
  7. src/peergos/shared/storage/auth/S3Request.java:189 .thenCompose(dateRegionServiceKey -> hasher.hmacSha256(dateRegionServiceKey, "aws4_request".getBytes()))
  8. src/peergos/shared/storage/auth/S3Request.java:190 .thenCompose(signingKey -> hasher.hmacSha256(signingKey, stringToSign.getBytes()))
code.named-call
Salsa20 Quantum-safe 6 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/peergos/server/crypto/hash/lambdaworks/crypto/SCrypt.java:136 salsa20_8(X);
  2. src/peergos/server/crypto/TweetNaCl.java:235 crypto_core_salsa20(x,z,k,sigma);
  3. src/peergos/server/crypto/TweetNaCl.java:248 crypto_core_salsa20(x,z,k,sigma);
  4. src/peergos/server/crypto/TweetNaCl.java:256 return crypto_stream_salsa20_xor(c,null,d,n, nOff, k);
  5. src/peergos/server/crypto/TweetNaCl.java:263 return crypto_stream_salsa20(c, d, n, 16, s);
  6. src/peergos/server/crypto/TweetNaCl.java:270 return crypto_stream_salsa20_xor(c, m, d, n, 16, s);
code.named-call
XSalsa20-Poly1305 Quantum-safe 6 places See details

Authenticated encryption through NaCl or libsodium

`crypto_secretbox` (XSalsa20-Poly1305), the libsodium AEADs and the one-time authenticator. Symmetric, so not broken by a quantum computer.

This is the kind of encryption that quantum computers do not break.

What to do. No change needed; keep 256-bit keys.

  1. src/peergos/server/crypto/JniTweetNacl.java:166 int res = impl.crypto_secretbox(cipherText, expandedData, cipherText.length, nonce, key);
  2. src/peergos/server/crypto/JniTweetNacl.java:177 int res = impl.crypto_secretbox_open(message, expandedCipher, expandedCipher.length, nonce, key);
  3. src/peergos/server/crypto/symmetric/Salsa20Poly1305Java.java:10 return TweetNaCl.secretbox(data, nonce, key);
  4. src/peergos/server/crypto/symmetric/Salsa20Poly1305Java.java:15 return TweetNaCl.secretbox_open(cipher, nonce, key);
  5. src/peergos/shared/crypto/symmetric/TweetNaClKey.java:57 return implementation.secretbox(data, nonce, key);
  6. src/peergos/shared/crypto/symmetric/TweetNaClKey.java:62 return implementation.secretbox_open(cipher, nonce, key);
nacl.secretbox
HMAC Quantum-safe 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/peergos/server/storage/LocalS3Handler.java:396 String expectedSig = hex(hmac(signingKey, stringToSign.getBytes(StandardCharsets.UTF_8)));
  2. src/peergos/server/storage/LocalS3Handler.java:446 byte[] kDate = hmac(("AWS4" + secret).getBytes(StandardCharsets.UTF_8), shortDate.getBytes(StandardCharsets.UTF_8));
  3. src/peergos/server/storage/LocalS3Handler.java:447 byte[] kRegion = hmac(kDate, region.getBytes(StandardCharsets.UTF_8));
  4. src/peergos/server/storage/LocalS3Handler.java:448 byte[] kSvc = hmac(kRegion, "s3".getBytes(StandardCharsets.UTF_8));
  5. src/peergos/server/storage/LocalS3Handler.java:449 return hmac(kSvc, "aws4_request".getBytes(StandardCharsets.UTF_8));
code.named-call
BLAKE2b Quantum-safe 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/peergos/shared/crypto/hash/ScryptJS.java:37 return scriptJS.blake2b(input, outputBytes);
  2. src/peergos/shared/fingerprint/FingerPrint.java:166 input = h.blake2b(input, 64);
  3. src/peergos/shared/io/ipfs/Multihash.java:25 blake2b(0x40, 64),
code.named-call
HMAC Quantum-safe 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/peergos/server/storage/LocalS3Handler.java:22 private static final String ALGORITHM = "AWS4-HMAC-SHA256";
  2. src/peergos/shared/storage/auth/S3Request.java:26 private static final String ALGORITHM = "AWS4-HMAC-SHA256";
  3. src/peergos/shared/storage/auth/S3Request.java:273 res.put("X-Amz-Algorithm", ALGORITHM);
config.algorithm-setting · CWE-327
scrypt Quantum-safe 3 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/peergos/server/crypto/hash/lambdaworks/crypto/SCryptUtil.java:47 byte[] derived = SCrypt.scrypt(passwd.getBytes("UTF-8"), salt, N, r, p, 32);
  2. src/peergos/server/crypto/hash/lambdaworks/crypto/SCryptUtil.java:88 byte[] derived1 = SCrypt.scrypt(passwd.getBytes("UTF-8"), salt, N, r, p, 32);
  3. src/peergos/server/crypto/hash/ScryptJava.java:46 byte[] scryptHash = SCrypt.scrypt(hash, salt, memoryCost, cpuCost, parallelism, nOutputBytes);
java.kdf
HKDF 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/peergos/shared/crypto/asymmetric/mlkem/HybridCurve25519MLKEMPublicKey.java:47 return crypto.hasher.hkdfKey(ArrayOps.concat(curve25519SharedSecret, mlkemSharedSecret)).thenCompose(combinedSecret -> {
  2. src/peergos/shared/crypto/asymmetric/mlkem/HybridCurve25519MLKEMSecretKey.java:48 .thenCompose(mlkemSharedSecret -> crypto.hasher.hkdfKey(ArrayOps.concat(curve25519SharedSecret, mlkemSharedSecret))
code.named-call
XSalsa20-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.

  1. src/peergos/server/crypto/TweetNaCl.java:355 private static int crypto_secretbox(byte[] c,byte[] m,long d,byte[] n,byte[] k)
  2. src/peergos/server/crypto/TweetNaCl.java:365 private static int crypto_secretbox_open(byte[] m,byte[] c,long d,byte[] n,byte[] k)
code.implementation
scrypt 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
BLAKE2s 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
BLAKE3 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.

  1. src/peergos/shared/crypto/hash/Blake3.java:77 public final class Blake3 {
code.implementation
CSPRNG Quantum-safe 1 place See details

Random bytes through NaCl or libsodium

`randombytes` / `randombytes_buf`: the platform CSPRNG behind NaCl.

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

What to do. No action.

  1. src/peergos/server/crypto/random/SafeRandomJava.java:10 TweetNaCl.randomBytes(b, offset, len);
nacl.random
CSPRNG 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.

  1. src/peergos/server/crypto/TweetNaCl.java:1270 public static void randomBytes(byte[] b, int offset, int len) {
code.implementation
DRBG Quantum-safe 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/peergos/server/crypto/asymmetric/mlkem/MlkemSecureRandom.java:12 private static final String SECURE_RBG_ALGO = "DRBG";
config.algorithm-setting · CWE-327
HMAC-SHA1 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/peergos/shared/login/mfa/TotpKey.java:14 public static final String ALGORITHM = "HmacSHA1"; // Can't change this because google authenticator ignores the algorithm!!
java.mac
Poly1305 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.

  1. src/peergos/server/crypto/TweetNaCl.java:287 private static int crypto_onetimeauth(byte[] out, int outOff, byte[] m, int mOff, long n,byte[] k)
code.implementation
SHA-512 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.

  1. src/peergos/server/crypto/TweetNaCl.java:594 private static int crypto_hash(byte[] out, byte[] m, int n) {
code.implementation
SHA-512 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
SHA3-512 Quantum-safe 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.

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/peergos/server/crypto/asymmetric/mlkem/fips203/hash/MLKEMHash.java:49 sha3Hash512 = MessageDigest.getInstance("SHA3-512");
java.messagedigest · CWE-328
SHAKE256 Quantum-safe 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/peergos/server/crypto/asymmetric/mlkem/fips202/Constants.java:16 public static final String SHAKE256_STREAM_CIPHER = "SHAKE256";
config.algorithm-setting · CWE-327
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.

  1. src/peergos/server/crypto/TweetNaCl.java:266 private static int crypto_stream_xor(byte[] c,byte[] m,long d,byte[] n,byte[] k)
code.implementation
XSalsa20-Poly1305 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.

  1. src/peergos/server/JavaCrypto.java:15 Salsa20Poly1305Java symmetricProvider = new Salsa20Poly1305Java();
code.named-call

Cryptographic assets

Algorithm Assessment What it means Occurrences
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. 110
CSPRNG Quantum-safe A cryptographically secure random number generator provided by the platform. Not weakened by a quantum computer. 102
HMAC Quantum-safe A keyed MAC is not affected by Shor and only marginally by Grover. 50
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. 43
Ed25519 Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. 42
X25519 Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. 32
scrypt Quantum-safe No known quantum algorithm changes the security margin. 27
BLAKE3 Quantum-safe No known quantum algorithm changes the security margin. 24
ML-KEM-768 Quantum-safe No known quantum algorithm changes the security margin. 21
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. 15
Keccak-256 Reduced margin Grover's algorithm halves the effective strength; the parameter, not the design, is the problem. 12
XSalsa20-Poly1305 Quantum-safe No known quantum algorithm changes the security margin. 9
MD5 Already broken Practical chosen-prefix collisions exist; MD5 has no remaining security as a digest. 7
Salsa20 Quantum-safe No known quantum algorithm changes the security margin. The XSalsa20 and XChaCha20 variants share this property. 6
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. 4
BLAKE2 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
HKDF Quantum-safe No known quantum algorithm changes the security margin. 2
SHA-512 Quantum-safe No known quantum algorithm changes the security margin. 2
RSA Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. 1
DRBG Quantum-safe No known quantum algorithm changes the security margin. 1
ECDSA Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. 1
EdDSA Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. 1
Poly1305 Quantum-safe No known quantum algorithm changes the security margin. 1
SHA3-256 Reduced margin Grover's algorithm halves the effective strength; the parameter, not the design, is the problem. 1
SHA3-512 Quantum-safe No known quantum algorithm changes the security margin. 1
SHAKE128 Reduced margin Grover's algorithm halves the effective strength; the parameter, not the design, is the problem. 1
SHAKE256 Quantum-safe No known quantum algorithm changes the security margin. 1
XSalsa20 Quantum-safe No known quantum algorithm changes the security margin. 1

Imported cryptographic libraries

Library Files
javax.net.ssl the TLS client and server 2
org.bouncycastle BouncyCastle, whose low-level API bypasses the JCA algorithm strings. It has shipped ML-KEM and ML-DSA since 1.79 1
javax.crypto the JCE 33