Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Vendor: libssh project · https://www.libssh.org/ · pkg:generic/libssh · Last reviewed 2026-12-05 · History

Summary

  • Hybrid key exchange is default from 0.12.0: the CHANGELOG lists sntrup761x25519-sha512, mlkem768nistp256-sha256, mlkem768x25519-sha256 and mlkem1024nistp384-sha384 and says “These are now preferred”; no pure post-quantum key exchange is offered.12
  • mlkem1024nistp384-sha384 is only built with OpenSSL 3.5 or later, or libgcrypt.1
  • Host keys, user keys and certificates are classical; requests and a draft merge request for ssh-mldsa44-ed25519 and pure ML-DSA keys are open (checked 2026-12-05).34
  • Classical key exchange can be disabled by the application with SSH_OPTIONS_KEY_EXCHANGE (client) or SSH_BIND_OPTIONS_KEY_EXCHANGE (server), or KexAlgorithms in a configuration file.56

To restrict to hybrids, call ssh_options_set(session, SSH_OPTIONS_KEY_EXCHANGE, "mlkem768x25519-sha256,sntrup761x25519-sha512"); the application must expose this.5

Cryptographic operations

  • Key exchange: libssh is a client and server SSH library, distinct from libssh2 and OpenSSH.7 Default list in src/kex.c at the commit checked:2
mlkem768x25519-sha256, mlkem768nistp256-sha256, mlkem1024nistp384-sha384,
sntrup761x25519-sha512, sntrup761x25519-sha512@openssh.com,
curve25519-sha256, curve25519-sha256@libssh.org,
ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521,
diffie-hellman-group18-sha512, diffie-hellman-group16-sha512,
diffie-hellman-group-exchange-sha256, diffie-hellman-group14-sha256
  • The first five are hybrid (ML-KEM-768 or -1024 with X25519 or an NIST curve; Streamlined NTRU Prime 761 with X25519); see mlkem768x25519-sha256 and sntrup761x25519-sha512. The rest are classical. Entries are omitted when the backend lacks support (HAVE_MLKEM1024, HAVE_SNTRUP761, HAVE_CURVE25519, HAVE_ECC, WITH_GEX).2
  • Host and user authentication: defaults are Ed25519, ECDSA P-521, P-384, P-256 (ECDSA), security-key variants, rsa-sha2-512, rsa-sha2-256, with matching certificate types; no post-quantum name (checked 2026-12-05).2
  • Signing data: 0.12.0 adds sshsig_sign() and sshsig_verify(), “New functions for signing arbitrary data (commits) with SSH keys”; accepted key types not stated.1

Versions

Change Version Date Package URL Source
Hybrid key exchange sntrup761x25519-sha512, sntrup761x25519-sha512@openssh.com, mlkem768nistp256-sha256, mlkem768x25519-sha256, mlkem1024nistp384-sha384 (OpenSSL 3.5+ and libgcrypt only); “These are now preferred” 0.12.0 2026-02-10 pkg:generic/libssh@0.12.0 1
Fix fallback to the default provider when the OpenSSL FIPS provider lacks ML-KEM 0.12.2 2026-07-28 (tag) pkg:generic/libssh@0.12.2 89

The 0.11 series (including 0.11.4, 2026-02-10, and 0.11.5) has no ML-KEM or sntrup761 CHANGELOG entry (checked 2026-12-05).1 0.12.2 is the newest release; its date is the tag’s commit date.9

Configuration

Enabling PQC

None from 0.12.0; hybrids are first in the default list.12

Disabling classical algorithms

  • No single switch: the application replaces the list or edits it with a prefix: “The list can be prepended by +,-,^ which will append, remove or move to the beginning (prioritizing) of the default list respectively.”5
ssh_options_set(session, SSH_OPTIONS_KEY_EXCHANGE,
    "mlkem768x25519-sha256,sntrup761x25519-sha512");
ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_KEY_EXCHANGE,
    "mlkem768x25519-sha256,sntrup761x25519-sha512");
  • Both configuration parsers read KexAlgorithms; a peer offering none of the listed algorithms cannot connect.610
  • SSH_OPTIONS_HOSTKEYS and SSH_OPTIONS_PUBLICKEY_ACCEPTED_TYPES set signature lists, but there is no post-quantum signature algorithm to list (checked 2026-12-05).210

Open work

