The Curse of Small Domains New Attacks on Format-Preserving - - PowerPoint PPT Presentation

the curse of small domains
SMART_READER_LITE
LIVE PREVIEW

The Curse of Small Domains New Attacks on Format-Preserving - - PowerPoint PPT Presentation

The Curse of Small Domains New Attacks on Format-Preserving Encryption Viet Tung Hoang Stefano Tessaro Ni Trieu Florida State University UC Santa Barbara Oregon State University CRYPTO 2018 August 20, 2018 1 Format-Preserving Encryption


slide-1
SLIDE 1

1

The Curse of Small Domains

New Attacks on Format-Preserving Encryption

Viet Tung Hoang Florida State University Stefano Tessaro UC Santa Barbara CRYPTO 2018

August 20, 2018

Ni Trieu Oregon State University

slide-2
SLIDE 2

2

Format-Preserving Encryption (FPE)

  • Property: Ciphertext has the same “format” as the plaintext  Avoid

disrupting the system

5887 3229 0447 4263

Ciphertexts also look like credit-card numbers

Widely used to encrypt credit-card numbers and fields in legacy databases [FIPS 74, BS97 BR02,BRPS09,…]

slide-3
SLIDE 3

3

Format-Preserving Encryption (FPE) FPE

1234-5678-0000-5555 3147-7312-4216-1319 Dom = set of credit-card numbers , set of PINs, set of SSNs, …

FPE = tweakable blockcipher with a general message space Dom

[FIPS 74, BS97 BR02,BRPS09,…] Key Tweak deterministic

slide-4
SLIDE 4

4

The Need for Tweaks

Scenario: DB enforces columns to store valid CC numbers.

Customer CC # John Doe 1234-0001-4321-5678 Jane Doe 9876-0004-3133-7311 … … Alice Crypto 9876-0001-1234-1234

  • Trans. #

CC # 1 1234-0001-4321-5678 2 1234-0001-4321-5678 3 9876-0001-1234-1234 ... … Customer CC # John Doe 4931-3137-3827-5934 Jane Doe 3819-5724-9477-3816 … … Alice Crypto 4820-4728-8439-1872

  • Trans. #

CC # 1 8431-5938-5229-6788 2 8431-5938-5229-6788 3 3015-0101-5343-3134 ... …

FPE-encrypt with key K and tweak “customer” FPE-encrypt with key K and tweak “transaction”

slide-5
SLIDE 5

5

Technical Challenge: FPE Domain Can Be Small

Credit-card numbers: PINs: Even smaller domains: ANSI ASC X9.124 envisions an application for

slide-6
SLIDE 6

6

Real-world FPEs

  • Specified two schemes, FF1 and FF3,

based on Feistel Companies offering FPE HPE Voltage, Veriphone, Ingenico, and

  • thers

Other FPE solutions from industry:

DTP from Protegrity:

  • Claimed to be more secure than NIST’s FPEs
  • Largely follows ad-hoc solution of [BS97]

FNR from Cisco:

  • Proposed but not used
  • Use [NR99] variant of Feistel

suspended but likely to get reinstated

slide-7
SLIDE 7

7

Prior FPE Attacks

Paper Recover Time #Msg per tweak Adaptive Known msg vs target Break [BHT16] A single target

3

No Same right half FF1 FF3 [DV17] Entire codebook Yes N/A FF3 Not applicable to generic Feistel Easily fixed by restricting the tweak space unbroken so far Scheme FF1 FF3 FNR Round # r 10 8 9

N: domain size

slide-8
SLIDE 8

8

Prior FPE Attacks

Paper Recover Time #Msg per tweak Adaptive Known msg vs target Break [BHT16] A single target

3

No Same right half FF1 FF3 [DV17] Entire codebook Yes N/A FF3 No None FF1 FF3 FNR Scheme FF1 FF3 FNR Round # r 10 8 9

N: domain size

Multiple targets Ours

slide-9
SLIDE 9

9

Cost of Our Attack on FF1/FF3

