Automatic Search for Linear Trails of the SPECK Family Yuan Yao 1 , - - PowerPoint PPT Presentation

automatic search for linear trails of the speck family
SMART_READER_LITE
LIVE PREVIEW

Automatic Search for Linear Trails of the SPECK Family Yuan Yao 1 , - - PowerPoint PPT Presentation

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallns Algorithm Summary Automatic Search for Linear Trails of the SPECK Family Yuan Yao 1 , 2 Bin Zhang 2 Wenling Wu 2 1 TCA Laboratory, Institute of Software, Chinese


slide-1
SLIDE 1

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary

Automatic Search for Linear Trails of the SPECK Family

Yuan Yao1,2 Bin Zhang2 Wenling Wu2

1TCA Laboratory, Institute of Software, Chinese Academy of Sciences 2University of Chinese Academy of Sciences

Information Security Conference, 2015

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-2
SLIDE 2

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary

Outline

1

Introduction Background Our Contribution

2

Linear Cryptanalysis Against SPECK Search Linear Trails Linear Distinguishers Key Recovery Attacks

3

An Implementation of Wallén’s Algorithm

4

Summary

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-3
SLIDE 3

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Background Our Contribution

SPECK

By NSA in 2013. Lightweight. Feistel-like. ARX. For software applications.

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-4
SLIDE 4

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Background Our Contribution

Previous Work

Differential Analysis by Alex Biryukov et. al. at CT-RSA 2014. Differential Analysis by Farzaneh Abed et. al. at FSE 2014. Differential Analysis by Alex Biryukov et. al. at FSE 2014. Differential Analysis by Itai Dinur at SAC 2014. Differential Fault Analysis by Harshal Tupsamudre et. al. at FDTC 2014.

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-5
SLIDE 5

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Background Our Contribution

Previous Work

Differential Analysis by Alex Biryukov et. al. at CT-RSA 2014. Differential Analysis by Farzaneh Abed et. al. at FSE 2014. Differential Analysis by Alex Biryukov et. al. at FSE 2014. Differential Analysis by Itai Dinur at SAC 2014. Differential Fault Analysis by Harshal Tupsamudre et. al. at FDTC 2014.

Linear Cryptanalysis???

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-6
SLIDE 6

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Background Our Contribution

Our Contribution

Linear cryptanalysis of SPECK. An implementation of Wallén’s algorithm.

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-7
SLIDE 7

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Basics

Definition (Correlation) cX 2Pr(X = 0)−1.

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-8
SLIDE 8

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Basics

Definition (Correlation) cX 2Pr(X = 0)−1. H0 : cX = 0 ← → H1 : cX = 0

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-9
SLIDE 9

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Basics

Definition (Correlation) cX 2Pr(X = 0)−1. H0 : cX = 0 ← → H1 : cX = 0 Lemma (Piling-up Lemma) cX⊕Y = cXcY .

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-10
SLIDE 10

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Basics

Definitions (Inner Product) X ·Y = n−1

i=0 Xi&Yi ∈ F2.

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-11
SLIDE 11

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Linear Approximation

r rounds encryption

  • S[0]
  • S[r]

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-12
SLIDE 12

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Linear Approximation

r rounds encryption

  • S[0]·

Γ[0]

  • S[r]·

Γ[r]

  • S[0]·

Γ[0]⊕ S[r]· Γ[r] ∈ F2

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-13
SLIDE 13

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Linear Trail

  • S[0]·

Γ[0]

  • S[1]·

Γ[1]

  • S[2]·

Γ[2] . . .

  • S[r −1]·

Γ[r −1]

  • S[r]·

Γ[r]

  • S[0]·

Γ[0]⊕ S[r]· Γ[r]

  • r−1
  • i=0
  • S[i]·

Γ[i]⊕ S[i +1]· Γ[i +1]

  • Yuan Yao, Bin Zhang, Wenling Wu

Automatic Search for Linear Trails of the SPECK Family

slide-14
SLIDE 14

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Linear Trail

  • S[0]·

Γ[0]

  • S[1]·

Γ[1]

  • S[2]·

Γ[2] . . .

  • S[r −1]·

Γ[r −1]

  • S[r]·

Γ[r]

  • S[0]·

Γ[0]⊕ S[r]· Γ[r]

  • r−1
  • i=0
  • S[i]·

Γ[i]⊕ S[i +1]· Γ[i +1]

  • Yuan Yao, Bin Zhang, Wenling Wu

Automatic Search for Linear Trails of the SPECK Family

slide-15
SLIDE 15

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Matsui Search

Proposed at EUROCRYPT 1994. Branch-and-bound: |B[r −s]∏s

i=1 c[i]| ≤ |B[r]|

s rounds r −s rounds ∏s

i=1|c[i]| =

|B[r −s]| ≥ ≤ |B[r]|

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-16
SLIDE 16

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Matsui Search Algorithm

1: function Search(B, T = {}) 2:

r ← Sizeof(B)−1,s ← Sizeof(T)

3:

if s = r then

4:

ˆ B[r] ← ∏r

i=1 c[i]

