Supported key exchange algorithms
Key exchange (KEX) algorithms set up the shared secret that the session’s encryption keys are made from. ZestSSH’s SSH engine (zest_ssh_core) offers the algorithms below.
ZestSSH offers a modern-only set by default, with the two post-quantum hybrids first. The per-host Compatibility mode switch adds two SHA-1 exchanges for older servers. Each list below is in the order ZestSSH offers it, most preferred first. The server picks the first algorithm on ZestSSH’s list that it also has.
Offered by default
Section titled “Offered by default”| Algorithm | Type | Hash |
|---|---|---|
mlkem768x25519-sha256 |
Post-quantum hybrid (ML-KEM-768 + X25519) | SHA-256 |
sntrup761x25519-sha512 |
Post-quantum hybrid (Streamlined NTRU Prime 761 + X25519) | SHA-512 |
sntrup761x25519-sha512@openssh.com |
The same exchange, OpenSSH’s original name | SHA-512 |
curve25519-sha256@libssh.org |
ECDH (Curve25519) | SHA-256 |
curve25519-sha256 |
ECDH (Curve25519), the RFC 8731 name | SHA-256 |
ecdh-sha2-nistp521 |
ECDH (NIST P-521) | SHA-512 |
ecdh-sha2-nistp384 |
ECDH (NIST P-384) | SHA-384 |
ecdh-sha2-nistp256 |
ECDH (NIST P-256) | SHA-256 |
diffie-hellman-group-exchange-sha256 |
DH group exchange | SHA-256 |
diffie-hellman-group14-sha256 |
Fixed-group DH (Group 14, 2048-bit) | SHA-256 |
In its first key exchange ZestSSH also adds two markers to this list: ext-info-c (it asks the server for its extensions, RFC 8308) and kex-strict-c-v00@openssh.com (the strict key exchange against the Terrapin attack). See SSH protocol support.
Post-quantum hybrids
Section titled “Post-quantum hybrids”Both hybrids pair a post-quantum key encapsulation mechanism (KEM) with a classic X25519 exchange in one handshake. The session secret is a hash of both secrets together, so the session is only as weak as the stronger of the two: a future quantum computer that breaks X25519 still faces the KEM. This protects a session against “harvest now, decrypt later”, where traffic recorded today is decrypted years from now.
A server that lists neither hybrid simply agrees on one of the classic exchanges below.
mlkem768x25519-sha256
Section titled “mlkem768x25519-sha256”| Property | Value |
|---|---|
| Type | Hybrid: ML-KEM-768 + X25519 |
| Hash | SHA-256 |
| Servers | The default of OpenSSH 9.9 and later |
sntrup761x25519-sha512
Section titled “sntrup761x25519-sha512”| Property | Value |
|---|---|
| Type | Hybrid: Streamlined NTRU Prime 761 + X25519 |
| Hash | SHA-512 |
| Servers | Offered by OpenSSH since 8.5 (under the @openssh.com name), the default from 9.0 to 9.8, still offered by 10.x |
This is what an Ubuntu 24.04 or Debian 12 server picks. ZestSSH offers both spellings, so servers of either age match.
Seeing which exchange a session used
Section titled “Seeing which exchange a session used”- On a computer: open the session’s Inspector from the session header. Under Details, the Key exchange row names the exchange, with a Post-quantum tag when it was a hybrid.
- On every device: the connection log has a line
ssh_kex: Negotiated <algorithm>after sign-in, with(post-quantum hybrid)after a hybrid. See Reading connection logs.
Classic exchanges
Section titled “Classic exchanges”curve25519-sha256@libssh.org and curve25519-sha256
Section titled “curve25519-sha256@libssh.org and curve25519-sha256”| Property | Value |
|---|---|
| Type | Elliptic Curve Diffie-Hellman |
| Curve | Curve25519 |
| Hash | SHA-256 |
curve25519-sha256 is the RFC 8731 (IANA) name of the same exchange. ZestSSH offers both.
ecdh-sha2-nistp521, ecdh-sha2-nistp384, ecdh-sha2-nistp256
Section titled “ecdh-sha2-nistp521, ecdh-sha2-nistp384, ecdh-sha2-nistp256”| Algorithm | Curve | Hash |
|---|---|---|
ecdh-sha2-nistp521 |
NIST P-521 | SHA-512 |
ecdh-sha2-nistp384 |
NIST P-384 | SHA-384 |
ecdh-sha2-nistp256 |
NIST P-256 | SHA-256 |
diffie-hellman-group-exchange-sha256
Section titled “diffie-hellman-group-exchange-sha256”| Property | Value |
|---|---|
| Type | Diffie-Hellman group exchange |
| Hash | SHA-256 |
| Group size asked for | 3072 bits (2048 at the least, 8192 at the most) |
In a group exchange the server names the group. ZestSSH asks for a group of 3072 bits and takes one from 2048 to 8192 bits. A group shorter than 2048 bits, or one that is not a usable group (for example an even modulus, or a generator of 0 or 1), is refused and the connection is not made.
diffie-hellman-group14-sha256
Section titled “diffie-hellman-group14-sha256”| Property | Value |
|---|---|
| Type | Fixed-group Diffie-Hellman |
| Group | Group 14 (2048-bit) |
| Hash | SHA-256 |
Compatibility mode
Section titled “Compatibility mode”These two SHA-1 exchanges are offered only when the host has Compatibility mode turned on. Compatibility mode only appends them: the post-quantum hybrids and the modern set stay first, so a server that has a modern exchange still picks it.
| Algorithm | Type | Hash |
|---|---|---|
diffie-hellman-group14-sha1 |
Fixed-group DH (Group 14, 2048-bit) | SHA-1 |
diffie-hellman-group-exchange-sha1 |
DH group exchange (1024 to 8192 bits in Compatibility mode) | SHA-1 |
In a group exchange, Compatibility mode also takes a group of 1024 bits (it asks for 1024 at the least, 3072 preferred, 8192 at the most), as some old servers have no longer group; with it off, a group under 2048 bits is refused, and the error says that Compatibility mode can connect to such a server. Nothing under 1024 bits is ever taken.
Compatibility mode is a switch in the host editor, Compatibility mode (old servers only): on a computer under Auth > Show advanced options, on a phone under Advanced options. It is not recommended: turn it on only for an old server that cannot be updated.
Not offered
Section titled “Not offered”diffie-hellman-group1-sha1 (Group 1, 1024-bit DH with SHA-1) is not offered, not even in Compatibility mode. Group 14 (2048-bit) is supported by anything that speaks SSH-2, so Group 1 adds no real compatibility, and a 1024-bit group can be broken by an attacker with enough resources.
Recommendation
Section titled “Recommendation”You do not need to choose. ZestSSH offers the post-quantum hybrids first and the server picks the best exchange it has: against OpenSSH 9.9 or later that is mlkem768x25519-sha256, against OpenSSH 9.0 to 9.8 it is sntrup761x25519-sha512. Turn on Compatibility mode only for a server that cannot be updated and needs the SHA-1 exchanges.
When no exchange matches
Section titled “When no exchange matches”If the server and ZestSSH have no key exchange in common, the connection is not made and the error, Algorithm mismatch, says which kind of algorithm did not match. Where Compatibility mode has something the server offers, the error tells you to turn it on. Where it would not help, the error says that no setting in ZestSSH changes this and that the server has to offer something ZestSSH has. Copy details on the error lists what each side offered.
To see which key exchanges a server supports, run this on the server:
ssh -Q kex