Log of ciphertext # per target Success rate

slide-10
SLIDE 10

10

Expanding versus Contracting

FF1: start with contracting round functions FF3: start with expanding round functions Domain Our cost (for FF1) Our cost (for FF3) [BHT16]’s cost (for FF1) [BHT16]’s cost (for FF3)

FF3’s design choice is inferior

slide-11
SLIDE 11

11

Our Results

Encoding PIN SSN CCN Decimal 460,000 525,000 575,000 Alphanumeric 46,000 51,000 53,000

#ciphertexts needed to recover target with 90% success against DTP

Scheme Attack type Practical for FF1/FF3/FNR Known-plaintext attack Small domains DTP Ciphertext-only attack Any domain

Protegrity uses alphanumeric encoding to enlarge domains  Make DTP actually 10 times weaker

slide-12
SLIDE 12

12

Attack Scenario: Known-Plaintext Attack … …

Random known msg Targets tweaks FPE

… … … … … …

Goal: Recover all targets given all ciphertexts and known msg Assumed to be distinct to avoid trivial attacks, as FPE is deterministic

slide-13
SLIDE 13

13

Feistel-based FPE

r-round Feistel ( for FF1, for FF3) Round functions are modeled as truly random We consider (abstract) domain and are abelian groups is inverse of

M and N can be very small For FF1/FF3:

slide-14
SLIDE 14

14

Attack Idea: Bias

[Patarin 91, BHT16]

Question: Take two inputs and such that

Same right half

What’s the distribution of ? peak at

slide-15
SLIDE 15

15

Using Bias

peak at

The bias is too small to exploit directly, but can be amplified if we have enough plaintext/ciphertext pairs!

[BHT16]

slide-16
SLIDE 16

16

A Wishful Dream

Random known msg Target Suppose we can magically select a known msg X s.t

  • Can trivially recover

Basically [BHT16] attack

  • Plot the frequency histogram of

… … …

Ciphertexts

likely to peak at

slide-17
SLIDE 17

17

Narrowing Known Messages …

Random known msg

Select s.t.

Question: How big is t so that selection is possible w.h.p? Some must have the same right half as the target Classic setting: coupons have truly random types  Our setting: known msg are distinct, so coupons are biased towards new types  Coupon-Collector problem:

  • There are N types of coupons
  • We buy t coupons and wish to have all N types w.h.p.
slide-18
SLIDE 18

18

Pinpointing The Correct Known Message … … … … …

For each , plot the frequency histogram of

There’s likely one column beyond the threshold If

slide-19
SLIDE 19

19

Pinpointing The Correct Known Message … … … … …

For each , plot the frequency histogram of

There’s likely no column beyond the threshold If

slide-20
SLIDE 20

20

How Many Tweaks Needed?

Recovery rate Log (base 2) of q

Theorem: Suppose that we use random distinct known msg under q tweaks, and want to recover p targets. Then the recovery rate is at least

slide-21
SLIDE 21

21

Experiments On FF3

Domain # known msg, t # of tweaks, q Recovery rate Time (min) 33 100% 0.9 66% 0.46 31 100% 5.92 86% 3.06 96 100% 8.72 66% 5.3

Empirical results are even better than theoretical analysis

slide-22
SLIDE 22

22

Generalization … …

Targets Recover all targets given all ciphertexts and known msg

Want:

  • Handle arbitrary distribution of known msg
  • Relax the requirements by recovering just some (not all) targets

Random, distinct known msg

slide-23
SLIDE 23

23

Can recover every satisfying

Generalized Attack … …

Targets Distinct known msg

Select s.t.

distinct right halves To try to recover target :

  • For every , use frequency histogram to

check if

  • If such is found, recover
slide-24
SLIDE 24

24

Conclusion

  • Our attacks are practical for

FF1/FF3/FNR on tiny domains DTP on any domains Recommendation:

  • Don’t use DTP
  • Use double encryption for FF1/FF3 on tiny domains, as suggested by ANSI

Protegrity is already moving to FF1