SlideShare a Scribd company logo
Feasibility of Security in Micro-Controllers 
Aaron Ardiri! ! ! ! ! ! ! ! Chief Technology Officer - Evothings AB 
Internet of Things Day, Oslo! ! ! ! ! ! ! ! ! ! ! ! ! 6th November, 2014
Introduction 
Evothings is a mobile application enabler for the Internet 
of Things (IoT) industry, helping developers and 
technology players that have the need to create mobile 
applications interfacing with IoT technologies.! 
! 
* come visit us at our booth 
for a demonstration of our 
mobile app development suite
Overview 
IoT Security! 
✤ why is it such a hot topic?! 
✤ why has it become an issue in the first place?! 
✤ what is the feasibility on the Arduino platform! 
✤ what is happening in the IoT developer ecosystem?! 
✤ food for thought: are we approaching it correctly?
IoT Security 
why is it such a hot topic?
Hewlett Packard Report 
HP’s Fortify division recently tested a selection of IoT 
solutions currently available on the market by popular 
manufacturers including TVs, webcams, thermostats, 
power outlets, door locks and home control hubs.! 
✤ 250 vulnerabilities found! 
✤ 76% of devices used unencrypted network resources! 
✤ 80% failed to use strong passwords, many unchanged! 
✤ 60% failed to protect firmware downloads/integrity
Sweden - National Security 
HOT OF THE PRESS ! ! ! ! ! 3rd November 2014! 
http://www.dn.se/nyheter/sverige/it-expert-bristerna-ett-hot-mot-rikets-sakerhet/! 
It was revealed a number of important public properties 
in Sweden including but not limited to Police Stations, 
Transit Stations, Data Centers and Space Center in Kiruna 
are completely open on the Internet and hackable - 
control of alarms, doors, heating, other sensitive systems! 
✤ sites are password protected but have weak security
IoT Security 
why has it become such an issue?
Gartner Hype Cycle Special Report 
http://www.gartner.com/newsroom/id/2819918 
Internet of Things
Explosion of micro-controllers 
postscapes.com/internet-of-things-hardware
Products - what is happening 
✤ companies making “land grab” in IoT space! 
✤ focus is product-to-market, not deliver quality! 
✤ a number of products are based on prototypes! 
✤ failure to provide OTA and update mechanisms! 
✤ SSL/TLS - implementations! 
✤ many micro-controllers have limited CPU / RAM! 
✤ existing libraries are not optimised for embedded
Standards War 
Hyper/Cat
0-day exploits (security) in 2014 
Heartbleed! 
serious vulnerability in the popular 
OpenSSL cryptographic software library. ! 
ShellShock! 
aka: Bashdoor group of bugs in the 
popular Bourne Again Shell (Bash).! 
POODLE! 
serious vulnerability in the popular 
OpenSSL cryptographic software library.
Operating Systems 
✤ What are the options for IoT product manufacturers? 
BareBones OS 
or
Security is not only encryption 
A common mis-conception; it is more than Encryption 
Integrity Authentication 
Security 
Non-Repudiation Confidentiality 
http://www.securerf.com/security-is-not-encrypting-data/
IoT Security 
what is the feasibility on Arduino?
Public Key Cryptography 
#1 provide your public key to sender #2 sender uses your public key to encrypt message 
your public key 
message cyphertext 
#3 sender provides cyphertext to you #4 use your private key to decrypt cyphertext 
cyphertext 
your private key 
cyphertext message 
your public key
RSA: Basic Overview 
✤ encryption! 
c != me mod n! 
✤ decryption! 
ALGORITHM KEY! 
! 
m ! = original message! 
c! = cyphertext! 
! 
e! = public key exponent! 
d! = private key exponent! 
n! = modulus (primes multiplied) 
m = cd mod n! 
! 
! the source text is to converted to an integer form that is 
then passed through the exponent modulus algorithm to 
create a second integer that can then be converted into a 
cyphertext string to be transmitted over the network.
RSA implementation on Arduino 
implementation of RSA encrypt/decrypt algorithms:! 
✤ custom written - mixture of C and assembly (avr only)! 
✤ implemented specifically for RSA algorithms! 
✤ keys are defined as (n,e) and (n,d) raw bit streams! 
✤ designed to be portable with a small code footprint! 
✤ 128, 256, 512, 1024 and 2048 keys (if possible)! 
✤ limited SRAM of micro controller restricts key sizes
RSA implementation on Arduino 
BigInt e, d, n, m, c;! 
! 
// define our public(n,e), private(n,d) and message ! 
BigInt_assignFromBuffer(&d, (unsigned char *)key_device_prv);! 
BigInt_assignFromBuffer(&e, (unsigned char *)key_device_pub);! 
BigInt_assignFromBuffer(&n, (unsigned char *)key_device_mod);! 
BigInt_assignFromBuffer(&m, (unsigned char *)rsa_message);! 
! 
// encrypt message ‘m’ into cypher text ‘c’! 
BigInt_exponent_with_modulus(&c, &m, &e, &n);! 
! 
// decrypt cypher text ‘c’ into message ‘m’! 
BigInt_exponent_with_modulus(&m, &c, &d, &n);!
IoT Security 
feasibility - results on the Arduino
RSA: Arduino UNO 
✤ CPU! 
✤ ATmega328! 
✤ 16Mhz! 
✤ 32Kb program mem! 
✤ 2Kb SRAM! 
Performance Results (ms) - compiled with 8bit, pure C 
algorithm 128 bit 256 bit 512 bit 1024 bit 2048 bit 
encrypt: public key 288 1070 4103 16160 N/A* 
decrypt: private key 3155 22365 175452 1383240 N/A* 
* insufficient SRAM to perform
RSA: Arduino UNO 
✤ CPU! 
✤ ATmega328! 
✤ 16Mhz! 
48% 
performance boost 
✤ 32Kb program mem! 
✤ 2Kb SRAM! 
Performance Results (ms) - compiled with 8bit, avr asm 
algorithm 128 bit 256 bit 512 bit 1024 bit 2048 bit 
encrypt: public key 178 609 2225 8504 N/A* 
decrypt: private key 1951 12716 95079 727955 N/A* 
* insufficient SRAM to perform
RSA: Arduino Due 
✤ CPU! 
✤ AT91SAMX8E! 
✤ 84Mhz! 
✤ 512Kb program mem! 
✤ 96Kb SRAM! 
Performance Results (ms) - compiled with 32bit, 100% C 
algorithm 128 bit 256 bit 512 bit 1024 bit 2048 bit 
encrypt: public key 25 77 264 1032 4122 
decrypt: private key 261 1586 11206 88216 701668
RSA: Arduino Yún 
✤ CPU! 
✤ ATmega32U4 and AR9331! 
✤ 16Mhz and 400Mhz! 
✤ 32Kb program mem! 
✤ 2.5Kb SRAM! 
* use Bridge Library to execute RSA algorithms on Linux CPU 
Performance Results (ms) - compiled with 32bit, 100% C 
algorithm 128 bit 256 bit 512 bit 1024 bit 2048 bit 
encrypt: public key 329 355 512 707 N/A* 
decrypt: private key 437 562 1681 10799 N/A* 
* insufficient SRAM to perform 
* the Bridge implementation has a 100-200ms fluctuation in results depending on key size
RSA: Intel Galileo 
✤ CPU! 
✤ Quark SoC X1000! 
✤ 400Mhz! 
✤ 256Kb program mem! 
✤ 512Kb SRAM! 
Performance Results (ms) - compiled with 32bit, 100% C 
algorithm 128 bit 256 bit 512 bit 1024 bit 2048 bit 
encrypt: public key 4 20 57 192 706 
decrypt: private key 95 397 2310 16055 119499
RSA: Intel Edison 
✤ CPU! 
✤ dual core Atom SoC and Quark! 
✤ 500Mhz and 100Mhz! 
✤ 10Mb program mem! 
✤ 1Gb SRAM! 
Performance Results (ms) - compiled with 32bit, 100% C 
algorithm 128 bit 256 bit 512 bit 1024 bit 2048 bit 
encrypt: public key 3 7 23 76 273 
decrypt: private key 30 150 976 6548 46579
RSA 1024: Resource Usage (avr) 
empty sketch:! 
Sketch uses 450 bytes (1%) of program storage space. ! 
Maximum is 32,256 bytes.! 
Global variables use 9 bytes (0%) of dynamic memory, leaving 2,039 
bytes for local variables. Maximum is 2,048 bytes.! 
! 
RSA 1024 with public key only! 
Sketch uses 4,116 bytes (12%) of program storage space. ! 
Maximum is 32,256 bytes.! 
Global variables use 981 bytes (47%) of dynamic memory, leaving 1,067 
bytes for local variables. Maximum is 2,048 bytes.! 
! 
resulting code size:! 
3,666 bytes of program storage space! 
972 bytes of dynamic memory 
~ 3.5Kb for code, < 1Kb for RAM
RSA 1024: Resource Usage (ARM) 
empty sketch:! 
Sketch uses 10,492 bytes (2%) of program storage space. ! 
Maximum is 524,288 bytes.! 
Global variables use 9 bytes (0%) of dynamic memory, leaving 98,295 
bytes for local variables. Maximum is 98,304 bytes.! 
! 
RSA 1024 with public key only! 
Sketch uses 12,836 bytes (2%) of program storage space. ! 
Maximum is 524,288 bytes.! 
Global variables use 981 bytes (0%) of dynamic memory, leaving 97,323 
bytes for local variables. Maximum is 98,304 bytes.! 
! 
resulting code size:! 
1,454 bytes of program storage space! 
972 bytes of dynamic memory 
~ 1.4Kb for code, < 1Kb for RAM
RSA 1024: Resource Usage (x86) 
empty sketch:! 
Sketch uses 55,375 bytes (21%) of program storage space. ! 
Maximum is 262,144 bytes.! 
Global variables use 9 bytes (0%) of dynamic memory, leaving 524,279 
bytes for local variables. Maximum is 524,288 bytes.! 
! 
RSA 1024 with public key only! 
Sketch uses 63,805 bytes (24%) of program storage space. ! 
Maximum is 262,144 bytes.! 
Global variables use 981 bytes (0%) of dynamic memory, leaving 
523,307 bytes for local variables. Maximum is 524,288 bytes.! 
! 
resulting code size:! 
8,430 bytes of program storage space! 
972 bytes of dynamic memory 
~ 8.2Kb for code, < 1Kb for RAM
Feasibility of Security in Micro-Controllers
Configuration Analysis 
✤ Advantages! 
✤ S_PUB can be dynamic between sessions! 
✤ only S_PUB used for encryption, low CPU demands! 
! 
✤ Disadvantages! 
✤ S_PUB is communicated over network! 
✤ no good method to validate that the server the 
device is talking to is authentic (no CA validation)
Feasibility of Security in Micro-Controllers
Configuration Analysis 
✤ Advantages! 
✤ S_PUB, D_PUB never communicated over network! 
✤ D_PUB is stored on server, associated to UUID! 
✤ only Arduino’s registered can communicate with server! 
✤ can remove any “compromised” devices from server! 
! 
✤ Disadvantages! 
✤ D_PRV is used to encryption on device = slower
Secure Random Number Generator 
✤ Arduino devices provide at least one analog pin that can be used to 
create secure random numbers critical for symmetric keys (AES).! 
✤ 2-pass von Neumann algorithm to remove “bias” from analog feed! 
✤ re-use the existing PRNG random(), seeding at random intervals! 
! 
int secureRandomByte() 
{ 
static int count = 0; 
static int next = (randomByte() >> 2) + 1; // max 64 iterations 
if ((count++ % next) == 0) 
{ randomSeed(randomWord()); next = (randomByte() >> 2) + 1; } 
return random(256); 
}
IoT Security 
what is the happening the IoT ecosystem?
Arduino + Secure Wifi Shield 
✤ WiFi shield with integrated WINC1500 processor! 
! 
✤ TLS provided using:! 
✤ ECC-256 (eq to RSA-3072)! 
✤ AES-128! 
✤ SHA-256
mbed OS - ARM 
✤ open source: code/framework designed for Cortex M7
libCommas - avr 
https://saifeinc.com/news/?p=223 ! 
! 
✤ open source: code/framework designed for avr! 
✤ ECC (ECDSA) and SHA-2 algorithms! 
✤ proprietary server for communication end-point
AVR crypto-lib - avr 
http://www.das-labor.org/wiki/AVR-Crypto-Lib/en! 
! 
✤ open source: code/framework designed for avr! 
✤ various block, stream cyphers and hash functions
IoT Security 
are we approaching it the right way?
Security Foundations: Classic 
Security in computing has been typically bound to the 
security of the real-world - by defining elements such as 
keys, trusted-zones (DMZ), firewalls et al.! 
DMZ
Security Foundations: Biology 
Researchers have considered following nature’s design 
and look at security from with a biological mindset - 
where devices would be open to infection and evolve.! 
! 
Immunological defence based on identification and 
isolation of a threat with backup nodes to spawn off to 
fulfil the function of compromised nodes.! 
! 
http://www.eetindia.co.in/ART_8800705403_1800001_NT_a11862e6.HTM
Importance of Diversity in Nature 
http://evolution.berkeley.edu/evolibrary/article/agriculture_02
How many IoT devices by 2020? 
! Gartner:! 26 Billion! Cisco:! ! 50 Billion! 
! Intel:! ! 200 Billion! IDC:! ! 220 Billion! 
It’s time to act now and ensure Security exists within IoT
Questions
Contact Information 
! 
! 
! 
! 
aaron@ardiri.com! 
www.ardiri.com/blog! 
www.linkedin.com/in/ardiri

