On the Impending Crypto Monoculture (2016)
metzdowd.com
metzdowd.com
I don't agree with you at all about the equivalent of IV misuse under CBC+HMAC and nonce reuse under ChaPoly. It's a bug either way, and bugs in cryptosystems are bad, but it's much less bad in CBC+HMAC. That is in fact a good reason to use it.
It's always bad. I don't want to get into a semantic argument about whether or not a repeated IV is a vulnerability. It is. But it's not as severe a vulnerability as a repeated CTR nonce, which repeats the entire keystream.
The fact that you can’t think of an example is not a serious security argument. This is why we have rigorous security definitions rather than hand waving “I can’t think of anything” arguments, which should have died in the 90s.
I already gave you one example: key-wrapping. JOSE (of course) has a key-wrapping mode based on GCM, and at least one recent article advocates for its widespread use [1] (see recommendations at end). Despite me not agreeing with that advice, it is an example of where CTR loses no information at all under nonce reuse: the XOR of two random keys is itself indistinguishable from random.
I can certainly think of examples based on encrypting binary data streams where the XOR of plaintexts may also reveal very little. To decide whether CBC or CTR leaks more you have to consider the specifics of the application, or you have to make shaky assumptions about “typical” data. IMO those assumptions are not a good foundation for security and we should move past them.
[1]: https://scottarc.blog/2023/09/06/how-to-write-a-secure-jwt-l...
You also said that IV reuse in CBC mode can only be exploited if you setup an ECB-style attack. Also untrue.
Now you have retreated to merely claiming that CBC issues are less likely to be exploitable, but have provided absolutely zero evidence to backup that assertion. I don’t think you could really stand that up without making a bunch of assumptions about typical application data that I think are shaky.
The way to address this is not to endlessly debate the pros and cons of different confidentiality-only cipher modes. Instead, modern crypto acknowledges that none of them are CPA-secure in the case of IV reuse, and they all leak info in different ways. The best course of action is then to assume that in the worst case they are basically all terrible and design around that at higher levels: like SIV, or XChaCha, or whatever.
We just disagree. You have a purer take on this stuff. My personal experience, which is that of a vulnerability researcher and not that of a cryptography engineer, is that the purity test perspective is helpful for spotting patterns of vulnerability, but that's about it. It's demonstrably safer to run a CBC+HMAC authenticated secure channel than to run a GCM secure channel, and lots of people do exactly that for exactly that reason. The purity test vantage says "feh! the same bug exists in both!". The vulnerability researcher vantage says "no, all bugs are not in fact the same".
It's fine that we disagree.
In other words, if the latter system is flawed it ends up having the sort of security properties more akin to physical security rather than the strong mathematical assurances we expect from cryptographic systems.
Given the high rate of issues with nonce mishandling in real systems, even ones that appeared to be carefully engineered, it shouldn't be hard to understand why systems engineers (as opposed to, say, cryptographic researchers) would have an unambiguous preference for one over another when it comes to practical systems, at least if all else were equal (which, of course, it seldom is!).
> IMO those assumptions are not a good foundation for security and we should move past them.
No one here is advocating that using CBC with intentional potential IV reuse is good security. But defense in depth is a good security practice and using primitives that fail less catastrophically when inevitable disasters happen is also a good security practice.
This is doubly so because there we know that that some sophisticated attackers have been known to exploit the brittleness of otherwise secure schemes to compromise implementations. Brittleness doesn't just increase exposure to chance it also makes it easier to inject bugdoors and to plausibly deny them.
What I take issue with is people stating that CBC somehow provides more security than CTR mode under IV reuse. (Ie your statement that it provides defence in depth). That is a statement that doesn’t stand up to scrutiny in any rigorous way. Both fail pretty badly. Learning the XOR of two plaintexts is sometimes worse than learning if they share a common prefix, sometimes not.
Put it another way, how would using CBC vs CTR mode in any way impact your response to learning you had a IV reuse bug in production? It wouldn’t in any meaningful way at all - you’d still have to assume that the data was compromised to some degree. Compare that to a real defence in depth like SIV mode, where in most cases (not all) you could assume that no data breach occurred.
Thomas Ptacek thinks that I’m being a purist about this stuff. Fair enough. But I think people who believe that CBC provides meaningfully better protection than CTR in the real world are kidding themselves.
It being standard, they just come packed with the algorithm. IMO, worrying about bugs there makes exactly as much sense as worrying about bugs on the main algorithm. There's no reason to single them out.
1. People use bad PRNGs or otherwise mess this up so the nonces aren’t as random as they should be, or they use ciphers with small nonce spaces (eg original ChaCha with 64-bit nonces) and generate enough nonces that collisions become likely.
2. Even if you use a larger nonce space, like GCM’s usual 96-bits, you may be Google and generate so many nonces so quickly that collisions even then become likely. (This is generally not a problem for >128 bit nonces though). See the rationale for the development of AES-GCM-SIV for an example.
3. If you generate a random nonce then you have to send that nonce on the wire, which adds overhead (e.g. 16 bytes per message). If you send a lot of small messages or have strict space limits then you might not want this overhead, leading back to deterministic nonce generation.
4. There are a lot of existing crypto protocols in use, and almost all of them use deterministic nonces. We’re not going to just replace them all overnight with random nonce variants.
Of course we might not even be aware of even better methods of doing crypto. But such advancements come from researchers anyway, and in that are not hindered by this monopoly.
Exactly. Considering the sheer effort put into Bitcoin, including volume manufacture of custom ICs, if this was possible, someone would have done it by now. It wouldn't even be illegal.
NIST does a lot more than just John Daemen's algorithms. And you can't have an entire crypto toolbox with just AES and SHA-3.
If you use NIST, you use the output of a committee, after it goes through another committee.
If you use sodium, then DJB is all there is. Dan is the committee. Even your hash (blake2) is secretly ChaCha20 inside.
I mean, if you're going to have monoculture, that seems like the one to go with...
It's also somewhat of its time - there has definitely been a turn towards systems which are less full of footguns in the intervening years. TLS 1.3 for example, which heavily pared down the available ciphersuites.
We're still using AES all over the place though!
* https://mailarchive.ietf.org/arch/msg/cfrg/qLTveWOdTJcLn4HP3...
The linked patent reflects the unpaid upkeep fee and shows a status of expired as a result.
On the Impending Crypto Monoculture (2016) - https://news.ycombinator.com/item?id=13383006 - Jan 2017 (69 comments)
On the Impending Crypto Monoculture - https://news.ycombinator.com/item?id=11355742 - March 2016 (124 comments)
It isn't. And that's a problem, because that means an implementation can't be both FIPS compliant and compliant with the TLS 1.3 RFC.
I think you have confused AP's operation.
How people are running Mastodon servers out of Germany, or how there are people running Mastodon-as-a-service shops is frankly mind-blowing IMHO.
Note I'm not sour on the idea of IM2000. I genuinely think its ideas were used by ActivityPub.
Cryptocurrency content ages like milk. Some of the original papers are worth reading of course, but by 2016 the influencers and hype shills had thoroughly taken over. That was the era when Buterin was calling Ethereum “a global supercomputer” with a straight face.
Do you think Groth16 counts? So named because it was written by Groth in 2016. Groth16 introduces the first really practical zero knowledge proving scheme. I'm pretty sure it's used by zcash as well as Filecoin, and projects like Tornado cash. It opened the floodgates on verifiable computation techniques that are used for everything from scaling to privacy.
Every year there's a ton of braindead noise, obviously, but every year there are also fundamental breakthroughs that change how we compute.
Actually, specifically because of Groth16, the "world computer" concept is becoming more and more possible every day. When you have verifiable computing, you shift the paradigm from every node on the network having to verify every state transition to any given state transition only needing to be verified by one machine somewhere in the world, once (which can be done in parallel with the proving of every other state transition). This means something like a blockchain network is now only limited in scale by how much compute you can throw at it, and as the algorithms get faster, and the compute gets better, we're seeing multiple orders of magnitude throughput increases every year. Things have been getting pretty wild in the cryptocurrency space for the past couple years, and the future looks insane.
edit: For people interested in diving into WTF "verifiable computing" is, this is a really awesome project that does some cool stuff with it that I'm not affiliated with in any way : https://github.com/risc0/risc0
P.S I think "global computer", "verifiable computation" are a make believe concept if you ask a computer scientist. Sounds good on paper and feel futuristic though.
I don't think cryptographers believe it's a "make believe concept", at least not the ones I know.
Verifiable computation doesn't require your faith. It works, and it's powering several billion dollar economies at the moment, and growing like crazy. By all means you're free to demonstrate that the math is faulty. Basically every project in that space has a million+ dollar bounty program for such bugs.
Isn’t it so that in general verifiable computation needs a trusted setup phase? Although it can be run between multiple parties, still one needs to have faith in their honesty.
Only a small subset of computations does not require a trusted setup phase. Proof of shuffle and threshold decryption comes to my mind as examples.
It’s only the rest of the mainstream business world that hasn’t yet caught on to the value it can provide. There are numerous good ideas for using it in business contexts that aren’t being done yet. It’s mainly the cryptocurrency ecosystem that grokked its value first and have been rapidly deploying it into production.
Second line: No way. Very little of the cryptocurrency ecosystem and industry actually do verifiable compute in any meaningful sense.
A lot is API calls to third-party trusted services (who are probably doing that, yes).
https://ethereum-magicians.org/t/a-rollup-centric-ethereum-r...
In 2023 alone, maybe 5 or so fully functional proving systems for running verifiable compute in the Ethereum Virtual Machine have been launched, and are currently live and operational. It's still early days, and there's a lot more work that needs to be done to fulfill the vision, but progress is happening faster than anyone expected.
In the case of HTTP calls to SaaS providers, that's part of the promise of verifiable computation - that you can outsource it to a provider and verify that both the input and the computation are what you specified, and thus that you can trust the output. Even if its running in an otherwise black box on the SaaS provider's infrastructure.
ETA: I just noticed I'm responding to Madars ;)
I'm kind of fond of cheese.
https://hackernoon.com/ten-years-in-nobody-has-come-up-with-...