Using torrent technology is not automatically illegal, but downloading copyrighted material without permission can be. Legal torrents exist, so the legality depends on the file and the rights of the copyright holder.