Optimization of Power Analysis Using Neural Network...Zdenek Martinasek, Jan Hajny and Lukas Malina...

17
About Us Introduction Optimization of Power Analysis Conclusion Optimization of Power Analysis Using Neural Network Zdenek Martinasek, Jan Hajny and Lukas Malina Dpt. of Telecommunications, Brno University of Technology Brno, Czech Republic [email protected] crypto.utko.feec.vutbr.cz Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network

Transcript of Optimization of Power Analysis Using Neural Network...Zdenek Martinasek, Jan Hajny and Lukas Malina...

Page 1: Optimization of Power Analysis Using Neural Network...Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network About Us Introduction Optimization

About UsIntroduction

Optimization of Power AnalysisConclusion

Optimization of Power Analysis Using NeuralNetwork

Zdenek Martinasek, Jan Hajny and Lukas Malina

Dpt. of Telecommunications, Brno University of TechnologyBrno, Czech Republic

[email protected]

Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network

Page 2: Optimization of Power Analysis Using Neural Network...Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network About Us Introduction Optimization

About UsIntroduction

Optimization of Power AnalysisConclusion

Outline

1 About Us

2 IntroductionMotivationOur Contribution

3 Optimization of Power AnalysisOptimization ProposalImplementation of OptimizationComparison of Classification Results

4 Conclusion

Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network

Page 3: Optimization of Power Analysis Using Neural Network...Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network About Us Introduction Optimization

About UsIntroduction

Optimization of Power AnalysisConclusion

Cryptology Research Group at BUT

Crypto Research Group, Brno University of Technology, CZ

Small group of cca 10 people,

part of Department of Telecommunications, FEEC BUT inBrno, Czech Republic,

equipped by SIX Research Centre,

both basic and applied research,

http://crypto.utko.feec.vutbr.cz/.

Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network

Page 4: Optimization of Power Analysis Using Neural Network...Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network About Us Introduction Optimization

About UsIntroduction

Optimization of Power AnalysisConclusion

Cryptology Research Group at BUT

R&D in Cryptology and Computer Security

Basic research:

provable cryptographic protocol design,

light-weight cryptography,

side channel cryptanalysis.

Implementation:

smart-cards (Java, .NET, MultOS),

mobile OS (iOS, Android),

sensors, micro-controllers.

Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network

Page 5: Optimization of Power Analysis Using Neural Network...Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network About Us Introduction Optimization

About UsIntroduction

Optimization of Power AnalysisConclusion

MotivationOur Contribution

Main Characteristics of the Original Implementation

PA based on two-layer perceptron network1 (preparation ofpower patterns, training of the neural network, classification),

the first experiment showed a success rate of 90% for thefirst byte of AES secret key (AddRoundKey and SubByte),

theoretical and empirical success rates were determined onlyto 80% and 85%, respectively,

these results were not sufficient enough,

other negative characteristics were revealed during the testing,

optimization of the method above was realized to increasethe success rate of classification.

1MARTINASEK, Z.; ZEMAN, V. Innovative Method of the Power Analysis. Radioengineering, 2013, vol. 22,

no. 02, p. 586-594. ISSN: 1210- 2512.

Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network

Page 6: Optimization of Power Analysis Using Neural Network...Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network About Us Introduction Optimization

About UsIntroduction

Optimization of Power AnalysisConclusion

MotivationOur Contribution

Our Contribution

Proposal of the optimization of the original power analysismethod using the neural network,

implementation of the proposed optimization,

comparison the results of the optimized method with theoriginal implementation,

highlighting the positive and negative characteristic,

verification of original method with standard 10-foldcross-validation,

comparison of the results of both implementations usingcross-validation..

Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network

Page 7: Optimization of Power Analysis Using Neural Network...Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network About Us Introduction Optimization

About UsIntroduction

Optimization of Power AnalysisConclusion

Optimization ProposalImplementation of OptimizationComparison of Classification Results

Optimization Proposal - Preparation of Power Patterns

The optimization using calculation of the average trace andthe subsequent calculation of the difference power traces,denote P[i , n] as power traces corresponding to every secretkey value, where n = {0, . . . , s} is discrete time, and irepresents all possible secret key byte values from 0 to 255,an average trace A can be calculate as:

A[n] =1

256

255∑i=0

P[i , n]. (1)

training patterns for the optimized implementation arecalculated as a subtraction:

PD [i , n] = A[n]− P[i , n] =1

256

255∑i=0

P[i , n]− P[i , n]. (2)

Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network

Page 8: Optimization of Power Analysis Using Neural Network...Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network About Us Introduction Optimization

About UsIntroduction

Optimization of Power AnalysisConclusion

Optimization ProposalImplementation of OptimizationComparison of Classification Results

Comparison of Resulting Power Patterns

Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network

Page 9: Optimization of Power Analysis Using Neural Network...Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network About Us Introduction Optimization

About UsIntroduction

Optimization of Power AnalysisConclusion

Optimization ProposalImplementation of OptimizationComparison of Classification Results

Detail of Power Patterns

5900 5920 5940 5960 5980 6000 6020 6040 6060 6080

-0.1

-0.05

0

0.05

0.1

0.15

0.2

0.25

t [n]

I [A

]

key 0

key 1

key 2

key 3

...

5900 5920 5940 5960 5980 6000 6020 6040 6060 6080-0.08

-0.06

-0.04

-0.02

0

0.02

0.04

0.06

0.08

t [n]

I [A

]

key 0

key 1

key 2

key 3

...

Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network

Page 10: Optimization of Power Analysis Using Neural Network...Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network About Us Introduction Optimization

