All Projects → Santandersecurityresearch → CurrentSense-TinyML

Santandersecurityresearch / CurrentSense-TinyML

Licence: MIT license
Spying on Microcontrollers using Current Sensing and embedded TinyML models

Programming Languages

C++
36643 projects - #6 most used programming language
Jupyter Notebook
11667 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to CurrentSense-TinyML

owlos
DIY Open Source OS for building IoT ecosystems
Stars: ✭ 43 (-39.44%)
Mutual labels:  embedded-systems, sensors
pico-loud talking detector
A tinyML system using a Raspberry Pi Pico and TensorFlow Lite for Microcontrollers to detect loud talking. It can be utilized to encourage people to eat quietly to prevent the spread of the coronavirus and help in the fight against COVID
Stars: ✭ 17 (-76.06%)
Mutual labels:  tensorflowlite, tinyml
Lwesp
Lightweight Espressif AT parser library for ESP8266 and ESP32 devices.
Stars: ✭ 212 (+198.59%)
Mutual labels:  embedded-systems
awesome-embedded-swift
⚡️🛠🧰 A curated list for Embedded and Low-Level development in the Swift programming language.
Stars: ✭ 57 (-19.72%)
Mutual labels:  sensors
Libhydrogen
A lightweight, secure, easy-to-use crypto library suitable for constrained environments.
Stars: ✭ 247 (+247.89%)
Mutual labels:  embedded-systems
Sierra Wireless Modems
EM7565/EM7455/MC7455 - Modem Configuration
Stars: ✭ 217 (+205.63%)
Mutual labels:  embedded-systems
COVID-Net
Launched in March 2020 in response to the coronavirus disease 2019 (COVID-19) pandemic, COVID-Net is a global open source, open access initiative dedicated to accelerating advancement in machine learning to aid front-line healthcare workers and clinical institutions around the world fighting the continuing pandemic. Towards this goal, our global…
Stars: ✭ 41 (-42.25%)
Mutual labels:  tinyml
Xfrp
xfrps&frp client for openwrt&LEDE
Stars: ✭ 205 (+188.73%)
Mutual labels:  embedded-systems
novaboot
A tool that automates booting of operating systems on target hardware or in qemu
Stars: ✭ 32 (-54.93%)
Mutual labels:  embedded-systems
Real Time Cpp
Real-Time C++ Companion Code
Stars: ✭ 242 (+240.85%)
Mutual labels:  embedded-systems
rpi boat utils
Utilities for Raspberry Pi, mostly for usage on a boat. Includes UART control scripts, traffic measurement tools for Mikrotik (RouterOS) and OpenWrt, AIS wireless daemon, AIS decoder and an extensible boat & IoT sensor daemon for Signal K.
Stars: ✭ 71 (+0%)
Mutual labels:  sensors
Open Electronics
📚 💻 Great Resources for Electronics Enthusiasts
Stars: ✭ 242 (+240.85%)
Mutual labels:  embedded-systems
Libonnx
A lightweight, portable pure C99 onnx inference engine for embedded devices with hardware acceleration support.
Stars: ✭ 217 (+205.63%)
Mutual labels:  embedded-systems
OpenMaterial
3D model exchange format with physical material properties for virtual development, test and validation of automated driving.
Stars: ✭ 23 (-67.61%)
Mutual labels:  sensors
Libuavcan
Portable reference implementation of the UAVCAN protocol stack in C++ for embedded systems and Linux.
Stars: ✭ 213 (+200%)
Mutual labels:  embedded-systems
Embedded-Linux-Education-Kit
Embedded Linux Education Kit
Stars: ✭ 66 (-7.04%)
Mutual labels:  embedded-systems
Copilot
A stream-based runtime-verification framework for generating hard real-time C code.
Stars: ✭ 204 (+187.32%)
Mutual labels:  embedded-systems
Gnu Eprog
Embedded Programming with the GNU Toolchain
Stars: ✭ 230 (+223.94%)
Mutual labels:  embedded-systems
nrf52840-experiments
802.15.4 experiments with nRF52840
Stars: ✭ 23 (-67.61%)
Mutual labels:  embedded-systems
E2E-Object-Detection-in-TFLite
This repository shows how to train a custom detection model with the TFOD API, optimize it with TFLite, and perform inference with the optimized model.
Stars: ✭ 28 (-60.56%)
Mutual labels:  tinyml

Welcome to CurrentSense-TinyML

Intro

CurrentSense-TinyML is all about detecting microcontroller behaviour with current sensing and TinyML. Basically we are trying to work out what is happening on a target PCB.

This work is inspired by prior work I have done, as well as the work of Stacksmashing at leveldown security. This work is intended to be a working Proof of Concept (PoC) for what is the next logical step in these kinds of attacks - using Machine Learning (ML) in current monitoring side-channel analysis attacks.

GOAL - To detect an LED flashing on a target using an TensorFlow Lite ML model running on a different microcontroller speaking to an INA219 power monitor that is reading the power going into the target.

See TinyML-CurrentSense-Writeup.ipynb for the writeup of this project. The Arduino_CurrentSense_ML folder contains the Arduino IDE .ino file that will load the model onto an Arduino Nano 33 Sense board. The rest of the code - for generating training data, recording it, and processing it, can all be found in the jupyter notebook and the DataCollection folder.

We've also uploaded it to Google Colaboratory for those who would like to have a play but not install stuff locally first: https://colab.research.google.com/github/Santandersecurityresearch/CurrentSense-TinyML/blob/main/TinyML-CurrentSense-Writeup.ipynb

This is a taster of the resulting behaviour - reading the state of the target LED (in RED) and copying it using the analyser's LED (Yellow):

PoC

What is CurrentSense-TinyML (and does it work?)

Despite prior evidence that says 'yes!' from the work we cited above, there are a few good indicators that this should work. If we setup the INA219 with the Nano 33 Sense and just monitor the Nano target running blink, we can see the following output when we use Arduino IDE's Serial Plotter (using the get_current_data.ino code for those who want to play along at home)

initial motivation

How Do I Install It?

First things first, we need to get the environment ready. TensorFlow does not support Python v3.9.x, so if you need to, you should run conda activate to enable a python 3.8.x environment.

We recommend you use a Jupyter Notebook instance as this makes life much easier.

We first install TensorFlow and then do our imports...

Tensorflow

Next up, you will need some hardware:

  • INA219 Current Measuring over I2C board
  • Arduino Nano ATMEGA329P target board (AliExpress or eBay is good here)
  • Arduino Nano 33 Sense ML capable board
  • USB Cables and Laborkabel
  • A Breadboard is handy

On the software side, your IDE Platformio or the Arduino should work with the Arduino Nano 33 Sense. You'll also need to add the INA219 library

How Do I Use It?

Ok, so we've convinced ourselves that this should work... or might work... or could work... so let's get started!

We recommend you load the TinyML-CurrentSense-Writeup.ipynb into your Jupyter instance as this is the most detailed explaination as to how you make magic happen.

Who Is Behind It?

CurrentSense-TinyML is a research project by Work done by Mark Carney of the Santander Group Cyber Security Research Team. (@LargeCardinal).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].