31
Optimisation heuristics in randomness testing Karel Kub´ ıˇ cek 2017-06-22 1 / 16

Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Optimisation heuristics in randomness testing

Karel Kubıcek

2017-06-22

1 / 16

Page 2: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Cryptoprimitives and their cryptanalysis

AES

3 years competitionused for 17+ years

DES

used for 24+ years

Manual cryptanalysis

Automation

statistical batteries: fixedEACirc: adaptive to the data

2 / 16

Page 3: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Cryptoprimitives and their cryptanalysis

AES

3 years competitionused for 17+ years

DES

used for 24+ years

Manual cryptanalysis

Automation

statistical batteries: fixedEACirc: adaptive to the data

2 / 16

Page 4: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Cryptoprimitives and their cryptanalysis

AES

3 years competitionused for 17+ years

DES

used for 24+ years

Manual cryptanalysis

Automation

statistical batteries: fixedEACirc: adaptive to the data

2 / 16

Page 5: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Goals of the work

Study metaheuristics

analyse their application for randomness testing

Try 4-5 metaheuristics

Compare them using dataset of well-known crypto functions

Implement the dataset functions

3 / 16

Page 6: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

EACirc basic scheme

distinguisher

AES ciphertext

Random data

AES

Random

Input = one test vector Output = guess of source

4 / 16

Page 7: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

EACirc circuit – the distinguisher from previous slide

5 / 16

Page 8: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Metaheuristics classification

Strategies for improving local search

Iterate with differentsolutions

Multi-startlocal search

Iterative localsearch, GRASP

Change landscapeof the problem

Change of the objective functionor the input data

Guidedlocalsearch

Noisy method Smoothingmethod

Use differentneighbourhoods

Variableneighbourhood

search

Accept non-improvingneighbours

Simulatedannealing

Tabusearch

6 / 16

Page 9: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Evaluation dataset

Well-known functions for benchmarking

SHA-3 finalists: Keccak, BLAKE, Grøstl, JH, SkeineSTREAM winners: HC-128, Rabbit, Salsa20, SOSEMANUK, Grainother: AES, DES, TEA, RC4

Tool for data generation

Data are highly customisableThesis data published online (and used by other research teams)

7 / 16

Page 10: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Evaluation dataset

Well-known functions for benchmarking

SHA-3 finalists: Keccak, BLAKE, Grøstl, JH, SkeineSTREAM winners: HC-128, Rabbit, Salsa20, SOSEMANUK, Grainother: AES, DES, TEA, RC4

Tool for data generation

Data are highly customisableThesis data published online (and used by other research teams)

7 / 16

Page 11: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Metaheuristic: Iterative local search – baseline

Function\rounds 0 1 2 3 4 5 6 7 8 9 10rnd rnd 0.01112 – – – – – – – – – –AES – 1.0 1.0 0.160 0.015 – – – – – –BLAKE 1.0 0.110 0.007 0.012 – – – – – – –Grain – – 1.0 0.006 0.007 – – – – – –Grøstl – – 1.0 0.013 0.013 0.013 – – – – –HC-128 0.009 0.007 – – – – – – – – –JH – – – – – – 1.0 0.015 0.012 – –Keccak – 1.0 1.0 0.018 0.017 – – – – – –MD6 – – – – – – – – 0.774 0.009 0.007Rabbit 0.014 0.009 – – – – – – – – –RC4 – 0.01 – – – – – – – – –Salsa20 – – 1.0 0.016 0.01 – – – – – –SINGLE-DES – – – 1.0 0.204 0.017 0.010 – – – –Skein 0.012 – – – – – – – – – –SOSEMANUK 0.012 0.010 – – – – – – – – –TEA – – – 1.0 0.444 0.009 0.010 – – – –TRIPLE-DES – – 1.0 0.010 0.015 0.012 – – – – –

8 / 16

Page 12: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Metaheuristic: Simulated annealing

