who are youjhartog/coursesecurity/materials/slides/13-5-auth.pdf · java card (‘95) ... used in...

97
Who are you ?

Upload: others

Post on 28-Mar-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

Who are you ?

Page 2: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

2

How can you identify someone?

Certificates, Protocols: Machine to Machine Human to Machine ?

Lets have some suggestions Be creative, not necessarily computer oriented

Classification of identification methodsWhat you know (e.g. password)What you are (e.g. biometrics, behaviour)What you have (e.g. security token)

Page 3: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

Passwordswww.dilbert.com

Page 4: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

4

Your passwords Everybody has several passwords

Did you choose them? If so how?

Can you remember them?Also if you do not use often?

Can no one guess them?`Vectra’ bad password for known Opel fan.

Page 5: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

5

Passwords (what you know)

But: How secure & secret is the secret ?

AsD5^#2a2fUHard to guess ~ Hard to rememberEasyPassword

AliceEasyPasswordBobBusterCharliePDf47$%2!aDilbert*****

User: AlicePwd: EasyPassword

RecoveryAlice’s Mother’s Name

Page 6: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

6

Example: pin protected copier

Copier in hallway Protected by 5 digit code Enough entropy? If 10 users with different codes? Number of tries needed in practice?

*****

Page 7: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

7

Ex2: Account passwords in Unix

Usually user chosen Passwords not stored on system

Why? HASH of a password stored instead

Hash is one-way Collision resistant

/etc/passwrdWorld readable (for Account info; name, id, group, etc.) Hashed-password

Page 8: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

8

Theoretical Strength (ball park)

8 symbols; 128^8 = 72,000,000 Gbrute force in little over a year at 1G/s (*) If restrict to letters, digits or common symbols;

96^8: in ~ 3 months Only letters and numbers: half a day

(*) 1G/s+ easily realistic (e.g. in 2002 75G/s RC5-64 passwords per seconds using distributed computing)

Page 9: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

9

Account passwords in Unix (cont.)

Multiple passwords reduce effort if any victim is fineSalt

Still significant risk Faster computersWeaknesses found in hash functionsCannot simply make password longer

Shadow passwordsAccess only for `root’, event to hashed pwd

Page 10: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

10

Example of password in Unix

Program to create Hashed passwords#!/bin/perl

$salt = “ab”; # should randomly generate

print “New Password: ”;

$pwd = <>; # enter pwd

print crypt( $pwd, $salt ); # lib call

Run New Password: Hello abdF5znAEMJTk New Password: Goodbye abPV5atKxA04c

Page 11: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

11

Practical Strength: Password Guessing

Often: dictionary words, keyboard patternsComplexity too low even with added symbol

Weak!WHY?...

Guessing: DB with often used words.Dictionary, common names, etc.Add symbols, numbers.Often only a single bad password needed

Page 12: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

12

