Error Amplification in Code-based Cryptography Alexander Nilsson 1,2 - - PowerPoint PPT Presentation

error amplification in code based cryptography
SMART_READER_LITE
LIVE PREVIEW

Error Amplification in Code-based Cryptography Alexander Nilsson 1,2 - - PowerPoint PPT Presentation

Error Amplification in Code-based Cryptography Alexander Nilsson 1,2 Thomas Johansson 1 Paul Stankovski Wagner 1 August 27, 2019 1 Dept. of Electrical and Information Technology, Lund University, Sweden 2 Advenica AB, Malm, Sweden WALLENBERG


slide-1
SLIDE 1

Error Amplification in Code-based Cryptography

Alexander Nilsson1,2 Thomas Johansson1 Paul Stankovski Wagner1 August 27, 2019

  • 1Dept. of Electrical and Information Technology, Lund University, Sweden

2Advenica AB, Malmö, Sweden

WALLENBERG AI, AUTONOMOUS SYSTEMS AND SOFTWARE PROGRAM

slide-2
SLIDE 2

Background Code-based Cryptography Previous work Attack Scenario Contributions The Chaining method Generating e0 Results Amplification effect Wrapping it up

slide-3
SLIDE 3

Code-based Cryptography

  • One of the major branches of cryptographic post-quantum

research.

  • Security based on hardness of decoding random linear

codes.

  • The McElice cryptosystem from 1978, using binary Goppa

codes, is still secure today.

  • Large keys!

1

slide-4
SLIDE 4

Code-based Cryptography

  • One of the major branches of cryptographic post-quantum

research.

  • Security based on hardness of decoding random linear

codes.

  • The McElice cryptosystem from 1978, using binary Goppa

codes, is still secure today.

  • Large keys!

1

slide-5
SLIDE 5

Code-based Cryptography

  • One of the major branches of cryptographic post-quantum

research.

  • Security based on hardness of decoding random linear

codes.

  • The McElice cryptosystem from 1978, using binary Goppa

codes, is still secure today.

  • Large keys!

1

slide-6
SLIDE 6

Code-based Cryptography

  • One of the major branches of cryptographic post-quantum

research.

  • Security based on hardness of decoding random linear

codes.

  • The McElice cryptosystem from 1978, using binary Goppa

codes, is still secure today.

  • Large keys!

1

slide-7
SLIDE 7

QC-MDPC (1/5)

Quasi-Cyclic Medium Density Parity Check is a variant of the McEliece cryptosystem [Mis+12]:

  • More compact keys by using cyclic structures in the

key-matrices.

  • Encryption simply: c

mG e

  • Uses iterative bitflipping decoding in the decryption stage
  • Decryption Failure Rate (DFR), is non-zero.

2

slide-8
SLIDE 8

QC-MDPC (1/5)

Quasi-Cyclic Medium Density Parity Check is a variant of the McEliece cryptosystem [Mis+12]:

  • More compact keys by using cyclic structures in the

key-matrices.

  • Encryption simply: c

mG e

  • Uses iterative bitflipping decoding in the decryption stage
  • Decryption Failure Rate (DFR), is non-zero.

2

slide-9
SLIDE 9

QC-MDPC (1/5)

Quasi-Cyclic Medium Density Parity Check is a variant of the McEliece cryptosystem [Mis+12]:

  • More compact keys by using cyclic structures in the

key-matrices.

  • Encryption simply: c ← mG + e
  • Uses iterative bitflipping decoding in the decryption stage
  • Decryption Failure Rate (DFR), is non-zero.

2

slide-10
SLIDE 10

QC-MDPC (1/5)

Quasi-Cyclic Medium Density Parity Check is a variant of the McEliece cryptosystem [Mis+12]:

  • More compact keys by using cyclic structures in the

key-matrices.

  • Encryption simply: c ← mG + e
  • Uses iterative bitflipping decoding in the decryption stage
  • Decryption Failure Rate (DFR), is non-zero.

2

slide-11
SLIDE 11

QC-MDPC (1/5)

Quasi-Cyclic Medium Density Parity Check is a variant of the McEliece cryptosystem [Mis+12]:

  • More compact keys by using cyclic structures in the

key-matrices.

  • Encryption simply: c ← mG + e
  • Uses iterative bitflipping decoding in the decryption stage
  • Decryption Failure Rate (DFR), is non-zero.

2

slide-12
SLIDE 12

QC-MDPC (2/5)

A (n,r,w)-QC-MDPC code, is a linear code with an error correcting capability t, length n, codimension r and with a row weight w in the parity check matrix H. Additionally we have that n = n0r. Suggested parameters for 80-bit security: n0 2 n 9602 r 4801 w 90 t 84 Sparse! 99 bits out of 100 are zero in H.

3

slide-13
SLIDE 13

QC-MDPC (2/5)

A (n,r,w)-QC-MDPC code, is a linear code with an error correcting capability t, length n, codimension r and with a row weight w in the parity check matrix H. Additionally we have that n = n0r. Suggested parameters for 80-bit security: n0 = 2, n = 9602, r = 4801, w = 90, t = 84 Sparse! 99 bits out of 100 are zero in H.

3

slide-14
SLIDE 14

QC-MDPC (2/5)

