Keylogging defines a piece of software or hardware that monitors and stores input from the keyboard. Not unlike a 'Trojan', such code is often installed illegally (via virus or worm etc.) with the aim of gathering password, credit card or other personal details.