More Related Content

PDF
Esp8266 basics
PDF
Home Automation by ESP8266
PPT
Wireless security testing with attack by Keiichi Horiai - CODE BLUE 2015
PDF
Adafruit Huzzah Esp8266 WiFi Board
PPTX
Introduction to Internet of Things Hardware
PPTX
Esp8266 NodeMCU
PDF
Wireless security
PDF
WiFi SoC ESP8266
Esp8266 basics
Home Automation by ESP8266
Wireless security testing with attack by Keiichi Horiai - CODE BLUE 2015
Adafruit Huzzah Esp8266 WiFi Board
Introduction to Internet of Things Hardware
Esp8266 NodeMCU
Wireless security
WiFi SoC ESP8266

What's hot (19)

PDF
ESP8266 and IOT
PDF
Boards for the IoT-Prototyping
PDF
SCADA deep inside: protocols and security mechanisms
PDF
Webinar: Plataforma Renesas Synergy – Construindo sua aplicação MQTT com anal...
PDF
Esp8266 hack sonoma county 4/8/2015
PDF
Rdl esp32 development board trainer kit
PDF
lwM2M OTA for ESP8266
PDF
Esp32 cam arduino-123
PDF
IoT support for .NET (Core/5/6)
PDF
Hardwear.io 2018 BLE Security Essentials workshop
PDF
Introduction to ESP32 Programming [Road to RIoT 2017]
PDF
A 2018 practical guide to hacking RFID/NFC
PPTX
Wi-Fi Esp8266 nodemcu
PPTX
IoT Hands-On-Lab, KINGS, 2019
PPT
Think Pad T410 T510 Top Options
PDF
lesson2 - Nodemcu course - NodeMCU dev Board
PPTX
Attendance System using ESP8266(Wi-Fi) with MySQL
PDF
Gattacking Bluetooth Smart devices - introducing new BLE MITM proxy tool
PPTX
Arduino & NodeMcu
ESP8266 and IOT
Boards for the IoT-Prototyping
SCADA deep inside: protocols and security mechanisms
Webinar: Plataforma Renesas Synergy – Construindo sua aplicação MQTT com anal...
Esp8266 hack sonoma county 4/8/2015
Rdl esp32 development board trainer kit
lwM2M OTA for ESP8266
Esp32 cam arduino-123
IoT support for .NET (Core/5/6)
Hardwear.io 2018 BLE Security Essentials workshop
Introduction to ESP32 Programming [Road to RIoT 2017]
A 2018 practical guide to hacking RFID/NFC
Wi-Fi Esp8266 nodemcu
IoT Hands-On-Lab, KINGS, 2019
Think Pad T410 T510 Top Options
lesson2 - Nodemcu course - NodeMCU dev Board
Attendance System using ESP8266(Wi-Fi) with MySQL
Gattacking Bluetooth Smart devices - introducing new BLE MITM proxy tool
Arduino & NodeMcu
Ad

