Understanding Have I Been Pwned's Use of SHA-1 and K-Anonymity
troyhunt.com
troyhunt.com
While it is quite impressive when someone manages to reduce the attack complexity, by let's say, reducing the cost of a chosen-prefix collision from billions of GPU hours to millions, it does not make the algorithm completely useless from one day to the next. It has to be taken into context.
Unfortunately, in an otherwise good post, the author is likely just repeating a myth. Due to HW acceleration, sha512 is the fastest and both sha256 and sha512 are faster than sha1. Go ahead. Compare sha1sum, sha256sum and sha512sum on a large file. If you don’t have HW acceleration for some reason Blake3 is the fastest and as secure as sha3 (since sha1 doesn’t benefit from HW acceleration, Blake3 would be a better hashing algorithm from this perspective). That being said, it might be true that sha1 is faster on lots of small inputs as most benchmarks focus on the aggregate speed of large files. Still, my prior would be that sha1 would still lose out unless I specifically benchmarked that use case and found it performed differently.
This doesn’t take away from the author’s main point that sha1 is still fine and there’s probably a certain amount of inertia with HIBP that makes changing the hash more difficult operationally/not worth it.
I didn’t see the email API and it is not obvious to me if this breaks any privacy protection (or what is the threat), but generating a lot of SHA-1 hashes for popular gmail addresses is probably very possible
https://blog.cloudflare.com/validating-leaked-passwords-with...