Giter Club home page Giter Club logo

yubiswitch's Introduction

yubiswitch

yubiswitch is an OSX status bar application to enable/disable a Yubikey Nano from Yubico.

Yubikey is the producer of the Yubikeys: an hardware authentication device, designed to provide an easy to use and secure compliment to the traditional username and password.

By touching the exposed gold edge, a YubiKey Nano emits a One Time Password (OTP) as if it was typed in from a keyboard. The unique passcode is verified by a YubiKey compliant application.

Yubikey Nano picture

So far all looks great doesn't it? :D

flnurfrdjvfrlutthjtjvcbcrlbbnnuu
ejehlrlrclcllukjgehhrttbknnbjdfn
njlvvnherbjvnljdvvvnihrfikufjucr
jhgkhrubrnuchhhbhrugvbenrhkcvich

Whooops! You see? I brought my laptop (lid opened) with me for a walk to a meeting room holding it with my right hand touching the golden stripe and this caused the Nano to start sending random OTP passwords to my Vim session, and to the FB chat window I had opened with my wife, and right now she's been asking WTF I've been writing :P

This status bar app allows you to avoid sending those accidental OTP passwords by allowing you to enable or disable the yubikey using a convenient global keyboard hot key that you can configure yourself.

Download

Download the latest version in DMG format from github release page here.

Integration with shell

The application supports two basic AppleScript commands:

  • KeyOn
  • KeyOff

You can switch your yubikey on and off using this basic osacript commands:

$ osascript -e 'tell application "yubiswitch" to KeyOn'
$ osascript -e 'tell application "yubiswitch" to KeyOff'

Screenshots

Menu items in the status bar:

Menu items screenshot

Preference window:

Menu items screenshot

Known Issues

  • This applicaiton only works with a single model of yubikey, the YubiKey Nano. There is no need to deal with other yubikeys because their form factor doesn't encourage the users to leave it always plugged in. The nano is the only the model that fits cleanly into your usb port. It has idVendor 0x1050 and idProduct 0x0010.

  • This app only works with recent version of OSX because it relies on the Notification Centre. OSX 10.8.x and above would do it. Sorry about that.

TODO and future plans

  • Make hotkey configurable via configuration window, currently it's static and it is cmd-Y. (This is done via ShortcutRecorder now)

  • Use NSNotificationCenter to notify other classes (ie AppDelegate and YubiKey) when user preferences are changed

  • Add "Start at login" feature

  • Support for basic AppleScript comomands: KeyOn/KeyOff

  • Feature: lock computer when yubikey is removed (use IOServiceAddMatchingNotification in IOKit?)

  • Feature: check update features, check if current version is the latest. Connect to github somehow

  • Support more yubikeys nano on multiple USB slots

  • Better support for plug and unplug events

  • Convert release process using [github's Release APIS] (https://github.com/blog/1645-releases-api-preview) and ChocTop

How to create DMG for distribution

Note that this will change soon to be integrated with [github's Release APIS] (https://github.com/blog/1645-releases-api-preview)

When you want to create a release:

  • Tag repo with vx.y, ie git tag -a -m 'comment' v0.2
  • Compile release app bundle in Xcode
  • Run script: cd dmg/ && bash createdmg.sh
  • Get the file at /tmp/yubiswitch\_$VERSION.dmg and distribute via release page as explained in the github blog

Dependencies

yubiswitch uses ShortcutRecoder to implement global hot key and shortcuts recording in the the preference window.

git submodule add git://github.com/Kentzo/ShortcutRecorder.git
  • See this helpful page for instructions on how to set up your Xcode environment should you have any problem.

Credits

Credits to Anton Tolchanov (@knyar), he originally wrote this in Python using PyObjC bridge. I decided to port this into Objective-C to learn the language when I found out that Carbon Event Manager libs have been removed from Python3. See http://docs.python.org/2/library/carbon.html

yubiswitch's People

Contributors

pallotron avatar ryanbrainard avatar varzan avatar will avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.