cloudflare / go

Go with Cloudflare experimental patches
BSD 3-Clause "New" or "Revised" License
321 stars 43 forks source link

Add hybrid KEMTLS #68

Open claucece opened 3 years ago

claucece commented 3 years ago

We need to add a version of a hybrid KEMTLS. This needs to:

Depends on #66

claucece commented 3 years ago

cc./ @armfazh @bwesterb @thomwiggers

thomwiggers commented 3 years ago

"hybrid KEMTLS" is just KEMTLS with hybrid KEMs for the ephemeral and static (leaf cert) KEM, and and hybrid signature schemes in the signature chain.

The security proof does not rely on fancy properties of the KEMs or signature schemes, so we don't need to make any protocol changes in that sense. We might need to pick some identifiers but that's not any different from what needs to be done for PQ-only KEMs.

This is probably most easily implemented by treating the hybrid KEM as a completely independent algorithm from its constituent components. Treat "KyberX25519" is a "proper" algorithm and do not give it any special treatment on the wire compared to "X25519" or "Kyber". If that means duplicate X25519 public keys: so be it.

So that means following the same strategy as is proposed for draft-ietf-tls-hybrid-design. This draft only covers the (ephemeral) key exchange, of course, so we need to adjust also for the static KEM key exchange: just slap two keys together in the certificate as well and do the same for the ciphertext sent back to the server/client.

For certificates we can probably also do something similar: just slap two signatures together and verify both.

thomwiggers commented 3 years ago

So my previous post covers the specification more-or-less 😉

With regards to implementation changes that'd then be:

bwesterb commented 3 years ago

I agree with Thom. Circl already supports some hybrid KEMs (eg. Kyber512-X25519) and Signatures (eg. Ed25519-Dilithium3.). For the latter we have also have OIDs (see Old() in Circl.) For the former not yet — Cloudflare can just register them though — it's on the internal wiki how to.

We also need internal TLS identifiers, but we can just pick some in the reserved space. See TLSIdentifier in Circl.

claucece commented 3 years ago

yes! thanks you @thomwiggers @bwesterb

For the former not yet — Cloudflare can just register them though — it's on the internal wiki how to.

I'll check about this.

We also need internal TLS identifiers, but we can just pick some in the reserved space. See TLSIdentifier in Circl.

Perfect!

I'll add this to our KEMTLS draft ;)

claucece commented 3 years ago

On our next meeting, I'll like to talk about this questions, as taken from https://datatracker.ietf.org/doc/html/draft-ietf-tls-hybrid-design#section-4:

Putting it here for people to think about it prior to our meeting.

Also, cc./ @chris-wood

thomwiggers commented 3 years ago

Failures

Failures aiui only occur in IND-CPA secure KEMs, but you need an IND-CCA secure KEM (src: KEMTLS paper). This means failures would be cryptographically negligible