Git 3.0's upcoming SHA-256 default will be a costly mistake
Thread
Unofficial Hacker News client; not affiliated with Y Combinator.
Git 3.0's upcoming SHA-256 default will be a costly mistake
Unofficial Hacker News client; not affiliated with Y Combinator.
meinersbur · · focus · HN ↗
> but the point is the SHA-1, as far as Git is concerned, isn't even a security feature. It's purely a consistency check. The security parts are elsewhere, so a lot of people assume that since Git uses SHA-1 and SHA-1 is used for cryptographically secure stuff, they think that, Okay, it's a huge security feature. It has nothing at all to do with security, it's just the best hash you can get. ... [1]
[1] <a href="https://www.youtube.com/watch?v=4XpnKHJAok8&t=56m20s" rel="nofollow">https://www.youtube.com/watch?v=4XpnKHJAok8&t=56m20s
So Torvalds used SHA-1 purely because he needed a hash function with no other property than identifying content.
zamalek · · focus · HN ↗
kazinator · · focus · HN ↗
huflungdung · · focus · HN ↗
[dead]
bawolff · · focus · HN ↗
Someone · · focus · HN ↗
Was there “something like murmur” in 2005 that’s cryptographically better than SHA1?
sgerenser · · focus · HN ↗
layer8 · · focus · HN ↗
throw0101c · · focus · HN ↗
See also perhaps Wireguard, which touts itself as not having "cryptographic agility" because they wanted to avoid all (perceived) problems and complications of IPsec. But now that PQC is (allegedly) approaching there's no easy to update things because (AIUI) there's no negotiation possible in the protocol; you're basically standing up a 'Wireguard 2.0' that runs separately than the original.
akerl_ · · focus · HN ↗
someonebaggy · · focus · HN ↗
computerfriend · · focus · HN ↗
> If an additional layer of symmetric-key crypto is required (for, say, post-quantum resistance), WireGuard also supports an optional pre-shared key that is mixed into the public key cryptography.
(From <a href="https://www.wireguard.com/protocol/" rel="nofollow">https://www.wireguard.com/protocol/.)
loeg · · focus · HN ↗
This flexibility ("agility") in cryptographic protocols is often seen as a mistake today, actually.
WorldMaker · · focus · HN ↗
Which is sort of the hash algorithm approach git is taking with incompatible versions and a version break.
layer8 · · focus · HN ↗
All modern formats, such as JOSE and COSE, continue to be built on algorithm agility, and that’s unlikely to change.
Older protocol elements that had SHA-1 or SHA-256 hardcoded have invariably been replaced or supplemented with elements using an algorithm parameter.
throwawayffffas · · focus · HN ↗
2. The hash function is not used for cryptographic purposes!
m463 · · focus · HN ↗
UltraSane · · focus · HN ↗
someonebaggy · · focus · HN ↗
Flexibility made sense in 1995 when nobody was sure which algorithms would stand the test of time. Even in 2005 it was unnecessary and in 2015 it was an outright liability. If you have a good algorithm just specify the good algorithm, don't let the parties negotiate either a good one or a bad one.
UltraSane · · focus · HN ↗
someonebaggy · · focus · HN ↗
UltraSane · · focus · HN ↗
creata · · focus · HN ↗
Sorry if the video answers this, but how does commit signing work if it doesn't rely on the hash algorithm being resistant to at least second-preimage attacks?
someonebaggy · · focus · HN ↗
xeyownt · · focus · HN ↗
For all practical purpose SHA-1 is a bad hash function, it's slow, it's insecure.
If SHA-1 is not a security measure, why do you even sign the commit. It doesn't make any sense. You give a strong signature on something weak.
someonebaggy · · focus · HN ↗
albedoa · · focus · HN ↗
creata · · focus · HN ↗
mnaza · · focus · HN ↗
SHA-1DC blocks the known SHAttered/Shambles-style attacks, which is a good stopgap, but it detects known techniques; it isn't a hash you can reason about.
Code signing went through the same thing. Authenticode signatures with SHA-1 digests are effectively distrusted on Windows now, and that migration hurt precisely because it was put off until it was urgent.
hinkley · · focus · HN ↗
lxgr · · focus · HN ↗
At the very latest, this fact was cemented when first-party git commit signatures started depending on the security properties of SHA-1.
feoren · · focus · HN ↗
So if my API happens to return text strings that always happen to have an even number of characters, I better make sure that all future versions of it also always return an even number of characters, just in case some moron decided to bank their application's functionality on that? No. If you decide to write a fragile application tethered to some incidental property of some upstream software, your application deserves to break.
lxgr · · focus · HN ↗
But seriously: If you can afford to break your user's applications if they "deserve to be broken", sure. Many API maintainers can't, or at least don't want to.
In the latter case (which is honestly the norm rather than the exception, at least for public APIs), yes, you should better think about all implicit API contracts your API shape might be projecting. That guideline has served me very well through my career, at least.
tredre3 · · focus · HN ↗
Just because you never made any promise regarding one aspect of your API doesn't mean that you're absolved from responsibility when you choose to change it. If you know for a fact that many users rely on it and you choose to break it, you need a good reason. That kind of balancing act is part of your job. If you don't respect your users, perhaps development wasn't the right career choice.
As developers we're of course constantly tempted to rename things that we named poorly, or change a schema that is no longer optimal. But we must always take a step back and think about the downstream impact.
cesarb · · focus · HN ↗
Oh yes, this does happen. There's even a name for that: ossification (<a href="https://en.wikipedia.org/wiki/Protocol_ossification" rel="nofollow">https://en.wikipedia.org/wiki/Protocol_ossification). You can't change your API/protocol, because "some moron" started depending on implementation details.
It's easy to say "your application deserves to break" from an ivory tower, but it's often not easy or viable to fix it (for instance, it might have different owners, it might no longer be maintained, it might be more expensive to change, etc). And the change which broke that application was not in it; the blame naturally goes to what was changed last.
shubhamjain · · focus · HN ↗
gaoshan · · focus · HN ↗