Checked 2026-12-05 on the project’s GitLab.

  • Work item 589 (2026-12-04): add ssh-mldsa44-ed25519 and ssh-mldsa44-ed25519-cert; requested.3
  • Merge request 902 (2026-10-21), “pki: Add support for pure ML-DSA keys”: “This still needs quite a lot of love.”; in progress.4
  • Issue 378 (2026-10-19): a known_hosts line with unrecognised type ssh-mldsa44-ed25519 makes ssh_session_is_known_server() report the host unknown; open.11
  • Draft merge request 822 (2026-04-23): GSSAPI key exchange with hybrid ML-KEM, draft-kario-gss-keyex-pqc; in progress.12
  • Merge request 687 (2025-11-26, contributor): HQC-256 key exchange and Falcon-1024 signatures; open, not merged.13
  • Issue 315 (2025-07-25), “Review default cryptographic algorithms”, asks to prefer hybrids; still open although the default list already starts with them.142

References

  1. libssh CHANGELOG, version 0.12.0 (released 2026-02-10), commit-pinned. https://gitlab.com/libssh/libssh-mirror/-/blob/c008a85fc970bd2f1eaab1cb742e48a48532eaeb/CHANGELOG (accessed 2026-12-05) ↩ ↩2 ↩3 ↩4 ↩5 ↩6

  2. libssh src/kex.c, DEFAULT_KEY_EXCHANGE, HYBRID_MLKEM, DEFAULT_HOSTKEYS, commit c008a85f (2026-12-03). https://gitlab.com/libssh/libssh-mirror/-/blob/c008a85fc970bd2f1eaab1cb742e48a48532eaeb/src/kex.c (accessed 2026-12-05) ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7

  3. libssh work item 589, “Add support for ssh-mldsa44-ed25519 and ssh-mldsa44-ed25519-cert”, opened 2026-12-04. https://gitlab.com/libssh/libssh-mirror/-/work_items/589 (accessed 2026-12-05) ↩ ↩2

  4. libssh merge request 902, “pki: Add support for pure ML-DSA keys”, opened 2026-10-21. https://gitlab.com/libssh/libssh-mirror/-/merge_requests/902 (accessed 2026-12-05) ↩ ↩2

  5. libssh src/options.c, documentation of SSH_OPTIONS_KEY_EXCHANGE, commit c008a85f. https://gitlab.com/libssh/libssh-mirror/-/blob/c008a85fc970bd2f1eaab1cb742e48a48532eaeb/src/options.c (accessed 2026-12-05) ↩ ↩2 ↩3

  6. libssh src/bind_config.c and src/config.c, the KexAlgorithms keyword, commit c008a85f. https://gitlab.com/libssh/libssh-mirror/-/blob/c008a85fc970bd2f1eaab1cb742e48a48532eaeb/src/bind_config.c (accessed 2026-12-05) ↩ ↩2

  7. libssh.org, “libssh is a multiplatform C library implementing the SSHv2 protocol on client and server side.” https://www.libssh.org/ (accessed 2026-12-05) ↩

  8. libssh.org news, “libssh 0.12.2 security release”. https://www.libssh.org/ (accessed 2026-12-05) ↩

  9. libssh tags, via the GitLab API. https://gitlab.com/api/v4/projects/libssh%2Flibssh-mirror/repository/tags (accessed 2026-12-05) ↩ ↩2

  10. libssh include/libssh/libssh.h and include/libssh/server.h, option enumerations, commit c008a85f. https://gitlab.com/libssh/libssh-mirror/-/blob/c008a85fc970bd2f1eaab1cb742e48a48532eaeb/include/libssh/server.h (accessed 2026-12-05) ↩ ↩2

  11. libssh work item 378, opened 2026-10-19. https://gitlab.com/libssh/libssh-mirror/-/work_items/378 (accessed 2026-12-05) ↩

  12. libssh merge request 822, opened 2026-04-23. https://gitlab.com/libssh/libssh-mirror/-/merge_requests/822 (accessed 2026-12-05) ↩

  13. libssh merge request 687, opened 2025-11-26. https://gitlab.com/libssh/libssh-mirror/-/merge_requests/687 (accessed 2026-12-05) ↩

  14. libssh work item 315, “Review default cryptographic algorithms”, opened 2025-07-25. https://gitlab.com/libssh/libssh-mirror/-/work_items/315 (accessed 2026-12-05) ↩


Edit: libssh

If you give an email address it is recorded publicly as the author of the commit, and GitHub will link the commit to your account if that address belongs to one.

Edits are reviewed before they appear. By submitting you release your contribution under CC BY-SA 4.0. Read the editorial guidelines first.

This site uses Just the Docs, a documentation theme for Jekyll.