Sleuth: Automated Verification of Software Power Analysis Countermeasures



Similar documents
Secure application programming in the presence of side channel attacks. Marc Witteman & Harko Robroch Riscure 04/09/08 Session Code: RR-203

Efficient Software Implementation of AES on 32-bit Platforms

Hardware Implementation of AES Encryption and Decryption System Based on FPGA

Unknown Plaintext Template Attacks

Privacy and Security in library RFID Issues, Practices and Architecture

Side Channel Analysis and Embedded Systems Impact and Countermeasures

A Predictive Model for Cache-Based Side Channels in Multicore and Multithreaded Microprocessors

AES implementation on Smart Card

AES Power Attack Based on Induced Cache Miss and Countermeasure

CS 758: Cryptography / Network Security

IJESRT. [Padama, 2(5): May, 2013] ISSN:

How To Perform Differential Frequency Analysis (Dfa) On A Powerline (Aes) On An Iphone Or Ipad (Ase) On Microsoft Powerline 2 (Aces) On Pc Or Ipa (Aas)

Rfid Authentication Protocol for security and privacy Maintenance in Cloud Based Employee Management System

SeChat: An AES Encrypted Chat

Design and Verification of Area-Optimized AES Based on FPGA Using Verilog HDL

Advanced compiler construction. General course information. Teacher & assistant. Course goals. Evaluation. Grading scheme. Michel Schinz

Small Tweaks do Not Help: Differential Power Analysis of MILENAGE Implementations in 3G/4G USIM Cards

C++ Programming Language

Combining Mifare Card and agsxmpp to Construct a Secure Instant Messaging Software

Physical Security: Status and Outlook

CSCE 465 Computer & Network Security

Phys4051: C Lecture 2 & 3. Comment Statements. C Data Types. Functions (Review) Comment Statements Variables & Operators Branching Instructions

Fast Implementations of AES on Various Platforms

Message Authentication Codes

Applying Remote Side-Channel Analysis Attacks on a Security-enabled NFC Tag

AES1. Ultra-Compact Advanced Encryption Standard Core. General Description. Base Core Features. Symbol. Applications

How To Understand And Understand The History Of Cryptography

2) Write in detail the issues in the design of code generator.

Enhancing Advanced Encryption Standard S-Box Generation Based on Round Key

Identity-based Encryption with Post-Challenge Auxiliary Inputs for Secure Cloud Applications and Sensor Networks

The Advanced Encryption Standard (AES)

Between Mutual Trust and Mutual Distrust: Practical Fine-grained Privilege Separation in Multithreaded Applications

Detecting SQL Injection Vulnerabilities in Web Services

Security (II) ISO : Security Architecture of OSI Reference Model. Outline. Course Outline: Fundamental Topics. EE5723/EE4723 Spring 2012

Software Vulnerabilities

Betriebssysteme KU Security

Secure Embedded Systems eine Voraussetzung für Cyber Physical Systems und das Internet der Dinge

1 The Java Virtual Machine

Chapter 15 Operating System Security

Runtime Code Generation for Code Polymorphism

Timing Attacks on software implementation of RSA

Lecture 9 - Message Authentication Codes

Static Analysis of Virtualization- Obfuscated Binaries

Side-Channel Analysis Resistant Implementation of AES on Automotive Processors

Common Pitfalls in Cryptography for Software Developers. OWASP AppSec Israel July The OWASP Foundation

Visualizing Information Flow through C Programs

A Vulnerability in the Song Authentication Protocol for Low-Cost RFID Tags

IMPROVED SECURITY MEASURES FOR DATA IN KEY EXCHANGES IN CLOUD ENVIRONMENT

Fast Software AES Encryption

Project: Simulated Encrypted File System (SEFS)

