Short Answer A keylogger is a hidden program or small device that secretly records every key a person presses on a keyboard. This lets an attacker read passwords, messages and card numbers as you type them. It is like someone standing behind you and copying down everything you type, without you ever seeing them.
What is a Keylogger?
A keylogger, short for keystroke logger, watches your keyboard. The keylogger writes down each key press, in order, so the attacker can rebuild every word you typed. That includes your bank login, your email password and the private chats you send.
In cyber security, a keylogger is a type of spyware. Spyware is hidden software that watches what you do and passes it to someone else. NIST, the US standards agency, describes a key logger as a program that records which keys are pressed. Attackers use it to get passwords, and with those passwords they can get around other protections.
Some keyloggers are software that runs quietly on a PC or phone. Others are small physical devices. Either way, the person typing usually has no idea that anything is listening. Also, many modern keyloggers do more than record keys. For example, some take screen captures, copy what you paste or record which websites you visit.
Key Words to Know
- Keystroke: one press of one key on a keyboard, including Enter, Backspace and the number keys.
- Login: the user name and password you type to get into an account.
- Attachment: a file sent along with an email or chat message, such as a PDF or a ZIP file.
- Hidden program: software that runs in the background and does not show a window or an icon.
- Screen capture: a picture of what is on your screen at one moment.
- MFA: multi-factor authentication, a second sign-in step, such as a code on your phone, on top of your password.
How Does a Keylogger Work?
A software keylogger attack usually follows five simple stages. Knowing them helps you see where you can stop it.
- Getting in: most often, a person opens a fake email attachment or downloads a fake file. This trick is called phishing. Sometimes the keylogger also comes bundled inside a program that looks useful.
- Recording: from then on, it notes every key you press, in every program you use.
- Saving: the recorded keys go into a hidden file on the device.
- Sending out: every so often, the keylogger sends that file to the attacker over the internet. NIST notes that some keyloggers send data by email or file transfer, while for others the attacker has to fetch it from the device.
- Using the data: finally, the attacker reads the file, picks out passwords and card details, and signs in as you.
So the attacker does not need to break in. They simply sign in with your own password.