Similar to Feasibility of Security in Micro-Controllers (20)

PPTX
Nanokeyer nano keyekr kano ketkker nano keyer
PDF
Tools Of The Hardware Hacking Trade Final
PDF
Presentation for IoT workshop at Sinhagad University (Feb 4, 2016) - 2/2
PPTX
M qcardiac
PPTX
Chapter_01_See_Program_Running.pptx
PDF
IDF_Eclipse_Plugin_EclipseCon2020_v2.pdf
PPTX
Chapter_01_See_Program_Running Yifeng Zhu
PPTX
RISC-V growth and successes in technology and industry - embedded world 2021
PPTX
ARDUINO AND RASPBERRYPI.pptx
PPT
An Overview Study on AVR32UC3 MCU: AT32UC3A3256
PPTX
NXP FRDM-K64F Platform with ARM mbed Demo - Edinburgh 2016 Workshop
PPTX
2015 01 24 Coding4Fun at Tajamar
PDF
LAS16 100 K1 - Keynote George Grey
PDF
LAS16-100K1: Welcome Keynote
PDF
Brochure (2016-01-30)
PDF
CONFidence 2014: Alexander Timorin: SCADA deep inside: protocols and security...
PDF
MicroEJ OS and Edje: the software foundation for IoT devices
PPTX
Hacker's and painters Hardware Hacking 101 - 10th Oct 2014
PPTX
Light Weight Cryptography for IOT.pptx
PPT
Single chip computer for iot application
Nanokeyer nano keyekr kano ketkker nano keyer
Tools Of The Hardware Hacking Trade Final
Presentation for IoT workshop at Sinhagad University (Feb 4, 2016) - 2/2
M qcardiac
Chapter_01_See_Program_Running.pptx
IDF_Eclipse_Plugin_EclipseCon2020_v2.pdf
Chapter_01_See_Program_Running Yifeng Zhu
RISC-V growth and successes in technology and industry - embedded world 2021
ARDUINO AND RASPBERRYPI.pptx
An Overview Study on AVR32UC3 MCU: AT32UC3A3256
NXP FRDM-K64F Platform with ARM mbed Demo - Edinburgh 2016 Workshop
2015 01 24 Coding4Fun at Tajamar
LAS16 100 K1 - Keynote George Grey
LAS16-100K1: Welcome Keynote
Brochure (2016-01-30)
CONFidence 2014: Alexander Timorin: SCADA deep inside: protocols and security...
MicroEJ OS and Edje: the software foundation for IoT devices
Hacker's and painters Hardware Hacking 101 - 10th Oct 2014
Light Weight Cryptography for IOT.pptx
Single chip computer for iot application
Ad