How To Write Security Enhanced Linux On Embedded Systems (Es) On A Microsoft Linux (Amd64) (Amd32) (A Microsoft Microsoft 2.3.2) (For Microsoft) (Or

5 Combinatorial Components. 5.0 Full adder. Full subtractor

CIS 551 / TCOM 401 Computer and Network Security

A low-cost Alternative for OAEP

Design and Implementation of Asymmetric Cryptography Using AES Algorithm

Fast Arithmetic Coding (FastAC) Implementations

The Advanced Encryption Standard: Four Years On

SENSE Security overview 2014

Debugging with TotalView

Parallel AES Encryption with Modified Mix-columns For Many Core Processor Arrays M.S.Arun, V.Saminathan

AES Flow Interception : Key Snooping Method on Virtual Machine. - Exception Handling Attack for AES-NI -

Life Cycle of a Memory Request. Ring Example: 2 requests for lock 17

TECHNICAL UNIVERSITY OF CRETE DATA STRUCTURES FILE STRUCTURES

CIS433/533 - Computer and Network Security Cryptography

best practices for encryption in android

Authentication and Encryption: How to order them? Motivation

A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc

Utility Software II lab 1 Jacek Wiślicki, jacenty@kis.p.lodz.pl original material by Hubert Kołodziejski

MACs Message authentication and integrity. Table of contents

Habanero Extreme Scale Software Research Project

CS558. Network Security. Boston University, Computer Science. Midterm Spring 2014.

Overview of Symmetric Encryption

Keil C51 Cross Compiler

Horst Görtz Institute for IT-Security

A Catalogue of the Steiner Triple Systems of Order 19

12/3/08. Security in Wireless LANs and Mobile Networks. Wireless Magnifies Exposure Vulnerability. Mobility Makes it Difficult to Establish Trust

CUDA SKILLS. Yu-Hang Tang. June 23-26, 2015 CSRC, Beijing

Atmel AVR4027: Tips and Tricks to Optimize Your C Code for 8-bit AVR Microcontrollers. 8-bit Atmel Microcontrollers. Application Note.

Are Cache Attacks on Public Clouds Practical?

Problems and Measures Regarding Waste 1 Management and 3R Era of public health improvement Situation subsequent to the Meiji Restoration

Numbering Systems. InThisAppendix...

SAMPLE EXAM QUESTIONS MODULE EE5552 NETWORK SECURITY AND ENCRYPTION ECE, SCHOOL OF ENGINEERING AND DESIGN BRUNEL UNIVERSITY UXBRIDGE MIDDLESEX, UK

Network Security. Security. Security Services. Crytographic algorithms. privacy authenticity Message integrity. Public key (RSA) Message digest (MD5)

GameTime: A Toolkit for Timing Analysis of Software

A Secure RFID Ticket System For Public Transport

Middleware support for the Internet of Things

Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Transcription:

Sleuth: Automated Verification of Software Power Analysis Countermeasures Ali Galip Bayrak*, Francesco Regazzoni, David Novo*, and Paolo Ienne* * Ecole Polytechnique Fédérale de Lausanne (EPFL) TU Delft and ALaRI University of Lugano CHES 2013

Side-Channel Attacks and Protection Unprotected first AddRoundKey of AES void ARK() { unsigned char i; for (i=0;i<16;i){ st[i] = pt[i] ˆ key[i]; } } pt[i] key[i] st[i] Masked first AddRoundKey of AES void maskedark() { unsigned char i; for (i=0;i<16;i){ st[i] = pt[i] ˆ (key[i] ˆ mask[i]); } } key[i] mask[i] pt[i] st CHES 2013 2

Verification (Functionality) pt 2 ct 2 pt 1 ct 1 pt 3 ct 3 void maskedark() { unsigned char i; for (i=0;i<16;i){ st[i] = pt[i] ˆ (key[i] ˆ mask[i]); } } CHES 2013 3

Verification (Security) pt 1 Power Consumption 1.8 1.6 1.4 1.2 1 0.8 0.6 0.4 0.2 0 1 2 3 4 5 6 7 8 9 10 11 12 Time CHES 2013 4

Verification (Security) pt 2 pt 1 Power Consumption 1.8 1.6 1.4 1.2 1 0.8 0.6 0.4 0.2 0 1 2 3 4 5 6 7 8 9 10 11 12 Time CHES 2013 5

Verification (Security) pt 1 pt 2 pt 3 Power Consumption 1.8 1.6 1.4 1.2 1 0.8 0.6 0.4 0.2 0 1 2 3 4 5 6 7 8 9 10 11 12 Time CHES 2013 6

Verification (Security) pt 2 pt 1 pt 3 key Power Consumption 1.8 1.6 1.4 1.2 1 0.8 0.6 0.4 0.2 0 1 2 3 4 5 6 7 8 9 10 11 12 Time CHES 2013 7

Never Trust Your Compiler void maskedark() { unsigned char i; for (i=0;i<16;i){ st[i] = pt[i] ˆ (key[i] ˆ mask[i]); } } avr-gcc-4.5.3 -O3.text.global ARK.type ARK, @function ARK: /* prologue: function */ /* frame size = 0 */ /* stack size = 0 */.L stack_usage = 0 lds r24,key lds r25,pt eor r24,r25 lds r25,mask eor r24,r25 sts st,r24 lds r24,key1 lds r25,pt1 eor r24,r25... CHES 2013 8

Verification is Important void maskedark() { unsigned char i; for (i=0;i<16;i){ st[i] = pt[i] ˆ (key[i] ˆ mask[i]); } } Sleuth lds r24,key lds r25,pt eor r24,r25 Find the sensitive operations of a given program. CHES 2013 9

Outline Sensitivity definitions Methodology Experimental studies CHES 2013 10

Sensitivity Definitions Goal: Given a program, find the sensitive operations, which leak critical information. Definitions we need: Program Types (secret, public, random) Leakage Sensitivity CHES 2013 11

Program A sequence of branch-free three-address form arithmetic/logic or memory operations. Example: key m1 m2 pt key_r = key xor m1 pt_r = pt xor m2 st = pt_r xor key_r Inputs: key, pt, m1, m2 st CHES 2013 12

Program A sequence of branch-free static analysis is exponentially complex for inputdependent branches. many countermeasures (e.g., masking, random precharging) do not use such branches. three-address form x = y op z, x = y[z], or y[z] = x. for simplicity of representation. arithmetic/logic or memory operations. CHES 2013 13

Type Each input is tagged with one of the types secret: content should not be revealed (e.g., key). public: content is observable by third-party (e.g., plaintext). random: uniformly distributed random values (e.g., mask). Example: key : secret pt : public m1 : random m2 : random CHES 2013 14

Leakage Model A model of the side-channel leakage (e.g., power consumption) of a device h, for a given subset of operations d of a program p. key m1 m2 pt key m1 m2 pt st st pt_r HW HD HW(st) HD(st, pt_r) CHES 2013 15

Sensitivity For a given program p whose input variables {v 0,,v k-1 } have types {t 0,,t k-1 }, a device h, a leakage model l, sensitivity of a subset d of operations of p represents whether leakage l(d, p, h) depends on at least one secret variable but not on any random variable. CHES 2013 16

Sensitivity key m1 m2 pt HW st HW(st) = HW(key m1 pt m2) HW(st) ~ key? : yes HW(st) ~ m1? : yes not sensitive HW(st) CHES 2013 17

Sensitivity key m1 pt HW st HW(st) = HW(key pt) HW(st) ~ key? : yes HW(st) ~ m1? : no sensitive HW(st) CHES 2013 18

Methodology Represent the program as a graph. Use satisfiability queries to detect the dependencies and sensitivity. CHES 2013 19

Graph Representation r0 = key ˆ m; r1 = pt ˆ r0; r2 = sm[r1]; public pt secret random key m r0 r1 LUT sm 01 101 MUX r2 Sample implementation in C Graph representation CHES 2013 20

Sensitivity Detection public pt secret random key m r0 r1 LUT sm 01 101 MUX Is q 1 sensitive? q 1 ~ key? (q 1 ~ m)? r2 HW q1 CHES 2013 21

Dependency Check pt key&1110 m pt key 0001 m LUT sm 01 101 LUT sm 01 101 MUX MUX HW HW Assign 0 to the last bit Assign 1 to the last bit SAT? 22

Sleuth Implementation Type Annotations Queried Operations Leakage Model Sleuth Sensitive Operations 23

Experimental Studies Compilers are not perfect. Programmers are not perfect. Countermeasures are not perfect. CHES 2013 24

Compiler Related Problems We used Hamming weight univariate leakage model. Detects all 16 such problems in 0.02 seconds. Similar problems arise in later operations (e.g., MixColumns). It takes 430 seconds to detect all problems in a round of AES. CHES 2013 25

Programmer Related Problems In the Boolean masking algorithm of Herbst et al. [19], st[2] and st[10] use the same mask. We used Hamming distance leakage model. Bivariate leakage will be HD(st[2], st[10]) = HD(st_orig[2] m, st_orig[10] m) = HW(st_orig[2] st_orig[10]). Finds all such problems (i.e., also between line 4 and 5) in 477 seconds. CHES 2013 26

Countermeasure Related Problems Find A such that If we use a proper leakage model an attack is possible [Coron and Goubin 00]. We used parity of the result as a leakage model. Finds in 0.02 seconds. CHES 2013 27

Conclusions and Discussions Our SAT-based methodology is generic (does not depend on the algorithm or countermeasure). We can find crucial real world problems (that can invalidate the countermeasure) in a reasonable time. The user can make use of an extendible library of leakage models. CHES 2013 28

CHES 2013 29

CHES 2013 30