News for hackers. Stuff that matters.
Re:Announcing the first SHA-1 collision by xamuel on Thursday February 23, 2017 @12:56PM (#13716014)
mikegerwitz is technically right. As an illuminating example, consider a hash-algorithm in which there's at least one hash that occurs precisely once. Then a 2nd-preimage attack is formally impossible no matter how much computational power you have (assuming by "second" you meant "distinct second"). But a 1st-preimage attack is formally possible.
Re:Announcing the first SHA-1 collision by tlb on Thursday February 23, 2017 @01:12PM (#13716180)
A 'good' hash function (exhibiting uniformity) that converts arbitrary-sized documents to finite-sized hashes should not have any hashes that occur precisely once.

This can occur with ill-conceived hash functions, for example if it bundles the length of the document with the hash, so there would be only 256 distinct hashes with length=1.

Re:Announcing the first SHA-1 collision by lisper on Thursday February 23, 2017 @01:07PM (#13716134)
One of the requirements for a hash to be cryptographically secure is that all possible values are equally likely. So yes, it is possible (in fact trivial) to construct a hash of the sort you describe, but such a hash would not be cryptographically secure to begin with.
Re:Announcing the first SHA-1 collision by Dylan16807 on Thursday February 23, 2017 @07:48PM (#13719675)
It's easier to use and to reason about a uniform hash, but you can design a secure system with a non-uniform hash.

I'd be willing to bet that an altered version of SHA3-256 that replaces four bits in the middle with length%16 is better for most purposes than SHA256, despite being non-uniform.

Re:Announcing the first SHA-1 collision by gliptic on Thursday February 23, 2017 @01:52PM (#13716599)
For that to be the case, in real hash functions, it would require you to be constrained to a certain number of possible preimages, not too many more than the number of possible hashes, so that it's likely that H^-1(H(x)) = x but there can still be a distinct y such that H(y) = H(x).

So I concede that this could be the case under very specific circumstances, but I doubt it makes much difference in the real world.