Skip to content

Add ML-KEM hybrid post-quantum key exchange support - #2604

Closed
alex wants to merge 1 commit into
paramiko:mainfrom
alex:claude/add-mlkem-support-edvYS
Closed

alex wants to merge 1 commit into
paramiko:mainfrom
alex:claude/add-mlkem-support-edvYS

Conversation

@alex

@alex alex commented May 10, 2026 •

Copy link
Copy Markdown
Member

Implements mlkem768x25519-sha256 from
draft-ietf-sshm-mlkem-hybrid-kex, combining ML-KEM-768 (FIPS 203) with X25519. The shared secret is SHA-256(K_PQ || K_CL); per the draft, K is encoded as an SSH string (rather than an mpint) in both the exchange hash and the symmetric key derivation.

ML-KEM is provided by pyca/cryptography (>=48), which itself requires OpenSSL 3.5+, AWS-LC, or BoringSSL. The kex method is auto-registered when ML-KEM is importable and is preferred over the existing classical methods. Verified interoperable with OpenSSH 10.0 in both directions.

@tomkins

tomkins commented Aug 4, 2026

Copy link
Copy Markdown

Not a code review (this definitely isn't my area of expertise!).

But - applied this patch to a currently installed paramiko 5.0.0 (Python 3.13, macOS 26) - and does work against a server configured for post-quantum only KexAlgorithms.

@mauricioharley

Copy link
Copy Markdown

Nice work here, the K-as-string vs mpint handling and reusing the small-order X25519 check are the kind of details that are easy to get wrong in a hybrid kex port.

Following this because I'm evaluating PQC SSH options for some Python tooling built on paramiko. Any idea what's blocking review, or just waiting on maintainer time? Also curious if [email protected] is on the radar too, since it covers a lot more OpenSSH servers out there than ML-KEM does right now.

@alex

alex commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

a) This is just waiting for maintainer review bandwidth.
b) No, I have no plans to do sntrup, since pyca/cryptography doesn't have any plans to expose it.

Implements `mlkem768x25519-sha256` from
draft-ietf-sshm-mlkem-hybrid-kex, combining ML-KEM-768 (FIPS 203) with
X25519. The shared secret is SHA-256(K_PQ || K_CL); per the draft, K
is encoded as an SSH string (rather than an mpint) in both the
exchange hash and the symmetric key derivation.

ML-KEM is provided by pyca/cryptography (>=48), which itself requires
OpenSSL 3.5+, AWS-LC, or BoringSSL. The kex method is auto-registered
when ML-KEM is importable and is preferred over the existing classical
methods. Verified interoperable with OpenSSH 10.0 in both directions.
@alex
alex force-pushed the claude/add-mlkem-support-edvYS branch from d03f898 to e854862 Compare August 9, 2026 22:10
@alex alex closed this Aug 10, 2026
@alex
alex deleted the claude/add-mlkem-support-edvYS branch August 10, 2026 00:18
@alex

alex commented Aug 10, 2026

Copy link
Copy Markdown
Member Author

(Re-created as #2668)

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.

3 participants