Yes, torrenting is legal. However, it becomes illegal when you decide to download unsanctioned copyrighted materials.