This idea was inspired by the recent discussion on the "talk" mailing list about the (in)security of the German ID card. The Chaos Computer Club and other researchers claim that the ID card is insecure. Actual attacks that have been demonstrated are based on keyloggers.

Keyloggers might be the biggest security threat for Linux users at this time. Keyloggers are trivial to write for Linux and readily installable, and a keylogger with normal user rights may read root's password. One might ask "Why are we caring about local root exploits at all as long as users run stuff like sudo in X terminals"? Keyloggers can even read the input from devices like the Yubikey.

Various techniques exist. The simplest way is just to read xinput events. More sophistcated attacks (usually requiring root) would read from /dev/input or ttys.

My idea is to explore possibilities for a "secure" keyboard mode. This is all totally crude, not thought-through brainstorm material. I'm thinking of an ioctl that would put an input device in a special mode in which events would be forwarded only to a single process (the process that made the ioctl). Care would need to be taken that this functionality couldn't be abused for locking the input device completely. The ability to use this ioctl could be bound to capabilities and/or further restricted e.g. by SELinux, so that not even root would be able to spy on keyboard input easily.

This "secure" mode would than be available for critical operations such as reading pass phrases. In a second step, we might consider doing the password hashing in the kernel, so that user space would never need to read the clear text password at all; I'm not sure what problems with keyboard mapping we'd encounter in such a setup though.

I'd like to understand if this is total bogus, and if not, discuss implementation steps and perhaps create a PoC.

Looking for hackers with the skills:

kernel c

This project is part of:

Hack Week 15


  • almost 4 years ago: slahl liked Secure keyboard
  • almost 4 years ago: hennevogel liked Secure keyboard
  • almost 4 years ago: mwilck added keyword "kernel" to Secure keyboard
  • almost 4 years ago: mwilck added keyword "c" to Secure keyboard
  • almost 4 years ago: mwilck liked Secure keyboard
  • almost 4 years ago: mwilck originated Secure keyboard

  • Comments

    Be the first to comment!

    Similar Projects

    Upstreaming of mediatek helios board by mbrugger

    The only Mediatek "hacker" board available is f...

    Help with mainline support for the Mediatek chromebook (MT8173 based) by mbrugger

    Lately the necessary patches to get rudimentary...

    Mainline Sunplus Plus1 SP7021 kernel for Banana Pi F2S by a_faerber

    The recent Banana Pi BPI-F2S board features a n...

    work on sunxi a64 cpufreq driver (for teres-1, pine64) by mbrugger

    With the teres-1 [1] laptop we have a first arm...

    openSUSE/SLE/Mainline U-boot for some not-yet-supported ARM64 boards by ldevulder

    The Khadas VIM ( is an a...

    Improving picotm by tdz

    Picotm is a system-level transaction manager. I...

    dmidecode: no more open-coded printfs by jdelvare

    There's a long standing request to extend the o...

    ethtool ops for netdevsim by mkubecek

    This can be seen as a subproject of [ethtool ne...

    netlink interface for ethtool by mkubecek

    There seems to be an overall consensus that the...

    make "predictable network interface names" more predictable by mkubecek

    Since the so-called "predictable names" for net...