Post-quantum public keys are enormous and it's really annoying for SSH keys but... why are we not using hashes?
Hardware has done this for many years. Store the hash of the public key, have the other side send the full public key on the wire.
It's basically a drop in abstraction that works for any digital signature application. The public key becomes just a SHA2 hash, and the signature embeds the real public key. It could be standardized at the crypto layer.
@lina Would this blow up the signature though? Also, and perhaps I'm overthinking it. But isn't the point of hardware doing this because it's stateful?
IDK, like every time you sign something, you have to update a counter so that you don't reuse a leaf. And so, say you have SSH keys that you backup and then move over to somewhere else. You get a new counter there or doing that in software feels fragile.
Is there a problem with OpenSSH's hybrid approach? Like say mlkem768x25519-sha256? I thought the default already was hybrid PQC? But I could be wrong about that.
@pop_justy No, hardware does this because OTP memory is expensive so it makes way more sense to store the hash only. This is how Intel microcode updates work for example. The full public key comes with the update, the CPU only knows the hash.
@lina Wouldn't that just make the signatures bigger? For ML-DSA the signatures are already larger than the public key and this just makes it worse.
@lina In the specific case of TLS, eliminating the ~5 signatures needed to verify the certificate chain is a major reason for switching to merkle tree certificates
@e_nomem It does make the signatures bigger but humans aren't copying and pasting those around, they are copying and pasting the keys. If the key is smaller than the signature then it's a marginal increase and worth it.
@lina Huh, the size of the ML-DSA-44 keys is surprising. 1312 *bytes*, not *bits*? That's bigger than most of the RSA keys people were using.
There's no technical reason why, say, the ssh "authorized_keys" and "known_hosts" files couldn't use the key fingerprint (hash) instead of the holding the entire public key, I suppose.
But given the general purpose machines that openssh runs on, i guess there just hasn't been a good enough reason to change it… plus the openssh folks don't seem like the type to trust a hash if they could trust the entire public key instead.
The way certificate validation in TLS works right now, it seems like they've optimized for reducing the number of packets being sent during connection setup rather than reduce storage size in the clients. Clients are expected to have the entire certificate, including the public key, for the trusted "root" certificates - and servers assume the clients have those, and don't send them during connection setup.
@kepstin They need to trust hashes anyway for the rest of the protocol. If common hashes are broken we have bigger problems.
I'm not saying this makes sense for TLS.
@lina Though with fingerprints you need to get the public key from yet another channel... smaller signatures but more bookkeeping
@koakuma The public key is delivered with the signature. This can be implemented at the crypto layer without any protocol/application logic changes.
@lina doesn’t that only prove the peer has the public key? Says nothing about control of the secret key. SLH-DSA is a signature scheme based on hashing; the keys are small but the signatures are huge.
@chrisvest @lina meant the signature is the original signature (generated from private key and challenge/data) *plus* the public key (generated from private key)
@dramforever @lina ah, ok. Kinda like certain pinning but to trade smaller key storage for larger signatures
@dramforever @lina what’s the annoyance with having large public keys with SSH, though?
@chrisvest @dramforever It gets really annoying when editing authorized_keys files...
@lina Yeah... that's a neat idea
Still thinking thou that... public key you send one time but signature you send many times
In my simple mind the economics looks better if you have large public key but only need to transfer small fingerprint when actually signing things 
@lina (Though again I'm thinking here for Internet applications where your computers usually have enough storage but can be in spotty 2G connection)
@koakuma I mean nothing says you *have* to do it this way. You could have both options.
@lina Ah, yeah. I'm no cryptographer but I don't really see a problem with storing the fingerprint/hash in the authorized keys file instead of the actual public key for SSH.
@e_nomem Intel does this for their CPU microcode updates already, it's relatively common in hardware (because OTP ROM is expensive).
@lina wait why do we want to have the larger thing be going over the network every time instead of just once
@rcombs The signatures are already longer anyway, it's only 50% worse.
@charlotte @e_nomem It's only ~50% worse than the already huge signatures anyway. Doesn't really make a big difference.
@charlotte @e_nomem @lina SSH already sends the whole key, sadly. That allows screwups, like looking it up case-insensitively.