New Crypto-fundamentals in RIOT Peter Kietzmann - - PowerPoint PPT Presentation

new crypto fundamentals in riot peter kietzmann
SMART_READER_LITE
LIVE PREVIEW

New Crypto-fundamentals in RIOT Peter Kietzmann - - PowerPoint PPT Presentation

New Crypto-fundamentals in RIOT Peter Kietzmann peter.kietzmann@haw-hamburg.de 3rd get-together of the friendly Operating System for the Internet of Things September 13, 2018 Crypto-Fundamentals??? IoT requires security. . . ... as we


slide-1
SLIDE 1

New Crypto-fundamentals in RIOT Peter Kietzmann

peter.kietzmann@haw-hamburg.de 3rd get-together of the friendly Operating System for the Internet of Things

September 13, 2018

slide-2
SLIDE 2

“Crypto-Fundamentals”???

IoT requires security. . . ... as we just learned in “Usable Security for RIOT and the Internet of Things”

slide-3
SLIDE 3

“Crypto-Fundamentals”???

IoT requires security. . . ... as we just learned in “Usable Security for RIOT and the Internet of Things” Low-cost “COTS” devices. . . . . . usually don’t provide secure hardware such as Trusted Platform Module, Intel SGX or ARM TrustZone to reduce cost

slide-4
SLIDE 4

“Crypto-Fundamentals”???

IoT requires security. . . ... as we just learned in “Usable Security for RIOT and the Internet of Things” Low-cost “COTS” devices. . . . . . usually don’t provide secure hardware such as Trusted Platform Module, Intel SGX or ARM TrustZone to reduce cost Lack of computational power. . . . . . and the absence of secure hardware require efficient software implementations to fit device constraints

slide-5
SLIDE 5

“Crypto-Fundamentals”???

IoT requires security. . . ... as we just learned in “Usable Security for RIOT and the Internet of Things” Low-cost “COTS” devices. . . . . . usually don’t provide secure hardware such as Trusted Platform Module, Intel SGX or ARM TrustZone to reduce cost Security protocols require. . . . . . certain resources such as high quality random numbers, salts, cryptographic keys Lack of computational power. . . . . . and the absence of secure hardware require efficient software implementations to fit device constraints

slide-6
SLIDE 6

“Crypto-Fundamentals”???

IoT requires security. . . ... as we just learned in “Usable Security for RIOT and the Internet of Things” Low-cost “COTS” devices. . . . . . usually don’t provide secure hardware such as Trusted Platform Module, Intel SGX or ARM TrustZone to reduce cost Security protocols require. . . . . . certain resources such as high quality random numbers, salts, cryptographic keys Lack of computational power. . . . . . and the absence of secure hardware require efficient software implementations to fit device constraints We introduce software fundamentals to address crypto requirements

slide-7
SLIDE 7

Physical Unclonable Functions

Function Input (Challenge) Output (Response)

slide-8
SLIDE 8

Physical Unclonable Functions

Function Input (Challenge) Output (Response)

◮ Digital fingerprint based on manufacturing process variations ◮ Extracted response identifies a device like human fingerprint ◮ The ”secret” is hidden in physical structure → Hard to predict or clone ◮ A variety of PUFs exist based on: Component delays, magnetism, optics, uninitialized memory pattern, ... Note: Like biometric data, PUF responses are affected by noise

slide-9
SLIDE 9

PUF Applications & Parameters

Applications Quality Parameters Noise ◮ RNG, PRNG seeding, ... ◮ Intra-device variations Identity ◮ Identification, authentication ◮ Secret key generation or storage ◮ Unique app–to–device binding (i.e., secure boot) ◮ Reproducible ◮ Unique ◮ Unpredictable ◮ Unclonable

slide-10
SLIDE 10

Literature & Recent Work

  • A. Schaller:

“Lightweight Protocols and Applications for Memory-Based Intrinsic Physically Unclonable Functions Found on Commercial Off-The-Shelf Devices” (2017)

Secure applications based on PUFs evaluated on multiple COTS

“A. Van Herrewege et al.: Secure PRNG Seeding on Commercial Off-the-Shelf Microcontrollers” (2013)

SRAM analysis of different COTS for PRNG seeding under varying environmental conditions

“Y. Dodis et al.: Fuzzy Extractors: How to Generate Strong Keys from Biometrics and Other Noisy Data” (2008)

