GithubHelp home page GithubHelp logo

siemg / nfc-unlock Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lanhed/nfc-unlock

0.0 0.0 0.0 1.51 MB

A simple nodejs server to unlock OS X with NFC tag - preferably implanted

JavaScript 56.34% Shell 1.92% C++ 41.74%

nfc-unlock's Introduction

nfc unlock

A simple Arduino to Nodejs serial communction program allowing user to unlock mac or start screensaver with a NFC tag.

Part of the code is forked from https://github.com/suhajdab/lan-unlock

Prerequisites

Nodejs (https://nodejs.org/) and forever package (https://www.npmjs.com/package/forever) needs to be installed to run current setup. Note the global flag -g when installing forever.

Arduino Serial communication enabled Arduino.

NFC Module PN532 NFC RFID module.

This application requires your nfc tag uid, you can use the example files in PN532 to find out the id. The tag uid will then be displayed in HEX values: 0x84 0x48 0x12 0xFF 0x2B 0xE1. This would translate to a string in this application: 844812ff2be1 saved in the config.json, to be matched with your tag uid.

To use this application without changing much, you'll need to set Display login window as to List of users. It will only function when logged in.

Hardware

Software

Instructions:

  1. Open config-BLANK.json and change the password to match your OSX password. Also add your tag uid to the list of uids and save as config.json.
  2. Add the current port to nfc.port (List ports in terminal with ls -l /dev/*.usbmodem*) 2 1/2. I've saved a nifty little script at https://gist.github.com/lanhed/dcb652c83f032fea31c9 that potentially could make the port selection automaticly. I just haven't had the time to implement it. But you could :)
  3. Generate ssl certificates ( ex: http://www.selfsignedcertificate.com ) and place local.cert & local.key in root folder.
  4. Plug in your Arduino connected PN532 NFC RFID module to your computer and upload the Arduino sketch

Start alternative 1, making the application start when you first log in

  1. Open Automator and from there open Start Unlock Deamon.app
  2. Change the path in the second line to match your installation directory (Do this to Stop Unlock Deamon.app as well).
  3. Save
  4. Go to System Preferences >> User & Groups and click on Login Items tab
  5. Add Start Unlock Deamon.app and check the box to enable it at first login
  6. Put your computer to sleep and scan your tag.

Start alternative 2, manual start

  1. Open start-unlock-deamon.command and stop-unlock-deamon.commmand and change the path in the first line to match your installation directory.
  2. Run start-unlock-deamon.command by double clicking it.
  3. Put your computer to sleep and scan your tag.

Disclaimer: Use at your own risk!, I take no responsibility for any harm caused by the use of this software.
License: WTFPL

TO-DO

  1. Make the app auto discover port
  2. Make the application work even if you're not logged in.
  3. Make a menubar app to display application status, show denied users, start/stop the deamon.
  4. Installation script

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.