Re: About git and the use of SHA-1

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andreas Ericsson
Date: Tuesday, April 29, 2008 - 5:27 am

Sverre Rabbelier wrote:

Only until someone who's already cloned the repository fetches
from it, at which point the collision will be detected.


True. So far though, the only attacks that have been successful requires
that the attacker is allowed to create both the colliding data-sets,
and so far none has been found that would allow the attacker to follow
any kind of syntactical rules what so ever, so from a practical point
of view, SHA1 is 100% secure *for sourcecode*.

From a theoretical point of view, no hash is 100% secure, so changing
algorithm buys us nothing.

Besides, "cryprographically secure" is not the same as "will never ever
be broken", because all hashes are obviously susceptible to brute-force
attacks. "Cryptographically secure" means, insofar as I've understood it
that given a source-file and a key, it would take such an extremely
long time to find a different data-set that hashes to the same key that
the result is unusable because the original source is obsolete.

That is why legal documents are always signed with the "most secure"
(or rather, "least insecure") of all available hashes. For our
purposes, SHA1 suffices until someone comes up with a relatively
trivial way of creating a collision within the parameters above.



Points of fact so far:
* It possible to create objects with colliding names (SHA1 hash keys).
  This holds true whichever algorithm we use, although it will be more
  difficult with a stronger algorithm.
* It is impossible to distribute the colliding content to already cloned
  repositories. This also holds true for all hash algorithms.

I've been arguing that the value of the first point is so greatly
diminished by the second, that even if SHA1 turns out to be horribly
broken, projects using git will still have a decent protection against
malicious code entering the repository without the knowledge of one of
the authors.

You've been arguing that SHA1 is not theoretically secure, which is
obviously true since no hash is theoretically secure.

I can think of one way to make git a lot more resilient to hash
collisions, regardless of which hash is used, namely: Add the length
of the hashed object to the hash.

In order for an evil-minded hacker to succeed in doing any real harm,
he/she now has to create a conflicting file which is valid for its
type (be it C, PHP, JPEG, AVI, PDF or whatever) and is also the same
length as the original source, without being allowed to create the
original object.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
About git and the use of SHA-1, Henrik Austad, (Mon Apr 28, 9:29 am)
Re: About git and the use of SHA-1, Daniel Barkalow, (Mon Apr 28, 12:34 pm)
Re: About git and the use of SHA-1, Henrik Austad, (Mon Apr 28, 2:29 pm)
Re: About git and the use of SHA-1, Daniel Barkalow, (Mon Apr 28, 3:15 pm)
Re: About git and the use of SHA-1, Andreas Ericsson, (Mon Apr 28, 11:38 pm)
Re: About git and the use of SHA-1, Russ Dill, (Tue Apr 29, 12:09 am)
Re: About git and the use of SHA-1, Andreas Ericsson, (Tue Apr 29, 12:21 am)
Re: About git and the use of SHA-1, Sverre Rabbelier, (Tue Apr 29, 4:05 am)
Re: About git and the use of SHA-1, Andreas Ericsson, (Tue Apr 29, 5:27 am)
Re: About git and the use of SHA-1, Dmitry Potapov, (Tue Apr 29, 5:41 am)
Re: About git and the use of SHA-1, Jurko Gospodnetić, (Tue Apr 29, 5:46 am)
Re: About git and the use of SHA-1, Paolo Bonzini, (Tue Apr 29, 6:05 am)
Re: About git and the use of SHA-1, Andreas Ericsson, (Tue Apr 29, 7:37 am)
Re: About git and the use of SHA-1, Andreas Ericsson, (Tue Apr 29, 7:41 am)
Re: About git and the use of SHA-1, Paolo Bonzini, (Tue Apr 29, 7:52 am)
Re: About git and the use of SHA-1, Tom Widmer, (Tue Apr 29, 8:02 am)
Re: About git and the use of SHA-1, Geoffrey Irving, (Tue Apr 29, 8:34 am)
Re: About git and the use of SHA-1, Nicolas Pitre, (Tue Apr 29, 8:42 am)
Re: About git and the use of SHA-1, Geoffrey Irving, (Tue Apr 29, 8:59 am)
Re: About git and the use of SHA-1, Russ Dill, (Tue Apr 29, 9:21 am)
Re: About git and the use of SHA-1, Russ Dill, (Tue Apr 29, 9:24 am)
Re: About git and the use of SHA-1, Daniel Barkalow, (Tue Apr 29, 9:27 am)
Re: About git and the use of SHA-1, Nicolas Pitre, (Tue Apr 29, 9:39 am)
Re: About git and the use of SHA-1, Tom Widmer, (Tue Apr 29, 10:08 am)
Re: About git and the use of SHA-1, Geoffrey Irving, (Tue Apr 29, 10:48 am)
Re: About git and the use of SHA-1, Nicolas Pitre, (Tue Apr 29, 10:55 am)
Re: About git and the use of SHA-1, Geoffrey Irving, (Tue Apr 29, 11:02 am)
Re: About git and the use of SHA-1, Matthieu Moy, (Tue Apr 29, 11:17 am)
Re: About git and the use of SHA-1, Fredrik Skolmli, (Tue Apr 29, 11:23 am)
Re: About git and the use of SHA-1, Daniel Barkalow, (Tue Apr 29, 11:41 am)
Re: About git and the use of SHA-1, Geoffrey Irving, (Tue Apr 29, 1:31 pm)
Re: About git and the use of SHA-1, Fredrik Skolmli, (Tue Apr 29, 1:50 pm)
Re: About git and the use of SHA-1, Geoffrey Irving, (Tue Apr 29, 2:39 pm)
Re: About git and the use of SHA-1, Fredrik Skolmli, (Tue Apr 29, 2:52 pm)
Re: About git and the use of SHA-1, Martin Langhoff, (Tue Apr 29, 7:58 pm)
Re: About git and the use of SHA-1, Geoffrey Irving, (Tue Apr 29, 10:18 pm)
Re: About git and the use of SHA-1, David Brown, (Tue Apr 29, 10:47 pm)
Re: About git and the use of SHA-1, Martin Langhoff, (Tue Apr 29, 10:56 pm)