3 ms·
Because presumably you don't always know the length of the data when you start with hashing. Like if you hash a file you're reading, it could get appended to wh
by wongarsu 3y ago
Because presumably you don't always know the length of the data when you start with hashing. Like if you hash a file you're reading, it could get appended to while you're reading it. Or imagine hashing a video stream as you are recording it.
The solution newer algorithms seem to have settled on is to instead get fancier in the finalization step, for example by having internal state that doesn't make it into the final hash but would be required to compute the longer hash (just like using SHA512/256 to avoid length extension attacks).