A Trojan Horse is a program that performs some undesired yet intended action while pretending to do something else. One common class of trojans are fake login programs which collect accounts and passwords by prompting for the info just like a normal login program does. Another is a disk defragger that erases files rather than reorganizing them. A Trojan Horse differs from a virus in that it does not attempt to reproduce itself. A Worm is a self propagating virus.
Viruses come in many shapes and sizes.
This topic is examined in Types.