Function\rounds 0 1 2 3 4 5 6 7 8 9 10rnd rnd 0.01681 – – – – – – – – – –AES – 1.0 1.0 0.305 0.013 – – – – – –BLAKE 1.0 0.051 0.015 0.017 – – – – – – –Grain – – 1.0 0.019 0.011 – – – – – –Grøstl – – 1.0 0.012 0.019 0.014 – – – – –HC-128 0.009 0.015 – – – – – – – – –JH – – – – – – 1.0 0.018 0.02 – –Keccak – 1.0 1.0 0.012 0.013 – – – – – –MD6 – – – – – – – – 0.419 0.019 0.015Rabbit 0.024 0.016 – – – – – – – – –RC4 – 0.011 – – – – – – – – –Salsa20 – – 1.0 0.013 0.021 – – – – – –SINGLE-DES – – – 1.0 0.093 0.019 0.021 – – – –Skein 0.014 – – – – – – – – – –SOSEMANUK 0.013 0.022 – – – – – – – – –TEA – – – 1.0 0.244 0.013 0.015 – – – –TRIPLE-DES – – 1.0 0.015 0.018 0.023 – – – – –

9 / 16

Page 13: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Metaheuristic: Guided local search

Function\rounds 0 1 2 3 4 5 6 7 8 9 10rnd rnd 0.01110 – – – – – – – – – –AES – 1.0 1.0 0.164 0.005 – – – – – –BLAKE 1.0 0.260 0.012 0.012 – – – – – – –Grain – – 1.0 0.010 0.013 – – – – – –Grøstl – – 1.0 0.015 0.016 0.014 – – – – –HC-128 0.021 0.012 – – – – – – – – –JH – – – – – – 1.0 0.011 0.003 – –Keccak – 1.0 1.0 0.021 0.016 – – – – – –MD6 – – – – – – – – 0.995 0.020 0.006Rabbit 0.006 0.015 – – – – – – – – –RC4 – 0.011 – – – – – – – – –Salsa20 – – 1.0 0.007 0.011 – – – – – –SINGLE-DES – – – 1.0 0.496 0.014 0.013 – – – –Skein 0.009 – – – – – – – – – –SOSEMANUK 0.010 0.007 – – – – – – – – –TEA – – – 1.0 0.729 0.011 0.008 – – – –TRIPLE-DES – – 1.0 0.008 0.012 0.009 – – – – –

10 / 16

Page 14: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Metaheuristic: Variable neighbourhood search

Function\rounds 0 1 2 3 4 5 6 7 8 9 10rnd rnd 0.01150 – – – – – – – – – –AES – 1.0 1.0 0.182 0.009 – – – – – –BLAKE 1.0 0.157 0.006 0.012 – – – – – – –Grain – – 1.0 0.010 0.011 – – – – – –Grøstl – – 1.0 0.014 0.007 0.017 – – – – –HC-128 0.015 0.015 – – – – – – – – –JH – – – – – – 1.0 0.005 0.010 – –Keccak – 1.0 1.0 0.018 0.014 – – – – – –MD6 – – – – – – – – 0.992 0.006 0.010Rabbit 0.017 0.010 – – – – – – – – –RC4 – 0.004 – – – – – – – – –Salsa20 – – 1.0 0.007 0.012 – – – – – –SINGLE-DES – – – 1.0 0.441 0.006 0.016 – – – –Skein 0.006 – – – – – – – – – –SOSEMANUK 0.013 0.012 – – – – – – – – –TEA – – – 1.0 0.877 0.009 0.013 – – – –TRIPLE-DES – – 1.0 0.013 0.007 0.017 – – – – –

11 / 16

Page 15: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Metaheuristics comparison

Functionrounds\Metaheuristic Iterated

local search

Simulated

annealing

Guidedlocal search

Variableneigh.search

AES3 0.160 0.305 0.164 0.182BLAKE1 0.110 0.051 0.260 0.157MD68 0.774 0.419 0.995 0.992Single DES4 0.204 0.093 0.496 0.441TEA4 0.444 0.244 0.729 0.877

Differences are small

Guided local search seems to be the best

because it has no performance loss and:

12 / 16

Page 16: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Cryptanalysis from the circuit

13 / 16

Page 17: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Cryptanalysis from the circuit

13 / 16

Page 18: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Cryptanalysis from the circuit – pruning

