4 ms·
> The best thing would be if one could prove a mathmatically incompatible set of counter functions where data colliding in the hash of one function would preven
by benaiah 10y ago
> The best thing would be if one could prove a mathmatically incompatible set of counter functions where data colliding in the hash of one function would prevent the other function from validating correctly.
I'm a rank amateur, so this is completely outside of my wheelhouse, but this sounds suspect. I don't think you can make hash collision impossible, even with multiple functions, unless the combined hashes contain as much data as the originals or the combined functions have restricted inputs. The point of hashes is making collisions hard, not mathematically impossible - the latter is, I believe, itself impossible.
Like I said, I'm totally unqualified to speak on this, so I may well be missing something here.
- versteegen 10y agoYou are correct: by the pigeonhole principle, if the sum of the lengths of all the hashes/checksums is less than the length of the checksummed data, then collisions exist. (A detail: If checksums are included into the input of other checksums, their length doesn't count towards the amount of checksummed data, because they are not free to vary.)
- jeeceebees 10y agoWouldn't this imply that all hash functions (other than one-to-one mappings) must have collisions? Why does the pigeonhole principle hold?
- glitch003 10y agoYes, this is correct. It's a really simple principle, and I think an explanation can help you understand :) Suppose you have 3 holes, and 4 pigeons, and you stuff the pigeons into holes. There must be 1 hole with at least 2 pigeons, right? The same is true with hash functions. If you're hashing data down to a fixed length, like say 256-bits with sha-256, and the data is longer than 256 bits, there must be a collision somewhere.
- userbinator 10y agoWouldn't this imply that all hash functions (other than one-to-one mappings) must have collisions? Yes, they do. Finding them is the hard part.
- clarkcox3 10y agoYes; by definition using something with X possible values to represent something with Y possible values will always have collisions if X < Y.
- acjohnson55 10y agoRight. But there are properties that can be proven about a given hash function that give us more faith that no collision can be efficiently found: https://en.m.wikipedia.org/wiki/Security_of_cryptographic_hash_functions#Provably_secure_hash_functions https://en.m.wikipedia.org/wiki/Security_of_cryptographic_ha...
- digikata 10y agoI'm an amateur in this area too, but I'm not suggesting to avoid collisions, I'm suggesting adding a validation function for the hashed data so that if one were to generate an intentional collision, you would still have to contend with generating it in a way that also validated. For Git, Linus basically says the validation function is a prepended type/length. https://news.ycombinator.com/item?id=13719368 https://news.ycombinator.com/item?id=13719368
- davidron 10y agoThe composition of the result of the original hash function and the result of that validation function can be taken together to be some larger function. Call that an uberhash. Such an uberhash is created by putting some number of bits in and getting some smaller number of bits out. There will unfortunately still be collisions. That trick is an improvement, and newer hashing algorithms contain similarly useful improvements to make creating collisions difficult.
- mcdavex 10y agoIssue with that is we already addressed that during the MD5/cert collision era; the final cert, as delivered, would by definition contain additional data over the CSR (the signer reference and the start/end dates) but because that information was predictable, the collision could be generated for the expected emitted cert, rather than the input data. Same would apply to git; if you were building the submitted data block, you would know what type and length it was going to be, so could build it with that in mind while colliding.