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
Background Code-based Cryptography Previous work Attack Scenario Contributions The Chaining method Generating e0 Results Amplification effect Wrapping it up
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.
1
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.
1
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.
1
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.
1
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.
mG e
- Uses iterative bitflipping decoding in the decryption stage
- Decryption Failure Rate (DFR), is non-zero.
2
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.
mG e
- Uses iterative bitflipping decoding in the decryption stage
- Decryption Failure Rate (DFR), is non-zero.
2
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 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 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
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
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
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
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
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
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 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:
n 2 with Hamming weight, wt e ,
less than t.
mG e.
5
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:
n 2 with Hamming weight, wt e ,
less than t.
mG e.
5
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.
mG e.
5
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.
5
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.
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 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 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 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 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 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 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 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 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 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 Previous attack
A reaction attack against CCA secure QC-MDPC. [GJS16]
- 0. Attacker: Initialize i
0.
i 1.
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 Previous attack
A reaction attack against CCA secure QC-MDPC. [GJS16]
- 0. Attacker: Initialize i ← 0.
- 1. Attacker: i
i 1.
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 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 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 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 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 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 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 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 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 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
Background Code-based Cryptography Previous work Attack Scenario Contributions The Chaining method Generating e0 Results Amplification effect Wrapping it up
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.
i 1.
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 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 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 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 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 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 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 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 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 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 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 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).
ij j
D
ij j
D ej D e
ij j
1
Dj D ej D ej
1
vectors!
11
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).
ij j
D
ij j
D ej D e
ij j
1
Dj D ej D ej
1
vectors!
11
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).
ij j ⇒ ∆D ij j ← D(ej) − D(e ij j )
1
Dj D ej D ej
1
vectors!
11
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).
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 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!
decryption failure e0 is found.
12
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!
decryption failure e0 is found.
12
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.
0 is replaced each time a
more difficult pattern is encountered!
decryption failure e0 is found.
12
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.
0 is replaced each time a
more difficult pattern is encountered!
decryption failure e0 is found.
12
SLIDE 63
Background Code-based Cryptography Previous work Attack Scenario Contributions The Chaining method Generating e0 Results Amplification effect Wrapping it up
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 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 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 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 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
Background Code-based Cryptography Previous work Attack Scenario Contributions The Chaining method Generating e0 Results Amplification effect Wrapping it up
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 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 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 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 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
Thank you!
(Questions?)
16
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.