14 / 16

Page 19: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Cryptanalysis from the circuit – pruning

14 / 16

Page 20: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Comparison with other tools

EACirc competitors = statistical batteries

NIST STS – worse or same (to EACirc)Dieharder – similar or slightly betterTestU01 – far better

15 / 16

Page 21: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Conclusion

Various metaheuristics explored, three implemented in EACirc

evaluated on many well-known cryptographic functions

Guided local search used in EACirc

mainly due to circuits analysis

Metaheuristics additionally tested on

evolutionary algorithms on polynomial representationneural networks for randomness testingongoing cooperation with Ca’ Foscari University of Venice and BUT

Developed standalone tool for crypto data generation

planed as publication on NordSec

Thank you for your attention, questions?

16 / 16

Page 22: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Conclusion

Various metaheuristics explored, three implemented in EACirc

evaluated on many well-known cryptographic functions

Guided local search used in EACirc

mainly due to circuits analysis

Metaheuristics additionally tested on

evolutionary algorithms on polynomial representationneural networks for randomness testingongoing cooperation with Ca’ Foscari University of Venice and BUT

Developed standalone tool for crypto data generation

planed as publication on NordSec

Thank you for your attention, questions?

16 / 16

Page 23: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

”Connection bug” explanation

17 / 16

Page 24: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

”Connection bug” explanation

17 / 16

Page 25: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Workaround

Remove 0 p-values

Change circuit if p-value = 0

Substitute 0 p-values with random (0,1)

Completely new evaluation

Metaheuristics

18 / 16

Page 26: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Baseline random-random experiment

Function\rounds 0 1 2 3 4 5 6 7 8 9 10rnd rnd 0.01112 – – – – – – – – – –AES – 1.0 1.0 0.160 0.015 – – – – – –BLAKE 1.0 0.110 0.007 0.012 – – – – – – –Grain – – 1.0 0.006 0.007 – – – – – –Grøstl – – 1.0 0.013 0.013 0.013 – – – – –HC-128 0.009 0.007 – – – – – – – – –JH – – – – – – 1.0 0.015 0.012 – –Keccak – 1.0 1.0 0.018 0.017 – – – – – –MD6 – – – – – – – – 0.774 0.009 0.007Rabbit 0.014 0.009 – – – – – – – – –RC4 – 0.01 – – – – – – – – –Salsa20 – – 1.0 0.016 0.01 – – – – – –SINGLE-DES – – – 1.0 0.204 0.017 0.010 – – – –Skein 0.012 – – – – – – – – – –SOSEMANUK 0.012 0.010 – – – – – – – – –TEA – – – 1.0 0.444 0.009 0.010 – – – –TRIPLE-DES – – 1.0 0.010 0.015 0.012 – – – – –

19 / 16

Page 27: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Metaheuristics comparison

Remove 0 p-values → 0.01681

Change circuit if p-value = 0 → cycling

Substitute 0 p-values with random (0,1) → 0.01267

Completely new evaluation → weaker

Metaheuristics

Function\Metaheuristic Iterated

local search

Simulated

annealing

Guidedlocal search

Variableneigh.search

rnd rnd 0.01112 0.01681 0.01110 0.01150

20 / 16

Page 28: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Metaheuristics comparison

Remove 0 p-values → 0.01681

Change circuit if p-value = 0 → cycling

Substitute 0 p-values with random (0,1) → 0.01267

Completely new evaluation → weaker

Metaheuristics

Function\Metaheuristic Iterated

local search

Simulated

annealing

Guidedlocal search

Variableneigh.search

rnd rnd 0.01112 0.01681 0.01110 0.01150

20 / 16

Page 29: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

”Substitute 0 p-values with random (0,1)” analysis

21 / 16

Page 30: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Guided local search – dense circuits

22 / 16

Page 31: Optimisation heuristics in randomness testing · Metaheuristic: Iterative local search { baseline Functionnrounds 0 1 2 3 4 5 6 7 8 9 10 rnd rnd 0.01112 { { { { { { { { { {AES { 1.0

Guided local search – sparse circuits

23 / 16