git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Marco Costalba" <mcostalba@gmail.com>
To: "Jon Smirl" <jonsmirl@gmail.com>
Cc: "Git Mailing List" <git@vger.kernel.org>, "Nicolas Pitre" <nico@cam.org>
Subject: Re: Why SHA are 40 bytes? (aka looking for flames)
Date: Sat, 21 Apr 2007 20:28:57 +0200	[thread overview]
Message-ID: <e5bfff550704211128i12035947i7597e920a0eca163@mail.gmail.com> (raw)
In-Reply-To: <9e4733910704211059h16c06e11k967d0bdd3e4970fc@mail.gmail.com>

On 4/21/07, Jon Smirl <jonsmirl@gmail.com> 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

  reply	other threads:[~2007-04-21 18:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-21 13:35 Why SHA are 40 bytes? (aka looking for flames) Marco Costalba
2007-04-21 15:08 ` Andy Parkins
2007-04-21 16:53   ` Karl Hasselström
2007-04-21 17:09     ` Marco Costalba
2007-04-21 16:58   ` Marco Costalba
2007-04-21 15:37 ` Jon Smirl
2007-04-21 17:06   ` Marco Costalba
2007-04-21 17:59     ` Jon Smirl
2007-04-21 18:28       ` Marco Costalba [this message]
2007-04-21 19:36         ` Jon Smirl
2007-04-24 14:48         ` Andreas Ericsson
2007-04-24 15:04           ` Nicolas Pitre
2007-04-24 15:18             ` Andreas Ericsson
2007-04-24 16:19               ` Nicolas Pitre
2007-04-22 13:27     ` Nicolas Pitre
2007-04-24  0:46       ` H. Peter Anvin
2007-04-24  2:30         ` Shawn O. Pearce
2007-04-24  2:44         ` Nicolas Pitre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e5bfff550704211128i12035947i7597e920a0eca163@mail.gmail.com \
    --to=mcostalba@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jonsmirl@gmail.com \
    --cc=nico@cam.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).