From: Marco Costalba Date: Sat, 21 Apr 2007 18:28:57 GMT Subject: Re: Why SHA are 40 bytes? (aka looking for flames) Message-ID: In-Reply-To: <9e4733910704211059h16c06e11k967d0bdd3e4970fc@mail.gmail.com> On 4/21/07, Jon Smirl wrote: > > You have to store the full SHAs at least once since they are the > signature against data corruption. > This is interesting. So until know I learnt 3 uses of sha: - Reference an object - Check against object data corruption - Prevent any possible collision among objects Karl says that we need 160 bits to prevent collisions: >prevent any possible collision created by a malicious adversary, too, >so that it's possible to e.g. sign just a commit and be able to trust >everything it points to. The SHA1 designers felt that 160 bits was a >good compromise between size and robustness, and we just trust that >their (and the cryptographic community's) guess is good enough. Probably we don't need 160bits to reference an object. I really don't know how many bit we need to be robust against data corruption. Someone more versed then me in SHA1 could tell the probablity to find a corrupted object calculating his hash and checking against his stored 160bits known good signature and *FAIL* to find as corrupt *the same object* calculating his hash and checking against a truncated sha to say 20bits. I would say this probability is veery veery low in random case (not a malicious attack of course, but I think this is not the case with git repository as it was with SHA1 designers). Marco