{"thread":{"id":"7770","subject":"Re: Why SHA are 20 bytes? (aka looking for flames)","startedAt":"2007-04-21T17:43:27Z","lastAt":"2007-04-21T17:43:27Z","messageCount":1,"participants":["Marco Costalba"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"40062","messageId":"e5bfff550704211043s40d33187jc334c1d85330132a@mail.gmail.com","threadId":"7770","inReplyTo":null,"subject":"Re: Why SHA are 20 bytes? (aka looking for flames)","fromName":"Marco Costalba","fromEmail":"mcostalba@gmail.com","sentAt":"2007-04-21T17:43:27Z","receivedAt":"2007-04-21T17:43:27Z","isPatch":false,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":"On 4/21/07, Karl Hasselström <kha@treskal.com> wrote:\n>\n> Well, any hash is \"incomplete\" or \"not long enough\" inasmuch as it's\n> theoretically possible to find collisions. The choice of the full 160\n> bits (note: this is 20 bytes, not 40) is arbitrary -- it's just \"long\n> enough\". 128 bits would have been enough to prevent any naturally\n> occurring collisions, too (maybe even 96 bits would be enough, I'm too\n> lazy to do the math). The only reason to go as high as 160 is to\n> prevent any possible collision created by a malicious adversary, too,\n> so that it's possible to e.g. sign just a commit and be able to trust\n> everything it points to. The SHA1 designers felt that 160 bits was a\n> good compromise between size and robustness, and we just trust that\n> their (and the cryptographic community's) guess is good enough.\n>\n\nI think it is sensible to differentiate between\n\n- creation of a 160bits possible unique signature\n\n- use of whole 160bits signature to reference the object\n\nI'm wondering that as long as we are able to calculate on the fly the\nwhole 160 bits signature from the object when needed then the second\npoint _could_ be relaxed and we could use a truncated sha (note that\nis not a new sha calculated with less bits, it is the good old 160bits\nsha just trucated to be used as object reference).\n\nThis could be convenient as long as collision is very unlikely, so to\nwork almost always with abbrev forms and fallback on full 160bits on\nthose rare cases.\n\n  Marco\n"}]}