About UsIntroduction

Optimization of Power AnalysisConclusion

Optimization ProposalImplementation of OptimizationComparison of Classification Results

Created Neural Network

The neural network was created in MATLAB using the neuralnetwork toolbox,

two-layer perceptron (MLP) was used,

training set was realized by using 3× 256 power traces, backpropagation learning algorithm.

Inputs

OutputsHidden units

X1

X12000

Z1

Z100

Y1

Y256

Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network

Page 11: Optimization of Power Analysis Using Neural Network...Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network About Us Introduction Optimization

About UsIntroduction

Optimization of Power AnalysisConclusion

Optimization ProposalImplementation of OptimizationComparison of Classification Results

Comparison of Classification Results

A new set of 256 power traces corresponding to all secret keyvalue was measured,

whole set was subsequently classified.

Ksec ↓ Original implementation R Optimized implementation RD

... . . . . . . . . . . . . . . . . . . . . . . . . . . .2 0.00% 0.00% 6.46% . . . 0.00% 0.00% 92.86% 0.00% . . .1 0.00% 66.42% 0.00% . . . 0.00% 99.87% 0.00% 0.00% . . .0 36.77% 0.00% 0.00% . . . 98.23% 0.00% 0.00% 0.00% . . .

Kest → 0 1 2 . . . 0 1 2 3 . . .

Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network

Page 12: Optimization of Power Analysis Using Neural Network...Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network About Us Introduction Optimization

About UsIntroduction

Optimization of Power AnalysisConclusion

Optimization ProposalImplementation of OptimizationComparison of Classification Results

Probability Vector for Five Secret Keys

Probability of correct key estimates is increased and the otherpossible key estimates are suppressed (negative?).

0 50 100 150 200 2500

10

20

30

40

50

60

70

80

90

100

Kest

P [%

]

K

sec 5

Ksec

41

Ksec

81

Ksec

129

Ksec

248

0 50 100 150 200 2500

10

20

30

40

50

60

70

80

90

100

Kest

P [%

]

Ksec 5

Ksec 41

Ksec 81Ksec 129

Ksec 248

Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network

Page 13: Optimization of Power Analysis Using Neural Network...Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network About Us Introduction Optimization

About UsIntroduction

Optimization of Power AnalysisConclusion

Optimization ProposalImplementation of OptimizationComparison of Classification Results

The Highest Selected Probabilities

Investigation of all selected key estimates,

theoretical success rate 80% was calculated in the originalimplementation.

0 50 100 150 200 2500

10

20

30

40

50

60

70

80

90

100

P[%

]

Ksec

0 50 100 150 200 2500

50

100

150

200

250

Ke

st

selected highest probability

selected key estimate

0 50 100 150 200 2500

10

20

30

40

50

60

70

80

90

100

P[%

]

Ksec

0 50 100 150 200 2500

50

100

150

200

250

Ke

st

selected highest probability

selected key estimate

Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network

Page 14: Optimization of Power Analysis Using Neural Network...Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network About Us Introduction Optimization

About UsIntroduction

Optimization of Power AnalysisConclusion

Optimization ProposalImplementation of OptimizationComparison of Classification Results

Histograms of Highest Probabilities

The results confirm the increase of the maximum probabilities,

number of keys potentially predisposed to wrong classificationis reduced.

0 10 20 30 40 50 60 70 80 90 1000

5

10

15

20

25

30

35

40

45

P [%]

num

ber

of occurr

ences

0 10 20 30 40 50 60 70 80 90 1000

50

100

150

200

250

P [%]

num

ber

of occurr

ences

Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network

Page 15: Optimization of Power Analysis Using Neural Network...Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network About Us Introduction Optimization

About UsIntroduction

Optimization of Power AnalysisConclusion

Optimization ProposalImplementation of OptimizationComparison of Classification Results

Cross-validation

2, 560 power traces, 10 power traces for each key value,

10-fold cross-validation, 9 training traces and 1 testing inevery step of validation,

template attack: 256 templates, 9 interesting points.

Step of cross-validation 1 2 3 4 5 6 7 8 9 10 err Successrate [%]

Template err [−] 11 13 7 6 12 7 8 7 4 9 8.4 96.71Original method err [−] 10 5 12 17 8 17 13 14 7 12 11.5 95.71

Optimized method err [−] 0 0 0 0 1 0 1 0 0 0 0.2 99.92

Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network

Page 16: Optimization of Power Analysis Using Neural Network...Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network About Us Introduction Optimization

About UsIntroduction

Optimization of Power AnalysisConclusion

Conclusion

Conclusion

Optimization of the power analysis based on multi-layerperceptron using preprocessing,

the optimization allowed a significant improvement of theclassification results,

probability of correct key estimates was increased and theother possible key estimates were suppressed,

total suppression of alternative probabilities might havenegative effect,

the original method and the optimized method were comparedusing the typical 10-fold cross-validation,

the optimized method is able to reveal the secret key valuewith almost 100% success rate.

Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network

Page 17: Optimization of Power Analysis Using Neural Network...Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network About Us Introduction Optimization

About UsIntroduction

Optimization of Power AnalysisConclusion

Conclusion

Thank you for [email protected]

This research work is funded by the Ministry of Industry and Trade of the Czech Republic, project FR-TI4/647.Measurements were run on computational facilities of the SIX Research Center, registration number

CZ.1.05/2.1.00/03.0072.

Zdenek Martinasek, Jan Hajny and Lukas Malina Optimization of Power Analysis Using Neural Network