A (n,r,w)-QC-MDPC code, is a linear code with an error correcting capability t, length n, codimension r and with a row weight w in the parity check matrix H. Additionally we have that n = n0r. Suggested parameters for 80-bit security: n0 = 2, n = 9602, r = 4801, w = 90, t = 84 Sparse! ≈ 99 bits out of 100 are zero in H.

3

slide-15
SLIDE 15

QC-MDPC (3/5)

The secret key H ∈ Fr×n

2

is constructed as H = [H0|H1| . . . |Hn0−1], where Hi is a circulant r × r matrix. For n0 2, we get H h0 0 h0 1 h0 r

1

h0 r

1

h0 0 h0 r

2

. . . . . . ... . . . h0 1 h0 2 h0 0 h1 0 h1 1 h1 r

1

h1 r

1

h1 0 h1 r

2

. . . . . . ... . . . h1 1 h1 2 h1 0 Knowledge of h0 (the first row of H0) is sufficient for complete key recovery.

4

slide-16
SLIDE 16

QC-MDPC (3/5)

The secret key H ∈ Fr×n

2

is constructed as H = [H0|H1| . . . |Hn0−1], where Hi is a circulant r × r matrix. For n0 = 2, we get H =             h0,0 h0,1 · · · h0,r−1 h0,r−1 h0,0 · · · h0,r−2 . . . . . . ... . . . h0,1 h0,2 · · · h0,0             h1,0 h1,1 · · · h1,r−1 h1,r−1 h1,0 · · · h1,r−2 . . . . . . ... . . . h1,1 h1,2 · · · h1,0             Knowledge of h0 (the first row of H0) is sufficient for complete key recovery.

4

slide-17
SLIDE 17

QC-MDPC (3/5)

The secret key H ∈ Fr×n

2

is constructed as H = [H0|H1| . . . |Hn0−1], where Hi is a circulant r × r matrix. For n0 = 2, we get H =             h0,0 h0,1 · · · h0,r−1 h0,r−1 h0,0 · · · h0,r−2 . . . . . . ... . . . h0,1 h0,2 · · · h0,0             h1,0 h1,1 · · · h1,r−1 h1,r−1 h1,0 · · · h1,r−2 . . . . . . ... . . . h1,1 h1,2 · · · h1,0             Knowledge of h0 (the first row of H0) is sufficient for complete key recovery.

4

slide-18
SLIDE 18

QC-MDPC (4/5)

Public key G ∈ F(n−r)×n

2

is constructed as follows: G =         I       (H−1

n0−1 · H0)T

(H−1

n0−1 · H1)T

. . . (H−1

n0−1 · Hn0−2)T

              Encryption of plaintext m

n r 2

into c

n 2 is given by:

  • 1. Generating random e

n 2 with Hamming weight, wt e ,

less than t.

  • 2. Computing c

mG e.

5

slide-19
SLIDE 19

QC-MDPC (4/5)

Public key G ∈ F(n−r)×n

2

is constructed as follows: G =         I       (H−1

n0−1 · H0)T

(H−1

n0−1 · H1)T

. . . (H−1

n0−1 · Hn0−2)T

              Encryption of plaintext m ∈ Fn−r

2

into c ∈ Fn

2 is given by:

  • 1. Generating random e

n 2 with Hamming weight, wt e ,

less than t.

  • 2. Computing c

mG e.

5

slide-20
SLIDE 20

QC-MDPC (4/5)

Public key G ∈ F(n−r)×n

2

is constructed as follows: G =         I       (H−1

n0−1 · H0)T

(H−1

n0−1 · H1)T

. . . (H−1

n0−1 · Hn0−2)T

              Encryption of plaintext m ∈ Fn−r

2

into c ∈ Fn

2 is given by:

  • 1. Generating random e ∈ Fn

2 with Hamming weight, wt(e),

less than t.

  • 2. Computing c

mG e.

5

slide-21
SLIDE 21

QC-MDPC (4/5)

Public key G ∈ F(n−r)×n

2

is constructed as follows: G =         I       (H−1

n0−1 · H0)T

(H−1

n0−1 · H1)T

. . . (H−1

n0−1 · Hn0−2)T

              Encryption of plaintext m ∈ Fn−r

2

into c ∈ Fn

2 is given by:

  • 1. Generating random e ∈ Fn

2 with Hamming weight, wt(e),

less than t.

  • 2. Computing c ← mG + e.

5

slide-22
SLIDE 22

QC-MDPC (5/5)

To decrypt c ∈ Fn

2 into m ∈ Fn−r 2

we need a decoding algorithm, ΨH, with knowledge of H.

  • 1. Decode mG

H mG

e

  • 2. Plaintext m is first n

r positions of mG. The decoding algorithms (

H) are based on variants of the

  • riginal Gallager’s bitflipping algorithm.

6

slide-23
SLIDE 23

QC-MDPC (5/5)

To decrypt c ∈ Fn

2 into m ∈ Fn−r 2

we need a decoding algorithm, ΨH, with knowledge of H.

  • 1. Decode mG ← ΨH(mG + e)
  • 2. Plaintext m is first n

r positions of mG. The decoding algorithms (

H) are based on variants of the

  • riginal Gallager’s bitflipping algorithm.

6

slide-24
SLIDE 24

QC-MDPC (5/5)

To decrypt c ∈ Fn

2 into m ∈ Fn−r 2

we need a decoding algorithm, ΨH, with knowledge of H.

  • 1. Decode mG ← ΨH(mG + e)
  • 2. Plaintext m is first (n − r) positions of mG.

