Top Banner
Starbug & Karsten Nohl University of Virginia
43

Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Jul 09, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Starbug & Karsten NohlUniversity of Virginia

Page 2: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Critical hardware relies onproprietary security primitives These algorithms can easily be

reverse-engineered

Their security level is often low

When designing security, prepare for failure Goal should be low risk of large damage,

but not perfect security

Publicly reviewed algorithms and independent analysis yield best results

2Starbug & Karsten Nohl – Hardware Reverse Engineering

Page 3: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Lots of critical systems rely on secure hardware

Smartcards for access control, payment tokens

Also: satellite TV cards, car keys, printer cartridges, …

Security often considered hard and expensive

Hence, often excluded from initial design

▪ Protection added after problems arise

▪ Patchwork security is harder and more expensive!

Starbug & Karsten Nohl – Hardware Reverse Engineering 3

Finding security bugs in hardware systems becomes ever easier, threat grows.

Page 4: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Security is a chain

Its strength is determined by the weakest link

4

Security protocols

Cryptographic functions

Key storage

Starbug & Karsten Nohl – Hardware Reverse Engineering

Page 5: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

5Starbug & Karsten Nohl – Hardware Reverse Engineering

Page 6: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Starbug & Karsten Nohl – Hardware Reverse Engineering 6

Cryptographic cipher

Cryptographic cipher Challenge-

response protocol

Page 7: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Starbug & Karsten Nohl – Hardware Reverse Engineering 7

Encrypted .data

Cipher

Decrypteddata .

Page 8: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Hardware security relies on

a) Key storage

b) Cryptographic cipher (encryption)

Many systems fail to acknowledge lack of secrecy in hardware

Starbug & Karsten Nohl – Hardware Reverse Engineering 8

This talk discusses common weaknesses in secure key storage and proprietary encryption.

Cipher

Page 9: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Reverse-engineering secret algorithms

1. Open chips

2. Find structures

3. Reconstruct circuit

Impact:

Find proprietary encryption

Open cryptographic key storage

Starbug & Karsten Nohl – Hardware Reverse Engineering 9

Page 10: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures
Page 11: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Infi

neo

n S

LE

66

, co

urt

esy

Fly

log

ic

Starbug & Karsten Nohl – Hardware Reverse Engineering 11

Page 12: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Infi

neo

n S

LE

66

, co

urt

esy

Fly

log

ic

Starbug & Karsten Nohl – Hardware Reverse Engineering 12

Page 13: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Starbug & Karsten Nohl – Hardware Reverse Engineering 13Infineon SLE66 address/data bus, courtesy Flylogic

Page 14: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Analyze chips using “last principles”

Principle #1: Chips are structured

▪ Crucial for design partitioning and refactoring

Principle #2: Chips are designed to be read back

▪ Enables prototyping and debugging

Complement analysis with “first principle”

Principle #3: Nothing can be hidden in silicon

▪ Chips are self-contained; hence all data, programs, and algorithms are available on the chip

Starbug & Karsten Nohl – Hardware Reverse Engineering 14

Page 15: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Meshes can sometimes protect data, but not algorithms

Starbug & Karsten Nohl – Hardware Reverse Engineering 15

“Last resort”: Hide security in secret algorithms.

Page 16: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures
Page 17: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Chemically extract chips:

Acetone

Fuming nitric acid

Starbug & Karsten Nohl – Hardware Reverse Engineering 17

Page 18: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Starbug & Karsten Nohl – Hardware Reverse Engineering 18

Page 19: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Polishing: Automated with machine Manually with sand paper

Starbug & Karsten Nohl – Hardware Reverse Engineering 19

Potential problem: tilt Solution: glue chip to

block of plastic

Page 20: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Starbug & Karsten Nohl – Hardware Reverse Engineering 20

Page 21: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Simple optical microscope 500x magnification

Camera 1 Mpixel

Costs < $1000, found in most labs— or—

Confocal microscope Colors images by layer

Makes structures easy to spot

Expensive: > $10k

Starbug & Karsten Nohl – Hardware Reverse Engineering 21

Page 22: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Starbug & Karsten Nohl – Hardware Reverse Engineering 22

Page 23: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Need to stitch 100x100μm images

Tool of choice: hugin

Borrowed from panorama photography

Starbug & Karsten Nohl – Hardware Reverse Engineering 23

hugin:

reference points

Page 24: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Starbug & Karsten Nohl – Hardware Reverse Engineering 24

Cover layer(optional)

Interconnection layers

Logic layer

Transistorlayer

Page 25: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Starbug & Karsten Nohl – Hardware Reverse Engineering 25

