New Possibilities for Cellular Automata in Cryptography Mauro Tardivo Filho Marco A. A. Henriques Faculty of Electrical and Computer Engineering University of Campinas Sao Paulo - Brazil
New Possibilities for
Cellular Automata in
Cryptography
Mauro Tardivo Filho
Marco A. A. Henriques
Faculty of Electrical and Computer Engineering
University of Campinas
Sao Paulo - Brazil
2
Overview
1.History
2.Cellular Automata
3.Chaotic Cellular Automata
4.Application of Chaotic Cellular Automata in Cryptography
5. Parallelism in Cellular Automata
1.Mechanisms of parallelism
2.Results
6.New results
7.Conclusion
3
History
• Universal copier and constructor (1940s):
• Stanislaw Ulam: growth of crystals;
• John von Neumann: self-replicating systems
in robotics.
• John Conway: Game of Life (1970s)
• Stephen Wolfram: analyzed the behavior and
complexity of cellular automata (1983).
4
Elementary Cellular
Automata (CA)
• Discrete dynamic system
• neighborhood radius r
D=1,
r=1,
c= 2
t
t+1
t+2
N
r
= 0
= 1
States (s) ...
...
...
...
...
...
• s states
• synchronous evolution
depending on rule R
5
CA Rules
• One-dimensional CA:
• next state of cell i:
• Example: Rule 3010 = 1E16 = 000111102
Tim
e
6
CA evolution
Source: Wolfram, “A New Kind of Science”, 2002
• Evolution depends strongly on initial
conditions and rule used
Tim
e
1-D
2-D
7
Chaotic Behaviour
• Some rules cause a chaotic behaviour => Chaotic CA
(CCA)
• The difference between the evolutions from two
similar initial states increases with respect to time;
• consequence: great dependence on initial conditions.
• future states cannot be predicted unless doing a state
by state calculation;
• cost to obtain previous states can be made very high,
increasing the number of CA cells and/or the radius r.
8
Chaotic CA Evolution
• Very similar conditions can led to very different
final states
Tim
e
9
Computational Unpredictability
and Irreversibility
Prediction:
impossible
Reversion:
costly
Tim
e
1
0
Applications of CCA in
Cryptography
• Random Number Generators
• Hash Algorithms
Input/Seed Input Input
Output Output Output
k-iteratio
ns
1st generation 2nd generation nth generation
1
1
Applications of CCA in
Cryptography
• Example: Vernam cipher key generator
Seed
k-iteratio
ns
Plain Text: Hello World 010010000110010101101100011011000110111100100
0000101011101101111011100100110110001100100
111100010000000010101010101010101001110100101
0011110011111110001001101000001000011010011
Cipher Text:
= 101110010110010111000110110001101111001000001
0011011000010011110010001100111110010110111
9aHew(d0=M$
1
2
CA robustness
• Bao (2003) showed vulnerabilities in CA
cryptosystems: they can be predictable.
• Solutions:
• use different rules for differente cells
(Hybrid CA);
• increase number of cells (N), neighborhood
radius (r) or number of iterations (k);
• use rules with good chaotic behaviour.
1
3
What is good,
can become better?
1
4
Parallelism in CA • The evolution of CA can be calculated using
parallel processing:
• take advantage of multicore processors;
• increase performance
N=20, r = 1, 4 cores
.
.
.
.
.
.
.
.
.
.
.
.
1
4
1
5
Parallel CA Experiments
• Large CA simulated using parallelism
• number of cells: 27 <= N <= 218 (128-
256k bits)
• cores: 2
• rule: 3010 = 1E16
• iterations: k = 2N
• parallel C libraries:
• OpenMP
• PThreads
1
6
Results (1)
Runtime as a function of the input size (2 cores)
time
decreases
1
7
Results (2) Speedup as a function of the (log2)
input size (2 cores)
Speedupmax=1.65 Gain over
single-
processing
1
8
New Results
• Impact of radius r on parallel processing of CAs
• Algorithm optimization
1
9
Impact of radius r on
processing parallel CA • Each of p cores, will
read ((N/p) + 2r) cells
at each iteration.
• The cells on the gray
area are shared by two
cores for reading, but
not for writing ==>
synchronization is
easier.
t
t+1
t+2
r=1
r r
...
...
...
...
...
...
2
0
Problem using larger
radius r
• Problems:
• Memory access
bottleneck
• Cores will need
more time to
synchronize
t
t+1
t+2
r=4
r r
...
...
...
...
...
...
2
1
Algorithm Optimization
• A pseudo-random number
(bit) generator can be obtained
from the central cell during the
CA evolution.
• In this case, fewer cell states
need to be calculated => black
areas cells can be ignored.
• Number of states to update:
• Traditional: N*k
• Optimized: N*(k - h/2)
N
k-iteratio
ns
h
2
2
Computational effort
reduction Reduction of steps as a function of number of
iterations k and radius r
2
3
Conclusions • CAs have good characteristics to be used as random number
generators and hash functions.
• However, they need adequate sizes and good set of rules.
• Popularity of multicore processors (even on mobile devices) is
increasing the adoption of parallel processing.
• CA can be easily implemented and scaled in parallel
architectures.
• However, experiments indicate that the choice of
appropriate mapping and programming tools is crucial to
the success of a parallel implementation.
• Some optimizations can be made to reduce the volume of
calculation needed and the actual reduction depends strongly
on the size and other CA parameters.
2
4
Future Works • New research efforts are needed to better
understand:
• the strength of CA with larger
neighborhoods (radius);
• the real benefits that can be obtained from
parallel processing techniques in multicore
enviroments;
• the impacts of a CA parallel implementation
on the overall system security.
2
5
Thank You!
Gracias! Obrigado!
• twitter: @maurotfilho
• about.me/maurotfilho
2
6
Boundary Conditions
• Null Neighbourhood
• Cyclic Neighbourhood
= 0 = 1
...
...
... N
At the extremes of each line, where the
neighboring cells are not physically adjacent, we
use one of the following approaches:
t
t+1
t+2
t
t+1
2
7
• Szaban et. al (2006) implemented a Genetic
Algorithm (GA) which found sets of rules
for CA with good non-linearity and
randomness, using neighborhoods of radii 1
and 2.
• As a future work, larger neighborhoods can
be explored to possible find better rules.
CA Important Facts
2
8
References • Petre Anghelescu, Silviu Ionita, and Ionel Bostan. Design of programmable cellular automata based cipher scheme. 2009
World Congress on Nature & Biologically Inspired Computing (NaBIC), pages 187–192, 2009.
• Blaise Barney. Posix threads programming. https://computing.llnl.gov/tutorials/pthreads/.
• Debasis, Das and Abhishek Ray. A Parallel Encryption Algorithm for Block Ciphers Based on Reversible Programmable Cellular Automata. Journal of Computer Science, 1(1):82– 90, 2010.
• Martin Gardner. The fantastic combinations of John Conway’s new solitaire game "life". Scientific American, 1(223):120–123, 1970.
• Juan Pedro Hecht. Autómatas celulares caóticos en la generación de funciones. IV Congreso Iberoamericano de Seguridad Informática CIBSI’07, pages 157–170, 2007.
• K J Jegadish Kumar, K Chenna Kesava, and S Salivahanan. Novel and Efficient Cellular Automata based Symmetric Key Encryption Algorithm for Wireless Sensor Networks. International Journal, 13(4), 2011.
• T. G. Mattos and J. G. Moreira. Universality classes of chaotic cellular automata. Brazilian Journal of Physics, 34(2a):448–451, June 2004.
• S.Nandi, B.K.Kar, and P. Pal Chaudhuri. Theory and applications of cellular automata in cryptography. IEEE Transactions on Computers, 43(12):1346–1357, 1994.
• The OpenMP API specification for parallel programming. http://openmp.org/wp/openmp- specifications/.
• Tommaso Toffoli and Norman Margolus. Invertible cellular automata: A review. Physica D 45, pages 229–253, 1990.
• Stanislaw Ulam. Random process and transformations. Proceedings of the International Congress on Mathematics, Vol. 2 (1952):264– 275, 1950.
• John von Neumann. The general and logical theory of automata. Collected Works, 5:288, 1963.
• John von Neumann. Theory of Self- Reproducing Automata. University of Illinois, Urbana, 1966.
• Stephen Wolfram. Theory and applications of cellular automata. Rev. Mod. Physica, 55(601), 1983.
• Stephen Wolfram. Universality and complexity in cellular automata. Physica D10, 1984.
• Stephen Wolfram. Random sequence generation by cellular automata. Adv Appl Math, 7:123, 1986.
• Stephen Wolfram. A New Kind of Science. Wolfram Media, Inc, 2002.