You are on page 1of 7


Digital Image Scrambling Using 2D Cellular Automata
Ajith K.P. (B100198EC), Arun Tony (B100171EC), Aswin E. Augustine (B100305EC) Basil Babu (B100523EC), Vaisakh R.P. (B100087EC) Project Guide : Sudhish N. George

Abstract—Scrambling is a process that has proved to be very effective in increasing the quality of data hiding, watermarking, and encryption applications. Cellular automata are used in diverse and numerous applications because of their ability to obtain complex global behavior from simple and localized rules. In this project we apply cellular automata in the field of image scrambling because of the potential it holds in breaking the correlation between different image pixels effectively.In this semester we are dealing with greyscale images and in the next semester we will be extending this to video.



he rapid development of communication technology due to the global spread of the Internet and the digital information revolution has given rise to a huge increase in the use and transmission of multimedia information (images, audio, and video). As a result, information security during storage and transmission has become a critical issue. Image scrambling, which tries to hide image content from irrelevant user, is commonly used for image data security. To scramble an image is to transform the meaningful original image into a meaningless or disordered image. Image scrambling is analogous to image encryption, with the plain text and cipher text corresponding to the original image and meaningless noises for unauthorized user respectively. Image data have strong correlations among adjacent pixels. In a meaningful image, the pixels are correlative in horizontal, vertical and diagonal directions. Thus an important tenet of image scrambling is to destroy the correlations among adjacent pixels. The ability to obtain complex global behavior from simple local rules makes CA an interesting platform for digital image scrambling.The most widely known example, the Game of Life (GL), is a 2D CA that produces large amounts of patterned data. The Game Of Life (which was designed by John Conway) can scramble the digital image by providing the complex behavior that would produce the most useful operations. II. L ITERATURE S URVEY A. Cellular Automata CA are widely used in applications such as art (generated images and music), random number generation, pattern recognition, routing algorithms, and games. The application of CA in the area of digital image processing includes image enhancement, compression, encryption, and watermarking.

CA are dynamic, complex space and time discrete systems originally proposed by Stanislaw Ulam and John von Neumann in the 1940s as formal models for self-reproducing organisms. They consist of a certain number of identical cells, each of which can take a finite number of states. The cells are distributed in space in a rectangular grid in one or more dimensions. At every time step, all the cells update their states synchronously by applying rules (transition function), which take as input the state of the cell under consideration and the states of its neighbouring cells. Typically, the rule for updating the state of cells is the same for each cell and does not change over time, and is applied to the whole grid simultaneously, though exceptions are known, such as the stochastic cellular automaton and asynchronous cellular automaton.

B. Classification Wolfram, in A New Kind of Science and several papers dating from the mid-1980s, defined four classes into which cellular automata and several other simple computational models can be divided depending on their behavior. While earlier studies in cellular automata tended to try to identify type of patterns for specific rules, Wolfram’s classification was the first attempt to classify the rules themselves. In order of complexity the classes are:

Class 1: Nearly all initial patterns evolve quickly into a stable, homogeneous state. Any randomness in the initial pattern disappears Class 2: Nearly all initial patterns evolve quickly into stable or oscillating structures. Some of the randomness in the initial pattern may filter out, but some remains. Local changes to the initial pattern tend to remain local. Class 3: Nearly all initial patterns evolve in a pseudorandom or chaotic manner. Any stable structures that appear are quickly destroyed by the surrounding noise. Local changes to the initial pattern tend to spread indefinitely. Class 4: Nearly all initial patterns evolve into structures that interact in complex and interesting ways, with the formation of local structures that are able to survive for long periods of time.

