# Tag Info

2

It is an object, not a function. The difference is important: the thing you get with m = hashlib.md5() is a structure in memory that has an internal state. Each update() call updates that state (hence the name). You can imagine the object has a kind of box. Each update() call accumulates input bytes in that box. When you want to obtain the hash value, the ...

5

It is not known whether there is a fixed point or not. Since MD5 gives you 128 bits, you would need an input of 128 bits as well. That is you are really considering a function from the set of 128-bit strings to 128-bit strings. Assume that such a function is chosen at random. Then we can calculate the probability that the function has a fixed point. The ...

7

It's called padding. MD5 fills the "not finished block" with exactly one "1" bit and a number of "0" bits until the length of the number is 64 bits away from being divisible be 512. It could happen that you don't need to add any "0" bits, that's okay, but never omit the "1" bit! After that, the length of the original message in bits is added, formatted with ...

-2

Use something more collision resistant like SHA... I can't find any hashes that are completely collision proof, but sha at least decreases the collisions...

2

As far as I understand, the scheme is: $$MD5(x) = a_1||a_2||a_3||a_4 \, \, \Longrightarrow \, \, H(x) = a_1 \oplus a_2 \oplus a_3 \oplus a_4,$$ with $a_i$ 4-byte/32-bit words. Obviously you can't guarantee a unique 32-bit hash from an unbounded domain, due to the pidgeonhole principle. Neither can you make finding collisions infeasible, since $2^{16}$ MD5 ...

0

You cannot escape the birthday bound - it will eat your lunch lunch every time. MD5 has a good uniform distribution, so should your algorithm. Since it outputs 32-bit values, you should expect collisions after around $\sqrt{\frac{\pi}{2}2^{32}} = 82137$ hashes.

Top 50 recent answers are included