How many attempts does it take to crack a 32-bit password hash with this scenario? How many attempts does it take to crack (match) a 32-bit password hash from a database of 4 million password hashes?

Correct me if I'm wrong, but to crack a 32-bit password hash would take roughly 2^31 attempts, while the math for matching a 32-bit hash from 4 million hashes should take (2^31)/4M ~ 537 attempts.

However in reality, the 4 million passwords in the database are not unique, as certain combinations are used as common passwords. Thus, what would be a more accurate calculation of the above question?
Correct me if I'm wrong, but to crack a 32-bit password hash would take roughly 2^31 attempts, while the math for matching a 32-bit hash from 4 million hashes should take (2^31)/4M ~ 537 attempts.


It would take on average $2^{32}$ attempts to crack a single 32-bit hash.

If you've got 4 million unique hashes to test against then then each hash you generate you've got a $4,000,000(\dfrac{1}{2^{32}}) \approx \dfrac{1}{1073}$ chance of finding a matching one. So you're going to need to try on average $1073$ times.

Unless you know the distribution of passwords and which ones are more common than others and you incorporate that into your guessing, this is as accurate as it's going to get.