The decoding algorithms (

H) are based on variants of the

  • riginal Gallager’s bitflipping algorithm.

6

slide-25
SLIDE 25

QC-MDPC (5/5)

To decrypt c ∈ Fn

2 into m ∈ Fn−r 2

we need a decoding algorithm, ΨH, with knowledge of H.

  • 1. Decode mG ← ΨH(mG + e)
  • 2. Plaintext m is first (n − r) positions of mG.

The decoding algorithms (ΨH) are based on variants of the

  • riginal Gallager’s bitflipping algorithm.

6

slide-26
SLIDE 26

Previous Work

  • QC-MPDC was previosly shown vulnerable in [GJS16]1.
  • Key recovery is possible with 250-300 M ciphertexts for

80-bit security parameters.

  • Attack against CCA secure QC-MDPC.
  • The authors discovered a correlation between the

distance spectrums of the secret key and of non-decodeable error patterns.

1Qian Guo, Thomas Johansson and Paul Stankovski. ”A Key Recovery Attack

  • n MDPC with CCA security Using Decoding Errors”. In: ASIACRYPT 2016

7

slide-27
SLIDE 27

Previous Work

  • QC-MPDC was previosly shown vulnerable in [GJS16]1.
  • Key recovery is possible with 250-300 M ciphertexts for

80-bit security parameters.

  • Attack against CCA secure QC-MDPC.
  • The authors discovered a correlation between the

distance spectrums of the secret key and of non-decodeable error patterns.

1Qian Guo, Thomas Johansson and Paul Stankovski. ”A Key Recovery Attack

  • n MDPC with CCA security Using Decoding Errors”. In: ASIACRYPT 2016

7

slide-28
SLIDE 28

Previous Work

  • QC-MPDC was previosly shown vulnerable in [GJS16]1.
  • Key recovery is possible with 250-300 M ciphertexts for

80-bit security parameters.

  • Attack against CCA secure QC-MDPC.
  • The authors discovered a correlation between the

distance spectrums of the secret key and of non-decodeable error patterns.

1Qian Guo, Thomas Johansson and Paul Stankovski. ”A Key Recovery Attack

  • n MDPC with CCA security Using Decoding Errors”. In: ASIACRYPT 2016

7

slide-29
SLIDE 29

Previous Work

  • QC-MPDC was previosly shown vulnerable in [GJS16]1.
  • Key recovery is possible with 250-300 M ciphertexts for

80-bit security parameters.

  • Attack against CCA secure QC-MDPC.
  • The authors discovered a correlation between the

distance spectrums of the secret key and of non-decodeable error patterns.

1Qian Guo, Thomas Johansson and Paul Stankovski. ”A Key Recovery Attack

  • n MDPC with CCA security Using Decoding Errors”. In: ASIACRYPT 2016

7

slide-30
SLIDE 30

Distance Spectrums

1 0 0 0 1 0 0 1 1 ← bits error pattern, e: 4 3 1 3 5 2 1 1 2 1 1 1 2 3 4 5 ← counters distance spectrum, D(e): Distance spectrum (D(. . . )): wrapping distances between two non-zero bits. The number in each counter counts the

  • ccurence of a specific distance, or its multiplicity.

We want to find D h0 , the distance spectrum of the first row of H0, the first part of the secret key H.

8

slide-31
SLIDE 31

Distance Spectrums

1 0 0 0 1 0 0 1 1 ← bits error pattern, e: 4 3 1 3 5 2 1 1 2 1 1 1 2 3 4 5 ← counters distance spectrum, D(e): Distance spectrum (D(. . . )): wrapping distances between two non-zero bits. The number in each counter counts the

  • ccurence of a specific distance, or its multiplicity.

We want to find D(h0), the distance spectrum of the first row of H0, the first part of the secret key H.

8

slide-32
SLIDE 32

Previous attack

A reaction attack against CCA secure QC-MDPC. [GJS16]

  • 0. Attacker: Initialize i

0.

  • 1. Attacker: i

i 1.

  • 2. Attacker: Encrypts ci

Gm ei, where ei is a random vector.

  • 3. Attacker: Sends ci to the victim.
  • 4. Victim: Decrypts ci (using

H).

  • 5. Victim: Sends response back to attacker
  • 6. Attacker: If decoding failure detected: Save D ei .
  • 7. Attacker: Repeat from step 1.

By combining all D ei vectors we see a non-uniform probability distribution of individual distances that directly correlates to D h0 . We need many samples to correctly determine D h0 .

9

slide-33
SLIDE 33

Previous attack

A reaction attack against CCA secure QC-MDPC. [GJS16]

  • 0. Attacker: Initialize i ← 0.
  • 1. Attacker: i

i 1.

  • 2. Attacker: Encrypts ci

Gm ei, where ei is a random vector.

  • 3. Attacker: Sends ci to the victim.
  • 4. Victim: Decrypts ci (using

H).

  • 5. Victim: Sends response back to attacker
  • 6. Attacker: If decoding failure detected: Save D ei .
  • 7. Attacker: Repeat from step 1.

By combining all D ei vectors we see a non-uniform probability distribution of individual distances that directly correlates to D h0 . We need many samples to correctly determine D h0 .

9

slide-34
SLIDE 34

Previous attack

A reaction attack against CCA secure QC-MDPC. [GJS16]

  • 0. Attacker: Initialize i ← 0.
  • 1. Attacker: i ← i + 1.
  • 2. Attacker: Encrypts ci

