For notebook computers, this doesn’t work so well. Sometimes they don’t have a
usable camera, and even if they have one, people don’t typically have a barcode
scanner installed.

Therefore, you typically end up typing in the (long) password, which is
annoying. I thought there should be a better way, perhaps by faking a USB Human
Interface Device (like a keyboard). Then I saw a YubiKey lying around and a
couple minutes later I had my solution working :-).

YubiKey

The YubiKey is
a small USB device (about as big as a USB memory stick) that is typically used
for two-factor authentication. You may be familiar with this concept from
Gmail, where you log in with a password and then provide a number generated by
the Google Authenticator on your phone as a second factor. The YubiKey does
this by simulating you typing in the number after you touch it.

Luckily, the device’s firmware also supports a mode where it essentially just
types a static password when being touched. Unfortunately, this feature is a
bit hard to use, so I wrote pw-to-yubi, a little script
which translates a (WiFi) password into a command line to program your YubiKey.