‹ BackHN Continuity

Thread

Git 3.0's upcoming SHA-256 default will be a costly mistake

570 points · 536 comments · chmaynard

  1. meinersbur · · focus · HN ↗
    Linus Torvalds in 2007:

    > 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:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=4XpnKHJAok8&amp;t=56m20s" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=4XpnKHJAok8&amp;t=56m20s

    So Torvalds used SHA-1 purely because he needed a hash function with no other property than identifying content.

    1. UltraSane · · focus · HN ↗
      Hard coding a specific hash algorithm was a big mistake.
      1. someonebaggy · · focus · HN ↗
        Have you seen algorithm-agnostic protocols, like TLS v1.2 and IPsec? It always turns out to be a bad idea. Future upgradability is fine but you really don&#x27;t want implementations of the protocol to be incompatible with each other and you don&#x27;t want attackers to have any chance of tricking you to using insecure protocols.

        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&#x27;t let the parties negotiate either a good one or a bad one.

        1. UltraSane · · focus · HN ↗
          Your argument is weird because it assumes we can know if a hash function will be secure forever. Assuming git would use SHA1 forever seems shortsighted.
          1. someonebaggy · · focus · HN ↗
            Then you make Git 2, which uses SHA256.
            1. UltraSane · · focus · HN ↗
              That creates even more compatibility issues for no reason.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.