Gm ei, where ei is a random vector.

  • 3. Attacker: Sends ci to the victim.
  • 4. Victim: Decrypts ci (using

H).

  • 5. Victim: Sends response back to attacker
  • 6. Attacker: If decoding failure detected: Save D ei .
  • 7. Attacker: Repeat from step 1.

By combining all D ei vectors we see a non-uniform probability distribution of individual distances that directly correlates to D h0 . We need many samples to correctly determine D h0 .

9

slide-35
SLIDE 35

Previous attack

A reaction attack against CCA secure QC-MDPC. [GJS16]

  • 0. Attacker: Initialize i ← 0.
  • 1. Attacker: i ← i + 1.
  • 2. Attacker: Encrypts ci ← Gm + ei, where ei is a random vector.
  • 3. Attacker: Sends ci to the victim.
  • 4. Victim: Decrypts ci (using

H).

  • 5. Victim: Sends response back to attacker
  • 6. Attacker: If decoding failure detected: Save D ei .
  • 7. Attacker: Repeat from step 1.

By combining all D ei vectors we see a non-uniform probability distribution of individual distances that directly correlates to D h0 . We need many samples to correctly determine D h0 .

9

slide-36
SLIDE 36

Previous attack

A reaction attack against CCA secure QC-MDPC. [GJS16]

  • 0. Attacker: Initialize i ← 0.
  • 1. Attacker: i ← i + 1.
  • 2. Attacker: Encrypts ci ← Gm + ei, where ei is a random vector.
  • 3. Attacker: Sends ci to the victim.
  • 4. Victim: Decrypts ci (using

H).

  • 5. Victim: Sends response back to attacker
  • 6. Attacker: If decoding failure detected: Save D ei .
  • 7. Attacker: Repeat from step 1.

By combining all D ei vectors we see a non-uniform probability distribution of individual distances that directly correlates to D h0 . We need many samples to correctly determine D h0 .

9

slide-37
SLIDE 37

Previous attack

A reaction attack against CCA secure QC-MDPC. [GJS16]

  • 0. Attacker: Initialize i ← 0.
  • 1. Attacker: i ← i + 1.
  • 2. Attacker: Encrypts ci ← Gm + ei, where ei is a random vector.
  • 3. Attacker: Sends ci to the victim.
  • 4. Victim: Decrypts ci (using ΨH).
  • 5. Victim: Sends response back to attacker
  • 6. Attacker: If decoding failure detected: Save D ei .
  • 7. Attacker: Repeat from step 1.

By combining all D ei vectors we see a non-uniform probability distribution of individual distances that directly correlates to D h0 . We need many samples to correctly determine D h0 .

9

slide-38
SLIDE 38

Previous attack

A reaction attack against CCA secure QC-MDPC. [GJS16]

  • 0. Attacker: Initialize i ← 0.
  • 1. Attacker: i ← i + 1.
  • 2. Attacker: Encrypts ci ← Gm + ei, where ei is a random vector.
  • 3. Attacker: Sends ci to the victim.
  • 4. Victim: Decrypts ci (using ΨH).
  • 5. Victim: Sends response back to attacker
  • 6. Attacker: If decoding failure detected: Save D ei .
  • 7. Attacker: Repeat from step 1.

By combining all D ei vectors we see a non-uniform probability distribution of individual distances that directly correlates to D h0 . We need many samples to correctly determine D h0 .

9

slide-39
SLIDE 39

Previous attack

A reaction attack against CCA secure QC-MDPC. [GJS16]

  • 0. Attacker: Initialize i ← 0.
  • 1. Attacker: i ← i + 1.
  • 2. Attacker: Encrypts ci ← Gm + ei, where ei is a random vector.
  • 3. Attacker: Sends ci to the victim.
  • 4. Victim: Decrypts ci (using ΨH).
  • 5. Victim: Sends response back to attacker
  • 6. Attacker: If decoding failure detected: Save D(ei).
  • 7. Attacker: Repeat from step 1.

By combining all D ei vectors we see a non-uniform probability distribution of individual distances that directly correlates to D h0 . We need many samples to correctly determine D h0 .

9

slide-40
SLIDE 40

Previous attack

A reaction attack against CCA secure QC-MDPC. [GJS16]

  • 0. Attacker: Initialize i ← 0.
  • 1. Attacker: i ← i + 1.
  • 2. Attacker: Encrypts ci ← Gm + ei, where ei is a random vector.
  • 3. Attacker: Sends ci to the victim.
  • 4. Victim: Decrypts ci (using ΨH).
  • 5. Victim: Sends response back to attacker
  • 6. Attacker: If decoding failure detected: Save D(ei).
  • 7. Attacker: Repeat from step 1.

By combining all D ei vectors we see a non-uniform probability distribution of individual distances that directly correlates to D h0 . We need many samples to correctly determine D h0 .

9

slide-41
SLIDE 41

Previous attack

A reaction attack against CCA secure QC-MDPC. [GJS16]

  • 0. Attacker: Initialize i ← 0.
  • 1. Attacker: i ← i + 1.
  • 2. Attacker: Encrypts ci ← Gm + ei, where ei is a random vector.
  • 3. Attacker: Sends ci to the victim.
  • 4. Victim: Decrypts ci (using ΨH).
  • 5. Victim: Sends response back to attacker
  • 6. Attacker: If decoding failure detected: Save D(ei).
  • 7. Attacker: Repeat from step 1.

