From: Jon Smirl Date: Sat, 21 Apr 2007 19:36:52 GMT Subject: Re: Why SHA are 40 bytes? (aka looking for flames) Message-ID: <9e4733910704211236m7f88aef2r76a1c4a3b72b1c75@mail.gmail.com> In-Reply-To: On 4/21/07, Marco Costalba wrote: > 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). The SHA is also a security signature against tampering. All commits having an SHA. These SHAs are repeated into a check-in entry, which then gets an SHA. Releases are identified by publishing an SHA. You take the release SHA and use it to find/verify the commit record. Opening the commit record gives you the SHA of all of the pieces of the commit. (I simplified this by ignoring trees). This stops some one from altering a file in a git repo as a way of inserting malicious code. If you alter a file all of the SHAs that depend on it will change. It is very, very difficult to figure out how to patch a file and not change the SHA for it. This is a real problem and people have tried to secretly insert code into the Linux kernel in the past. -- Jon Smirl jonsmirl@gmail.com