This has been proven for Rule 110 and Conway’s game of Life. according to the Moore neighborhood. A cell dead at time t becomes alive at time t + 1 if exactly three of its neighbors are alive at time t.that show some features of one class and some of another. yields a total of five cells in the Von Neumann neighborhood. Wolfram’s class 2 can be partitioned into two subgroups of stable (fixed-point) and oscillating (periodic) rules. A cell alive at time t dies at time t + 1 if four or more of its neighbors are alive at time t. east. Such cellular automata have rules specially constructed to be reversible. Local changes to the initial pattern may spread indefinitely.” Wolfram’s classification has been empirically matched to a clustering of the compressed lengths of the outputs of cellular automata. A cell alive at time t will remain alive at time t + 1 if two or three of its neighbors are alive at time t.. Reversible cellular automata are often used to simulate such physical phenomena as gas and fluid dynamics. According to Wolfram. 2) Death by overcrowding. 2: Moore Neighborhood E. represented by 1 and 0. And so it is with cellular automata: there are occasionally rules. each cell computes its new state by determining the states of the cells in its neighborhood and applying the transition rules to compute its new state. For one-dimensional cellular automata there are known algorithms for deciding whether a rule is reversible or irreversible. The Von Neumann neighborhood of range r is defined by N H (x0 . which is typically used. each cells neighborhood consists of itself. and can therefore be considered a subset of conventional cellular automata. C. it can be shown that they can be emulated by conventional cellular automata with sufficiently large neighborhoods and numbers of states. Convey’s Game Of Life The GL consists of an [M X N] matrix of cells. 4) Survival. Reversible A cellular automaton is said to be reversible if for every current configuration of the cellular automaton there is exactly one past configuration (preimage). where each cell may take only two states: alive or dead. Cellular Automata Neighborhood The radius or range is a shorthand method of specifying the neighborhood for common configurations. “. y ) : |x − x0 | + |y − y0 | ≤ r]. However. one cell to its immediate left and another to its immediate right. two common neighborhoods methods are used: Von Neumann and Moore neighborhoods. and the number of cells in each neighborhood is 2r(r + 1) + 1. inspired by the Wolfram’s classification. y0 . Every cell uses the same update rules. A range of one. it has been shown that every reversible cellular automaton can be emulated by a block cellular automaton.Several techniques can be used to explicitly construct reversible cellular automata with known inverses. D. In a 1D CA of radius r = 1.with almost any general classification scheme there are inevitably cases which get assigned to one class by one definition and another class by another definition.. John Conways Game of Life uses the Moore neighborhood.2 Class 2 type stable or oscillating structures may be the eventual outcome. In 2D CA. with neighbors to the north. y ) : |x − x0 | ≤ r. Conversely. y0 . and all the cells are updated simultaneously. 3) Death by exposure. Typically r = 1. membership in these proved to be undecidable. both of which involve modifying the definition of a cellular automaton in some way. |y − y0 | ≤ r] . If one thinks of a cellular automaton as a function mapping configurations to configurations. since they obey the laws of thermodynamics. r) = [(x. 1: Von Neuman Neighborhood of range r is defined by N H (x0 . which are sometimes called Culik-Yu classes. also called a generation.If a cellular automaton is reversible. Each cell has eight neighbors. Wolfram has conjectured that many. Culik and Yu proposed three well-defined classes (and a fourth one for the automata not matching any of these).. if not all class 4 cellular automata are capable of universal computation. r) = [(x. for cellular automata of two or more dimensions reversibility is undecidable. A cells next state is determined as follows: 1) Birth. The number of cells in each neighborhood is (2r + 1)2 . and west. Although such automata do not strictly satisfy the definition given above. that is. The Moore neighborhood Fig. respectively. . which yields a total of nine cells in the Moore neighborhood. south. For instance. but the number of steps required to reach this state may be very large.. Fig. there is no algorithm that takes as input an automaton rule and is guaranteed to determine correctly whether the automaton is reversible. These definitions are qualitative in nature and there is some room for interpretation. A cell alive at time t dies at time t + 1 if one or none of its neighbors are alive at time t. even when the initial pattern is relatively simple. its time-reversed behavior can also be described as a cellular automaton. At every time step. Two common ones are the second order cellular automaton and the block cellular automaton. reversibility implies that this function is bijective. There have been several attempts to classify cellular automata in formally rigorous classes.

it dies otherwise. rules tend to exhibit long-lived. Mirek’s Cellebration’s multi-coloured ”Rules Table” and “Weighted Life” rule families each include sample rules equivalent to Conway’s Life. State transitions are then determined either by a weighting system or by a table specifying separate transition rules for each state. j ) = 1 4 [P (i. j )]2 i. with live cells shown in black. The first number. F. Additional Life-like cellular automata exist. He quantified the classification scheme by introducing parameter λ and hypothesized that CAs computational capability is related to their average dynamic behavior. Cellular automata on a two-dimensional grid that can be described in this way are known as Life-like cellular automata. which are the basis for designing practical ciphers. and dead cells shown in white. This procedure can easily be generalized and applied to any type of digital media. HighLife is best known for its frequently occurring replicators. and patterns that translate themselves across the board (”spaceships”). Except for the variation among ON cells. the Game of Life produces live and dead cells. Moreover. new similar cellular automata have been developed. Conway’s rules may also be generalized such that instead of two states (live and dead) there are three or more. The standard Game of Life is symbolised as“B3/S23”: A cell is “Born” if it has exactly 3 neighbours. When a new cell is born from three different ON neighbours. 1) Examples of patterns: Many different types of patterns occur in the Game of Life.3 In this work. and otherwise. Cellular Automata Lambda Parameter Chris Langton proposed a relation between the λ (Lambda) value of a set of rules and the Wolfram classification. both of these variations act identically to Life. Therefore. for example. causes a birth. To evaluate the effect of image scrambling. For a binary-state 1D CA. Another similar variation. Some frequently occurring examples of these three classes are shown below. is what is required for a dead cell to be born. except that there are two ON states (often expressed as two different colours). majority of them produce universes that are either too chaotic or too desolate to be of interest. the Lambda parameter is the probability that a given neighborhood (chosen among all possible configurations) leads to a nonquiescent state (an active cell) and is equal to the fraction of 1s in the output table bits. 3: Examples of Patterns G. Hence“B6/S16” means “a cell is born if there are 6 neighbours. it takes the majority value. which λ is claimed to predict. is described by the rule B36/S23. Fig. like Immigration. while dead cells will be neglected. “Stays alive” if it has 2 or 3 living neighbours. in addition to the original game’s B3/S23 rule. called QuadLife. although the vast The scrambling effect lets us determine the robustness of the scrambled image against passive attacks. Immigration is a variation that is very similar to Conway’s Game of Life. complex behavior. and lives on if there are either 1 or 6 neighbours”. we want to show how the GL number of generations and other configurations affect the scrambling degree. CA produces ordered behavior when Lambda values are close to 0 or 1 and chaotic behavior is somewhere in between. Langtonsλ parameter has recently been extended to 2D CA. oscillators. The gray difference of a pixel with a neighbor pixel is defined as follows: GD(i. As λ reaches a critical value (λc .j . it takes on the fourth value. Live cells will be selected to form the new pixel coordinates for the scrambled image. because having 6 neighbours. This feature can be used to examine interactions between spaceships and other “objects” within the game. at each generation. Analysis of the Scrambling Effect 2) Variations on Life: Since Life’s inception. Another common Life-like automaton. it takes on the ON state that is the majority in the three cells that gave it birth. Whenever a new cell is born. we introduce gray difference and gray degree of scrambling. the scrambled image must have diffusion and confusion properties. The second set is the requirement for a live cell to survive to the next generation. involves four different ON states. j ) − P (i . or list of numbers. the edge of chaos). These two superior properties can be tested by computing the correlations of adjacent pixels in the scrambled image using the gray difference degree (GDD) function. HighLife. including still lifes.

j).This can be exteneded to colour images.. except the pixels at the edges. 2) Let Z denote the input image (scrambled image) and R the output image (decoded plain image). column). (i..For the 7th semester we will be implementing this on greyscale images. (i + 1. thus obtaining A1 . M ETHOD OF I MPLEMENTATION We will be doing this project using M ATLAB R simulation. k. j )) where E(GD(i. 4) For q = 2. Set row = 1. put it in R(i. j) such that A1 (i. Scrambling With the Game of Life Adjacent pixels in an image have a strong correlation. A2 . j) = 1 and An (i. which must be reduced to scramble the image. for all q = 1. j ). . . I MPLEMENTATION C HALLENGES Number of stages of scrambling is limited in M ATLAB R . put it in R(row. . Set row = 1. j) = 1. Fig. j such that Aq (i.. V. 2) Let Z denote the input image (plain image) and R the output image (scrambled image). C URRENT S TATUS Game of life algorithm has been successfully implemented for grey scale images in M ATLAB R . j) where. 2 .The algorithm can be described as follows 1) An [M X M] GL automaton is set up with an initial random configuration A0 and is set to run for k generations. take the gray value of pixel Z(i. column = 1. ... column) to point to the next pixel in the input image. 3) For all (i. for all i.Resolution of image used for scrambling is limited since we have to deal with extremely large number of pixels in high resolution images and it will take a long time to scramble them. 5) Take the gray value of the remaining pixels in Z in column first order and put them in column-first order in those R(row. put it in R(row. .Ak matrices. . j )) + E (GD(i.. j ) (M − 2)X (N − 2) The gray value degree is defined by GDD = E (GD(i. j + 1) and P (i. and increment (row.. A1 is the first generation produced by the GL. j) = 0. After computing the gray difference for every pixel in the image.Ak matrices. . 4) For q = 2. j )) E (GD(i. O BSERVATIONS AND R ESULTS All the images were scrambled for twenty generations. for all q = 1. column). 2 . A1 is the first generation produced by the GL.The images are loaded as matrices in M ATLAB R . j). and increment (row.1). q . j). column) to point to the next pixel.j))and E’(GD(i. in column-first order.j)) denote the average neighborhood gray differences of the input and scrambled images. . j ) denotes the gray value at position (i. A2 . . . (i.If RGB images are used then the matrix will be three dimensional and accordingly the computation will be memory consuming. VII. take the gray value of pixel Z(row. . then it is scrambled in the vertical direction. .. we execute the inverse of the scrambling algorithm using as keys the initial random configuration A0 and the number of iterations k. . q . j such that Aq (i. . column) where. We can also use double scrambling to increase the security that is. column).For the 8th semester we will be extending the project to video scrambling. F ORMULATION OF THE P ROBLEM A.We will be performing pixel scrambling using several Game of Life generations. j). j) = 1. . VI. column). We have read in and scrambled a number of image files using this method and decoded the same. 3) For all (i. take the gray value of pixel Z(row. put it in R(i. . k. first image is scrambled in the horizontal direction. j) = 0 (for n = 1. 5) Take the gray value of the remaining pixels in Z and put them in column-first order in those R(i. . and increment (row. k. we can compute the whole images average neighborhood gray difference by summing and averaging: E [GD(i. . respectively III. 4: Scrambling using Game of Life Algorithm (first step) where (i . j − 1). j ). j) such that A1 (i. IV. column = 1.. j) = 0 (for n = 1. Aq (i. for all i. thus obtaining A1 . in column-first order. column) to point to the next pixel in the input image. and increment (row. j) = 0. column) to point to the next pixel. Aq (i. .1). . . take the gray value of pixel Z(i. j) = 1 and An (i. j ) = (i − 1..4 B. j )] = M −1 i=2 N −1 j =2 GD(i. j )) − E (GD(i. j).To recover the original image. k. Decoding The algorithm for decoding can be described as follows 1) An [M X M] GL automaton is set up with the initial configuration A0 which was used in encoding the image when it was scrambled and is set to run for k generations.

5 Fig. 8: Scrambled Image of the boat Fig. 6: Scrambled Image of lena Fig. 9: Original Grey Scale Image of a rino Fig. 10: Scrambled Image of the rino . 5: Original Grey Scale Image of lena Fig. 7: Original Grey Scale Image of a boat Fig.

6 Fig. 11: Original Grey Scale Image of graphics Fig. 12: Scrambled Image of the graphics .

Ye and H.IEEE CS Press.0000 1. 1266-1271 [2] S. of generations 1 5 20 100 lena 0.9979 0. C. the correlativity of the adjacent pixels decreases. IEEE CS Press.6801 0. it is one as the value of the average neighbourhood grey difference of the original image was zero because of the single colour nature of the image(ie. • Converting images into greyscale 2) MATLAB Simulation Studies • Converting images into matrices • Code for Game of Life Algorithm B.9989 0. 2008. the rate of encryption and decryption obviously improved because of the high degree of the diffusion processthat is. and Security. 1986. Wolfram. the proposed algorithm is suitable for any size digital image and can be used to encrypt binary. Electronic Commerce and Security.9983 0.9987 graphics 1. pp. Proc.China.1993. ”An Image Encryption System by Cellular Automata with Memory”.. That is. 3rd Intl Conf. this method enables excellent confidentiality. 2008.8446 rino 0. Maleki et al. Lastly. IEEE Transactions on Computers. Vol. Hu Q (2010).In: Proc. Computer Science and Software Eng. A New Kind of Science. we can provide high security by scrambling pixel locations using double scramblingfirst scrambling the image in horizontal order and then scrambling the result in vertical order. Chen YH (2009) Genetic fingerprinting for copyright protection of multicast media. Final Evaluation 7th Semester 1) Literature Survey • Decoding the scrambled images 2) Matlab simulation • Code for encoding images using game of life algorthm • Code for decoding scrambled images 3) Trying to implement it on colour images. 3. pp 6266 [7] Huang HC. Wolfram Media. Wolfram.7128 0. pp.0000 1. pp. [3] S. IEEE CS Press. W ORK S CHEDULE The Project work has been divided into 4 stages : A. 118-122. [6] Chen G. 938-941.9991 0. The restoration process can also be easily carried out following the inverse steps with the precise keys. vol. Proc.From the table it is clear that. Second. most of the time.4618 0. scrambling can break the correlation between adjacent pixels.7 We have also found out the grey value degree of each images for different generations and these are tabulated as follows no. TABLE I: GDD It is very good to get a value close to one for Grey value degree(GDD). Final Evaluation 8th Semester 1) Matlab simulation • Code for video scrambling . pp. Soft Comput 13(4):383391.9847 0. ”‘A Digital Image Scrambling Method Based on AES and Error-Correcting Code”Proc. and color images. we need to only use values as small as five to get a good scrambling of the pixels. When we use complex GL behavior.‘graphics’. international conference on computer science and information technology (ICCSIT).A Novel Image Scrambling and Watermarking Scheme Based on Cellular Automata. First.9938 0. 2002 [4] N. 42. grayscale. 2008. An attacker cannot break the encrypted image even if the algorithm is open.9984 boat 0. Theory and Applications of Cellular Automata. In the future we intend to test this procedure with other types of multimedia files.For the image file. Chengdu. [5] R.0000 IX. VIII. such as video files. 677-680. most of the neghbouring pixels were of the same colour). World Scientific . Interim Evaluation 8th Semester 1) Literature Survey • Audio scrambling • Video scrambling D. Reliability. Interim Evaluation 7th Semester 1) Literature Survey • Cellular Automata • Algorithm for Game of Life. Li. R EFERENCES [1] F. Intl Symp. making it difficult for attackers to crack. Jiping et al. CONCLUSION Our experimental results reveal several characteristics of the proposed algorithm. An audio scrambling method based on combination strategy. Intl Conf. Availability.0000 1. We expect that CA of the GL type will also be useful for scrambling these other file formats.