| > That part is debatable, if we imagine different padding schemes. It isn't debatable because SHA-256 (and all these schemes) define the padding because it's necessary to have padding defeat the problem you're about to talk about and to do that they are in fact one-to-one: > If the padding was just 0s, I would easily accept an argument that 111000 and 1110 are the same input giving the same hash. As you might have guessed, this is not how it works. SHA-256 appends that "extra 1 bit" you talk about, then zeroes until it is 64-bits short of a multiple of 512 bits, and then a 64-bit count. So, as the earlier poster explained there are 2^257 -1 distinct hash inputs in abotsis' imagined set and thus there must be collisions by the pigeon hole principle, it really is that simple. |
There is no way it's "necessary" to avoid that particular problem, yet at the same time unnecessary to avoid length extension attacks.
> As you might have guessed, this is not how it works.
That's a weirdly hostile way to respond to a clearly counterfactual thought experiment.
> and thus there must be collisions by the pigeon hole principle, it really is that simple
Except they didn't just say there must be collisions in SHA-256, by my reading they were making an argument that the method of appending padding and stuff doesn't matter.