From (Password) Crack tutorialPeople tend to pick keyboard patterns ("qwerty", "!@#$%^&*', etc.) and natural language words. Suddenly an adversary doesn't have to try 5.96E16 strings.

Success rate 22% using a lists of dutch, english, french, german, italian, norwegian and swedish words plus lists of names, jargon words, keyboard patterns and anything else people tend to use when picking passwords.

List of 2.2E7 "words“ (out of 5.96E16) (At 1.000 tries a second: all in 6 hrs)

Page 13: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

13

Passwords pros and cons

Checking passwords At time of entry With password cracking tool

MyOnePwd

Assigned Randomly generated

Reuse

Password safe(Why cannot use hash?)

Guidelines

Generation

Use

System side

Page 14: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

14

Some Conclusions on Passwords Very commonly used system

Well known, easy to use Cheap

A weak form of authentication Limited complexity Badly chosen passwords

Have to be used in correct way Prevent access to encrypted passwords Limit guess rates where possible Remember it may be broken

Page 15: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

www.trustedreviews.com

Biometrics

Page 16: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

16

Biometrics Physical and behavioral characteristics, e.g.Fingerprints Iris facial characteristicshand measurements grip patternsignaturevoice typing patternDNAetc.

Page 17: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

17www.cl.cam.ac.uk

www.byometric.com

Example: Privium program at Schiphol

Iris recognition Profile stored on card Skip passport check FallbackRegular checkAt front of the line

Page 18: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

18

Typical Mode of Operation

Verification is easier than identification…

Page 19: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

19

Characteristics biometric system Universal (everyone has it)

Uniqueness (different for everyone)

Permanence (same over time), ... ... ... ...

Page 20: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

20

Characteristics biometric system Collectability (usability, convenience),

Performance (accurate and fast)

=

Page 21: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

21

Characteristics biometric system

Acceptance (user and societies view)

Circumvention (easy to fake)

Page 22: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

22

Some Comparisons

Page 23: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

23

Variation in Measurements

Every measurement slightly different Enrollment

Profile (e.g. average) from many measurements Validation

New measurements approximately match profile? Threshold describes allowed distance

Trade off false acceptance rate - false reject rate Quality often specified by equal error rate

Page 24: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

24

threshold => FAR – FRR trade-off

Acceptimposter

Reject valid

individual

Fals

e Ac

cept

Rat

e

False Reject Rate

t small

t big

Page 25: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

25

Evaluation Security of a Biometric system

Page 26: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

26

Biometrics Privacy & `key’ loss issues:

DNA `blueprint’ of a person very privacy sensitive interesting e.g. for health insurance companies

Information does not change, cannot be replaced Information left everywhere

Your fingerprint is on the chair, desk, lunch plate, etc. Not transferable (*)

Biometric passports electronic picture (e.g. against fraud with ID) fingerprint (e.g. against `look alike’)

Page 27: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

Template Protection

27

TemplateStorage

Securely Store templates• Normal hash not possible

Page 28: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

28

A Template Protection Scheme(*)

Shielding function G : Rk × {0, 1}k → {0, 1}K

K-bit secret S chosen randomly,

biometric X

create helper data W so G(X,W) = S

(*)Practical Biometric Authentication with Template Protection, P. Tyles et al.

k Features K bits secret

Page 29: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

29

Template Protection Scheme (cont.)

Noise insensitive (δ-contracting)d(X’, X) < δ => G(X’,W) = G(X,W) = S

Secure (ε -revealing): I(W; S) ≤ εW leaks less than ε bits on S

Template protecting (ζ-revealing) : I(W; X) ≤ ζW leaks less than ζ information on X

Shielding function G : Rk × {0, 1}k → {0, 1}K

helper data W

Page 30: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

30

Template Protection Scheme (cont.) Enrolment: extract features X from Alice’s biometricschoose random secret Scompute helper data WUse one-way hash function H and store

(Alice, W , H(S))

Verification of identity of Alice: measure biometric: X’ load helper data W for Alice Compute S = G(X’,W) and H(S).

Page 31: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

31

Design Biometric Practical

Able to do at home Able to do in class

Keep characteristics in mind: Choose collection method Define Features

Enrolment Create several measurements.

Evaluation

• Universal• Uniqueness • Permanence• Collectability • Performance• Acceptance• Circumvention

Page 32: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

www.trustedreviews.com

Biometrics(Experimental results)

Page 33: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

33

Measure:

3 points B,C,D (A=(0,0))

AB

CD

A

B

C

D

Page 34: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

34

Hand features Feature 1: circumference of the middle joint

(typically thickest part of finger)

Feature 2: Length top digit From middle top to separating line

Feature 3: Length middle digit From separating line to separating line (use main;

lower line as end point).

Feature 4: Length bottom digit

Uses indexfinger

Page 35: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

35

Feature extraction

Blue line: all users Purple line: distinctive

feature for user Red line: weakly

distinctive feature Can help prevent false

accepts Green: indistinctive

features Very close to average -

expect many to have similar results.

Page 36: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

36

Page 37: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

37

Page 38: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

38

Page 39: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

39

Page 40: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

40

Feature 1 2 3 4

1 1 0.4203 0.4285 0.1291

2 1 0.2217 -0.0403

3 1 0.6790

4 1

Feature correlation

Page 41: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

41

Options Translation measurement into featuresPre processing; rotation.Data extraction: A,B,C,DFeatures should be scaling insensitive

Relative sizesAngle insensitive?

Effect collectability

Choose features per user ?Performance

Page 42: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

42

Biometric - Conclusions:

Varying strength of identification Can be tailored to application Additional hardware needed Non-replaceable Privacy & Acceptance

Page 43: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

Security Tokens & Tamper resistant devices

Page 44: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

44

Functional & Security Goals

Example Tokens

Page 45: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

45

Physical security

Secure processing (image source: IBM)

Page 46: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

46

Smart Card History

Dethloff (‘68), Arimura (‘70), Moreno (‘74) First chip by Motorola & Bull (‘77) France Telecom phone card (‘84) Java Card (‘95) 1 Billion Java cards (2005)

Used in many SIM and ATM cards

Standards (ISO 7816, GSM, EMV, VOP, CEPS)

Page 47: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

47

Form factors

85.6 mm

53.98 mm

0.76 mm SIM Card

Contactless Card

I-buttonEmbedded `Card’

ISO 7816

Page 48: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

48

What makes the card smart?

CPU (8-bit, 16/32 bit) Memory (RAM, ROM, EEPROM/Flash) I/O channel (Contact/Contact less) Cryptographic co-processor On card devices (Fingerprint, display)

Page 49: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

49

Applications of smartcards (1) Banking(new) creditcards, Chipknip, internet-banking

(e.g. ABN-Amro card). Telephone cards Toll payment`Rekening rijden’

Public transportMany systems in useOV chip card

Page 50: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

50

Applications of smartcards (2) Identification & AuthorizationeNik (Electronic ID)SIM cardsBuilding Access cardsLoyalty cards

Secure data storage/accessPrivium program schipholElectronic health record Germany

Page 51: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

51

Terminals

Embedded systems Standards (ISO 7816,

PC/SC, OCF) Communication: APDU

(Application Protocol Data Unit)

Problems: connections, yield, power, thickness

Page 52: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

52

Attacks on smartcards

Logical Attacks crypto, protocols, implementation

Physical attacks hardware

Side Channel attacks physical properties

Invasive - Non-invasive

Page 53: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

5353

Physical AttackRemoving chip from smartcard

heat, etching, acid, etc. to remove protective covering

[Source: Oliver Kömmerling, Marcus Kuhn]

Page 54: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

5454

Eavesdropping & Altering Physical needles Electron beam Ion beam

Also remove/create connection

Read out Rom, etc.

[Source: Brightsight]

blown fuse: Restore to re-enable testing mode

Page 55: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

55

Countermeasures

Smaller circuitrymakes many physical attacks harder

Obfuscate chip layouteg hide bus lines

encrypt bus, memory content add sensorsDetect tampering

Page 56: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

56

Logical attacks

Card reader and PC (*)

Man in the middle

(*) E.g. Software from RU Nijmegen to readout chipknip:http://www.ru.nl/ds/research/smartcards/

Page 57: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

57

Countermeasures Don't invent your own cryptographic primitives

GSM: SIM card can be cloned in couple of hoursMifare Classic: ov-chipcard in seconds

Don't invent your own security protocols use standard ones

Beware of random number generationmaking good randomness is difficult

Page 58: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

58

You all know Java High-level OO language, portable Large footprint Good tools, APIs Java Safety

Type safety: Enforces objects are of correct typeMemory safety:

Only access to `own’ memory run-time buffer size check

Helps prevent some common flaws Program in Java or assembler?

Page 59: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

59

Java card

Java card VM Multiple applets possible Subset of javaSubset of API, exceptions Initially: No concurrency, garbage collectionVersion 3: adds these, HTTP, RMI (optional)

Java card extends javaTransactions, sharable objects

Page 60: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

60

Java implementation

Parsing Type checking Code generation

Java program Byte codeclass file interpretercompiler

Class loading Byte code verification Execution

Page 61: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

61

Java Card implementation

Class loading Byte code verification CAP file generation Digital signature

Class loading Signature verification

Ver3: On card verifier Execution

Byte codeclass file

‘Byte codes’Cap file installerconverter

Page 62: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

62

Architecture

Page 63: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

63

Transaction mechanism

Transaction: set of instructionsShould execute all or noneRoll back changes on failure

Non-Atomic methodsSome things should not be rolled backExample: PIN try counter

Issues if mixed...

Page 64: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

64

Applet firewall

Context switchContext switch

Page 65: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

65

Sharable interfaces

Page 66: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

66

Sharable Interfaces

Page 67: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

Side Channel Attacks

Page 68: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

68

Side Channel attacks Use physical characteristics of the device

to gain extra information. Examples: Power consumptionelectro-magnetic emissions (EE)HeatTiming information

SPA, DPA, Timing attack

Page 69: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

69

Power Consumption

Usually easy to obtain, non-invasive

Power consumption while running DES (source: TNO-TPD).

Page 70: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

70

(*) Actually for most of current devices: Changing value causes power consumption;data with many changes consume more power.

Power AnalysisTiming attacksSimple Power Analysis (SPA)• Power consumption is higher for a 1 than a 0(*)• Gain extra information from a single power trace:

Data with many 1’s will consume more power.

Page 71: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

71

Differential Power Analysis (DPA)Look at differences in average power consumption• Collect a set of power traces• Split into two groups• Find difference in average power consumption:

Difference trace

Page 72: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

72

DPA: Bit Propagation• Collect Traces (random inputs I1,I2,...In)

• Choose input bit X

• Group traces by value bit X

• Difference trace shows where bit X used

Partial diff. traces for DES input bit X = 16,17,18,19

InputI1 I2 ... In

TraceT1 T2 ... Tn I1 bit X = 1

T1 => G1I2 bit X = 0T2 => G0etc...

Avg – AvgDiff. trace

T1...

T2...

Boolean functionAny function (#1s)

Page 73: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

73

Fundamental idea: Lower Complexity

Goals is to check a guess for PART of the key.

Example: 64 bit key nr of possibilities: 18,446,744,073,709,551,616 At 1G encryption per second: more than 500 years

If one can check 1 byte at a type: nr of possibilities (256 per byte, 8 bytes): 2048 Easily doable even if millions of instructions needed

for each check.

Page 74: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

74

Extracting keys with DPA

What: Validate guess for part of the key In practice: part < 32 bits

Select intermediate result Use guess of the key to predict Check prediction

Page 75: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

75

Extracting keys with DPA What: Validate guess for part of the key Select intermediate resultalgorithm needs to compute

Don’t care where in implementationdepends on part of the key

The part to be guessed

Use guess of the key to predict Check prediction

Input

Output

Page 76: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

What: Validate guess for part of the key Select intermediate result Use guess of the key to predictcalculate intermediate result using guess

Check prediction

Extracting Keys with DPA

76

InputI1 I2 ... In

R1 R2 ... RnPredicted

Intermediate

guess guess

InputI1 I2 ... In

R1 R2 ... RnPredicted

Intermediate

Each guess => different function

R, R, ...

Page 77: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

77

Extracting keys with DPA What: Validate guess for part of the key Use intermediate result Use guess of the key to predict Check prediction (see Bit-propagation); function R, (R, R,...) computed?Group Ti by few 1s/many 1s in Ri, (Ri, Ri, ...)Can see where computed

Nowhere for wrong guess/predictionPeak in difference trace: correct guess

(Also shows when R is computed)

Page 78: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

78Difference trace for Correct guess and incorrect guesses

Page 79: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

79

Correlation power analysis (CPA)

Compute correlation: #1s in predicated value (X) and power consumption (Y)

Or actually: sample correlation coefficient

Improves efficiency

Page 80: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

80

Key Retrieval Example: DES

S-box 1:subkey candidate: 24, peak value: 0,953 at position 66subkey candidate: 19, peak value: -0,439 at position 66subkey candidate: 26, peak value: -0,419 at position 66subkey candidate: 7, peak value: -0,418 at position 66

Page 81: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

81

Example(*): AES (Rijndael) Symmetric cipher 128 bits key (i.e. 16 bytes) First round starts with:

Intermediate value: input[ i ] ^ key-guess. (Need to check 256 possibilities.)

void AddRoundKey(){

for( i = 0; i < 16; i++ ){

inputdata[ i ] = inputdata[ i ] ^ key[ i ];}

}

(*) for simple example: assume hamming weight leaks

Page 82: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

82Simulation tool from the PINPAS Project

Page 83: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

83

Example: RSA Public key crypto, 512+ bit key size Encryption: calculate mpk mod M Typical SQR-MUL-implementation:

r = 1;for ( i = 0; i < bitlength( pk ); i++ ){

r = SQR( r, M );if ( bit( pk, i ) == 1 ){

r = MUL( r, m, M );}

}

Page 84: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

84

RSA (2)

Smartcard implementation: SQR, MUL in coprocessor

Coprocessor in tool:Add two new instructions to processorJava BigInteger class for functional behaviorPower consumption: leaks Hamming weights

of coprocessor input – output + timing.

Page 85: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

85

RSA (3) Timing attack possible:

0 0 0 1 1 0 0 0 ...if ( bit( pk, i ) == 1 ){

r = MUL( r, m, M );}else{

dummy = MUL( r, m, M );}...

Page 86: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

86

RSA (4) Defense against timing attack lines up traces No more timing information However: potential for DPA attacks

r = 1;for ( i = 0; i < bitlength( pk ); i++ ){

r = SQR( r, M );if ( bit( pk, i ) == 1 )

r = MUL( r, m, M );else

dummy = MUL( r, m, M );}

Page 87: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

87

RSA Countermeasures (1)

Randomization Prevent traces from lining up. Add dummy operations Randomize order real operations

void AddRoundKey(){ order = random_permutation( 0, 15 );

for( i = 0; i < 16; i++ ){ inputdata[ order[ i ] ] =

inputdata[ order[ i ] ] ^ key[ order[ i ] ];}

}

Page 88: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

88

RSA Countermeasures (2)

RandomizationDummy operations must appear realCorrelation reduced not removed

Nr traces needed increases ~ square of probability.

MaskingMask intermediate values with random mask

am = a XOR m confusion: confuse mask also diffusion: `masked version operation’.

Page 89: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

89

Side-Channel Countermeasures Don't make your own implementation

Unless know state-of-the art in side-channel attacks Architectural defense:

Prevent collection of set of traces: Try counter Regularly change keys. May be defeated by `template attacks’.

Limit vulnerability of key loss Do not use single key Have alternate levels of defense; e.g. revocation possibilities

Page 90: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

90

Side-Channel Countermeasures Software defense:Try to change implementation

Implement countermeasures aboveChoose less vulnerable encryption schema

Hardware defense, try to:remove correlation data – power consumption

Random activity, noise, reduce power consumptionPrevent traces from lining up

e.g. variable clock cycles

Page 91: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

Provably resistant against DPA

Sbox:Compute for every possible input in random orderreturn the result for the correct value

Masked computation of S-box Input x + r ( x masked with random r ) Output S(x) + s S(x) masked with new mask s

91

Page 92: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

92

Tamper resistant

... but not tamper proof

“make something foolproof and somebody will invent a better fool”

Design moral: breaking card should not break whole system

Page 93: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

93

Active/Invasive attacks

Probing attacks:Tap specific parts of a chip (a bus)

Change specific parts reconnect test circuits

...both require special equipment Map entire chip logic If algorithm/implementation unknown...

Page 94: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

94

Active/Invasive attacks Fault attacks:Purposefully cause errors in computation;

prevent unwanted updates (e.g. pincounter) use faulty computation to derive information. check for dummy instructions

How: Change voltage Bombard with light Shake it Drop a hammer on it...

Page 95: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

95

Mifare (also: OV-chip) hacking

Hack of Mifare: e.g. http://www.youtube.com/watch?v=Y8VVKnUdECg

Work by researchers in Nijmegen `Dagkaart’ broken. Later: All cards broken, cloneable Recently: Discussion traceability

Page 96: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

96

SCard breakable, however, ...

Smartcard often not the weakest point Weaknesses in issuing / use / ... (missing security goals? e.g. OV-chip)

Page 97: Who are youjhartog/CourseSecurity/materials/Slides/13-5-Auth.pdf · Java Card (‘95) ... Used in many SIM and ATM cards Standards (ISO 7816, GSM, EMV, VOP, CEPS) 47 Form factors

97

Exercise: DPA attack1. Determine algorithm & location to attack

(done) 2. Gather traces (done) 3. Make Key Hypothesis (i.e. key 00,01...)4. Check Hypothesis Does difference trace show expected peak?

5. Check key value (not in exercise)