A Surat Textile Exporter Example
For example, imagine a textile exporter in Surat. Its accountant receives an email that looks like a courier company’s delivery notice. It says a parcel is held and asks her to open the attached “shipping details” file. She opens it on the accounts PC. Nothing seems to happen, so she closes it and gets back to work.
However, the file has quietly installed a keylogger. Later that day, she signs in to the company’s online banking. The keylogger records the user name and password and sends them to the attacker. A few days later, someone tries to send a large payment to an unknown account. But the bank sends a one-time code to the finance head’s phone before any large payment. The attacker does not have that phone, so the payment fails. The bank’s alert then leads IT to the infected PC.
Types of Keylogger
Keyloggers come in a few main forms. Some are software, some are hardware and some live only inside a web browser. The table below shows each type in one plain line.
| Type | What It is | Where You Might Spot It |
|---|---|---|
| Software keylogger | A hidden program on a PC that records key presses | A security scan or an unknown program in the list |
| Hardware keylogger | A small plug between the keyboard cable and the PC | A strange extra part on the keyboard cable or USB port |
| Browser keylogger (form grabber) | A harmful browser add-on that copies what you type into web forms | An add-on you never installed in your browser |
| Mobile keylogger | A harmful phone app or fake keyboard that records your typing | An unknown keyboard or app with too many permissions |
Hardware keyloggers need someone to touch your computer, so they are rarer. In contrast, software and browser keyloggers can reach you from anywhere through the internet, so they are more common in offices.
Is a Keylogger Malware?
Yes, when someone uses it secretly to steal. Malware is any software made to harm a device or its user. A keylogger used this way is malware, and more exactly, a kind of spyware.
A keylogger often arrives inside a Trojan horse, a harmful program dressed up as something useful, such as an invoice or a courier slip. People also say “keylogger virus”, but that is not quite right. A virus copies itself into other files and spreads. Most keyloggers do not spread on their own. Instead, they sit quietly on one device and watch.
Keyloggers also often travel with other harmful tools. For instance, a rootkit can hide a keylogger from normal checks, which makes it harder to find.
Monitoring at Work vs Secret Spying
Some companies use monitoring software on company-owned devices, for example to meet audit rules. This is acceptable only when it is open: staff know about it, a written policy explains it and it covers work devices only. Secretly recording another person’s typing is another matter. Using a keylogger on someone’s device without permission, to read their passwords or messages, can be a crime under India’s Information Technology Act, 2000. This page does not give legal advice, so speak to a lawyer for a specific case.
Warning Signs on a PC
A keylogger is built to stay quiet, so you may see no signs at all. Still, a few clues can point to one. Check calmly, and remember that each sign can also have a normal cause.
- Typing lag: letters appear a moment after you press the keys, or the mouse feels slow.
- Unknown programs: a program, browser add-on or phone keyboard you never installed.
- Odd internet use: the PC keeps sending data over the internet even when no one is using it. IT teams can spot this in their tools.
- A strange plug: a small extra part between the keyboard cable and the PC.
- Accounts used without you: password-change emails you did not ask for, or sign-ins from places you have never been.
- Security settings switched off: your security software is turned off and you did not do it.
The last two signs matter most. If someone uses your account without you, act at once, even if the PC seems fine.
Talk to an ExpertCould a stolen password open your company’s accounts? Talk to our team about spotting and stopping password theft.Ways to Prevent a Keylogger
No single step stops every keylogger. Instead, several simple layers work together. If one layer fails, the next one still protects you.
- Keep software updated: install updates for Windows, browsers and office programs soon after they arrive. Updates close the weak spots that harmful files use to get in.
- Use security software: keep antivirus turned on and up to date. On Windows, Microsoft Defender Antivirus comes built in. For offices, endpoint security lets IT watch every laptop and PC from one screen and get alerts.
- Turn on a second sign-in step: with multi-factor authentication, a stolen password alone is not enough. The attacker also needs the code or approval on your phone. CISA, the US cyber agency, makes the same point: if one factor such as a password leaks, the second one still blocks the attacker.
- Use a password manager: a password manager fills in passwords for you. So you type fewer passwords, and a keylogger catches less.
- Be careful with attachments: pause before you open a file you did not expect, even when it looks like a courier or bank message. Call the sender on a known number if in doubt.
- Check office keyboards: from time to time, look at shared and front-desk PCs for unknown plugs on the keyboard cable.
- Use the bank’s on-screen keyboard: some net banking pages let you click letters on the screen instead of typing. This beats a plain key recorder, but not one that takes screen captures, so keep MFA on too.
Layers of Protection for an Office
For a business, the goal is simple: even if a password is stolen, the attacker still cannot use it. First, staff training cuts the number of fake attachments people open. Then updates and security software catch most harmful files that do get through. A password manager also means staff type fewer passwords. Next, MFA, such as a one-time code on a phone, stops a stolen password from being enough. In the Surat example, the attacker had the password but not the finance head’s phone, so that code saved the payment. Finally, a payment approval rule, such as a second person approving large payments, adds one more layer before money can leave.

What to Do If You Find a Keylogger
Stay calm and act in a clear order. The aim is to stop the leak first, and then lock the attacker out of your accounts.
- Disconnect: take the device off the internet and the office network, so it cannot send any more data.
- Tell IT: at work, tell your IT or security team at once, because some incidents must reach CERT-In within 6 hours. Do not try to clean a work PC yourself.
- Run a full scan: IT runs a full security scan and removes what it finds. For a hardware keylogger, they unplug and keep the device as evidence.
- Change passwords from a clean device: use a different, safe device, because the infected one may still record. Start with email, banking and work accounts.
- Turn on MFA: switch it on for every account that offers it, if it was not on already.
- Tell the bank: if you typed any bank or card details on that device, call your bank and watch your statements.
If the infection keeps coming back, IT may decide to wipe the device and reinstall it from a clean copy. That takes longer, but it gives you a device you can trust again.
Reporting in India
In India, CERT-In (the Indian Computer Emergency Response Team) is the national agency for cyber incidents. Its directions of 28 April 2022 cover service providers, data centers, companies and government bodies. They must report certain cyber incidents within 6 hours of noticing them or being told about them. Malicious code attacks, including spyware and Trojans, are on that list. If money is lost or at risk, anyone can also call the national helpline 1930. You can also file a complaint on cybercrime.gov.in, the National Cyber Crime Reporting Portal run by the Ministry of Home Affairs.
Frequently Asked Questions About Keylogger
What is a keylogger in cyber security?
What is a keylogger used for?
What is a keylogger in the context of password attacks?
What is a keylogger trojan?
What is keylogger blocking?
What does keylogger mean in computer terms?
References
- Definition of a key logger: NIST CSRC Glossary, key logger
- How keystroke loggers send data and arrive with other tools: NIST SP 800-83 Rev. 1, Guide to Malware Incident Prevention and Handling for Desktops and Laptops
- Why a second sign-in step stops stolen passwords: CISA, More than a Password
Get the Latest Terms & Insights.
New encyclopedia terms, threat intelligence, and architecture decisions, by email.
