Proof of Life: Authenticate Critical Arduino Actions w/ ADA

Proof of Life: Authenticate Critical Arduino Actions w/ ADA © MIT

Use VBBMicro to add an extra layer of security to your Arduino app by proving mission critical actions in real-time, in-circuit, and in ADA.

  • 555 views
  • 1 comment
  • 6 respects

Components and supplies

A000066 iso both
Arduino UNO & Genuino UNO
×1
Virtual Breadboard VBBMicro
×1

Apps and online services

AdaCore JGNAT [Java Virtual Machine on Windows]
To download : * Select Java Virtual Machine on Windows from the dropdown list * Download gnat-gpl-2012-avr-windows-bin.exe
Virtual Breadboard VBB App
Virtual Breadboard VBB Debug VSCode Extension
VSCode ADA Extension
Microsoft VSCode PowerShell Extension

About this project

Code

ProofOfLifeADA
Code from Repository describing the Contracts framework
with Ada.Text_IO; use Ada.Text_IO;
with ProofOfLifeVBB;

package body ProofOfLife is
 
   function IsNoKeyAttack(Samples : in ProofOfLifeVBB.KeySampleData ; LastSampleIndex : in Integer) return Boolean is 
    
   begin

      if LastSampleIndex = 0 then
         -- Maybe it wrapped
         if Samples(1) = 0 then
            -- Maybe it happened to overflow to zero
            if Samples(2) = 0 then
               return True;
            end if;
         end if;
      end if;

      return False;

   end IsNoKeyAttack;

   function IsKeyScanningAttack(Samples : in ProofOfLifeVBB.KeySampleData ; LastSampleIndex : in Integer) return Boolean is 
       
   begin
      -- TODO

      return False;

   end IsKeyScanningAttack;

   function UniqueKeyPresses(Samples : in ProofOfLifeVBB.KeySampleData ; LastSampleIndex : in Integer) return Integer is 
       
   begin
      -- TODO

      return 5;

   end UniqueKeyPresses;

 
   procedure ProofOfLife(Samples : in ProofOfLifeVBB.KeySampleData ; LastSampleIndex : in Integer)  is
    --  N : Integer;
   begin
         if IsNoKeyAttack(Samples, LastSampleIndex) then
            Put_Line ("--Alert IsNoKeyAttack--");
         elsif IsKeyScanningAttack(Samples, LastSampleIndex) then
            Put_Line ("--Alert IsNoKeyAttack--");
         elsif UniqueKeyPresses(Samples,LastSampleIndex) = 5 then
            Put_Line ("--Unlock Authenticated--");
         else
            Put_Line ("--Uknown Attack--");
         end if;
 
   end ProofOfLife;
 
   procedure WaitForEvent is

      Samples : ProofOfLifeVBB.KeySampleData ;
      N : Integer;

   begin

         Put_Line ("--Sampling Keys while waiting for Unlock event--");
      
         N := ProofOfLifeVBB.CaptureKeyEvents(Samples);

         ProofOfLife(Samples, N);
 
 
   end WaitForEvent;

end ProofOfLife;

 
KeypadArduino
Keypad testing application for Arduino
 
#include <Keypad.h>

const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
//define the cymbols on the buttons of the keypads
char hexaKeys[ROWS][COLS] = {
  {'0','1','2','3'},
  {'4','5','6','7'},
  {'8','9','A','B'},
  {'C','D','E','F'}
};
byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {9, 8, 7, 6}; //connect to the column pinouts of the keypad

//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); 
char customKey = 0;
long mark;
void setup(){
 
  Serial.begin(9600);
  Serial.println("Begin Keypad");
}
  
void loop(){
   if( millis() > mark )
      customKey = customKeypad.getKey();
   
  if (customKey){
    Serial.println(customKey);
    mark = millis() + 100;
    customKey = 0;
  }
}
Proof of life
Extract to your computer and follow the youtube tutorial

Schematics

Keypad Schematics
Virtual Breadboard Keypad Test Schematic
Keypadschematics qchgbfambj

Comments

Similar projects you might like

Arduino LED Matrix Game of Life

Project showcase by aerodynamics

  • 3,401 views
  • 0 comments
  • 19 respects

Cloud connected Reconnaissance Droid

Project in progress by Jeremy Dunham

  • 8,562 views
  • 14 comments
  • 25 respects

Temperature Sensor To control Servo Motor

by Jasleen

  • 10,526 views
  • 2 comments
  • 15 respects

TIA Weak Artificial Intelligence IoT Assistant

Project tutorial by Adam Milton-Barker

  • 4,140 views
  • 0 comments
  • 22 respects

Arduino AI platform -- life assistance

Project in progress by Robert's Robot

  • 3,631 views
  • 2 comments
  • 15 respects
Add projectSign up / Login