A trojan horse is a piece of code that is created to interfere with the normal functioning of a computer. Infections can spread quickly and cause significant damage to both individual computers and networks. Some infections are harmless, while others can erase files, corrupt information, or even damage hardware.