Question: **Is it possible to defeat software keyloggers?**

I remember reading long ago about programs run from a USB which will defeat keyloggers. 

The software works (if I remember correctly) by intercepting keyboard events to the system, and randomly replacing your keystrokes with random keys, and then counteracting the randomness with a backspace or copy and paste type algorithm.

Does this kind of software exist, and is it reliable? I'm sure a dedicated attacker could read his/her logs, but for use in a library or other public location this approach could seemingly work.

Answer: 
The generic issue with such countermeasures is that they defeat only *some* keyloggers, and are themselves defeated by the next generation of keyloggers. In this case, it would be easy for a keylogger to take into account the backspace events (the keylogger sees all keyboard events, so in it sees backspaces) to rebuild the actual password. In fact existing key loggers should already do that, because *human users* use the backspace key occasionally, too !

Another generic issue with an anti-keylogger software is that it is *software*. A software keylogger, in order to enact its malevolent functionality, must intercept keypress events, and this requires privileged access to the operating system, at least administrator-level. An evil piece of code which obtains such access will not necessarily stop there; it may also scan for the launch of known anti-keylogger software and deactivate it. Malware and virus do that in general, against anti-malware and anti-virus software.

An additional reason why a keylogger would block out your envisioned anti-keylogger software is that keylogger writers generally dislike competition -- if they find other keyloggers from their fellow keylogger writers, they promptly kick them out. Your anti-keylogger software, from the outside, really looks like a keylogger, since it intercepts keypress events; it is then likely to be deactivated by another keylogger which just wants the monopoly of key logging.

Therefore, if software such as you describe exists at all, then it cannot be considered as reliable. It might enjoy some partial success against a few keyloggers, but this won't last.
About the only consistent protection - other than all the usual precautions about protecting your computer from malware - is a **hardware two-factor authentication dongle** (à la SecureID). 

This way if a software or hardware keylogger exists, your security has collapsed into one-factor authentication instead of *zero*-factor authentication.

The equivalent of a hardware dongle can be created by having a seeded pRNG on a mobile device. The Battle.Net authenticator for example. This assumes the malware is only on one of your computing devices - not both. 

In either case, this protection from keyloggers is website-specific (or single sign-on equivalents) as the two-factor authentication needs to be recognised on the server-side. 

Protecting the decryption of assets residing on the same device as the malware is impossible without some seriously [compartmentalised hardware modules](http://en.wikipedia.org/wiki/Trusted_Computing), or a weak malware infection to begin with.