More from ardiri (8)

PDF
20180517 Oraclecode Shenzhen Keynote
PDF
20180517 OracleCode Singapore Keynote
PDF
Introduction to the Internet of Things
PPTX
Native Application (C/C++) on BlackBerry 10
PPTX
Start to Finish: Porting to BlackBerry 10
PPTX
Introduction to BlackBerry 10 NDK for Game Developers.
PDF
iPhone Introduction
PDF
Game Development using SDL and the PDK
20180517 Oraclecode Shenzhen Keynote
20180517 OracleCode Singapore Keynote
Introduction to the Internet of Things
Native Application (C/C++) on BlackBerry 10
Start to Finish: Porting to BlackBerry 10
Introduction to BlackBerry 10 NDK for Game Developers.
iPhone Introduction
Game Development using SDL and the PDK

Recently uploaded (20)

PDF
cuic standard and advanced reporting.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Machine Learning_overview_presentation.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
A comparative analysis of optical character recognition models for extracting...
cuic standard and advanced reporting.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Network Security Unit 5.pdf for BCA BBA.
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Machine Learning_overview_presentation.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
20250228 LYD VKU AI Blended-Learning.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Unlocking AI with Model Context Protocol (MCP)
Chapter 3 Spatial Domain Image Processing.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
The Rise and Fall of 3GPP – Time for a Sabbatical?
MIND Revenue Release Quarter 2 2025 Press Release
NewMind AI Weekly Chronicles - August'25-Week II
A comparative analysis of optical character recognition models for extracting...

