security - Does an MD5 match between a torrent file and an original file from a provider mean the torrent file is safe?

26
2014-06
  • johnny

    I wanted to download a certain distro of Linux. However it is only using bittorent for download. I'm not to keen on bittorent. If I do use it, however, if the MD5 I download matches the MD5 of the distrubition's website, does that mean the file has not been tampered with? That it matches exactly what the provider has and, assuming the original is "safe," the torrent downloaded file is as well?

  • Answers
  • ultrasawblade

    if the MD5 I download matches the MD5 of the distrubition's website, does that mean the file has not been tampered with?

    Probably hasn't been tampered with. MD5 does have known attacks on it, so it's not as good as something like SHA-1. For something like verifying if you have the correct file, MD5 is ok.

    Where MD5 is sort of not ok is if you use as stored password hashes. Websites and such typically don't want to store your password, but a hash of it - and then compare the password you enter to login with a hash. In this way, they don't know your password. However, if a hacker gets a list of accounts with these hashes, they may be able to generate a password that, when put through MD5, generates the same hash (this is called a hash collision). I'm not sure how any of this works, really, just that it with MD5 hash collisions are possible and easier than they've been in the past.

    Bittorrent uses SHA-1 to "know" what file it's downloading and whether pieces that peers trade are good or not. So that a malicious peer could inject bad data in the swarm is unlikely - even if one peer knew how to break SHA-1, most other peers would have to cooperate as well. You can be relatively confident that no one on the Bittorrent swarm can corrupt the download, assuming you have the correct .torrent file and it hasn't been maliciously modified to point to a different tracker or the hashes in it modified.

  • ben

    Yes it is likely okay.

    I use md5 a lot in my everyday sysadmin work so I did a lot of research on security issues. Found some great links on it and also summed up security concerns and uses of hashes in a blog post

    The gist of it: three main things to consider:

    1) It is possible for two different files to have the same hash. In their findings, both files need to be created by the attacker i.e. the creator of the files.

    2) Also the hash cannot be targeted. You cannot find a hash and then design a file to match that hash. Instead, the creator has to create two different files of identical hashes, and the actual hash values themselves cannot be "chosen" ahead of time

    3) Lastly, there are a finite number of hashes, and so by pure dumb luck it's possible two random files will have the same hash (called a "collision"). One of the strengths of a good hashing algorithm is to avoid collisions.

    Taking the above into account: So if you use the hash from the vendor, you know that is the actual hash you can check against with a high percentage of confidence

    Here are some references for you:

    A fantastic article about the security of hashing is right here: http://blog.codinghorror.com/speed-hashing/

    Very in-depth article about security vulneability of hashing (and even shows an example of creating two different files with identical hashes) http://www.win.tue.nl/hashclash/SoftIntCodeSign/

    My own collection of info on security and use of hash http://geekswing.com/geek/the-magic-of-hash-and-i-mean-of-the-md5-and-sha-1-vintage/


  • Related Question

    download - Did something change with uTorrent speed capping?
  • L0neRanger

    I download a lot of Linux torrents for testing systems every time there is a new release. And Linux torrents are always seeded well so seeding is not the issue here. Neither is firewall, I have port forwarding setup properly. I did a glasnost test and my ISP does not throttle my connection. So...

    I've tested and verified over the past year that I would get the maximum download speed possible with my connection(2MBps) if I have at least 6kbps upload set.

    Lately this is not true. If I have 6kbps upload my download gets capped at ~91kbps. If I have 10kbps upload the max download I get is around 153kbps. And so on. I can clearly see that the download speed increases as I increase the upload speed in steps.

    So did something change with uTorrent? I'm using uTorrent 2.0 Beta. Should I go back to the non-beta version?

    Can someone confirm that this is happening. I'm going mad trying to analyze the source of this.

    You can go to this link and see the image for further explanation as to what I'm talking about:

    enter image description here


  • Related Answers
  • L0neRanger

    I just found out that this a bug in the current build of uTorrent 2.0 Beta. When uTP is enabled it erroneously throttles the download rate based on the upload rate.

    Found this answer by fishing around uTorrent forums and found these 2 links that refer to the same problem.

    http://forum.utorrent.com/viewtopic.php?pid=441281