Yubikey autotouch
Yubikey is a popular solution for the 2 Factor Authentication. Typical usage scenario is: you enter credentials and then touch yubikey sensor to complete authentication. I was curious if touch can be automated. 1st I looked for purely programmatic solution, but this forum thread showed that this is impossible. My next experiment was to simulate touch using capacitor. I took 22uF 50V capacitor, connected 1 wire to the yubikey sensor and touched connector casing (which is grounded) with another wire. This worked! So next thought was: what device I can use to commutate capacitor? After some search I decided to try Digispark USB Development Board. I found a very helpful Little-Wire project that can be used to control pins on the Digispark board. I’ve created fork of the repository with yubikey branch and added file yubikey-touch.c based on the examples. The idea is to keep pin2 in the high-z (high impedance) state, then switch it to the low level output state and after delay restore high-z state.
Here is sample a session:
Now you can programatically touch yor yubikey :-)!
You may find useful another project that can help you detect situations when yubikey requires touch.