5:

else

6:

for T ′ in Extend(T) do

7:

if |B[r −(s +1)]∏s+1

i=1 c′[i]| > | ˆ

B[r]| then

8:

Search(B, T ′)

9:

else

10:

return

11:

end if

12:

end for

13:

end if

14: end function

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-17
SLIDE 17

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Round Function of SPECK

≫ ς

⊞ ⊕ ⊕

≪ τ

  • S[i]L
  • S[i +1]L
  • S[i +1]R
  • S[i]R
  • k[i]

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-18
SLIDE 18

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Approximations of Primitives

  • Γ1
  • Γ2
  • Γ3
  • Γ1 ⊕

Γ2 ⊕ Γ3 = ≪ t

  • Γ1
  • Γ2
  • Γ2 =

Γ1 ≪ t

  • Γ1
  • Γ2
  • Γ3
  • Γ1 =

Γ2 = Γ3

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-19
SLIDE 19

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Approximations of Primitives

  • Γ1
  • Γ2
  • Γ3
  • Γ1 ⊕

Γ2 ⊕ Γ3 = ≪ t

  • Γ1
  • Γ2
  • Γ2 =

Γ1 ≪ t

  • Γ1
  • Γ2
  • Γ3
  • Γ1 =

Γ2 = Γ3

Modulo Addition???

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-20
SLIDE 20

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Approximations of Modulo Addition

Definition c ( u, v, w) c

u·( Z1⊞ Z2)⊕ v· Z1⊕ w· Z2.

  • v
  • w
  • u

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-21
SLIDE 21

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Linear Approximation Table

Enumerate u, v, w, calculate c ( u, v, w), and sort. Time: O

  • 23n

, Memory: O

  • 23n

.

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-22
SLIDE 22

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Linear Approximation Table

Enumerate u, v, w, calculate c ( u, v, w), and sort. Time: O

  • 23n

, Memory: O

  • 23n

.

Generate Online!!!

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-23
SLIDE 23

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Wallén’s Theorem

Theorem Let S0(0,0) {null}, S0(n,k) = S1(n,k) / 0 when k < 0 or k ≥ n > 0, and S0(n,k)

  • S0(n −1,k) {0}
  • S1(n −1,k −1) {1,2,4,7}
  • S1(n,k)
  • S0(n −1,k) {7}
  • S1(n −1,k −1) {0,3,5,6}
  • therwise, where S⋆ Ω {

a b | a ∈ S⋆, b ∈ Ω}. Then S(n,k) S0(n,k)∪S1(n,k) is the set of all masks such that c ( u, v, w) = ±2−k.

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-24
SLIDE 24

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Wallén’s Theorem

Example S0(n,0) = {(0···00)}, S1(n,0) = {(0···07)}, thus S(n,0) = { ((0···00),(0···00),(0···00)), ((0···01),(0···01),(0···01)) } is the set of all masks such that c ( u, v, w) = ±1.

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-25
SLIDE 25

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Top-down Method

S⋆(4,2) S0(3,2) S0(2,2) S1(2,1) S0(1,1) S1(1,0) S0(0,0)S1(0,−1) S1(3,1) S0(2,1) S0(1,1) S1(1,0) S0(0,0)S1(0,−1) S1(2,0) S0(1,0) S0(0,0)S1(0,−1) S1(1,−1)

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-26
SLIDE 26

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Bottom-up Method

S0(0,0) S0(1,0) S0(2,0) S1(2,0) S0(3,1) S1(3,1) S0(4,2) S1(4,2) S1(1,0) S0(2,1) S0(3,1) S1(3,1) S0(4,2) S1(4,2) S1(2,1) S0(3,2) S0(4,2) S1(4,2) S1(3,2)

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-27
SLIDE 27

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Extend()

≫ ς

⊞ ⊕ ⊕

≪ τ

  • Γ[i]L
  • v[i]
  • u[i]
  • Γ[i +1]L
  • Γ[i +1]R
  • Γ[i]R
  • w[i]
  • u[i] =

Γ[i +1]L ⊕ Γ[i +1]R

  • v[i] =

Γ[i]L ≫ ς

  • w[i] =

Γ[i]R ⊕

  • Γ[i +1]R ≫ τ
  • Yuan Yao, Bin Zhang, Wenling Wu

Automatic Search for Linear Trails of the SPECK Family

slide-28
SLIDE 28

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Extend()

  • u[r] =

X[r +1]⊕ Y [r +1]

  • u[r −1] = (

v[r] ≪ ς)⊕ w[r]⊕

  • Y [r +1] ≫ τ
  • u[i] = (

v[i +1] ≪ ς)⊕ w[i +1]⊕(( u[i +1]⊕( v[i +2] ≪ ς)) ≫ τ)

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-29
SLIDE 29

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Search Results

SPECK-32 Rounds(r) 1 2 3 4 5 6 7 8 |B[r]| 1 1 2−1 2−3 2−5 2−7 2−9 2−12 Rounds(r) 9 10 11 12 13 14 15 16 |B[r]| 2−14 2−17 2−19 2−20 2−22 2−24 2−26 2−28 Rounds(r) 17 18 19 20 21 22 |B[r]| 2−30 2−34 2−36 2−38 2−40 2−42 SPECK-48/ 64/ 96/ 128: Omitted.

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-30
SLIDE 30

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Search Results