Provide secure techniques to generate crypto-keys from noisy responses

“C. B¨

  • sch et al.:Efficient Helper Data Key Extractor on FPGAs” (2008)

Design and evaluation of key extractors on FPGAs

“J. Delvaux et al.: Attacking PUF-Based Pattern Matching Key Generators via Helper Data Manipulation” (2012)

Propose attacks and recovery from PUF-constructed keys

slide-11
SLIDE 11

No lightweight, open source, operating system integration? We implement SRAM based PUFs in RIOT for PRNG seeding and key generation

slide-12
SLIDE 12

Outline

A Brief Introduction to PUFs SRAM Memory Analysis of Standard RIOT Devices A Seeder for Pseudo Random Number Generators Cryptographic Key Generation from Noisy PUF Responses Current Implementation Progress in RIOT Next Steps, Future Plans, ...

slide-13
SLIDE 13

SRAM Memory Analysis of Standard RIOT Devices

slide-14
SLIDE 14

Experiment Setup

◮ Periodically power-on device and read SRAM blocks after boot → Power-down time > RAM hold-time ◮ Transistor variations lead to different cell states on startup → Unique pattern + noise ◮ Results depend on SRAM technologies, circuit and environment → Should be evaluated individually

slide-15
SLIDE 15

Intra-Device Analysis

50 reads; 1kB SRAM; 5 SAMD21; Ambient Temperature

Quantify randomness by min. entropy: Hmin = − n

i=1 log2(max(pi 0, pi 1)) · 100% n

n: memory length, p0/1: low/high probabilities

Quantify bias by hamming weight: W (a) = {ai = 0}1≤i≤n · 100%

n

Device A B C D E

  • Min. Entropy

4.16 % 5.46 % 5.28 % 4.68 % 5.48 % Hamming Weight 50.7±3 % 49.5±3 % 51.3±6 % 49.8±4 % 53.1±3 % → The SRAM memory is not biased and contains a random component

slide-16
SLIDE 16

Inter-Device Analysis

50 reads; 1kB SRAM; 5 SAMD21; Ambient Temperature

Device Pair A–B A–C A–D A–E Hamming Distance 49.2±4 % 49.5±3 % 50.1±3 % 50.4±4 % → The SRAM pattern do not correlate between devices Quantify uniqueness by fractional hamming distance: D(a, b) = {ai = bi}1≤i≤n · 100% n

slide-17
SLIDE 17

A Seeder for Pseudo Random Number Generators

slide-18
SLIDE 18

Seeder Architecture

◮ Module hooks into startup before kernel init ◮ Patterns of uninitialized SRAM are hashed by DEK Hash ◮ 32-bit result is stored in pre-reserved RAM section ◮ Seeds PRNG after kernel init

Entropy Extraction Hash Function Kernel Init Modules Init (PRNG) Application Bootloader ROM RAM

seed

slide-19
SLIDE 19

SRAM Memory Length

  • Min. Seed Entropy; Varying SRAM Lengths; Ambient Temperature

102 103 SRAM length [Bytes] 5 10 15 20 25 30 Entropy [Bit] MEGA2560 SAMD21 CC2538 STM32F4

→ Approximately 31 Bit entropy @ 1kB SRAM is a good fit

slide-20
SLIDE 20

Seed Distribution

  • Frac. Hamming Distances of Seeds; 1kB SRAM; Ambient Temperature

0.0 0.2 0.4 0.6 0.8 1.0

  • Frac. Hamming Distance

1 2 3 4 5

Probability CC2538 0.0 0.2 0.4 0.6 0.8 1.0

  • Frac. Hamming Distance

1 2 3 4 5 Probability SAMD21

0.0 0.2 0.4 0.6 0.8 1.0

  • Frac. Hamming Distance

1 2 3 4 5

Probability STM32F4

0.0 0.2 0.4 0.6 0.8 1.0

  • Frac. Hamming Distance

1 2 3 4 5

Probability MEGA2560

Distances follow a normal distribution with expectation value around 0.5 → We consider seeds as independent

slide-21
SLIDE 21

Reset Detection

◮ The SRAM needs to be uninitialized to provide highest intra-device entropy → device needs start from power-off ◮ That’s not the “development” case where programmers press reset ◮ We implement a reset detection mechanism to report soft-resets ◮ A 32-bit marker is written to a specific location ◮ During the next reboot we test it’s presence

