Martin's corner on the web

High security key fob project

This project is about creating a high-security keyfob using Atmel’s ATSHA204 hardware authentication device. It was inspired by this post about security and signing. Many modern key fobs use various security techniques to prevent replay attacks, yet it turns out it is possible to hack even rolling codes. To solve this problem and have a key fob that I can use with confidence (as garage door keyfob replacement for example), I am thinking of something along these lines (still WIP):

The encryption key will be set on the ATSHA204 and One-Time Programmable fuses will lock the chip.

The actuator will be the BBoilRF, it already has 433Mhz FSK module and an option for ATSHA204 and will act as either gateway to MQTT or will be configured to execute actions on its own upon the received from the key fob command. Possible uses are relay toggling, setpoint increase/decrease, entering boost mode when in thermostat mode etc.

The keyfob enclosure is an off-the shelf one, not my design, I designed the PCB to fit in it. The hardware specs are as follows:

  • MCU ATmega328p
  • Status LED
  • Four buttons
    • click, double-click and long press detection for all buttons
    • Requiring ACK, transmission strength, # of tx retries and nodeID configurable via buttons menu
  • Powered by CR2032 coin cell battery
    • Reverse polarity protection
    • Short circuit protection
    • Battery voltage measurement included in transmitted payload
  • ATSHA204 encryption chip (option)
  • 433Mhz RFM69 FSK module
    • HW encryption
    • long-range

I already have second PCB prototype, works like a charm so far. I’ve already quite some experience with low power battery operated IoT nodes, that knowledge came in handy for this project. Battery life is excellent, range as well. I am yet to complete the most challenging part with ATSHA204, it is still WIP. I am also in the process of creating custom membrane keypad cover that will be glued on top of the buttons to give the keyfob a finished look.



3 thoughts on “High security key fob project

    1. Martin Post author

      Excellent observation. Yes, there are couple 0603 10uF caps and one 0805 22uF, without these it is browning out.. This is a lesson I learned from an old project (Funky v3+RFM69 ). With this setup the juice is more than enough and it works well.. Also, the RFM69 will draw excessive current until initialized, giving the MCU some hard time starting up.. I have some tricks up the sleeve in that direction too.

      I like your setup, the enclosure you used is more expensive though. What antenna did you plan to use? Ideally PCB trace antenna would be best, but I am not an expert in this direction and didn’t try.

      1. kvoit

        That sounds encouraging, since I left space for a beefy tantalum cap. Should work, then.
        The bottom cutout of the pcb takes a spring antenna. I also do not have any expertise in PCB antennas.
        The enclosure might be more expensive, but I also like it better, and that gateway does it only on a hardly noticeable scale, no idea why. It’s not the module, I soldered in to a breakout and it works on a breadboard.

        Software will be the next thing. Have to decide if I cook something up myself or use MySensors.

        I’ll keep an eye on this project.