Hacker News new | past | comments | ask | show | jobs | submit login

Minor problems? Isn't this a security issue? Somebody can modify a binary and still have it return the same hash and distribute it to people who think that they are receiving an authentic file. Is it even an option to keep going with SHA1? Even Git, which this is less of an issue, has a plan for migrating to SHA2. https://git-scm.com/docs/hash-function-transition/



This isn't really true, sha1's weakness would require you to be the creator of the torrent, which if you are, you can just make the binary malicious to begin with.


The issue is that you can change it later on - after people have reviewed your torrent, breaking the immutability property of bittorrent.


> sha1's weakness would require you to be the creator of the torrent

Huh, why?


I'm not an expert here, but I'm thinking about it like this:

Creating a SHA-1 collision is doable, but it's still hard. If you want to serve someone a malicious piece of data, that's already one hash of the two colliding hashes that you've used up. Now you have to create harmless or "benevolent" data that collides with the hash of your malicious data so that you can create a positive reputation for your file from users who aren't your targets. That way, when your target inevitably goes to download the file, you wrestle into the protocol with a lot of speed and/or nodes, and you serve the malicious data to your target instead of the data you've been serving to everyone else.

If you don't need the positive reputation, and someone will just download and run whatever you put in the torrent, you don't need the collision in the first place.


It sounds like the perfect scenario for movie companies to target pirates.


if you feel like using centuries of computer time per torrent that nobody will download.


because you can create two hashes that match, but you cannot create a hash that matches an arbitrary hash you do not control.

That is a much more serious weakness called a "second pre-image attack"


So, as I understand, that's expected to happen in foreseeable future. Otherwise, why switch from SHA1 if you can't create a collision with unaltered data?


It is not expected to happen in the foreseeable future, MD5 for instance hasn't broken in a second pre-image way, more than a decade after it was known to be weak.

This class of attacks is MUCH harder to construct against a cryptographic hash.


Then, why did BitTorrent work on such a costly change if it's not vulnerable against it?


For the purpose of operating a bait and switch on the files, the torrent creators controls the two hashes somewhat, so it's an easier to pull attack.


If you have control over the bait, I don't understand the reason to switch at all. Just make the bait evil and be done with it?




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: