Keylogging is a type of cyber attack in which the attacker monitors keystrokes on your computer. For example he may record your password or other sensitive information.
Keylogging How does it work?
Keylogger (or Keystroke logger) is either a malicious program or a hardware device installed inside your keyboard. The principle of both is the same - keylogger captures and records the keystrokes on your keyboard. Sometimes keylogger is used legally for monitoring of the behavior of users (employees) in the company (eg banks use this) for security reasons.
Keylogger as the malware you can get as a common virus. Keylogger silently send data to the attacker and he is able to read your password, pin number or credit card and so on.
How to defend against unwanted keylogging?
Keylogger malware is very dangerous because it is usually very silent - besides keylogging does not harm anything and so its detection is difficult. Basically, the only defense is to use good security software to protect against such malware (eg. Antivirus, internernet security suite, firewall). Equally important are preventive measures - do not visit suspicious websites, and do not open suspicious e-mails.