Y

A

+

-

+

-

Page 26: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Starbug & Karsten Nohl – Hardware Reverse Engineering 26

Y

A B

Page 27: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

The Silicon Zoo

Collection of logic cells Free to everyone for study,

comparison, and reverse-engineering of silicon chips

Zoo wants to grow—send your chip images!

www.siliconzoo.org

Page 28: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Starbug & Karsten Nohl – Hardware Reverse Engineering 28

select

detect

Logic cells are picked form a library

Library contains fewerthan 70 gate types

Detection automated (template matching using MATLAB)

Page 29: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Starbug & Karsten Nohl – Hardware Reverse Engineering 29

Page 30: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Mifare: 1500 connections for Crypto-1 DECT: 2000 connections for DSC Manually tracing connections

Tedious, time consuming

Error-prone (but errors easily spottable)

Tracing automated by now

Starbug & Karsten Nohl – Hardware Reverse Engineering 30

Page 31: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Tracing Connections

Karsten Nohl - Hardware Security 31

Page 32: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Metal wire

Intra-layer via

Automated Tracing

Karsten Nohl - Hardware Security 32

Page 33: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Starbug & Karsten Nohl – Hardware Reverse Engineering 33

Page 34: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Obfuscated placing and wiring of logic cells

May defeat human inspection, but not automated tools

Dummy cells

Makes reversing harder, but not impossible

Large chips

Huge effort, huge rewards?

Self-destructive chips?

May protect secret keys, not secret algorithms

Starbug & Karsten Nohl – Hardware Reverse Engineering 34

Source: flylogic.net

Page 35: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Mifare Classic Break

Mifare cards uses proprietary Crypto-1 algorithm

Never publicly reviewed for 20+ years

We reverse-engineered algorithm and announce insecurities at 24C3

Feb/Mar: Reports find Crypto-1 to be strong enough for a “few more years”

We releases more details about attacks▪ Final report recommends migration

April: Dutch researchers publicly demonstrate attacks against Oyster

Law suit erupts, free speech prevails

Details published in October35

Page 36: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Once strong cryptography is used, key storage becomes weakest link

More ubiquitous systems typically have more copies of the secret keys in accessible places

36

Security protocols

Cryptographic functions

Key storage

Starbug & Karsten Nohl – Hardware Reverse Engineering

Page 37: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Secret keys can be stored:

Online:

▪ Keys only stored on central server

▪ Expensive setup, long response times

Semi-online:

▪ Devices receive keys at boot time

▪ Keys often stored in DRAM at runtime; bad idea!

Offline:

▪ Devices “securely” store key copy

Starbug & Karsten Nohl – Hardware Reverse Engineering 37

Page 38: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Secret keys should be

Different for every user

▪ Requires many different keys

Immediately accessible

▪ Requires small number of keys

Best practice: derive user keys from master key; store master key in „key vault“

38Starbug & Karsten Nohl – Hardware Reverse Engineering

Page 39: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Hardware Security Modules (HSM)

Used in ATMs (cash machine), few smart card readers

Use proprietary encryption

Hence, can be broken

▪ Usually high effort (> $100.000)

Secure Access Modules (SAM) are much easier to break

Credit card / smart card readers

39Starbug & Karsten Nohl – Hardware Reverse Engineering

Page 40: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Starbug & Karsten Nohl – Hardware Reverse Engineering 40

Everything needed to disclose key is found on chip

Finding secret algorithms might be costly

HSM ID

Encrypted key

Proprietary Decryption

Master keyCard ID,

sector, …

AES / 3DES

Card key

Hardware Security Module (HSM)

Page 41: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

„Secure“ Access Modules are standard micro-processors Low effort to

extract master keys

SIMs/SAMs are becoming cheaper and less secure!

(cell phones are not any better)

41

Source: Flylogic

Starbug & Karsten Nohl – Hardware Reverse Engineering

Page 42: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Guidelines learned from past hacks include:

Prepare for security breaks, no measure is perfect

▪ Need: redundancy, “layering”

▪ Need: migration plan

Use standardized security

▪ Never rely on your own security “inventions”

Manage risks through threat modeling

▪ Find acceptable balance between potential losses and cost of security

42Starbug & Karsten Nohl – Hardware Reverse Engineering

Page 43: Starbug & Karsten Nohl University of Virginiaevents.ccc.de/congress/2008/Fahrplan/attachments/1218_081227.25… · Reverse-engineering secret algorithms 1. Open chips 2. Find structures

Karsten [email protected]

[email protected]

43Starbug & Karsten Nohl – Hardware Reverse Engineering