slide-22
SLIDE 22

Talk Progress

A Brief Introduction to PUFs SRAM Memory Analysis of Standard RIOT Devices A Seeder for Pseudo Random Number Generators Cryptographic Key Generation from Noisy PUF Responses Current Implementation Progress in RIOT Next Steps, Future Plans, ...

slide-23
SLIDE 23

Motivation

Problem:

  • 1. PUF responses are error-prone
  • 2. PUF responses are not distributed uniformly

Requirement:

  • 1. We need reproducible PUF responses
  • 2. We want to produce uniformly distributed secrets

Solution:

  • 1. Remove errors from PUF measurements
  • 2. Map the high-entropy input to a uniformly distributed output
slide-24
SLIDE 24

Fuzzy Extractor Mechanism

Secure Sketch: ◮ Reliably reconstruct response from a noisy measurement ◮ Uses error correction codes Randomness Extractors: ◮ One way hash function to compress high entropy output ◮ The input sequence needs min. entropy

slide-25
SLIDE 25

Fuzzy Extractor Mechanism

Secure Sketch: ◮ Reliably reconstruct response from a noisy measurement ◮ Uses error correction codes Randomness Extractors: ◮ One way hash function to compress high entropy output ◮ The input sequence needs min. entropy

Deployment

Enrollment: ◮ Encoding and helper data generation ◮ Uses a reference PUF response ◮ Executed in trusted environment Reconstruction: ◮ Decodes corrupted input sequence ◮ Uses a noisy PUF measurement ◮ Executed on the device after startup

slide-26
SLIDE 26

Fuzzy Extractor Design

Golay Encoder Repetition Encoder Helper Code Offset Oneway Hash Key PUF MLE

Enrollment

slide-27
SLIDE 27

Fuzzy Extractor Design

Golay Encoder Repetition Encoder Helper Code Offset Oneway Hash Key PUF MLE

Enrollment

slide-28
SLIDE 28

Fuzzy Extractor Design

Golay Encoder Repetition Encoder Helper Code Offset Oneway Hash Key PUF MLE

Enrollment

slide-29
SLIDE 29

Fuzzy Extractor Design

Golay Encoder Repetition Encoder Helper Code Offset Oneway Hash Key PUF MLE

Enrollment

slide-30
SLIDE 30

Fuzzy Extractor Design

Golay Encoder Repetition Encoder Helper Code Offset Oneway Hash Key PUF MLE

Enrollment

slide-31
SLIDE 31

Fuzzy Extractor Design

Golay Encoder Repetition Encoder Helper Code Offset Oneway Hash Key PUF MLE

Enrollment

slide-32
SLIDE 32

Fuzzy Extractor Design

Golay Encoder Repetition Encoder Helper Code Offset Oneway Hash Key PUF MLE Golay Decoder Code Offset Helper Golay Encoder Repetition Encoder Oneway Hash Key Repetition Decoder PUF Noisy PUF MLE

Enrollment Reconstruction

slide-33
SLIDE 33

Fuzzy Extractor Design

Golay Encoder Repetition Encoder Helper Code Offset Oneway Hash Key PUF MLE Golay Decoder Code Offset Helper Golay Encoder Repetition Encoder Oneway Hash Key Repetition Decoder PUF Noisy PUF MLE

Enrollment Reconstruction

slide-34
SLIDE 34

Fuzzy Extractor Design

Golay Encoder Repetition Encoder Helper Code Offset Oneway Hash Key PUF MLE Golay Decoder Code Offset Helper Golay Encoder Repetition Encoder Oneway Hash Key Repetition Decoder PUF Noisy PUF MLE

Enrollment Reconstruction

slide-35
SLIDE 35

Fuzzy Extractor Design

Golay Encoder Repetition Encoder Helper Code Offset Oneway Hash Key PUF MLE Golay Decoder Code Offset Helper Golay Encoder Repetition Encoder Oneway Hash Key Repetition Decoder PUF Noisy PUF MLE

Enrollment Reconstruction

slide-36
SLIDE 36

Fuzzy Extractor Design

Golay Encoder Repetition Encoder Helper Code Offset Oneway Hash Key PUF MLE Golay Decoder Code Offset Helper Golay Encoder Repetition Encoder Oneway Hash Key Repetition Decoder PUF Noisy PUF MLE