By combining all D(ei) vectors we see a non-uniform probability distribution of individual distances that directly correlates to D(h0). We need many samples to correctly determine D h0 .

9

slide-42
SLIDE 42

Previous attack

A reaction attack against CCA secure QC-MDPC. [GJS16]

  • 0. Attacker: Initialize i ← 0.
  • 1. Attacker: i ← i + 1.
  • 2. Attacker: Encrypts ci ← Gm + ei, where ei is a random vector.
  • 3. Attacker: Sends ci to the victim.
  • 4. Victim: Decrypts ci (using ΨH).
  • 5. Victim: Sends response back to attacker
  • 6. Attacker: If decoding failure detected: Save D(ei).
  • 7. Attacker: Repeat from step 1.

By combining all D(ei) vectors we see a non-uniform probability distribution of individual distances that directly correlates to D(h0). We need many samples to correctly determine D(h0).

9

slide-43
SLIDE 43

Background Code-based Cryptography Previous work Attack Scenario Contributions The Chaining method Generating e0 Results Amplification effect Wrapping it up

slide-44
SLIDE 44

New attack

An adaptive reaction and/or side-channel attack against CPA secure QC-MDPC:

  • 0. Attacker: Initialize i

0, j 0, e0 any non-decodable pattern.

  • 1. Attacker: i

i 1.

  • 2. Attacker: Encrypts ci

Gm ei, where ei is derrived from ej.

  • 3. Attacker: Sends ci to the victim.
  • 4. Victim: Decrypts ci (using

H).

  • 5. Victim: Sends response back to attacker
  • 6. Attacker: If decoding failure detected:

ej ei, j j 1, i 0. Save D ei regardless. if

H not constant time: save time measurment of steps 3-5.

  • 7. Attacker: Repeat from step 1.

We call deriving ei from ej the chaining method, by which we significantly amplify the DFR.

10

slide-45
SLIDE 45

New attack

An adaptive reaction and/or side-channel attack against CPA secure QC-MDPC:

  • 0. Attacker: Initialize i ← 0,

j 0, e0 any non-decodable pattern.

  • 1. Attacker: i ← i + 1.
  • 2. Attacker: Encrypts ci ← Gm + ei, where ei is

derrived from ej.

  • 3. Attacker: Sends ci to the victim.
  • 4. Victim: Decrypts ci (using ΨH).
  • 5. Victim: Sends response back to attacker
  • 6. Attacker: If decoding failure detected:

ej ei, j j 1, i 0. Save D ei regardless. if

H not constant time: save time measurment of steps 3-5.

  • 7. Attacker: Repeat from step 1.

We call deriving ei from ej the chaining method, by which we significantly amplify the DFR.

10

slide-46
SLIDE 46

New attack

An adaptive reaction and/or side-channel attack against CPA secure QC-MDPC:

  • 0. Attacker: Initialize i ← 0, j ← 0,

e0 any non-decodable pattern.

  • 1. Attacker: i ← i + 1.
  • 2. Attacker: Encrypts ci ← Gm + ei, where ei is

derrived from ej.

  • 3. Attacker: Sends ci to the victim.
  • 4. Victim: Decrypts ci (using ΨH).
  • 5. Victim: Sends response back to attacker
  • 6. Attacker: If decoding failure detected:

ej ei, j j 1, i 0. Save D ei regardless. if

H not constant time: save time measurment of steps 3-5.

  • 7. Attacker: Repeat from step 1.

We call deriving ei from ej the chaining method, by which we significantly amplify the DFR.

10

slide-47
SLIDE 47

New attack

An adaptive reaction and/or side-channel attack against CPA secure QC-MDPC:

  • 0. Attacker: Initialize i ← 0, j ← 0, e0 any non-decodable pattern.
  • 1. Attacker: i ← i + 1.
  • 2. Attacker: Encrypts ci ← Gm + ei, where ei is

derrived from ej.

  • 3. Attacker: Sends ci to the victim.
  • 4. Victim: Decrypts ci (using ΨH).
  • 5. Victim: Sends response back to attacker
  • 6. Attacker: If decoding failure detected:

ej ei, j j 1, i 0. Save D ei regardless. if

H not constant time: save time measurment of steps 3-5.

  • 7. Attacker: Repeat from step 1.

We call deriving ei from ej the chaining method, by which we significantly amplify the DFR.

10

slide-48
SLIDE 48

New attack

An adaptive reaction and/or side-channel attack against CPA secure QC-MDPC:

  • 0. Attacker: Initialize i ← 0, j ← 0, e0 any non-decodable pattern.
  • 1. Attacker: i ← i + 1.
  • 2. Attacker: Encrypts ci ← Gm + ei, where ei is derrived from ej.
  • 3. Attacker: Sends ci to the victim.
  • 4. Victim: Decrypts ci (using ΨH).
  • 5. Victim: Sends response back to attacker
  • 6. Attacker: If decoding failure detected:

ej ei, j j 1, i 0. Save D ei regardless. if

H not constant time: save time measurment of steps 3-5.

  • 7. Attacker: Repeat from step 1.

We call deriving ei from ej the chaining method, by which we significantly amplify the DFR.

10

slide-49
SLIDE 49

New attack

