-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking issue for RFC 685 #701
Comments
libp2p/specs#351 (tld;dr libp2p engineers are terrified 🤣) |
Well, I don't think there is going to be a spec anytime soon, not sure if that is a deal breaker for you. However if you are using rust-libp2p I'd recommend using tcp/noise/yamux as that works with the relay and hole punching that will (hopefully) land soon and swallow the multiple roundtrips required to establish a connection. Let me know if there is anything I can help you with in regards to quinn-noise/ipfs-embed, radicle looks like a very interesting project. |
Thanks @dvc94ch. We considered (rust-)libp2p early on, but it didn't pull its weight for what we wanted to do. In that sense it does not matter much whether there is a libp2p spec or not -- although we obviously benefit from whatever libp2p standardises on, if only because that means it received peer review. However, since crypto is "baked in" to QUIC and not something that's added on top, it is unclear why libp2p / Protocol Labs should be standardising QUIC+Noise and not the IETF / QUIC-WG. I believe @marten-seemann's comment amounts to the same, although I can't infer whether or not he would see value in a QUIC+Noise standard. I remember @djc mentioning elsewhere that alternatives to TLS were considered in the WG, and now that the base specs are final there might be interest in reviving a Noise specification effort. I don't know, however, how one would get involved in that process when one is not knowledgeable enough to actually write the spec :) Perhaps the people mentioned would be willing to chime in? |
Having been an active member of the IETF QUIC working group since the beginning (late 2016), I'd say having this standardized in the IETF be the ideal situation. For protocol standardization, it's always best to have multiple players with vastly different use cases, if your intention is to specify a protocol that can be applied to a wide range of use cases. The problem here could be that most of the big players (at least those using QUIC on the web) will be quite happy with TLS 1.3. At the moment I'm not aware of any attempts to standardize Noise+QUIC, currently people are pretty busy building protocols on top of QUIC, for example MASQUE and WebTransport, as well as defining QUIC extensions, for example Version Negotiation, ACK frequency and various others.
The easiest way would be join the QUIC working group Slack channel, and ask around there. Most important is to find other people who're interested in putting in the effort to write an implementation (and a spec). |
See the QUIC WG mailing list thread on Noise: https://mailarchive.ietf.org/arch/msg/quic/iqkxQcb5pTtFA33aS6jwvwUPChY/. I wonder to what extent having Noise itself specified at the IETF would be a prerequisite to standardizing Noise + QUIC.
Not sure I agree with this sentiment. The QUIC tls spec is a separate document for a reason -- as far as I can tell, QUIC has been intended to abstract over the implementation of the confidentiality/integrity protocol for a long time. |
Ohhh...
Yes sure, what I was trying to express was that the way QUIC defines how it can be extended with crypto protocols is on a layer that libp2p should not need to concern itself with -- unless it would want to implement a less general protocol (which I'm not sure why they would want that). I think it's also fair to say that the transport-level primitives cater very much for TLS, which appears to make things more complicated for Noise specifically (by contrast, just layering a Noise state machine over plain TCP streams is almost trivial). Everytime this topic comes up, I have people expressing interest, but noone has stepped up yet to say that they would be willing the help make it happen. I'm not sure if I just haven't met the right people, or if it's indeed a matter of resources. Otoh, non-web focused organisations exist which could support this: PL, web3, and of course the Radicle Foundation. I guess I'll try the Slack route (thanks for the suggestion), or ask on the mailing list. It would be a shame if @dvc94ch's initiative would fizzle, like nQUIC did. |
just my 2 cents on the topic of security. I've been looking into what is involved in the libp2p quic tls specification again. While maybe it is secure in theory, bugs are proportional to the number of lines of code. adding tls in the libp2p flavor involves pulling in thousands of loc from more or less trusted and maintained sources. also there is the shear complexity of it. so I'm not convinced that the libp2p tls spec results in more security. Implementing my proposal, if you like it or not for whatever reason, is just a few hundred lines of code which can be easily audited. |
@dvc94ch I tend to agree -- modulo the Xoodyak stuff, which I haven't had the time yet to even read the paper, it is all very straightforward and most likely good enough(tm) for what radicle-link would require. My concerns are these:
|
I did the best I could on that one [0], but I don't have the money to pay for a proper audit. I don't even know what something like that would cost.
The current intention would be to support both. Try version a, if that fails, try version b. And at some point deprecate version b. Some work in that area was done here [1], but not sure if it is sufficient for a smooth transition.
With a little bit of effort something closer to noise could be designed. But it is not immediately obvious how to derive keys for an external cipher during the handshake (at least in code that is supposed to be generic over the handshake). Once the handshake is complete, you have data keys that can be used with any cipher. I guess the handshake state could be used as the seed for a csprng to extract some keys. |
I guess that isn't true. I'll ask on the noise mailing list what they think about it and if someone is interested in performing a thorough security audit + what it would cost. |
I guess the handshake state could be used as the seed for a csprng to extract some keys. So would be something like this:
If this is what makes people comfortable with it and there is interest in using it, I can implement it. |
@dvc94ch keep us updated, we'd be open to funding this effort. |
Can you explain again why you think snow doesn't provide what you need? The key derivation on the TLS side does not seem very complex to me, and I didn't quite understand what you wrote in libp2p/specs#351 (comment):
Going from the established crypto + protocol in TLS to a completely new implementation using a competition candidate algorithm seems like a big step back in maturity. Since QUIC + Noise is itself fairly novel, I'd recommend sticking with trusted implementations/algorithms as far as possible and seeking minimal extensions where it's not. |
There is an impedance missmatch between the quinn/snow api's. A clear example is that there is no support for providing the header as associated data when encrypting the packet in snow. The rest is a bit more subtle, but it certainly was hammering something that doesn't fit.
well, tls required quite a bit of contortion to make it fit quic too from what I understand. There is a reason why rustls requires the
just pointing out the list of dependencies required to make quic + tls work: compiling libp2p-quic with the noise feature flag has 243 dependencies while compiling it with the tls feature flag has 250 dependencies, which I must admit is not as dramatic as I expected. But it's still a non-negligable amount of code. it's also worth pointing out that snow hasn't been audited either. Quoting from the NIST finalist selection report published on the 21 july, maybe we should wait for 12 months and see if NIST decides to standardize it.
No clue what a zero-sum distinguisher is or a 4-round rotational differential-linear distinguisher is. |
At the protocol level the QUIC/TLS interaction different is quite different from TCP/TLS, and a bunch of experts spent a good amount of time thinking about how to make that work. This is why there is a separate QUIC API in rustls; the QUIC support does not itself require the use of
To be fair, the QUIC/TLS interaction just requires quinn-proto, rustls and ring (which in turn pull in webpki and untrusted). All the other stuff is about a different aspect of this implementation, the use of non-PKI certificates, which you would still need if you wanted to do TLS over TCP for libp2p scenarios. (And with snow you might also use ring and untrusted, so the difference is even smaller.)
Yes, but maturity is not a binary state. And it looks libp2p already has a libp2p-noise implementation, so it seems sensible to reuse that existing code rather than bifurcating efforts across different implementations. |
Oh is |
that one doesn't support 0-rtt encryption. It also doesn't really make sense to add as you have a large amount of roundtrips anyway. tcp handshake then negotiating noise using multistream-select, then the noise handshake, then negotiating the muxer, and then negotiating the application protocol on a substream. |
Another change to consider is replacing xoodyak with strobe. That would be almost a 1:1 primitive swap. strobe is used in ed25519-dalek for some advanced features, in bulletproofs and in schnorrkel. |
But to be honest, I'd like to just get a reasonable libp2p quic implementation so that I can focus on other problems. Like adding support for the nymtech mixnet to libp2p, testing the relay/hole punching, improving blake-streams which I think is pretty cool. |
Anyway, in 2023 quinn-noise (and tls) will be irreparably broken. So I don't think it's worth having a security audit, I'm sure it's good enough till 2023.
|
It's not quite as easy as just replacing ecdh with sidh. One issue is this one which I don't fully understand, quoting from the document you linked and also matching what I've read in other places:
and this one:
which I'm not sure if it fixes the first one, but means that quite a few assumptions are broken in libp2p:
and probably others one option to fix that might be using an NN handshake and authenticating the peer via a signing key and a signature. but a post quantum secure signature scheme would need to be selected too. in any case the result would certainly need a version bump of quinn-noise, that's for sure. |
if we are serious about PQC we should find a protocol that isn't based on dh but on KEM and signatures, as SIDH, SIKE and other supersingular isogeny based crypto won't be standardized for a while. would need to spend some time consulting the literature, I don't think [0] is exactly what we want, but goes in the right direction. If it has a universal composability proof we should be able to plug in anything that NIST standardizes in 2022. |
Not that hard to construct an AKE using KEM + signatures
There are even optimizations possible to this scheme [0]. This would allow peer-id's to only contain the hash of the public key if the public key is sent with the second message. |
Yeah afaik KEMs have also been proposed for WireGuard, which afaiu requires a PSK and/or out-of-band exchange of static keys. I can not, however, see the urgency of a PQ resistant handshake in open ("permissionless") peer-to-peer networks: identities are not effectively hidden, nor are they trusted. I would think that there are cheaper attacks. More impactful would be to ensure PQ data integrity, ie. a suitable signature scheme. I believe the NIST winner is due to be announced later this year. |
That's a good point that in some cases it won't matter. However let's say you configure some bootstrap nodes in a dht, you probably don't want anyone to be able to claim they're the node you're trying to contact. It's also not a good idea to provide the user with an abstraction that puts the burden on the user. Let's forget online attacks for now. The question is can someone record an encrypted communication and in 2023 rent an IBM cloud QC to find the shared secret and decrypt it, which at the moment is yes. |
One note on the IBM quantum roadmap. I'm pretty sure the number of qubits they are referring to are physical qubits, they'll still be several orders of magnitude away from 1500 logical qubits. |
that does sound reassuring, didn't realize I was comparing apples to oranges. so I guess we can wait a few years. thanks! |
Fyi it is 2023, and I believe we are still fine 😅 Though I still could use a security audit for quic + noise |
RFC PR: #685
The text was updated successfully, but these errors were encountered: