Search code examples
operating-systemkeylogger

Do operating systems have facilities for secure text input?


I'm wondering if there's a way to ensure that text you type in to a program is not visible by any other program (other than the OS obviously). I know there are key loggers that do things like hook into the OS to circumvent userspace keylogger prevention methods (eg https://code.google.com/p/logkext/).

Is it possible to ensure completely private text input, barring hardware key loggers?


Solution

  • Not really. Excluding a physical adapter that did keylogging, you won't be able to prevent kernel-space keyloggers completely in any OS. You could introduce some kind of trust between the kernel and applications, but there would be no way to fully prevent spoofing that trust on the application level or some malicious kernel level code (such as a device driver) from reading the input and passing it along.

    I'd imagine different operating systems have different safeguards against malicious (or potentially malicious code), but there'd always be some way of getting around those safeguards to allow for kernel level execution. Think about warnings you get when installing drivers and making sure they come from a trusted source, etc.

    There are other strategies you might pursue for application specific protection, such as ensuring that various drivers are signed by the correct trusted source, but you probably won't do much better than the OS does. In the end, a foolish user can thwart all of this when they install something they don't understand using elevated privileges.

    The only way I can think of this really working would be an embedded system with cryptographically secured static kernel and application code - in other words, an OS that doesn't allow the loading of any foreign code, which would not ordinarily be useful in every day computing (but is useful in many embedded and other sensitive systems). Even then, there may be firmware liabilities to consider, but it may be possible to properly lock down even the firmware data - even then though, someone who's smart enough and persistent enough will find a way around it if they have physical access to the device, and if you leave even the smallest opening for foreign code execution, they'll get it even without physical access to the device. Research the Equation Group (http://arstechnica.com/security/2015/02/how-omnipotent-hackers-tied-to-the-nsa-hid-for-14-years-and-were-found-at-last/) for an example.