An adaptive reaction and/or side-channel attack against CPA secure QC-MDPC:

  • 0. Attacker: Initialize i ← 0, j ← 0, e0 any non-decodable pattern.
  • 1. Attacker: i ← i + 1.
  • 2. Attacker: Encrypts ci ← Gm + ei, where ei is derrived from ej.
  • 3. Attacker: Sends ci to the victim.
  • 4. Victim: Decrypts ci (using ΨH).
  • 5. Victim: Sends response back to attacker
  • 6. Attacker: If decoding failure detected: ej ← ei,

j j 1, i 0. Save D ei regardless. if

H not constant time: save time measurment of steps 3-5.

  • 7. Attacker: Repeat from step 1.

We call deriving ei from ej the chaining method, by which we significantly amplify the DFR.

10

slide-50
SLIDE 50

New attack

An adaptive reaction and/or side-channel attack against CPA secure QC-MDPC:

  • 0. Attacker: Initialize i ← 0, j ← 0, e0 any non-decodable pattern.
  • 1. Attacker: i ← i + 1.
  • 2. Attacker: Encrypts ci ← Gm + ei, where ei is derrived from ej.
  • 3. Attacker: Sends ci to the victim.
  • 4. Victim: Decrypts ci (using ΨH).
  • 5. Victim: Sends response back to attacker
  • 6. Attacker: If decoding failure detected: ej ← ei, j ← j + 1,

i 0. Save D ei regardless. if

H not constant time: save time measurment of steps 3-5.

  • 7. Attacker: Repeat from step 1.

We call deriving ei from ej the chaining method, by which we significantly amplify the DFR.

10

slide-51
SLIDE 51

New attack

An adaptive reaction and/or side-channel attack against CPA secure QC-MDPC:

  • 0. Attacker: Initialize i ← 0, j ← 0, e0 any non-decodable pattern.
  • 1. Attacker: i ← i + 1.
  • 2. Attacker: Encrypts ci ← Gm + ei, where ei is derrived from ej.
  • 3. Attacker: Sends ci to the victim.
  • 4. Victim: Decrypts ci (using ΨH).
  • 5. Victim: Sends response back to attacker
  • 6. Attacker: If decoding failure detected: ej ← ei, j ← j + 1, i ← 0.

Save D ei regardless. if

H not constant time: save time measurment of steps 3-5.

  • 7. Attacker: Repeat from step 1.

We call deriving ei from ej the chaining method, by which we significantly amplify the DFR.

10

slide-52
SLIDE 52

New attack

An adaptive reaction and/or side-channel attack against CPA secure QC-MDPC:

  • 0. Attacker: Initialize i ← 0, j ← 0, e0 any non-decodable pattern.
  • 1. Attacker: i ← i + 1.
  • 2. Attacker: Encrypts ci ← Gm + ei, where ei is derrived from ej.
  • 3. Attacker: Sends ci to the victim.
  • 4. Victim: Decrypts ci (using ΨH).
  • 5. Victim: Sends response back to attacker
  • 6. Attacker: If decoding failure detected: ej ← ei, j ← j + 1, i ← 0.

Save D(ei) regardless. if

H not constant time: save time measurment of steps 3-5.

  • 7. Attacker: Repeat from step 1.

We call deriving ei from ej the chaining method, by which we significantly amplify the DFR.

10

slide-53
SLIDE 53

New attack

An adaptive reaction and/or side-channel attack against CPA secure QC-MDPC:

  • 0. Attacker: Initialize i ← 0, j ← 0, e0 any non-decodable pattern.
  • 1. Attacker: i ← i + 1.
  • 2. Attacker: Encrypts ci ← Gm + ei, where ei is derrived from ej.
  • 3. Attacker: Sends ci to the victim.
  • 4. Victim: Decrypts ci (using ΨH).
  • 5. Victim: Sends response back to attacker
  • 6. Attacker: If decoding failure detected: ej ← ei, j ← j + 1, i ← 0.

Save D(ei) regardless. if ΨH not constant time: save time measurment of steps 3-5.

  • 7. Attacker: Repeat from step 1.

We call deriving ei from ej the chaining method, by which we significantly amplify the DFR.

10

slide-54
SLIDE 54

New attack

An adaptive reaction and/or side-channel attack against CPA secure QC-MDPC:

  • 0. Attacker: Initialize i ← 0, j ← 0, e0 any non-decodable pattern.
  • 1. Attacker: i ← i + 1.
  • 2. Attacker: Encrypts ci ← Gm + ei, where ei is derrived from ej.
  • 3. Attacker: Sends ci to the victim.
  • 4. Victim: Decrypts ci (using ΨH).
  • 5. Victim: Sends response back to attacker
  • 6. Attacker: If decoding failure detected: ej ← ei, j ← j + 1, i ← 0.

Save D(ei) regardless. if ΨH not constant time: save time measurment of steps 3-5.

  • 7. Attacker: Repeat from step 1.

We call deriving ei from ej the chaining method, by which we significantly amplify the DFR.

10

slide-55
SLIDE 55

The Chaining method

e0 e0 . . . ei0 e1 e0

1

. . . ei1

1

e2 ej e0

j

. . .

e

ij j

e... MUTATE(ej−1)

Error Amplification is gained by generating a chain of related non-decodable error patterns:

  • From e0 we can find another error pattern by randomly

swapping a ’1’ and a ’0’ in the bit pattern (MUTATE).

  • Decoding success: e

ij j

D

ij j

D ej D e

