Malware
A keylogger records every keystroke you make. Each key press is stored in a log, so anything you type, such as a password, a private message or a bank card number, can be read later by the person who set it up. It captures everything, including typos and the backspaces that delete them, which can reveal even more than the final message.
A hardware keylogger is a physical device rather than a program. Some are built into a replacement keyboard so that nothing looks out of place; others are fitted into the keyboard's cable. Either way it captures the keyboard's signal before the computer receives it, so it works even if no keylogging software is installed. Fitting one needs physical access to the machine, but no files have to be changed.
A software keylogger is a program running on the computer. It can be installed without the user realising. It runs in the background and records keystrokes as they pass through the operating system. Because it is only software, it can be installed remotely, without anyone touching the machine.
Software keyloggers can send their logs to the attacker over the internet automatically, so the attacker never has to return to the computer. Some hardware keyloggers store the log on the device instead, and the attacker has to collect it. Once the text reaches the attacker it becomes stolen data they can use from anywhere: if the log contains your game account password, they can sign in as you and take over the account.
Edexcel GCSE Computer Science · Malware