Sid ide Channel Analysis and Protection for McEliece Im Implementations
Thomas Eisenbarth
Joint work with Cong Chen, Ingo von Maurich and Rainer Steinwandt
9/27/2016
NATO Workshop- Tel Aviv University
for McEliece Im Implementations Thomas Eisenbarth Joint work with - - PowerPoint PPT Presentation
Sid ide Channel Analysis and Protection for McEliece Im Implementations Thomas Eisenbarth Joint work with Cong Chen, Ingo von Maurich and Rainer Steinwandt 9/27/2016 NATO Workshop- Tel Aviv University Overview Motivation QC-MDPC
Thomas Eisenbarth
Joint work with Cong Chen, Ingo von Maurich and Rainer Steinwandt
9/27/2016
NATO Workshop- Tel Aviv University
McEliece
2
3
Logarithm Problem
10 years?
4
“Quantum-Secure Cryptography”
NIST announces PQC Standardization Process Deadline: November 2017
5
6
7
Key Generation:
𝐼 = 𝐼0 𝐼1 , 𝐼0, 𝐼1 ∈ 𝔾2
4801×4801
Public Key
𝐻 = 𝐽 𝐼1
−1 ⋅ 𝐼0 𝑈 , 𝐽 ∈ 𝔾2 4801×4801
McEliece based on Quasi-Cyclic Moderate Density Parity-Check code
𝐼0 𝐼1 ℎ0 ℎ1
8
Decryption 1. Compute the syndrome 𝑡 = 𝐼𝑦𝑈 2. Count #𝑣𝑞𝑑 for each ciphertext bit a) If #𝑣𝑞𝑑 exceeds threshold 𝑐𝑗, flip the ciphertext bit b) Add current row ℎ𝑘 to the syndrome 3. Repeat 2. until either 𝑡 = 𝟏 or exceeding max. iterations
Encryption Message 𝑛 ∈ 𝔾2
4801, error vector 𝑓 ∈𝑆 𝔾2 9602, 𝑥𝑢(𝑓) ≤ 84
x ← 𝑛𝐻 + 𝑓
9
10
ciphertext
plaintext
Leakage
11
state.
[3] Heyse, Moradi, Paar: Practical Power Analysis Attacks on Software Implementations of McEliece PQCrypto 2010
12
[MG14] von Maurich, I.; Güneysu, T., "Lightweight code-based cryptography: QC-MDPC McEliece encryption on reconfigurable devices," DATE 2014
Key rotation Syndrome computation
1 4801
( ) ( )
i i
s s h i x h i x
T
s H x
13
32- bit Read-First BRAM 1-bit carry 150 4800 0:31 31 4800:30 63 64:95 95 63:94 31 32:63 63 31:62
during one decryption
14
For any key bit , the leakage when it overwrites carry register:
1-bit carry ℎ𝑗,𝑘 ℎ𝑗,𝑘−32
, 32 , 1
...
i j i j
h h
, 1 , 32
...
i j i j
h h
, 31 ,
...
i j i j
h h
, 32 , , 32
... ...
i j i j i j
h h h
, ,
{0,1}, j [0,4800]
i j
h i
15
16
bit 31 overwrites carry
17
18
caused by a set bit in the differential trace
shape
find more characteristic shapes
…0… …0… …0… …0… 1 …0… 1 …0… 1 …0… …0…
, 32 , , 32
...... ......
i j i j i j
h h h
…0… …0…
19
Recovered key bits of 0 vs. false positives Recovered key bits of 1 vs. false positives
20
Key rotation Syndrome computation
1 4801
( ) ( )
i i
s s h i x h i x
T
s H x
Idea: set single bit in 𝑦𝑗 and see ℎ0 written in 𝑡 4801 different leakages for ℎ0
22
empty syndrome:
23
24
25
26
𝑅 = 𝐼1
−1 · 𝐼0 𝑈
Known public key:
1 T
h h Q
h0 + h1 [0 0 1 0 * 0 0 1 0 0 …… * 0 0 1 0 0 1]
DPA recovers :
h0 ⊕ h1 [0 0 * 0 * 0 0 * 0 0 …… * 0 0 * 0 0 *] h1 [0 0 * 0 * 0 0 * 0 0 …… * 0 0 * 0 0 *]
1
h h
1 1 T
h Q h
48 1 01
( )
T
Q I h
27
1
h h
48 1 01
( )
T
Q I h
0 * … * 1 ….. 0 1 1 1 …… 0 …… …… …… …… …… 1 …… 1 1 …… 1 1
= ×
* … * * … * … DPA recovers 4400 0s with some errors N 4801-N > => N > 2400 Select N=2401 from 4400 without error. The probability is between
4395 2401 0.02 4400 2401 4398 2401 0.21 4400 2401
28
implementation issues of cryptography
but makes DPA feasible
property
[CEMS15] Chen, Eisenbarth, von Maurich, Steinwandt: Differential Power Analysis of a McEliece Cryptosystem ACNS 2015 [CEMS16] Chen, Eisenbarth, von Maurich, Steinwandt: Horizontal and Vertical Side Channel Analysis of a McEliece Cryptosystem IEEE TIFS 2016
29
30
parity-check matrix 𝐼 has quasi-cyclic structure use uniformly random masks m0, …, mn01 to mask h0, …, hn01 quasi-cyclic shifting yields mask matrix M split H into two shares H Hm M masked syndrome sm HmxT and syndrome mask ms MxT can be computed independently
31
32
AND of 𝐼 and 𝑡 [NRR06] requires three shares
[NRR06] Nikova, Rechberger, Rjimen Threshold Implementations against sidechannel attacks and glitches ISC 2006
33
accumulation of look-ups with pre-computed table
facilitate secure accumulation [CGV14] Independent sums for each bit position wt(sh) (sh1, 1 sh2, 1 sh3, 1) … (sh1, |sh| sh2, |sh| sh3, |sh|) wt(sh) A1,1 A2,1, … A1, |sh| A2, |sh| (A1,1 … A1, |sh|) (A2,1 … A2, |sh|)
[CGV14] Coron Großschädl Vadnala Secure Conversion between Boolean and Arithmetic Masking of Any Order CHES 2014
34
35
36
VHDL design, synthesized for Virtex-5 XC5VLX50 FPGA, Overhead (4x) not out of line (cf. Moradi et al.’s AES implementation – EC 2011)
FFs LUTs Slices BRAMs Freq. Unprotected 412 568 148 3 318 Masked 3045 4672 1549 3 73 Overhead 7.4x 8.2x 10.5x 1x 4.3x
37
38
SASEBO-GII board, Tektronix DSO 5104 oscilloscope
per second, Tektronix DSO 5104 oscilloscope
39
40
41
42
about 4
43
[CEMS15] Chen, Eisenbarth, von Maurich, Steinwandt Masking Large Keys in Hardware: A Masked Implementation of McEliece SAC 2015
More information: users.wpi.edu/~teisenbarth teisenbarth@wpi.edu v.wpi.edu