New Possibilities for Cellular Automata in Cryptography

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
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
2
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).
3
Elementary Cellular
Automata (CA)
• s states
• synchronous evolution
• Discrete dynamic system
• neighborhood radius r
depending on rule R
r
States (s)
=0
=1
t ...
t+1 ...
t+2 ...
...
...
...
4
N
D=1,
r=1,
c= 2
CA Rules
• One-dimensional CA:
• next state of cell i:
• Example: Rule 30
10
= 1E16 = 000111102
Time
5
CA evolution
• Evolution depends strongly on initial
conditions and rule used
1-D
Time
2-D
6 Kind of Science”, 2002
Source: Wolfram, “A New
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.
7
Chaotic CA Evolution
• Very similar conditions can led to very different
final states
Time
8
Computational Unpredictability
and Irreversibility
Prediction:
impossible
Time
Reversion:
costly
9
Applications of CCA in
Cryptography
• Random Number Generators
• Hash Algorithms
Input
Input
Output
Output
Output
1st generation
2nd generation
nth generation
k-iterations
Input/Seed
1
Applications of CCA in
Cryptography
• Example: Vernam cipher key generator
Seed
Plain Text:
Hello World
k-iterations
010010000110010101101100011011000110111100100
0000101011101101111011100100110110001100100
111100010000000010101010101010101001110100101
0011110011111110001001101000001000011010011
=
101110010110010111000110110001101111001000001
0011011000010011110010001100111110010110111
Cipher
Text: 9aHew(d0=M$
1
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
What is good,
can become better?
1
Parallelism in CA
• The evolution of CA can be calculated using
parallel processing:
• take advantage of multicore processors;
• increase performance
.
.
.
.
.
.
.
.
.
N=20, r =11, 4 cores
.
.
.
1
Parallel CA Experiments
•
Large CA simulated using parallelism
•
•
•
•
•
number of cells: 27 <= N <= 218 (128256k bits)
cores: 2
rule: 3010 = 1E16
iterations: k = 2N
parallel C libraries:
•
•
OpenMP
PThreads
1
Results (1)
Runtime as a function of the input size (2 cores)
time
decreases
1
Results (2)
Speedup as a function of the (log2)
input size (2 cores)
Speedupmax=1.65
Gain over
singleprocessing
1
New Results
• Impact of radius r on parallel processing of CAs
• Algorithm optimization
1
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
r
t
area are shared by two t+1
cores for reading, but
not for writing ==>
t+2
synchronization is
easier.
1
r
...
...
...
...
...
...
r=1
Problem using larger
radius r
• Problems:
• Memory access
r
r
t
...
...
• Cores will need
t+1
...
...
more time to
synchronize
t+2
...
...
bottleneck
r=4
2
Algorithm Optimization
•
•
N
In this case, fewer cell states
need to be calculated => black
areas cells can be ignored.
k-iterations
•
A pseudo-random number
(bit) generator can be obtained
from the central cell during the
CA evolution.
Number of states to update:
•
•
Traditional: N*k
Optimized: N*(k - h/2)
2
h
Computational effort
reduction
Reduction of steps as a function of number of
iterations k and radius r
2
•
•
Conclusions
CAs have good characteristics to be used as random number
generators and hash functions.
•
Popularity of multicore processors (even on mobile devices) is
increasing the adoption of parallel processing.
•
•
•
However, they need adequate sizes and good set of rules.
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
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
Thank You!
Gracias! Obrigado!
• [email protected][email protected]
• twitter: @maurotfilho
• about.me/maurotfilho
2
Boundary Conditions
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
•
•
Null Neighbourhood
Cyclic Neighbourhood
...
...
...
t
N
=0
=1
t+1
2
CA Important Facts
• 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.
2
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.
2
• Stephen Wolfram. A New Kind of Science. Wolfram Media, Inc, 2002.