Key logging is the action of recording (logging) the keys pressed on a keyboard, usually without the user of the keyboard knowing so they are unaware their actions are being monitored. The data can then be accessed by the person in control of the keylogger. A keylogger can either be software or hardware.
These are computer programs designed to work on a victims computer. They can be legitimately used to help troubleshoot technical problems with computers and networks or improve typing and writing services. The problem is when malicious individuals install keyloggers on public or target computers to steal passwords, credit card details and other information.
They can infect computers through a Trojan horse or as part of a virus.
Hardware key loggers are a physical device that is attached somewhere between a the computer keyboard and the computer, usually on the end of the keyboards cable connector. They serve the same purpose as software-based keyloggers but can rarely be detected by antivirus.
They must be physically put in place by an attacker.
Good defence against keyloggers varies as there is a variety of different methods keyloggers use to capture keystrokes.