ij j

  • Decoding failure: ej

1

Dj D ej D ej

1

vectors!

11

slide-56
SLIDE 56

The Chaining method

e0 e0 . . . ei0 e1 e0

1

. . . ei1

1

e2 ej e0

j

. . .

e

ij j

e... MUTATE(ej−1)

Error Amplification is gained by generating a chain of related non-decodable error patterns:

  • From e0 we can find another error pattern by randomly

swapping a ’1’ and a ’0’ in the bit pattern (MUTATE).

  • Decoding success: e

ij j

D

ij j

D ej D e

ij j

  • Decoding failure: ej

1

Dj D ej D ej

1

vectors!

11

slide-57
SLIDE 57

The Chaining method

e0 e0 . . . ei0 e1 e0

1

. . . ei1

1

e2 ej e0

j

. . .

e

ij j

e... MUTATE(ej−1)

Error Amplification is gained by generating a chain of related non-decodable error patterns:

  • From e0 we can find another error pattern by randomly

swapping a ’1’ and a ’0’ in the bit pattern (MUTATE).

  • Decoding success: e

ij j ⇒ ∆D ij j ← D(ej) − D(e ij j )

  • Decoding failure: ej

1

Dj D ej D ej

1

vectors!

11

slide-58
SLIDE 58

The Chaining method

e0 e0 . . . ei0 e1 e0

1

. . . ei1

1

e2 ej e0

j

. . .

e

ij j

e... MUTATE(ej−1)

Error Amplification is gained by generating a chain of related non-decodable error patterns:

  • From e0 we can find another error pattern by randomly

swapping a ’1’ and a ’0’ in the bit pattern (MUTATE).

  • Decoding success: e

ij j ⇒ ∆D ij j ← D(ej) − D(e ij j )

  • Decoding failure: ej+1 ⇒ ∆Dj ← D(ej) − D(ej+1)

} vectors!

11

slide-59
SLIDE 59

Generating e0

By using timing information we can distinguish the number of iterations required.

1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 ·107 number of iterations required for decoding nanoseconds required for decoding Decoder B Decoder F Decoder Q

We use the chaining method to find harder and harder patterns e0.

  • e0 is replaced each time a

more difficult pattern is encountered!

  • Keep going until a

decryption failure e0 is found.

12

slide-60
SLIDE 60

Generating e0

By using timing information we can distinguish the number of iterations required.

1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 ·107 number of iterations required for decoding nanoseconds required for decoding Decoder B Decoder F Decoder Q

We use the chaining method to find harder and harder patterns e′

0.

  • e0 is replaced each time a

more difficult pattern is encountered!

  • Keep going until a

decryption failure e0 is found.

12

slide-61
SLIDE 61

Generating e0

By using timing information we can distinguish the number of iterations required.

1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 ·107 number of iterations required for decoding nanoseconds required for decoding Decoder B Decoder F Decoder Q

We use the chaining method to find harder and harder patterns e′

0.

  • e′

0 is replaced each time a

more difficult pattern is encountered!

  • Keep going until a

decryption failure e0 is found.

12

slide-62
SLIDE 62

Generating e0

By using timing information we can distinguish the number of iterations required.

1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 ·107 number of iterations required for decoding nanoseconds required for decoding Decoder B Decoder F Decoder Q

We use the chaining method to find harder and harder patterns e′

0.

  • e′

0 is replaced each time a

more difficult pattern is encountered!

  • Keep going until a

decryption failure e0 is found.

12

slide-63
SLIDE 63

Background Code-based Cryptography Previous work Attack Scenario Contributions The Chaining method Generating e0 Results Amplification effect Wrapping it up

slide-64
SLIDE 64

Results

We see that the vector ∆D = ∑j

k=0 ∆Dk

j settle into multiplicity layers for large j (long chains). Also using the successfull decodings ( Dik

k ), inverted,

improves the results.

500 1000 1500 2000 0.00002 0.00001 0.00000 0.00001 0.00002 0.00003 0.00004 0.00005 0.00006 0.00007 A * a / sum(a) + B * b / bsum + F * f / fsum + G * g / gsum Multiplicity 0 Avg Multiplicity 0 Multiplicity 1 Avg Multiplicity 1 Multiplicity 2 Avg Multiplicity 2 Multiplicity 3 Avg Multiplicity 3 Multiplicity 4 Avg Multiplicity 4

We can reconstruct the secret key using [GJS16]!

13

slide-65
SLIDE 65

Results

We see that the vector ∆D = ∑j

k=0 ∆Dk

j settle into multiplicity layers for large j (long chains). Also using the successfull decodings (∆Dik

k ), inverted,

improves the results.

500 1000 1500 2000 0.00002 0.00001 0.00000 0.00001 0.00002 0.00003 0.00004 0.00005 0.00006 0.00007 A * a / sum(a) + B * b / bsum + F * f / fsum + G * g / gsum Multiplicity 0 Avg Multiplicity 0 Multiplicity 1 Avg Multiplicity 1 Multiplicity 2 Avg Multiplicity 2 Multiplicity 3 Avg Multiplicity 3 Multiplicity 4 Avg Multiplicity 4

We can reconstruct the secret key using [GJS16]!

13

slide-66
SLIDE 66

Results

We see that the vector ∆D = ∑j

k=0 ∆Dk

j settle into multiplicity layers for large j (long chains). Also using the successfull decodings (∆Dik

k ), inverted,

