logoalt Hacker News

tristor • today at 12:15 AM • 0 replies • view on HN

Technically, ML-KEM is an asymmetric cryptographic algorithm, so it emits a public and a private key as a keypair. Asymmetric keypairs are the basis for digital certificates, but are not by themselves sufficient. What makes a certificate a certificate is that it can be validated via a trust chain to its issuer, which is accomplished with digital signatures.

It would be more precise to say that an ML-KEM cert cannot sign itself, a certificate is meaningless without signatures from the issuer, and that is done using ML-DSA, which is a PQC asymmetric algo for digital signing. ML-KEM is not, by itself, designed to replace existing X509 certificates, rather that is the purpose of MTC. MTC provides an alternative pathway for certificate issuance that doesn't rely on signature chaining, because ML-DSA signatures are quite large.

Either way, key exchange (KEX) is a separate cryptographic action from authentication. The purpose of generating an SSH keypair is to authenticate you, over the encrypted tunnel established by the key exchange protocol.

Below I've snipped two sections from a debug for using OpenSSH 10.6 client to connect to an OpenSSH 10.6 server using PQC KEX and PQC authentication. As you can see, the ML-KEM hybrid KEX algorithm is used similar to normal TLS, where a session key using a symmetric cipher (chacha20-poly1305 in this case) and a MAC is set up. Once completed, within that session you use your ML-DSA private key to sign a nonce which is sent over the session and verified using the ML-DSA public key that is stored in the authorized_keys file.

  debug3: kex_choose_conf: will use strict KEX ordering
  debug1: kex: algorithm: mlkem768x25519-sha256
  debug1: kex: host key algorithm: ssh-mldsa44-ed25519
  debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
  debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
  debug3: send packet: type 30
  debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
  debug3: receive packet: type 31
  debug1: SSH2_MSG_KEX_ECDH_REPLY received
  debug1: Server host key: ssh-mldsa44-ed25519 SHA256:<redacted>
  debug3: record_hostkey: found key type MLDSA44-ED25519 in file <redacted>



  debug1: Next authentication method: publickey
  debug3: ssh_get_authentication_socket_path: path '<redacted>/agent.sock'
  debug2: get_agent_identities: ssh_agent_bind_hostkey: agent refused operation
  debug1: get_agent_identities: agent returned 8 keys
  debug1: Will attempt key: <redacted> MLDSA44-ED25519 SHA256:<redacted> explicit
  debug2: pubkey_prepare: done
  debug1: Offering public key: <redacted> MLDSA44-ED25519 SHA256:<redacted> explicit
  debug3: send packet: type 50
  debug2: we sent a publickey packet, wait for reply
  debug3: receive packet: type 60
  debug1: Server accepts key: <redacted> MLDSA44-ED25519 SHA256:<redacted> explicit
  debug3: sign_and_send_pubkey: using [email protected] with MLDSA44-ED25519 SHA256:<redacted>
  debug3: sign_and_send_pubkey: signing using ssh-mldsa44-ed25519 SHA256:<redacted>
  Enter passphrase for key '<redacted>':

For PQC, the standards make an explicit split between the asymmetric algorithm used for encryption (ML-KEM) and the asymmetric algorithm used for signing and authentication [which relies on signing] (ML-DSA). This differs for RSA and ECC, where the same algorithm is used for all three functions.