Skip to content

Java 24: Quantum-resistant ML-KEM and ML-DSA (JEP 496, 497) - #123

Draft
mperor wants to merge 1 commit into
masterfrom
DAILY/111-ml-kem-ml-dsa
Draft

mperor wants to merge 1 commit into
masterfrom
DAILY/111-ml-kem-ml-dsa

Conversation

@mperor

@mperor mperor commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

What you'll learn

  • How to generate an ML-KEM key pair and run a full encapsulate/decapsulate round trip with the KEM API, ending up with the same shared secret on both sides
  • How to sign and verify with ML-DSA through the familiar Signature API
  • Why a tampered message fails ML-DSA verification even though the signature bytes themselves are untouched

Why it matters

ML-KEM and ML-DSA are the NIST-standardized, quantum-resistant replacements for Diffie-Hellman/RSA key exchange and digital signatures; from JDK 24 they're built into the JDK with no extra library, so knowing the JCA names ("ML-KEM-768", "ML-DSA-65") is enough to start using them today.

Read more

Quiz

If you call verifier.verify(signature) with the correct public key but feed it a message that differs from the one that was signed, what does it return?

Answer It returns `false` (it does not throw). ML-DSA verification recomputes a check over the exact bytes passed to `update`; any difference from the signed message makes the signature fail to match, so `verify` simply reports `false` instead of raising an exception.

Note: tests were not run locally. The build requires a JDK 25 toolchain, which Gradle's foojay auto-provisioning tries to download from api.foojay.io; that host is blocked by this environment's network policy, and no JDK 25 is otherwise installed here. The ML-KEM/ML-DSA algorithm names and API usage are verified against JEP 496/497 and the KEM/Signature JCA docs. Opening as a draft so CI (which runs on JDK 25) can verify.

Closes #111

@mperor mperor added the daily Queued for the daily learning PR label Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

Test Results

309 tests  +3   306 ✅ +3   6s ⏱️ ±0s
 84 suites ±0     3 💤 ±0 
 84 files   ±0     0 ❌ ±0 

Results for commit fbb5f53. ± Comparison against base commit 40465e6.

This pull request skips 1 and un-skips 1 tests.
pl.mperor.lab.java.design.pattern.creational.singleton.SingletonTest ‑ testLazyInitialized()
pl.mperor.lab.java.design.pattern.creational.singleton.SingletonTest ‑ testSerializationSafe()

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

@mperor ⏰ This daily topic is still waiting for your review.

6 similar comments
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

@mperor ⏰ This daily topic is still waiting for your review.

@github-actions

Copy link
Copy Markdown

@mperor ⏰ This daily topic is still waiting for your review.

@github-actions

Copy link
Copy Markdown

@mperor ⏰ This daily topic is still waiting for your review.

@github-actions

Copy link
Copy Markdown

@mperor ⏰ This daily topic is still waiting for your review.

@github-actions

Copy link
Copy Markdown

@mperor ⏰ This daily topic is still waiting for your review.

@github-actions

Copy link
Copy Markdown

@mperor ⏰ This daily topic is still waiting for your review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

daily Queued for the daily learning PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Java 24: Quantum-resistant ML-KEM and ML-DSA (JEP 496, 497)

2 participants