Skip to content

Add OpenSSL-backed ML-KEM key exchange - #1005

Open
bdewater-thatch wants to merge 3 commits into
net-ssh:masterfrom
bdewater-thatch:pq-mlkem
Open

bdewater-thatch wants to merge 3 commits into
net-ssh:masterfrom
bdewater-thatch:pq-mlkem

Conversation

@bdewater-thatch

@bdewater-thatch bdewater-thatch commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

This PR adds support for mlkem768x25519-sha256 key exchange. It is dependant on ruby/openssl#1062 getting merged, but locally unit and integration tests pass when running that branch with a crypto backend that supports ML-KEM-768 (eg OpenSSL version 3.5+). When available, net-ssh advertises it ahead of existing key exchange algorithms; when unavailable, behavior is unchanged.

OpenSSH 10.0 made mlkem768x25519-sha256 the default key agreement algorithm for post-quantum safety. OpenSSH describes it as NIST-standardized, quantum-safe, no weaker than curve25519-sha256, and faster than the previous default: This is also where public-sector cryptography guidance is heading. NIST finalized ML-KEM in FIPS 203 in August 2024, and government roadmaps are starting to put late-2020s/2030s dates on PQC migration planning.

@mfazekas

Copy link
Copy Markdown
Collaborator

Thanks @bdewater-thatch! Status update: ruby/openssl#1062 was merged on 2026-06-22 but isn't in a released openssl gem yet (the latest is 4.0.2, from May). This PR now also conflicts with master: the kex lists changed in 8.0 (#925, and #1042 dropped diffie-hellman-group14-sha1 from the defaults). No rush; a rebase once an openssl release with KEM support is out would be great, and we'll review then.

@mfazekas

Copy link
Copy Markdown
Collaborator

Thanks for this! net-ssh now uses changelog fragments instead of edits to CHANGES.txt (see the Changelog section of CONTRIBUTING.md), and CI requires one per PR, so I pushed a commit adding changelog.d/1005.change.txt with a short entry for this change. Feel free to reword it.

@mfazekas

Copy link
Copy Markdown
Collaborator

Merged current master into the branch to pick up the latest changes.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants