This chapter presents the fundamental definitions to understand network security. Malicious codes (malware) are programs designed to execute attacks on the operating system of a computer, causing damage or promoting harmful activities. There are several ways that malicious code can infect or compromise a computer. A virus is a program or part of a computer program, usually malicious, that spreads typically inserting copies of itself into other programs or files. Worms consume a lot of computational resources, considering that they produce many copies of their own at the expense of intense computer use. A spy program (spyware) is designed to monitor the activities of a system and send the collected information to third parties. It can be used in a legitimate or harmful way, depending on the installation procedure, on the performed actions, on the type of monitored information, and on the use that is made by whoever receives the collected information.