Enrollment Reconstruction The key does not need to be stored anywhere!

slide-37
SLIDE 37

Fuzzy Extractor Parameters

Error probability: ◮ Measured bit error probability: pmax = 0.1 (literature calculates with pb = 0.15) ◮ Calculated output error probability: Ptotal = 5.07 × 10−7 (literature considered Ptotal = 1 × 10−6 as conservative)

1T.Ignatenko et al.: ”Estimating the Secrecy-Rate of Physical Unclonable Functions with the

Context-Tree Weighting Method”

slide-38
SLIDE 38

Fuzzy Extractor Parameters

Error probability: ◮ Measured bit error probability: pmax = 0.1 (literature calculates with pb = 0.15) ◮ Calculated output error probability: Ptotal = 5.07 × 10−7 (literature considered Ptotal = 1 × 10−6 as conservative)

  • Min. length of PUF response:1

Secret Bits Source Bits Coded Source Bits Coded Source Bytes 32 42 1056 132 128 171 3960 495 146 192 4224 528

1T.Ignatenko et al.: ”Estimating the Secrecy-Rate of Physical Unclonable Functions with the

Context-Tree Weighting Method”

slide-39
SLIDE 39

Fuzzy Extractor Processing Time

132 528 50 100 150 200 Processing time [ms] Atmel SAMD21 132 528 5 10 15 20 STMicroelectronics STM32F4

SHA1 XOR OUT REP ENCODE GOLAY ENCODE GOLAY DECODE REP DECODE XOR IN

PUF Response Length [Bytes]

slide-40
SLIDE 40

Current Implementation Progress in RIOT

slide-41
SLIDE 41

RIOT Implementation Progress

Component Feature Status PRNG Seeder Cortex-M ✓ AVR8 ✓ Evaluation Tool ✓ Fuzzy Extractor Cortex-M ✓ AVR8 ✘ Helper Data generation tool ✓

slide-42
SLIDE 42

Next Steps, Future Plans, ...

slide-43
SLIDE 43

General: ◮ Implement the missing components :-) ! ◮ Evaluate SRAM startup from low power wake-up

slide-44
SLIDE 44

General: ◮ Implement the missing components :-) ! ◮ Evaluate SRAM startup from low power wake-up Random: ◮ Add “secure” seed for cryptographically secure PRNG ◮ Extend random API in various aspects

◮ Enable parallel PRNGs ◮ Application based seed provisioning ◮ Event reporting, e.g., soft-reset detection

◮ Apply NIST statistical test suite to RIOT

slide-45
SLIDE 45

General: ◮ Implement the missing components :-) ! ◮ Evaluate SRAM startup from low power wake-up Random: ◮ Add “secure” seed for cryptographically secure PRNG ◮ Extend random API in various aspects

◮ Enable parallel PRNGs ◮ Application based seed provisioning ◮ Event reporting, e.g., soft-reset detection

◮ Apply NIST statistical test suite to RIOT Fuzzy Extractor: ◮ Evaluate privacy of public Helper Data ◮ Measure bit error probability on embedded devices ◮ Implement build target for Helper Data generation & storage

slide-46
SLIDE 46
slide-47
SLIDE 47

BS - Error Correction Code

◮ Binary codes are noted as [n, k, d] -codes with n = code length, k = encoded message length, d = minimum distance of code words ◮ Concatenation of Golay and Repetition 11 code leads to [264, 12, 77] -code ◮ Binary Symmetric Channel as model: Ptotal = 1 −

t

  • i=1

n i

  • pi

b(1 − pb)n−i

with t = (dmin − 1)/2 correctable errors ◮ tgolay = 3, trep11 = 5 and pb = 0.1 ◮ Total error by calculating inner code and apply error to outer code

slide-48
SLIDE 48

BS - Length of PUF response

Secrecy rate: ◮ Universal hash function compresses PUF response bits ◮ Min. amount of compression (by hashing) is expressed by “secrecy rate” SR ◮ Max. achievable secrecy rate given by mutual information between PUF responses during Enrollment and Reconstruction ◮ Common value is SR = 0.76 → For a secret of length 128 Bit, we need S−1

R

· 128 = 171 source Bits ◮ Minimum number of source bits after encoding: n⌈171/k⌉