Feasibility of Security in Micro-Controllers

  • 1. Feasibility of Security in Micro-Controllers Aaron Ardiri! ! ! ! ! ! ! ! Chief Technology Officer - Evothings AB Internet of Things Day, Oslo! ! ! ! ! ! ! ! ! ! ! ! ! 6th November, 2014
  • 2. Introduction Evothings is a mobile application enabler for the Internet of Things (IoT) industry, helping developers and technology players that have the need to create mobile applications interfacing with IoT technologies.! ! * come visit us at our booth for a demonstration of our mobile app development suite
  • 3. Overview IoT Security! ✤ why is it such a hot topic?! ✤ why has it become an issue in the first place?! ✤ what is the feasibility on the Arduino platform! ✤ what is happening in the IoT developer ecosystem?! ✤ food for thought: are we approaching it correctly?
  • 4. IoT Security why is it such a hot topic?
  • 5. Hewlett Packard Report HP’s Fortify division recently tested a selection of IoT solutions currently available on the market by popular manufacturers including TVs, webcams, thermostats, power outlets, door locks and home control hubs.! ✤ 250 vulnerabilities found! ✤ 76% of devices used unencrypted network resources! ✤ 80% failed to use strong passwords, many unchanged! ✤ 60% failed to protect firmware downloads/integrity
  • 6. Sweden - National Security HOT OF THE PRESS ! ! ! ! ! 3rd November 2014! http://www.dn.se/nyheter/sverige/it-expert-bristerna-ett-hot-mot-rikets-sakerhet/! It was revealed a number of important public properties in Sweden including but not limited to Police Stations, Transit Stations, Data Centers and Space Center in Kiruna are completely open on the Internet and hackable - control of alarms, doors, heating, other sensitive systems! ✤ sites are password protected but have weak security
  • 7. IoT Security why has it become such an issue?
  • 8. Gartner Hype Cycle Special Report http://www.gartner.com/newsroom/id/2819918 Internet of Things
  • 9. Explosion of micro-controllers postscapes.com/internet-of-things-hardware
  • 10. Products - what is happening ✤ companies making “land grab” in IoT space! ✤ focus is product-to-market, not deliver quality! ✤ a number of products are based on prototypes! ✤ failure to provide OTA and update mechanisms! ✤ SSL/TLS - implementations! ✤ many micro-controllers have limited CPU / RAM! ✤ existing libraries are not optimised for embedded
  • 12. 0-day exploits (security) in 2014 Heartbleed! serious vulnerability in the popular OpenSSL cryptographic software library. ! ShellShock! aka: Bashdoor group of bugs in the popular Bourne Again Shell (Bash).! POODLE! serious vulnerability in the popular OpenSSL cryptographic software library.
  • 13. Operating Systems ✤ What are the options for IoT product manufacturers? BareBones OS or
  • 14. Security is not only encryption A common mis-conception; it is more than Encryption Integrity Authentication Security Non-Repudiation Confidentiality http://www.securerf.com/security-is-not-encrypting-data/
  • 15. IoT Security what is the feasibility on Arduino?
  • 16. Public Key Cryptography #1 provide your public key to sender #2 sender uses your public key to encrypt message your public key message cyphertext #3 sender provides cyphertext to you #4 use your private key to decrypt cyphertext cyphertext your private key cyphertext message your public key
  • 17. RSA: Basic Overview ✤ encryption! c != me mod n! ✤ decryption! ALGORITHM KEY! ! m ! = original message! c! = cyphertext! ! e! = public key exponent! d! = private key exponent! n! = modulus (primes multiplied) m = cd mod n! ! ! the source text is to converted to an integer form that is then passed through the exponent modulus algorithm to create a second integer that can then be converted into a cyphertext string to be transmitted over the network.
  • 18. RSA implementation on Arduino implementation of RSA encrypt/decrypt algorithms:! ✤ custom written - mixture of C and assembly (avr only)! ✤ implemented specifically for RSA algorithms! ✤ keys are defined as (n,e) and (n,d) raw bit streams! ✤ designed to be portable with a small code footprint! ✤ 128, 256, 512, 1024 and 2048 keys (if possible)! ✤ limited SRAM of micro controller restricts key sizes
  • 19. RSA implementation on Arduino BigInt e, d, n, m, c;! ! // define our public(n,e), private(n,d) and message ! BigInt_assignFromBuffer(&d, (unsigned char *)key_device_prv);! BigInt_assignFromBuffer(&e, (unsigned char *)key_device_pub);! BigInt_assignFromBuffer(&n, (unsigned char *)key_device_mod);! BigInt_assignFromBuffer(&m, (unsigned char *)rsa_message);! ! // encrypt message ‘m’ into cypher text ‘c’! BigInt_exponent_with_modulus(&c, &m, &e, &n);! ! // decrypt cypher text ‘c’ into message ‘m’! BigInt_exponent_with_modulus(&m, &c, &d, &n);!
  • 20. IoT Security feasibility - results on the Arduino
  • 21. RSA: Arduino UNO ✤ CPU! ✤ ATmega328! ✤ 16Mhz! ✤ 32Kb program mem! ✤ 2Kb SRAM! Performance Results (ms) - compiled with 8bit, pure C algorithm 128 bit 256 bit 512 bit 1024 bit 2048 bit encrypt: public key 288 1070 4103 16160 N/A* decrypt: private key 3155 22365 175452 1383240 N/A* * insufficient SRAM to perform
  • 22. RSA: Arduino UNO ✤ CPU! ✤ ATmega328! ✤ 16Mhz! 48% performance boost ✤ 32Kb program mem! ✤ 2Kb SRAM! Performance Results (ms) - compiled with 8bit, avr asm algorithm 128 bit 256 bit 512 bit 1024 bit 2048 bit encrypt: public key 178 609 2225 8504 N/A* decrypt: private key 1951 12716 95079 727955 N/A* * insufficient SRAM to perform
  • 23. RSA: Arduino Due ✤ CPU! ✤ AT91SAMX8E! ✤ 84Mhz! ✤ 512Kb program mem! ✤ 96Kb SRAM! Performance Results (ms) - compiled with 32bit, 100% C algorithm 128 bit 256 bit 512 bit 1024 bit 2048 bit encrypt: public key 25 77 264 1032 4122 decrypt: private key 261 1586 11206 88216 701668
  • 24. RSA: Arduino Yún ✤ CPU! ✤ ATmega32U4 and AR9331! ✤ 16Mhz and 400Mhz! ✤ 32Kb program mem! ✤ 2.5Kb SRAM! * use Bridge Library to execute RSA algorithms on Linux CPU Performance Results (ms) - compiled with 32bit, 100% C algorithm 128 bit 256 bit 512 bit 1024 bit 2048 bit encrypt: public key 329 355 512 707 N/A* decrypt: private key 437 562 1681 10799 N/A* * insufficient SRAM to perform * the Bridge implementation has a 100-200ms fluctuation in results depending on key size
  • 25. RSA: Intel Galileo ✤ CPU! ✤ Quark SoC X1000! ✤ 400Mhz! ✤ 256Kb program mem! ✤ 512Kb SRAM! Performance Results (ms) - compiled with 32bit, 100% C algorithm 128 bit 256 bit 512 bit 1024 bit 2048 bit encrypt: public key 4 20 57 192 706 decrypt: private key 95 397 2310 16055 119499
  • 26. RSA: Intel Edison ✤ CPU! ✤ dual core Atom SoC and Quark! ✤ 500Mhz and 100Mhz! ✤ 10Mb program mem! ✤ 1Gb SRAM! Performance Results (ms) - compiled with 32bit, 100% C algorithm 128 bit 256 bit 512 bit 1024 bit 2048 bit encrypt: public key 3 7 23 76 273 decrypt: private key 30 150 976 6548 46579
  • 27. RSA 1024: Resource Usage (avr) empty sketch:! Sketch uses 450 bytes (1%) of program storage space. ! Maximum is 32,256 bytes.! Global variables use 9 bytes (0%) of dynamic memory, leaving 2,039 bytes for local variables. Maximum is 2,048 bytes.! ! RSA 1024 with public key only! Sketch uses 4,116 bytes (12%) of program storage space. ! Maximum is 32,256 bytes.! Global variables use 981 bytes (47%) of dynamic memory, leaving 1,067 bytes for local variables. Maximum is 2,048 bytes.! ! resulting code size:! 3,666 bytes of program storage space! 972 bytes of dynamic memory ~ 3.5Kb for code, < 1Kb for RAM
  • 28. RSA 1024: Resource Usage (ARM) empty sketch:! Sketch uses 10,492 bytes (2%) of program storage space. ! Maximum is 524,288 bytes.! Global variables use 9 bytes (0%) of dynamic memory, leaving 98,295 bytes for local variables. Maximum is 98,304 bytes.! ! RSA 1024 with public key only! Sketch uses 12,836 bytes (2%) of program storage space. ! Maximum is 524,288 bytes.! Global variables use 981 bytes (0%) of dynamic memory, leaving 97,323 bytes for local variables. Maximum is 98,304 bytes.! ! resulting code size:! 1,454 bytes of program storage space! 972 bytes of dynamic memory ~ 1.4Kb for code, < 1Kb for RAM
  • 29. RSA 1024: Resource Usage (x86) empty sketch:! Sketch uses 55,375 bytes (21%) of program storage space. ! Maximum is 262,144 bytes.! Global variables use 9 bytes (0%) of dynamic memory, leaving 524,279 bytes for local variables. Maximum is 524,288 bytes.! ! RSA 1024 with public key only! Sketch uses 63,805 bytes (24%) of program storage space. ! Maximum is 262,144 bytes.! Global variables use 981 bytes (0%) of dynamic memory, leaving 523,307 bytes for local variables. Maximum is 524,288 bytes.! ! resulting code size:! 8,430 bytes of program storage space! 972 bytes of dynamic memory ~ 8.2Kb for code, < 1Kb for RAM
  • 31. Configuration Analysis ✤ Advantages! ✤ S_PUB can be dynamic between sessions! ✤ only S_PUB used for encryption, low CPU demands! ! ✤ Disadvantages! ✤ S_PUB is communicated over network! ✤ no good method to validate that the server the device is talking to is authentic (no CA validation)
  • 33. Configuration Analysis ✤ Advantages! ✤ S_PUB, D_PUB never communicated over network! ✤ D_PUB is stored on server, associated to UUID! ✤ only Arduino’s registered can communicate with server! ✤ can remove any “compromised” devices from server! ! ✤ Disadvantages! ✤ D_PRV is used to encryption on device = slower
  • 34. Secure Random Number Generator ✤ Arduino devices provide at least one analog pin that can be used to create secure random numbers critical for symmetric keys (AES).! ✤ 2-pass von Neumann algorithm to remove “bias” from analog feed! ✤ re-use the existing PRNG random(), seeding at random intervals! ! int secureRandomByte() { static int count = 0; static int next = (randomByte() >> 2) + 1; // max 64 iterations if ((count++ % next) == 0) { randomSeed(randomWord()); next = (randomByte() >> 2) + 1; } return random(256); }
  • 35. IoT Security what is the happening the IoT ecosystem?
  • 36. Arduino + Secure Wifi Shield ✤ WiFi shield with integrated WINC1500 processor! ! ✤ TLS provided using:! ✤ ECC-256 (eq to RSA-3072)! ✤ AES-128! ✤ SHA-256
  • 37. mbed OS - ARM ✤ open source: code/framework designed for Cortex M7
  • 38. libCommas - avr https://saifeinc.com/news/?p=223 ! ! ✤ open source: code/framework designed for avr! ✤ ECC (ECDSA) and SHA-2 algorithms! ✤ proprietary server for communication end-point
  • 39. AVR crypto-lib - avr http://www.das-labor.org/wiki/AVR-Crypto-Lib/en! ! ✤ open source: code/framework designed for avr! ✤ various block, stream cyphers and hash functions
  • 40. IoT Security are we approaching it the right way?
  • 41. Security Foundations: Classic Security in computing has been typically bound to the security of the real-world - by defining elements such as keys, trusted-zones (DMZ), firewalls et al.! DMZ
  • 42. Security Foundations: Biology Researchers have considered following nature’s design and look at security from with a biological mindset - where devices would be open to infection and evolve.! ! Immunological defence based on identification and isolation of a threat with backup nodes to spawn off to fulfil the function of compromised nodes.! ! http://www.eetindia.co.in/ART_8800705403_1800001_NT_a11862e6.HTM
  • 43. Importance of Diversity in Nature http://evolution.berkeley.edu/evolibrary/article/agriculture_02
  • 44. How many IoT devices by 2020? ! Gartner:! 26 Billion! Cisco:! ! 50 Billion! ! Intel:! ! 200 Billion! IDC:! ! 220 Billion! It’s time to act now and ensure Security exists within IoT
  • 46. Contact Information ! ! ! ! [email protected]! www.ardiri.com/blog! www.linkedin.com/in/ardiri