improves the results.

500 1000 1500 2000 0.00002 0.00001 0.00000 0.00001 0.00002 0.00003 0.00004 0.00005 0.00006 0.00007 A * a / sum(a) + B * b / bsum + F * f / fsum + G * g / gsum Multiplicity 0 Avg Multiplicity 0 Multiplicity 1 Avg Multiplicity 1 Multiplicity 2 Avg Multiplicity 2 Multiplicity 3 Avg Multiplicity 3 Multiplicity 4 Avg Multiplicity 4

We can reconstruct the secret key using [GJS16]!

13

slide-67
SLIDE 67

Amplification effect

2 4 6 8 10 10−9 10−8 10−7 10−6 10−5 10−4 10−3 10−2 10−1 100 5.05 × 10−4 9.59 × 10−6 1.08 × 10−7 Number of iterations Probability Decoder B Decoder F Decoder Q

Random samples

2 4 6 8 10 10

9

10

8

10

7

10

6

10

5

10

4

10

3

10

2

10

1

100 2 16 10

1

1 68 10

2

8 83 10

3

Number of iterations Probability Decoder Decoder Decoder

Chaining method DFR indicated by horizontal lines. Note the logarithmic scale on the y-axis!

14

slide-68
SLIDE 68

Amplification effect

2 4 6 8 10 10−9 10−8 10−7 10−6 10−5 10−4 10−3 10−2 10−1 100 5.05 × 10−4 9.59 × 10−6 1.08 × 10−7 Number of iterations Probability Decoder B Decoder F Decoder Q

Random samples

2 4 6 8 10 10−9 10−8 10−7 10−6 10−5 10−4 10−3 10−2 10−1 100 2.16 × 10−1 1.68 × 10−2 8.83 × 10−3 Number of iterations Probability Decoder B Decoder F Decoder Q

Chaining method DFR indicated by horizontal lines. Note the logarithmic scale on the y-axis!

14

slide-69
SLIDE 69

Background Code-based Cryptography Previous work Attack Scenario Contributions The Chaining method Generating e0 Results Amplification effect Wrapping it up

slide-70
SLIDE 70

Conclusions

  • Improvement over the original

(CPA-version) attack with a factor 20-30.

  • Low DFR’s as a protective measure might

not be enough if we have side-channels.

  • Attacker selection of error patterns makes

attacks possible and efficient.

  • Knowledge of a single non-decodable error pattern can

be used as leverage for generating more.

  • IND-CCA secure schemes are not vulnerable to the

chaining method.

15

slide-71
SLIDE 71

Conclusions

  • Improvement over the original

(CPA-version) attack with a factor 20-30.

  • Low DFR’s as a protective measure might

not be enough if we have side-channels.

  • Attacker selection of error patterns makes

attacks possible and efficient.

  • Knowledge of a single non-decodable error pattern can

be used as leverage for generating more.

  • IND-CCA secure schemes are not vulnerable to the

chaining method.

15

slide-72
SLIDE 72

Conclusions

  • Improvement over the original

(CPA-version) attack with a factor 20-30.

  • Low DFR’s as a protective measure might

not be enough if we have side-channels.

  • Attacker selection of error patterns makes

attacks possible and efficient.

  • Knowledge of a single non-decodable error pattern can

be used as leverage for generating more.

  • IND-CCA secure schemes are not vulnerable to the

chaining method.

15

slide-73
SLIDE 73

Conclusions

  • Improvement over the original

(CPA-version) attack with a factor 20-30.

  • Low DFR’s as a protective measure might

not be enough if we have side-channels.

  • Attacker selection of error patterns makes

attacks possible and efficient.

  • Knowledge of a single non-decodable error pattern can

be used as leverage for generating more.

  • IND-CCA secure schemes are not vulnerable to the

chaining method.

15

slide-74
SLIDE 74

Conclusions

  • Improvement over the original

(CPA-version) attack with a factor 20-30.

  • Low DFR’s as a protective measure might

not be enough if we have side-channels.

  • Attacker selection of error patterns makes

attacks possible and efficient.

  • Knowledge of a single non-decodable error pattern can

be used as leverage for generating more.

  • IND-CCA secure schemes are not vulnerable to the

chaining method.

15

slide-75
SLIDE 75

Thank you!

(Questions?)

16

slide-76
SLIDE 76

[GJS16] Qian Guo, Thomas Johansson, and Paul Stankovski. “A Key Recovery Attack

  • n MDPC with CCA Security Using Decoding Errors”. In: ASIACRYPT 2016,

Part I. Ed. by Jung Hee Cheon and Tsuyoshi Takagi. Vol. 10031. LNCS. Springer, Heidelberg, Dec. 2016, pp. 789–815. doi: 10.1007/978-3-662-53887-6_29. [Mis+12] Rafael Misoczki et al. MDPC-McEliece: New McEliece Variants from Moderate Density Parity-Check Codes. Cryptology ePrint Archive, Report 2012/409. http://eprint.iacr.org/2012/409. 2012. [NJW18] Alexander Nilsson, Thomas Johansson, and Paul Stankovski Wagner. “Error Amplification in Code-based Cryptography”. In: IACR TCHES 2019.1 (2018). https: //tches.iacr.org/index.php/TCHES/article/view/7340,

  • pp. 238–258. issn: 2569-2925. doi: 10.13154/tches.v2019.i1.238-258.