<<

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; • : 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)

• Discrete dynamic system • s states • neighborhood radius r • synchronous evolution depending on rule R

r t ...... States (s) t+1 ...... D=1, = 0 r=1, = 1 t+2 ...... c= 2

4 N CA Rules • One-dimensional CA: • next state of cell i:

• Example: Rule 3010 = 1E16 = 000111102

Time

5 CA evolution • Evolution depends strongly on initial conditions and rule used

1-D

Time 2-D

Source: Wolfram, “A New6 Kind of Science”, 2002 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/Seed Input Input

k

-

iterations

Output Output Output

1st generation 2nd generation nth generation 1 0 Applications of CCA in Cryptography

• Example: Vernam cipher key generator

Seed Plain Text: Hello World

010010000110010101101100011011000110111100100

k -

iterations 0000101011101101111011100100110110001100100

111100010000000010101010101010101001110100101 0011110011111110001001101000001000011010011

= 101110010110010111000110110001101111001000001 0011011000010011110010001100111110010110111

Cipher1 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 2 What is good, can become better?

1 3 Parallelism in CA • The evolution of CA can be calculated using parallel processing: • take advantage of multicore processors; • increase performance

......

N=20, r =1 1, 4 cores 1 4 4 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 5 Results (1)

Runtime as a function of the input size (2 cores)

time decreases

1 6 Results (2)

Speedup as a function of the (log2) input size (2 cores)

Speedupmax=1.65 Gain over single- processing

1 7 New Results

• Impact of radius r on parallel processing of CAs • Algorithm optimization

1 8 Impact of radius r on processing parallel CA • Each of p cores, will read ((N/p) + 2r) cells at each iteration. r r t ...... • The cells on the gray area are shared by two t+1 ...... cores for reading, but not for writing ==> t+2 ...... synchronization is easier. r=1

1 9 Problem using larger radius r

• Problems: r r Memory access • t ...... bottleneck • Cores will need t+1 ...... more time to t+2 ...... synchronize r=4

2 0 Algorithm Optimization

• A pseudo-random number (bit) generator can be obtained from the central cell during the N CA evolution.

• In this case, fewer cell states k - need to be calculated => black iterations areas cells can be ignored. h • Number of states to update: • Traditional: N*k • Optimized: N*(k - h/2)

2 1 Computational effort reduction Reduction of steps as a function of number of iterations k and radius r

2 2 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 3 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 4 Thank You! Gracias! Obrigado!

[email protected][email protected] • twitter: @maurotfilho • about.me/maurotfilho

2 5 Boundary Conditions At the extremes of each line, where the neighboring cells are not physically adjacent, we use one of the following approaches: • Null Neighbourhood

• Cyclic Neighbourhood t ... t t+1 ... t+2 ... N t+1

= 0 = 1 2 6 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 7 References

• Petre Anghelescu, Silviu Ionita, and Ionel Bostan. Design of programmable cellular automata based cipher scheme. 2009 World Congress on Nature & Biologically Inspired (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 , 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 , 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 . Invertible cellular automata: A review. Physica D 45, pages 229–253, 1990. • Stanislaw Ulam. Random process and transformations. Proceedings of the International Congress on , 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. . Wolfram Media, Inc, 2002. 8