5

Let's say I would like to get the ISO images for CentOS. If instead of directly downloading the ISO images from a mirror server, I just download the .torrent file from the same server and then use a BitTorrent client, are there any chances that the images could be corrupted on purpose?

2
  • 2
    You should always verify the final image hash regardless. Aug 15, 2012 at 1:10
  • 1
    Nothing is "safe" on the internet, period. images/files can be manipulated and retain the original hash. Its all based on faith.
    – Moab
    Aug 15, 2012 at 2:21

2 Answers 2

12

So long as you obtain the torrent file from a trusted source, it is not possible to corrupt the images.

The torrent file contains sufficient information to securely validate each chunk of the final image. As your client receives each chunk of the image file, it validates it against the hash set (or Merkle tree) in the torrent file. Invalid chunks are discarded and fetched again from a different source. Sources that continue to send you invalid data are blacklisted.

It is, however, possible to make it very hard for someone to download the torrent file by creating a large number of bogus clients that serve corrupt chunks. The client will throw each corrupt chunk away and blacklist the bogus clients as fast as it can. But this can still make downloading the torrent file impractically slow if an attacker is determined enough.

See the Wikipedia article on Torrent files, particularly the pieces or root hash keys.

2
  • 2
    The corollary is that you should always download the .torrent file from a trusted source - from the HTTPS version of the site if possible (to prevent man-in-the-middle attacks.) Aug 15, 2012 at 2:19
  • unless of course the file was tampered with shortly before the torrent was created.
    – Moab
    Aug 15, 2012 at 2:22
0

Advantage of torrent is that 512byte chunks may be corrupted, but because it is sources from different sources, one bad 512 byte chunk will not cause the whole file of 600MB to get corrupted. Rather, the bad MD5 sum of the bad 512byte is trashed, and sourced from alternate routing peer. This allows the inherent advantage of torrent to download, accurately the large files.

This means, from authentically source torrent server list (especially through HTTPS) is always going to have trust value of 1:1.

Of course, you must always check the MD5 or SHA1 (or other hashes) to verify the true accuracy of the downloaded file.

According to Tails Linux (tails.boum.org) recommendation, you should (if absolutely paranoid about it) download same file repeatedly to make sure you are able to generate same MD5/SHA1 hashes, to TRUST the servers from where you have downloaded the Torrent action file.

Not the answer you're looking for? Browse other questions tagged .