SPECK-32 Rounds(r) 1 2 3 4 5 6 7 8 |B[r]| 1 1 2−1 2−3 2−5 2−7 2−9 2−12 Rounds(r) 9 10 11 12 13 14 15 16 |B[r]| 2−14 2−17 2−19 2−20 2−22 2−24 2−26 2−28 Rounds(r) 17 18 19 20 21 22 |B[r]| 2−30 2−34 2−36 2−38 2−40 2−42 SPECK-48/ 64/ 96/ 128: Omitted.

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-31
SLIDE 31

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Linear Distinguishers

Block Length Trail Length Correlation Rounds Data 32 9 2−14 10 228 48 9 2−20 10 240 64 11 2−25 12 250 64 12 2−31 13 262 96 6 2−11 7 222 128 6 2−11 7 222

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-32
SLIDE 32

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary Search Linear Trails Linear Distinguishers Key Recovery Attacks

Key Recovery Attacks

Block/ Key Length Rounds (this paper/ Dinur/ Total) Data (this pa- per/ Dinur) Average Time (this paper/ Dinur) 32/ 64 12/ 14/ 22 230.8668/231 261.2164/263 48/ 72 11/ 14/ 22 243.727/241 268.345/265 48/ 96 12/ 15/ 23 243.727/241 292.345/289 64/ 96 13/ 18/ 26 254.6279/261 286.1551/293 64/ 96 14/ 18/ 26 262.7302/261 295.8714/293 64/ 128 14/ 19/ 27 254.8029/261 2118.155/2125 64/ 128 15/ 19/ 27 262.7302/261 2127.871/2125 96/ 96 8/ 16/ 28 227.6463/285 274.8954/285 96/ 144 9/ 17/ 29 227.6463/285 2122.895/2133 128/ 128 8/ 17/ 32 228.2959/2113 292.7363/2113 128/ 192 9/ 18/ 33 228.2959/2113 2156.736/2177 128/ 256 7/ 19/ 34 228.2959/2113 2220.736/2241

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-33
SLIDE 33

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary

Masks of Carry

Example

  • u = (1100),

v = w = (1000), then

  • φ =

v ⊕ u = (0100),

  • ϕ =

w ⊕ u = (0100).

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-34
SLIDE 34

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary

Common Prefix Mask & Correlation

Lemma Let δ be the CPM of u, v,

  • w. Then

c ( u, v, w) =    (−1)wt

  • δ

φ ϕ

  • 2−wt
  • δ
  • ,

if φ = φ δ and ϕ = ϕ δ 0,

  • therwise

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-35
SLIDE 35

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary

More Explicit Formula

Theorem

  • δ is the CPM of

u, v, w, and c( u, v, w) = 0 if and only if

  • φ =

φ δ

  • ϕ =

ϕ δ

  • γ ≫ 1 =
  • u ⊕

δ

  • ≫ 1

δ

  • 0 =
  • (

u ≫ 1)⊕ δ

  • δ ⊕

1

  • ≫ 1
  • 0 =
  • (

v ≫ 1)⊕ δ

  • δ ⊕

1

  • ≫ 1
  • 0 =
  • (

w ≫ 1)⊕ δ

  • δ ⊕

1

  • ≫ 1
  • Yuan Yao, Bin Zhang, Wenling Wu

Automatic Search for Linear Trails of the SPECK Family

slide-36
SLIDE 36

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary

CPM Method

1 Generate

δ in increasing order of Hamming weight.

2 Generate unknowns in

u, v, w.

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-37
SLIDE 37

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary

Performance Comparison

Task: Generating n−1

k=0 S(n,k).

Platform: 32-bit Win7 with Visual C++ 2015 CTP optimized by /Ox.

2 4 6 8 10 12 14 16 18 2−23 2−18 2−13 2−8 2−3 22 27 212 217 n time (seconds) The Top-down Method The Bottom-up Method The CPM Method

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-38
SLIDE 38

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary

Conclusions

It is hard to find linear trails for large blocks. SPECK-32 is immune to the 1-dimensional linear cryptanalysis. Linear cryptanalysis seems less efficient than differential cryptanalysis to SPECK.

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-39
SLIDE 39

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary

Further Work

Threshold search. Vectorial linear cryptanalysis. Apply the search to other ARX ciphers.

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-40
SLIDE 40

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary

Q & A

Q & A

yaoyuan@tca.iscas.ac.cn

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family

slide-41
SLIDE 41

Introduction Linear Cryptanalysis Against SPECK An Implementation of Wallén’s Algorithm Summary

Acknowledgment

Thanks to my family, my supervisors, and my friends. Thanks to ISC, and anonymous reviewers. Thanks to all of you.

Yuan Yao, Bin Zhang, Wenling Wu Automatic Search for Linear Trails of the SPECK Family