Live data from Hacker News

Linus' reply on Git and SHA-1 collision

marc.info

171–180 of 273 posts

Re: Linus' reply on Git and SHA-1 collision

#171
post #148

Earlier quoted context omitted.

Moore's law still holds, and is expected to hold true until at least 2025 (see wikipedia). I don't think it will be done by then, but that is just guess work.

How much faster is a cpu from 2012 and a cpu from today when you compare them by single thread performance @ 3 ghz.

Irrelevant for this particular issue since finding SHA-1 collisions is embarrassingly parallel.

Re: Linus' reply on Git and SHA-1 collision

#172

Earlier quoted context omitted.

> I doubt anyone is able to find an input that MD5 and SHA-1 both hash to the same value. It would significantly reduce reliance on a single hash function. As was mentioned in the original collision thread, concatenating insecure hash functions has fundamental weaknesses: https://www.iacr.org/archive/crypto2004/31520306/multicollis...

Sort of. It does not improve brute force resistance in a meaningful way, but that is not the purpose either. It protects against one of the hash functions being broken. Let us assume that we have 2 160bit hash functions, and one is broken to the degree that we can find collisions in constant time. This now means that we can break the combined hash in 2^80 rather than 2^80 + 2^80. The total brute force complexity was…

Yes, but you picked two hash functions which are known to be insecure. Their complexity reduction argument appears to apply to cases where you are not using pure brute force for either hash, which would be the case if you were attacking MD5 and SHA1.

Re: Linus' reply on Git and SHA-1 collision

#173
The Git docs have some very specific claims about cryptographic integrity of git:

https://git-scm.com/about/info-assurance

These claims are wrong as long as it uses SHA-1. Full stop.

It'd be really nice if git had cryptographic integrity. Not just because it'd prevent some attacks on git repos, but because it'd make git essentially a secure append only log. Which would be interesting, as it'd more or less automatically give some kind of software transparency for many projects.

Re: Linus' reply on Git and SHA-1 collision

#174
post #144

Earlier quoted context omitted.

I'm not sure how fast these go once they hit the atmosphere. I've seen numbers in the 15 to 25km/hr range, which is pretty damned fast, but how much do they slow down in the thicker atmosphere closer to the ground?

15 to 25km/hr is a running speed of human, probably you meant 15 to 25 km/s here (actually, some meteorites hit atmosphere >70km/s). Seems like they decelerate pretty fast after that[0]: "At some point, usually between 15 to 20 km (9-12 miles or 48,000-63,000 feet) altitude, the meteoroid remnants will decelerate to the point that the ablation process stops, and visible light is no longer generated. This occurs at a…

> 15 to 25km/hr

just btw, 25 km/s is almost 100.000 km/h.

Re: Linus' reply on Git and SHA-1 collision

#175
post #154

Earlier quoted context omitted.

The length field makes the attack significantly more difficult. In the publish attack, you take 2 fixed input and prepend special data to make the collision. With Git, you have additional constraint. Either it needs to be of exact length, this may or may not be an issue, but most likely is unless we find a new weakness in SHA-1, or you must be able to handle the changing input. In all the examples in your link, while…

> The length field makes the attack significantly more difficult. In the publish attack, you take 2 fixed input and prepend special data to make the collision. That's not how the attack works. Not at all.

If you ignore the prepend part, it is in essence taking known input and calculate a collision.

> This is an identical-prefix collision attack, where a given prefix P is extended with two distinct near-collision block pairs such that they collide for any suffix S.

And

> Our example colliding files only differ in two successive random-looking message blocks generated by our attack. We exploit these limited differences to craft two colliding PDF documents containing arbitrary distinct images.

Re: Linus' reply on Git and SHA-1 collision

#176

Earlier quoted context omitted.

Clearly, Linus didn't know at the time. If he'd know, he would have chosen another hash in 3 seconds —no additional complexity, no additional effort involved in not choosing a hash the security community starts to have doubts about.

Don't forget the extra computation cost with a more complex hash.

Nobody cares. Hashes are plenty fast. Even the code complexity doesn't matter: I've implemented both SHA-256, and SHA-512, take less than a hundred lines of code. And of course, Linus would have use some existing implementation.

Also, "more secure" doesn't necessarily mean "more complex", or "slower". Blake2b for instance is as fast as md5 and has a simple RAX (xor, rot, add) core from Chacha20.

Re: Linus' reply on Git and SHA-1 collision

#177
post #72

Earlier quoted context omitted.

Which is largely irrelevant on desktops. Nobody's using git on embedded devices, so hash computational cost shouldn't be the deciding factor. Maybe people storing BLOBs will notice.

There are blobs in the kernel and speed was a very important motivation when kernel switched to git.

So now we need to assess whether hashes are a significant bottleneck.

Re: Linus' reply on Git and SHA-1 collision

#178

Earlier quoted context omitted.

Sort of. It does not improve brute force resistance in a meaningful way, but that is not the purpose either. It protects against one of the hash functions being broken. Let us assume that we have 2 160bit hash functions, and one is broken to the degree that we can find collisions in constant time. This now means that we can break the combined hash in 2^80 rather than 2^80 + 2^80. The total brute force complexity was…

Yes, but you picked two hash functions which are known to be insecure. Their complexity reduction argument appears to apply to cases where you are not using pure brute force for either hash, which would be the case if you were attacking MD5 and SHA1.

I did so quite on purpose. Both are concidered broken, but combined, only the bruteforce attack is known to work, i.e. "the whole is greater than the sum of its parts".

Re: Linus' reply on Git and SHA-1 collision

#179
There is some speculation on whether Linus got it right or wrong, but I haven't seen anyone actually test this with the shattered-1 & 2 files, so I did.

Git sees them as different despite them having the same hash. You can test with:

  mkdir shattered && cd shattered
  git init
  wget https://shattered.it/static/shattered-1.pdf
  git add shattered-1.pdf
  git commit -am "First shattered pdf"
  git status
  wget https://shattered.it/static/shattered-2.pdf
  sha1sum *
  md5sum *
  mv shattered-2.pdf shattered-1.pdf
  git status
So it doesn't see the files the same.

Apologies for those on mobile (please fix this HN!): the commands are: mkdir shattered && cd shattered && git init && wget https://shattered.it/static/shattered-1.pdf && git add shattered-1.pdf && git commit -am "First shattered pdf" && git status && wget https://shattered.it/static/shattered-2.pdf && sha1sum * && md5sum * && mv shattered-2.pdf shattered-1.pdf && git status

EDIT: Ah, of course! git adds a header and takes the sha1sum of the header+content, which breaks the identical SHA1 trick. You can add a footer on and they keep the same SHA1 though. Don't have time to play about with this more just now, but try it with `cat`ing some identical headers and footers onto the pdfs.

EDIT2: Actually, this is discussed more extensively in the other thread which I hadn't read yet. Go there for more details: https://news.ycombinator.com/item?id=13713480

Re: Linus' reply on Git and SHA-1 collision

#180
post #89

Earlier quoted context omitted.

160 bits are still quite many. You could have done what Linus suggests and use a better hash but truncate it. If it's a good hash, a truncation of it should still be good (modulo the fewer number of bits, of course.)

That is jerry rigging it. If a stronger hash function is known to be secure, you throw all that confidence out the window if you truncate it. At best you reduce the brute force complexity, at worst you enable pre-image attacks.

This is wrong. There is no faster way for preimage attacks with truncated SHA-2.

http://crypto.stackexchange.com/questions/9435/is-truncating...

Post reply on HN