Crypto-View

Mastercard/client-encryption-java

Readiness score
58 of 100
How this is calculated · previous scan 58
Cryptographic posture
Quantum-vulnerable 13 Reduced margin 2 Could not be determined 32 Quantum-safe 1
To address21
Key establishment13
Inventory only1
Total findings49
What was analysed
Branch main
Commit 680da5afbc453670503f84fcfeb01a44f21e5115 Merge pull request #130 from Mastercard/version-bump
Committed 2026-08-12 08:27 UTC
Scanned 2026-09-07 18:53 UTC 3 days ago
Coverage 101 files, 86 java

Earlier scans of this repository

20 scans · score 58 → 11 · compare any two
20 scans · 58 → 11 (down 47). The filled point is the scan you are reading.
Scanned Commit Score To address
4 hours ago 680da5afbc45 main 11 31 Compare
5 hours ago 680da5afbc45 main 39 27 Compare
18 hours ago 680da5afbc45 main 39 27 Compare
19 hours ago 706794ea1904 39 27 Compare
19 hours ago 680da5afbc45 main 39 27 Compare
19 hours ago 680da5afbc45 main 39 27 Compare
19 hours ago 680da5afbc45 main 39 27 Compare
21 hours ago 680da5afbc45 main 39 27 Compare
1 day ago 680da5afbc45 main 39 27 Compare
1 day ago 680da5afbc45 main 39 27 Compare
1 day ago 680da5afbc45 main 39 27 Compare
1 day ago 680da5afbc45 main 59 21 Compare
2 days ago 680da5afbc45 main 58 21 Compare
2 days ago 680da5afbc45 main 58 21 Compare
2 days ago 680da5afbc45 main 58 21 Compare
3 days ago this scan 680da5afbc45 main 58 21
3 days ago 680da5afbc45 main 58 21 Compare
10 days ago 680da5afbc45 main 58 21 Compare
11 days ago 706794ea1904 58 21 Compare
11 days ago 706794ea1904 58 21 Compare

Every repository in this history is re-scanned weekly.

List of cryptographic assets

RSA Quantum-vulnerable Recorded traffic 4 places See details

Private key committed to the repository

A PEM private-key block. The header names the algorithm where the format is the legacy one; for PKCS#8 the algorithm OID is read out of the DER. A private key in version control is a present-day incident before it is a quantum question.

A secret key is stored in this repository's files. Anyone who can read the repository can use it. This needs attention today, regardless of quantum computers.

What to do. Revoke and rotate the key, then keep key material out of the repository. Record the algorithm in the inventory.

  1. src/test/resources/keys/pkcs1/test_key_pkcs1-1024.pem:1 test path -----BEGIN RSA PRIVATE KEY-----
  2. src/test/resources/keys/pkcs1/test_key_pkcs1-2048.pem:1 test path -----BEGIN RSA PRIVATE KEY-----
  3. src/test/resources/keys/pkcs1/test_key_pkcs1-4096.pem:1 test path -----BEGIN RSA PRIVATE KEY-----
  4. src/test/resources/keys/pkcs1/test_key_pkcs1-512.pem:1 test path -----BEGIN RSA PRIVATE KEY-----
pem.private-key · CWE-321, CWE-327
RSA Quantum-vulnerable Recorded traffic 1 place See details

Classical key material handled through the JCA

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

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. 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/main/java/com/mastercard/developer/utils/EncryptionUtils.java:99 KeyFactory keyFactory = KeyFactory.getInstance("RSA");
java.keyfactory · CWE-327
RSA1024-bit Quantum-vulnerable Recorded traffic 1 place See details

X.509 certificate

A PEM certificate. The subject public-key algorithm and key size are read from the SubjectPublicKeyInfo structure, and the not-after date is reported so certificates that outlive the migration window are visible.

This is a digital identity document. Its expiry date matters: one valid for many years locks in today's algorithms for that long.

What to do. Shorten certificate lifetimes so re-issuing with a post-quantum key is routine.

  1. src/test/resources/certificates/test_certificate-1024.pem:1 test path -----BEGIN CERTIFICATE-----
pem.certificate
RSA2048-bit Quantum-vulnerable Recorded traffic 1 place See details

X.509 certificate

A PEM certificate. The subject public-key algorithm and key size are read from the SubjectPublicKeyInfo structure, and the not-after date is reported so certificates that outlive the migration window are visible.

This is a digital identity document. Its expiry date matters: one valid for many years locks in today's algorithms for that long.

What to do. Shorten certificate lifetimes so re-issuing with a post-quantum key is routine.

  1. src/test/resources/certificates/test_certificate-2048.pem:1 test path -----BEGIN CERTIFICATE-----
pem.certificate
RSA4096-bit Quantum-vulnerable Recorded traffic 1 place See details

X.509 certificate

A PEM certificate. The subject public-key algorithm and key size are read from the SubjectPublicKeyInfo structure, and the not-after date is reported so certificates that outlive the migration window are visible.

This is a digital identity document. Its expiry date matters: one valid for many years locks in today's algorithms for that long.

What to do. Shorten certificate lifetimes so re-issuing with a post-quantum key is routine.

  1. src/test/resources/certificates/test_certificate-4096.pem:1 test path -----BEGIN CERTIFICATE-----
pem.certificate
RSA512-bit Quantum-vulnerable Recorded traffic 1 place See details

X.509 certificate

A PEM certificate. The subject public-key algorithm and key size are read from the SubjectPublicKeyInfo structure, and the not-after date is reported so certificates that outlive the migration window are visible.

