glitching and side-channel analysis for all · glitching and side-channel analysis for all colin...

47
Glitching and Side-Channel Analysis for All Colin O’Flynn – NewAE Technology Inc. RECON 2015 – Montreal, QC.

Upload: others

Post on 05-Apr-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Glitching and Side-Channel Analysis for AllColin O’Flynn – NewAE Technology Inc.

RECON 2015 – Montreal, QC.

Page 2: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Overview

• W.t.f is side-channel power analysis (again)

• Example: IEEE 802.15.4 Node

• Example: AES-256 Bootloader

• W.t.f. is Glitching

• Simple power glitching

Page 3: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

About Me

• PhD at Dalhousie University in Halifax, Canada (Ongoing)

• Designed open-source hardware security project (ChipWhisperer)

• Commercialization through NewAE Technology Inc.

• Previously talked at Blackhat US/EU/AD, RECON, ESC

Page 4: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Side Channel Power Analysis

Page 5: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Side Channel Analysis

Crypto Device

Secret Key

CiphertextPlaintext

Page 6: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Super-Fast Side Channel

Page 7: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Real-Life

Page 8: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Breaking Apart

Page 9: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Hardware Example

Page 10: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Hackaday Prize 2014

Page 11: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Cheap Hardware… First Ver

Page 12: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

ChipWhisperer-Lite Kickstarter

Page 13: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Cheaper Hardware

Page 14: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Open-Source Software

Page 15: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Example of Power Analysis

<demo here>

Page 16: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

IEEE 802.15.4 Nodes

Page 17: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

IEEE 802.15.4

Page 18: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Example #1: 802.15.4

http://eprint.iacr.org/2015/529

802.15.4 Node

ZigBee (ZigBee IP, ZigBee Pro, RF4CE, etc.)WirelessHARTMiWiISA100.11a6LoWPANNest WeaveJenNetThreadAtmel Lightweight MeshIEEE 802.15.5DigiMesh

Page 19: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Hardware Setup

Page 20: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

802.15.4 Frame Format

Frame Header

Seq. Number

Dest Address (ff = Broadcast)

Source Addressing

Sec. Level.

FrameCounter Key ID

Encrypted Payload + MAC (MIC in 802.15.4 parlance) CRC-16 Goes Here

Page 21: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

802.15.4 Decoding

1. Validate headers and security options.2. Check that the received frame counter is numerically

greater than the last stored frame count.3. Look up the secret key based on message address

and/or key index.4. Decrypt the payload (and MAC if present).5. Validate the MAC (if present).6. Store the frame counter.

IEEE 802.15.4 Wireless Stack: Frame Decryption Procedure:

Page 22: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Example #1: 802.15.4

Input to AES Block

Page 23: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Many fixed bytes…

Page 24: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

CPA Attack Result

Page 25: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

ATMega128RFA1

Page 26: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

ATMegaRF AES Peripheral

Page 27: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Example #2: AES-256 Bootloader

Tutorial:

http://newae.com/sidechannel/cwdocs/tutorialaes256boot.html

Paper (CCECE 2015):

https://eprint.iacr.org/2014/899.pdf

Page 28: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Bootloader Protocol

Page 29: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

AES-256 in CBC Mode

Page 30: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Round 14

Page 31: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Round 13

Page 32: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Trace View

Page 33: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Success Rate

Page 34: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Getting Started in Side Channel Power

• Build/buy a simple target device:

• AVR dev-board

• Arduino Uno

• PIC

• Get a scope with USB API

• Picoscope

• Most bench scopes

• Be wary of cheap off-brand scopes, sometimes USB interface is poor

• Experiment!

Page 35: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Glitching

Page 36: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Glitching Target

int i,j,count;

while(1){count = 0;

for (j = 0; j < 5000; j++){for (i = 0; i < 5000; i++){

count++;}

}

printf("%d %d %d\n", count, i, j);}

Page 37: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Easy Glitching

Page 38: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

High-Precision Glitches

Page 39: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Easy Glitching

Page 40: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Raspberry Pi Example

Page 41: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Raspberry Pi Example

Page 42: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Raspberry Pi Example

Page 43: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Glitch Tool

Page 44: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Glitch Waveform (Raspberry Pi)

Page 45: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Getting Started in Glitching

• Load simple code onto target

• Determine/guess sensitive power rail

• Test glitch parameters ideally with profiling code

Page 46: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

Glitching in CW-Lite

Page 47: Glitching and Side-Channel Analysis for All · Glitching and Side-Channel Analysis for All Colin O’Flynn –NewAE Technology Inc. RECON 2015 –Montreal, QC

It’s fun!

Try Power Analysis and Glitching today!

ChipWhisperer Project: www.chipwhisperer.com

NewAE Technology Inc.: www.newae.com

Personal:

@colinoflynn

[email protected]

http://www.oflynn.com