such a property was identified, providing a higher de-
gree of freedom when searching for a distinguisher.
We designed and tested an automated process that
can be used in a similar manner as general statistical
testing suites, but additionally provides the possibil-
ity to construct (again automatically) new tests. We
represent the “tests” as a hardware-like circuit emu-
lated in software that execute over given inputs and
computes outputs. Evolutionary algorithms (EAs)
are used to design the circuit layout (“wires” and
“gates”). Although such an automated tool will not
(at least for the moment) outperform a skilled cryp-
tographer, still it brings two major advantages:
• It can be applied automatically against multiple
different cryptographic functions with no addi-
tional human labour – working implementation of
the inspected function is sufficient. Cryptographic
function competitions like AES (AES, 1997),
SHA-3 (SHA-3, 2007) or eStream (ECRYPT,
2004) are providing a particular advantage be-
cause candidate functions have to comply with
a standard programming interface (API), further
easing tests of numerous functions.
• It may discover and use other information leakage
“side channels” of the function than those usu-
ally assumed by cryptographers. The proposed
approach does not require pre-selection of partic-
ular parts of the function or input/output bits or to
define statistics used – this decision is left to the
evolutionary algorithm. Note that the proposed
approach may lead to even better results if a crypt-
analyst targets only a specific part of the inspected
function.
We implemented the proposed approach (more details
given in Section 3) and tested our idea on random
distinguishers of output from several eStream candi-
date functions (see Section 4). To assess the success
and usefulness of this method, we focused on func-
tions with inner structure containing repeated rounds.
By gradually increasing the number of rounds used
in a function, one can identify the maximum num-
ber of rounds where the approach still provides re-
sults (i.e., distinguisher with better probability than
random guessing). Results are very similar to those
obtained from STS NIST and Dieharder test suites
w.r.t. the number of rounds of the inspected function.
2 PREVIOUS WORK
Numerous works tackled the problem of distinguisher
construction between data produced by cryptographic
functions and truly random data, both with reduced
and full number of rounds. Usually, statistical testing
with battery of tests (e.g., STS NIST (Rukhin, 2010)
or Dieharder (Brown, 2004)) or additional custom tai-
lored statistical tests are performed. The STS NIST
battery was used to evaluate fifteen AES (round 2)
candidates, demonstrating some deviation from ran-
domness in six candidates (Soto, 1999). In (Turan
et al., 2006), detailed examination of eStream Phase
2 candidates (full and reduced round tests) with STS
NIST battery and structural randomness tests was per-
formed, finding six ciphers deviating from expected
values. More recently, the same battery, but only a
subset of the tests, was applied to the SHA-3 candi-
dates (in the second round of competition, 14 in to-
tal) for a reduced number of rounds as well as only
to compression function of algorithm (Doganaksoy
et al., 2010). Additionally, custom-built statistical
tests based on strict avalanche criterion and others
were used, resulting in estimation of relative secu-
rity margins of candidates w.r.t. the number of rounds.
(Sulak et al., 2010) proposed a method to test statis-
tical properties of short sequences typically obtained
by block ciphers or hash algorithms for which some
from STS NIST can not be applied due to insufficient
length. Probabilities expressed by p-values are calcu-
lated for each short subinterval and improved method
based on recalculation of expected probabilities is
provided. Example results applied to selected block
and hash functions are presented. 256-bit versions of
SHA-3 finalists were subjected to statistical tests us-
ing a GPU-accelerated evaluation (Kaminsky, 2012).
Both algorithms and selected tests from STS NIST
battery were implemented for the nVidia CUDA plat-
form. Because of massive parallelization, superpoly
tests introduced by (Dinur and Shamir, 2009) were
possible to be performed, detecting some deviations
in all but the Grøstl algorithm.
Stochastic algorithms were also applied in cryp-
tography to some extent, focusing initially mostly on
simple transposition and substitution ciphers or prob-
lems like efficient knapsack algorithm. A nice re-
view of usage of genetic algorithms in cryptography
up to year 2004 can be found in (Delman, 2004), a
more recent review of evolutionary methods used in
cryptography is provided by (Picek and Golub, 2011).
TEA algorithm (Wheeler and Needham, 1995) with
a reduced number of rounds is a frequent target for
cryptoanalysis with genetic algorithms. In (Castro
and Vi˜nuela, 2005), a successful randomness distin-
guisher for XTEA limited to 4 rounds is generated
with genetic algorithms. The distinguisher gener-
ates a bit mask with high Hamming weight which
when applied to function input, resulting in devi-
ated χ
2
Goodness of Fit test of the output. Addi-
SECRYPT2013-InternationalConferenceonSecurityandCryptography
136