Computer virus is a type of software that places a copy of itself within another computer program and can spread to other software after the infected application is run. A computer virus cannot duplicate itself without attaching to another program. A virus can be transferred from one computer to another via a computer network, the Internet, or a storage device, such as a compact disc.
A harmless virus may simply cause a message to appear on a computer monitor. A malicious virus may change information in databases, rewrite sections of programs, or cause a computer to send data to other locations over a network. Mischievous programmers create some viruses. Some have even developed sets of programs known as virus creation toolkits or virus generators. Such software enables even computer users with no programming experience to create viruses.
National and local governments enforce laws regarding the distribution of viruses. A person who writes or distributes a malicious virus in one country may be subject to legal action in other countries to which the virus spreads.
Well-known types of viruses include (1) boot sector viruses, (2) file infectors, and (3) macro viruses. A boot sector virus alters the short program that activates a computer when it is booted (turned on). A file virus spreads between other types of applications, such as game programs or word-processing programs. Pure data files cannot be infected by a virus, because data are only displayed and not run. But some documents, spreadsheets, and other data files contain macros, small programs that help to manage the data. These programs are vulnerable to macro viruses.
Some other types of malicious software, including Trojan horses and worms, are similar to viruses but are not true viruses. A Trojan horse acts like a useful program, but usually has a harmful purpose. It does not copy itself, but it may be used to steal passwords or to deliver a virus. A worm duplicates itself without attaching to other programs. It may thus congest a computer network by filling up storage space with copies of itself.
Many companies manufacture protective software, commonly called antivirus software. Such software scans programs entering a computer for common viruses and eliminates them. It may also help prevent other types of malicious software from entering the computer.
In 1949, the Hungarian-born computer pioneer John von Neumann predicted that computer instructions could be designed to reproduce themselves. In 1984, Fred Cohen, a graduate student at the University of Southern California, wrote the first known computer virus as part of his research.