Defeating Relay Attacks in NFC Payments
Serge Vaudenay
ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE
http://lasec.epfl.ch/
SV 2014 distance-bounding SDTA 14 1 / 42
Defeating Relay Attacks in NFC Payments Serge Vaudenay COLE - - PowerPoint PPT Presentation
Defeating Relay Attacks in NFC Payments Serge Vaudenay COLE POLYTECHNIQUE FDRALE DE LAUSANNE http://lasec.epfl.ch/ SV 2014 distance-bounding SDTA 14 1 / 42 Relay Attacks 1 Distance-Bounding Protocols 2 3 Asymmetric DB Protocols
Serge Vaudenay
ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE
http://lasec.epfl.ch/
SV 2014 distance-bounding SDTA 14 1 / 42
1
Relay Attacks
2
Distance-Bounding Protocols
3
Asymmetric DB Protocols
SV 2014 distance-bounding SDTA 14 2 / 42
1
Relay Attacks
2
Distance-Bounding Protocols
3
Asymmetric DB Protocols
SV 2014 distance-bounding SDTA 14 3 / 42
✛ ✲
SV 2014 distance-bounding SDTA 14 4 / 42
honest prover honest verifier adversary ✲ a ✲ a ✲ a ✛b ✛ b ✛b ✲ c ✲ c ✲ c
SV 2014 distance-bounding SDTA 14 5 / 42
SV 2014 distance-bounding SDTA 14 6 / 42
✲ ✛ ✲ ✛
1
now widely spread
2
payment device: creditcard or smartphone
3
(creditcard) no action by the holder on the creditcard
4
for small amounts: no action by the holder on the terminal
5
larger amounts may need a PIN
SV 2014 distance-bounding SDTA 14 7 / 42
Identification Tokens, or: Solving the Chess Grandmaster Problem [Beth-Desmedt CRYPTO 1990]
basic idea: use time to detect relay attacks assume that relaying a message takes time > 0 use exact time measurement
SV 2014 distance-bounding SDTA 14 8 / 42
10ns = round-trip of 2× 1.5m
SV 2014 distance-bounding SDTA 14 9 / 42
1
Relay Attacks
2
Distance-Bounding Protocols
3
Asymmetric DB Protocols
SV 2014 distance-bounding SDTA 14 10 / 42
Distance-Bounding Protocols [Brands-Chaum EUROCRYPT 1993]
Verifier Prover secret key: x public key: y initialization phase
Commit(m)
← − − − − − − − − − − − −
pick m distance bounding phase for i = 1 to n pick ci start timeri
ci
− − − − − − − − − − − − →
stop timeri
ri
← − − − − − − − − − − − −
ri = mi ⊕ ci check timers termination phase check responses
← − − − − − − − − − − − −
check signature
Signx (c,r)
← − − − − − − − − − − − −
OutV
− − − − − − − − − − − − →
SV 2014 distance-bounding SDTA 14 11 / 42
to answer ri on challenge ci should take a few nanoseconds almost no time to do computation no time to receive several bits (period in microseconds) nearly no time to digitize an analog signal we need an ad-hoc chip for transmission and computation
SV 2014 distance-bounding SDTA 14 12 / 42
a malicious prover P∗ tries to prove that he is close to a verifier V
SV 2014 distance-bounding SDTA 14 13 / 42
for some applications, a malicious prover could be a threat cars want to have the key holder inside the car doors do not want to open for someone who is not here payment booths want remote payment to be impossible
SV 2014 distance-bounding SDTA 14 14 / 42
Distance Hijacking Attacks on Distance Bounding Protocols [Cremers-Rasmussen-Schmidt- ˇ Capkun IEEE S&P 2012]
a malicious prover P∗ tries to prove that he is close to a verifier V by taking advantage of other provers P′
SV 2014 distance-bounding SDTA 14 15 / 42
Major Security Problems with the “Unforgeable” (Feige)-Fiat-Shamir Proofs of Identity and How to Overcome Them [Desmedt SECURICOM 1988]
an adversary A tries to prove that a prover P is close to a verifier V
SV 2014 distance-bounding SDTA 14 16 / 42
An Efficient Distance Bounding RFID Authentication Protocol [Avoine-Tchamkerten ISC 2009]
an adversary A tries to prove that a prover P is close to a verifier V
SV 2014 distance-bounding SDTA 14 17 / 42
Major Security Problems with the “Unforgeable” (Feige)-Fiat-Shamir Proofs of Identity and How to Overcome Them [Desmedt SECURICOM 1988]
a malicious prover P∗ helps an adversary A to prove that P∗ is close to a verifier V without giving A another advantage
SV 2014 distance-bounding SDTA 14 18 / 42
Identification Tokens, or: Solving the Chess Grandmaster Problem [Beth-Desmedt CRYPTO 1990]
embed provers in tamper-resistant devices
= assume that provers are honest!
SV 2014 distance-bounding SDTA 14 19 / 42
without post-authentication Hancke-Kuhn DBENC TDB SKI with post-authentication Swiss-Knife Fischlin-Onete DB1-DB2-DB3 asymmetric Brands-Chaum DBPK-Log ProProx privDB
SV 2014 distance-bounding SDTA 14 20 / 42
some have no security proofs
→ some are broken
some have “semi-formal” security proofs
→ some have instances which could be broken
some have wrong security proofs
→ some are broken
SV 2014 distance-bounding SDTA 14 21 / 42
success probability of best known attacks (θ < 1 s.t. 2−θn = negl)
Protocol Success Probability DF MF TF
†
Brands & Chaum
(1/2)n (1/2)n
1
†
Bussard & Bagga 1
(1/2)n
1
†
ˇ Capkun et al.
(1/2)n (1/2)n
1
†
Hancke & Kuhn
(3/4)n to 1 (3/4)n
1
†
Reid et al.
(3/4)n to 1
1
(3/4)θn †
Singel´ ee & Preneel
(1/2)n (1/2)n
1
†
Tu & Piramuthu
(3/4)n
1
(3/4)θn †
Munilla & Peinado
(3/4)n (3/5)n
1
(3/4)n (1/2)n to 1 (3/4)θn †
Kim & Avoine
(7/8)n (1/2)n
1
(3/4)n to 1 (2/3)n to 1 (5/6)θn
(3/4)n (2/3)n (5/6)θn
(3/4)n (3/4)n γ = γ′
(1/3)n (1/3)n (2/3)θn
(1/ √
2)n
(1/2)n (1/ √
2)θn
SV 2014 distance-bounding SDTA 14 22 / 42
success probability of best known attacks
Protocol Success Probability DF MF TF
†
Brands & Chaum tl(n,τ,1/2) tl(n,τ,1/2) 1
†
Bussard & Bagga 1 tl(n,τ,1/2) 1
†
ˇ Capkun et al. tl(n,τ,1/2) tl(n,τ,1/2) 1
†
Hancke & Kuhn tl(n,τ,3/4) to 1 tl(n,τ,3/4) 1
†
Reid et al. tl(n,τ,3/4) to 1 1 1
†
Singel´ ee & Preneel tl(n,τ,1/2) tl(n,τ,1/2) 1
†
Tu & Piramuthu tl(n,τ,3/4) 1 1
†
Munilla & Peinado tl(n,τ,3/4) tl(n,τ,3/5) 1
†
Swiss-Knife tl(n,τ,3/4) tl(n,τ,1/2) to 1 1
†
Kim & Avoine tl(n,τ,7/8) tl(n,τ,1/2) 1
†
Avoine et al. tl(n,τ,3/4) to 1 tl(n,τ,2/3) to 1 1
tl(n,τ,3/4) tl(n,τ,2/3) tl(n,τ,5/6)
tl(n,τ,3/4) tl(n,τ,3/4)
γ = γ′
tl(n,τ,1/3) tl(n,τ,1/3) tl(n,τ,2/3)
tl( n
2,τ− n 2,1/2)
tl(n,τ,1/2) tl( n
2,τ− n 2,1/2) SV 2014 distance-bounding SDTA 14 23 / 42
Serge Katerina Ioana
SV 2014 distance-bounding SDTA 14 24 / 42
SKI non-binary challenges Fischlin-Onete different TF-resistance model DB1 and DB2 (combine both)
SV 2014 distance-bounding SDTA 14 25 / 42
DF
10 20 30 40 50 60 70 80 20 40 60 80 100 120 140
SKI and FO DB1 q = 3 DB1 q = 4 DB2 DB3
MF
10 20 30 40 50 60 70 80 20 40 60 80 100 120 140
SKI FO DB1 q = 3 DB1 q = 4 DB2 and DB3
TF
5 10 15 20 25 20 40 60 80 100 120 140
SKI DB1 q = 3 DB1 q = 4 DB2
SV 2014 distance-bounding SDTA 14 26 / 42
Verifier (b fixed of weight n
2 )
Prover secret: x secret: x initialization phase pick µ ∈ Zs
2,NV ∈ {0,1}ℓnonce NP
← − − − − − − − − − − − − −
pick NP ∈ {0,1}ℓnonce a = fx(NP,NV ,µ)
NV ,µ
− − − − − − − − − − − − − →
a = fx(NP,NV ,µ) x′ = µ· x x′ = µ· x distance bounding phase for i = 1 to n pick ci ∈ {0,1} start timeri
ci
− − − − − − − − − − − − − →
receive c′
i
receive ri, stop timeri
r′
i
← − − − − − − − − − − − − −
r′
i = ai ⊕ c′ i (x′ ⊕ bi)
verification phase receive c′′
c′,tag
← − − − − − − − − − − − − −
tag = fx(NP,NV ,µ,c′) check tag = fx(NP,NV ,µ,c′′), ci = c′′
i , ri, and timeri correct OutV
− − − − − − − − − − − − − →
SV 2014 distance-bounding SDTA 14 27 / 42
Verifier (b fixed of weight n
2 )
Prover secret: x secret: x initialization phase pick µ ∈ Zs
2,NV ∈ {0,1}ℓnonce NP
← − − − − − − − − − − − − −
pick NP ∈ {0,1}ℓnonce a = fx(NP,NV ,µ)
NV ,µ
− − − − − − − − − − − − − →
a = fx(NP,NV ,µ) x′ = µ· x x′ = µ· x distance bounding phase for i = 1 to n pick ci ∈ {0,1} ci ri r′
i = ai ⊕ random·(x′ ⊕ bi)
. . .
it is correct for sure for n
2 rounds (for all others, probability is 1 2)
Pr[pass] =
(
1 2
) n
2 SV 2014 distance-bounding SDTA 14 28 / 42
Verifier Adversary Prover secret: x secret: x initialization phase
NP
← − − − − − − − − − − − −
NP
← − − − − − − − − − − − −
NV ,µ
− − − − − − − − − − − − →
NV ,µ
− − − − − − − − − − − − →
distance bounding phase for i = 1 to n pick c∗
i c∗
i
− − − − − − − − − − − − →
ci
− − − − − − − − − − − − →
r∗
i
← − − − − − − − − − − − −
ri
← − − − − − − − − − − − −
ri = r∗
i
. . .
Pr[pass] =
(
1 2
)n
SV 2014 distance-bounding SDTA 14 29 / 42
Verifier Adversary Malicious Prover secret: x secret: x initialization phase
NP
← − − − − − − − − − − − −
NP
← − − − − − − − − − − − −
NV ,µ
− − − − − − − − − − − − →
NV ,µ
− − − − − − − − − − − − →
table ci→r∗
i
← − − − − − − − − − − − −
distance bounding phase for i = 1 to n
ci
− − − − − − − − − − − − →
(for half of the i, (ci → r∗
i ) = (ci → ri) r∗
i
← − − − − − − − − − − − −
. . .
Pr[pass] =
(
1 2
) n
2 SV 2014 distance-bounding SDTA 14 30 / 42
1
Relay Attacks
2
Distance-Bounding Protocols
3
Asymmetric DB Protocols
SV 2014 distance-bounding SDTA 14 31 / 42
the prover does not want to share his secret with the verifier could have a public key (and a certificate from the issuing authority) nice for payment systems may also need privacy
SV 2014 distance-bounding SDTA 14 32 / 42
protocol MF DF DH TF Privacy Strong p. Brands-Chaum
!! !!
!! ProProx
distance-bounding SDTA 14 33 / 42
Verifier y = ComH(x) Prover public: y
(yj = Com(xj;H(x,j)))
secret: x initialization phase for j = 1 to s in parallel (b: a vector of weight n
2 )
pick ai,j,ρi,j, i = 1,...,n
A1,j,...,An,j
← − − − − − − − − − − − − − − − − − − −
Ai,j = Com(ai,j;ρi,j) challenge phase for i = 1 to n and j = 1 to s pick ci,j ∈ Z2 start timeri,j
ci,j
− − − − − − − − − − − − − − − − − − − →
receive c′
i,j
receive ri,j, stop timeri,j
r′
i,j
← − − − − − − − − − − − − − − − − − − −
r′
i,j = ai,j + c′ i,jbi + c′ i,jxj
verification phase check timeri,j ≤ 2B zi,j = Ai,j
( θbi yj )ci,j θ−ri,j
ZKPκ(zi,j:ζi,j;i,j)
← − − − − − − − − − − − − − − − − − − → ζi,j = ρi,jH(x,j)c′
i,j
OutV
− − − − − − − − − − − − − − − − − − − →
SV 2014 distance-bounding SDTA 14 34 / 42
Verifier y = ComH(x) Prover public: y
(yj = Com(xj;H(x,j)))
secret: x initialization phase pick aj,ρj, j = 1,...,s
A1,...,As
← − − − − − − − − − − − − − − − − − − −
Aj = Com(aj;ρj) pick b ∈ Zs
2 b
− − − − − − − − − − − − − − − − − − − →
challenge phase for j = 1 to s pick cj ∈ Z2 start timerj
cj
− − − − − − − − − − − − − − − − − − − →
receive c′
j
receive rj, stop timerj
r′
j
← − − − − − − − − − − − − − − − − − − −
r′
j = aj + c′ j bj + c′ j xj
verification phase check timerj ≤ 2B zj = Aj
( θbj yj )cj θ−rj
ZKPκ(zj:ζj;j)
← − − − − − − − − − − − − − − − − − − → ζj = ρjH(x,j)c′
j
OutV
− − − − − − − − − − − − − − − − − − − →
SV 2014 distance-bounding SDTA 14 35 / 42
Theorem If Com is a perfectly binding, computationally hiding, and homomorphic bit commitment, ComH is one-way, ZKPκ is a complete κ-sound computationally zero-knowledge proof of membership for κ = negl(λ), then the protocol is a sound and secure PoPoK. Furthermore, the protocol resists to distance frauds.
SV 2014 distance-bounding SDTA 14 36 / 42
bound s pDF pSec pSound proven 80 2−22 2−12 2−11 empirical 80 2−22 2−80 2−80 proven bounds pDF
= (
3 4
)s +κ
pSec
= (
1 2
)⌊s/log2 s⌋ +κ+ negl
pSound
=
2
(
1 2
)⌊s/log2 s⌋ + 2κ
proven bounds pDF
= (
3 4
)s
pSec
= (
1 2
)s
pSound
= (
1 2
)s
SV 2014 distance-bounding SDTA 14 37 / 42
Verifier Prover secret key: skV secret key: skP public key: pkV public key: pkP pick N
N
− − − − − − − − − − − − − →
pick s, σ = SignskP (N) s∥pk∥N∥σ = DecskV (e)
e
← − − − − − − − − − − − − −
e = EncpkV (s∥pkP∥N∥σ) check N, Verifypk(σ,N), Validate(pk)
symDB(s)
← − − − − − − − − − − − →
OutV
− − − − − − − − − − − − − →
private output: pk
requires encryption and signature (EMV cards could do that)
SV 2014 distance-bounding SDTA 14 38 / 42
Verifier Prover secret key: skV secret key: skP public key: pkV public key: pkP pick N
N
− − − − − − − − − − − − − →
pick s, σ = SignskP (N) s∥pk∥N∥σ = DecskV (e)
e
← − − − − − − − − − − − − −
e = EncpkV (s∥pkP∥N∥σ) check N, Verifypk(σ,N), Validate(pk) pick m ∈ {0,1}2n
m
− − − − − − − − − − − − − →
a = s ⊕ m a = s ⊕ m challenge phase for i = 1 to n pick ci ∈ {0,1} start timeri
ci
− − − − − − − − − − − − − →
stop timeri
ri
← − − − − − − − − − − − − −
ri = a2i+ci−1 verification phase check timeri ≤ 2B, ri = a2i+ci−1
OutV
− − − − − − − − − − − − − →
private output: pk
SV 2014 distance-bounding SDTA 14 39 / 42
Verifier Prover secret: s secret: s pick m ∈ {0,1}2n
m
− − − − − − − − − − − − − →
a = s ⊕ m a = s ⊕ m challenge phase for i = 1 to n pick ci ∈ {0,1} start timeri
ci
− − − − − − − − − − − − − →
stop timeri
ri
← − − − − − − − − − − − − −
ri = a2i+ci−1 verification phase check timeri ≤ 2B, ri = a2i+ci−1
OutV
− − − − − − − − − − − − − →
could use n = 49 (for 2−20 security) or n = 25 (for 2−10 security)
SV 2014 distance-bounding SDTA 14 40 / 42
Theorem If the signature is UF-CMA-secure and the cryptosystem is IND-CCA-secure, then the protocol is
1
DF-secure
2
MF-secure
3
DH-secure
4
wide-strong private in the HPVP model
SV 2014 distance-bounding SDTA 14 41 / 42
good models for DB protocols many weak protocols around more confidence in recent symmetric DB, optimal new asymmetric DB protocols appearing could defeat relay attacks in payment systems
SV 2014 distance-bounding SDTA 14 42 / 42