This is a digital identity document. Its expiry date matters: one valid for many years locks in today's algorithms for that long.

What to do. Shorten certificate lifetimes so re-issuing with a post-quantum key is routine.

  1. src/test/resources/certificates/test_certificate-512.pem:1 test path -----BEGIN CERTIFICATE-----
pem.certificate
RSA1024-bit Quantum-vulnerable Recorded traffic 1 place See details

Private key committed to the repository

A PEM private-key block. The header names the algorithm where the format is the legacy one; for PKCS#8 the algorithm OID is read out of the DER. A private key in version control is a present-day incident before it is a quantum question.

A secret key is stored in this repository's files. Anyone who can read the repository can use it. This needs attention today, regardless of quantum computers.

What to do. Revoke and rotate the key, then keep key material out of the repository. Record the algorithm in the inventory.

  1. src/test/resources/keys/pkcs8/test_key_pkcs8-1024.pem:1 test path -----BEGIN PRIVATE KEY-----
pem.private-key · CWE-321, CWE-327
RSA2048-bit Quantum-vulnerable Recorded traffic 1 place See details

Private key committed to the repository

A PEM private-key block. The header names the algorithm where the format is the legacy one; for PKCS#8 the algorithm OID is read out of the DER. A private key in version control is a present-day incident before it is a quantum question.

A secret key is stored in this repository's files. Anyone who can read the repository can use it. This needs attention today, regardless of quantum computers.

What to do. Revoke and rotate the key, then keep key material out of the repository. Record the algorithm in the inventory.

  1. src/test/resources/keys/pkcs8/test_key_pkcs8-2048.pem:1 test path -----BEGIN PRIVATE KEY-----
pem.private-key · CWE-321, CWE-327
RSA4096-bit Quantum-vulnerable Recorded traffic 1 place See details

Private key committed to the repository

A PEM private-key block. The header names the algorithm where the format is the legacy one; for PKCS#8 the algorithm OID is read out of the DER. A private key in version control is a present-day incident before it is a quantum question.

A secret key is stored in this repository's files. Anyone who can read the repository can use it. This needs attention today, regardless of quantum computers.

What to do. Revoke and rotate the key, then keep key material out of the repository. Record the algorithm in the inventory.

  1. src/test/resources/keys/pkcs8/test_key_pkcs8-4096.pem:1 test path -----BEGIN PRIVATE KEY-----
pem.private-key · CWE-321, CWE-327
RSA512-bit Quantum-vulnerable Recorded traffic 1 place See details

Private key committed to the repository

A PEM private-key block. The header names the algorithm where the format is the legacy one; for PKCS#8 the algorithm OID is read out of the DER. A private key in version control is a present-day incident before it is a quantum question.

A secret key is stored in this repository's files. Anyone who can read the repository can use it. This needs attention today, regardless of quantum computers.

What to do. Revoke and rotate the key, then keep key material out of the repository. Record the algorithm in the inventory.

  1. src/test/resources/keys/pkcs8/test_key_pkcs8-512.pem:1 test path -----BEGIN PRIVATE KEY-----
pem.private-key · CWE-321, CWE-327
SHA-256 Reduced margin 2 places See details

Hash algorithm through the JCA

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

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

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

  1. src/main/java/com/mastercard/developer/encryption/EncryptionConfigBuilder.java:51 MessageDigest messageDigest = MessageDigest.getInstance("SHA-256");
  2. src/test/java/com/mastercard/developer/utils/EncodingUtilsTest.java:25 test path String hex = EncodingUtils.hexEncode(MessageDigest.getInstance("SHA-256").digest("WIDDIES".getBytes()));
java.messagedigest · CWE-328
unknown Could not be determined 5 places See details

Key pair algorithm chosen at runtime

`KeyPairGenerator.getInstance(x)` where the argument is an identifier. The algorithm cannot be resolved without running the program, so this is reported as an unknown rather than assumed to be classical.

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

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

  1. src/main/java/com/mastercard/developer/encryption/FieldLevelEncryptionParams.java:112 KeyGenerator generator = KeyGenerator.getInstance(SYMMETRIC_KEY_TYPE);
  2. src/main/java/com/mastercard/developer/encryption/aes/AESCBC.java:31 Cipher cipher = Cipher.getInstance(CYPHER);
  3. src/main/java/com/mastercard/developer/encryption/aes/AESGCM.java:29 Cipher cipher = Cipher.getInstance(CYPHER);
  4. src/main/java/com/mastercard/developer/encryption/rsa/RSA.java:27 Cipher cipher = Cipher.getInstance(asymmetricCipher);
  5. src/main/java/com/mastercard/developer/encryption/rsa/RSA.java:42 Cipher cipher = Cipher.getInstance(asymmetricCipher);
java.keypairgenerator.variable · CWE-327
unknown Could not be determined 1 place See details

Key store holding classical key material

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

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

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

  1. src/main/java/com/mastercard/developer/utils/EncryptionUtils.java:90 KeyStore pkcs12KeyStore = KeyStore.getInstance("PKCS12");
java.keystore
CSPRNG Quantum-safe 1 place 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.

java.rng

Cryptographic assets

Algorithm Assessment What it means Occurrences
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. 32
RSA Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. 13
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. 2
CSPRNG Quantum-safe A cryptographically secure random number generator provided by the platform. Not weakened by a quantum computer. 1

Imported cryptographic libraries

Library Files
java.security — the JCA — algorithms are selected by string 18