You are on page 1of 7

1

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

AbstractScrambling 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 eld 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.

I. I NTRODUCTION

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 nite 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. Classication Wolfram, in A New Kind of Science and several papers dating from the mid-1980s, dened 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 specic rules, Wolframs classication was the rst 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 lter 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 indenitely. 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.

Class 2 type stable or oscillating structures may be the eventual outcome, but the number of steps required to reach this state may be very large, even when the initial pattern is relatively simple. Local changes to the initial pattern may spread indenitely. Wolfram has conjectured that many, if not all class 4 cellular automata are capable of universal computation. This has been proven for Rule 110 and Conways game of Life. These denitions are qualitative in nature and there is some room for interpretation. According to Wolfram, ...with almost any general classication scheme there are inevitably cases which get assigned to one class by one denition and another class by another denition. And so it is with cellular automata: there are occasionally rules...that show some features of one class and some of another. Wolframs classication has been empirically matched to a clustering of the compressed lengths of the outputs of cellular automata. There have been several attempts to classify cellular automata in formally rigorous classes, inspired by the Wolframs classication. For instance, Culik and Yu proposed three well-dened classes (and a fourth one for the automata not matching any of these), which are sometimes called Culik-Yu classes; membership in these proved to be undecidable. Wolframs class 2 can be partitioned into two subgroups of stable (xed-point) and oscillating (periodic) rules. C. Reversible A cellular automaton is said to be reversible if for every current conguration of the cellular automaton there is exactly one past conguration (preimage). If one thinks of a cellular automaton as a function mapping congurations to congurations, reversibility implies that this function is bijective.If a cellular automaton is reversible, its time-reversed behavior can also be described as a cellular automaton. For one-dimensional cellular automata there are known algorithms for deciding whether a rule is reversible or irreversible. However, for cellular automata of two or more dimensions reversibility is undecidable; that is, there is no algorithm that takes as input an automaton rule and is guaranteed to determine correctly whether the automaton is reversible. Reversible cellular automata are often used to simulate such physical phenomena as gas and uid dynamics, since they obey the laws of thermodynamics. Such cellular automata have rules specially constructed to be reversible.Several techniques can be used to explicitly construct reversible cellular automata with known inverses. Two common ones are the second order cellular automaton and the block cellular automaton, both of which involve modifying the denition of a cellular automaton in some way. Although such automata do not strictly satisfy the denition given above, it can be shown that they can be emulated by conventional cellular automata with sufciently large neighborhoods and numbers of states, and can therefore be considered a subset of conventional cellular automata. Conversely, it has been shown that every reversible cellular automaton can be emulated by a block cellular automaton. D. Cellular Automata Neighborhood The radius or range is a shorthand method of specifying the neighborhood for common congurations. In a 1D CA of

radius r = 1, each cells neighborhood consists of itself, one cell to its immediate left and another to its immediate right. In 2D CA, two common neighborhoods methods are used: Von Neumann and Moore neighborhoods. The Von Neumann neighborhood of range r is dened by N H (x0 , y0 , r) = [(x, y ) : |x x0 | + |y y0 | r], and the number of cells in each neighborhood is 2r(r + 1) + 1. A range of one, which is typically used, yields a total of ve cells in the Von Neumann neighborhood, with neighbors to the north, south, east, and west. The Moore neighborhood

Fig. 1: Von Neuman Neighborhood of range r is dened by N H (x0 , y0 , r) = [(x, y ) : |x x0 | r, |y y0 | r] . The number of cells in each neighborhood is (2r + 1)2 . Typically r = 1, which yields a total of nine cells in the Moore neighborhood. John Conways Game of Life uses the Moore neighborhood.

Fig. 2: Moore Neighborhood

E. Conveys Game Of Life The GL consists of an [M X N] matrix of cells, where each cell may take only two states: alive or dead, represented by 1 and 0, respectively. Each cell has eight neighbors, according to the Moore neighborhood. At every time step, also called a generation, 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. Every cell uses the same update rules, and all the cells are updated simultaneously. A cells next state is determined as follows: 1) Birth. A cell dead at time t becomes alive at time t + 1 if exactly three of its neighbors are alive at time t. 2) Death by overcrowding. A cell alive at time t dies at time t + 1 if four or more of its neighbors are alive at time t. 3) Death by exposure. A cell alive at time t dies at time t + 1 if one or none of its neighbors are alive at time t. 4) Survival. 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.

In this work, at each generation, the Game of Life produces live and dead cells. Live cells will be selected to form the new pixel coordinates for the scrambled image, while dead cells will be neglected. This procedure can easily be generalized and applied to any type of digital media.

1) Examples of patterns: Many different types of patterns occur in the Game of Life, including still lifes, oscillators, and patterns that translate themselves across the board (spaceships). Some frequently occurring examples of these three classes are shown below, with live cells shown in black, and dead cells shown in white.

majority of them produce universes that are either too chaotic or too desolate to be of interest. Conways rules may also be generalized such that instead of two states (live and dead) there are three or more. State transitions are then determined either by a weighting system or by a table specifying separate transition rules for each state; for example, Mireks Cellebrations multi-coloured Rules Table and Weighted Life rule families each include sample rules equivalent to Conways Life. Immigration is a variation that is very similar to Conways Game of Life, except that there are two ON states (often expressed as two different colours). Whenever a new cell is born, it takes on the ON state that is the majority in the three cells that gave it birth. This feature can be used to examine interactions between spaceships and other objects within the game. Another similar variation, called QuadLife, involves four different ON states. When a new cell is born from three different ON neighbours, it takes on the fourth value, and otherwise, like Immigration, it takes the majority value. Except for the variation among ON cells, both of these variations act identically to Life. F. Cellular Automata Lambda Parameter Chris Langton proposed a relation between the (Lambda) value of a set of rules and the Wolfram classication. He quantied the classication scheme by introducing parameter and hypothesized that CAs computational capability is related to their average dynamic behavior, which is claimed to predict. For a binary-state 1D CA, the Lambda parameter is the probability that a given neighborhood (chosen among all possible congurations) leads to a nonquiescent state (an active cell) and is equal to the fraction of 1s in the output table bits. CA produces ordered behavior when Lambda values are close to 0 or 1 and chaotic behavior is somewhere in between. As reaches a critical value (c , the edge of chaos), rules tend to exhibit long-lived, complex behavior. Langtons parameter has recently been extended to 2D CA.

Fig. 3: Examples of Patterns G. Analysis of the Scrambling Effect 2) Variations on Life: Since Lifes inception, new similar cellular automata have been developed. The standard Game of Life is symbolised asB3/S23: A cell is Born if it has exactly 3 neighbours, Stays alive if it has 2 or 3 living neighbours; it dies otherwise. The rst number, or list of numbers, is what is required for a dead cell to be born. The second set is the requirement for a live cell to survive to the next generation. HenceB6/S16 means a cell is born if there are 6 neighbours, and lives on if there are either 1 or 6 neighbours. Cellular automata on a two-dimensional grid that can be described in this way are known as Life-like cellular automata. Another common Life-like automaton, HighLife, is described by the rule B36/S23, because having 6 neighbours, in addition to the original games B3/S23 rule, causes a birth. HighLife is best known for its frequently occurring replicators. Additional Life-like cellular automata exist, although the vast The scrambling effect lets us determine the robustness of the scrambled image against passive attacks. Therefore, we want to show how the GL number of generations and other congurations affect the scrambling degree. Moreover, the scrambled image must have diffusion and confusion properties, which are the basis for designing practical ciphers. 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. To evaluate the effect of image scrambling, we introduce gray difference and gray degree of scrambling. The gray difference of a pixel with a neighbor pixel is dened as follows: GD(i, j ) = 1 4 [P (i, j ) P (i , j )]2
i,j

B. Decoding The algorithm for decoding can be described as follows 1) An [M X M] GL automaton is set up with the initial conguration A0 which was used in encoding the image when it was scrambled and is set to run for k generations, thus obtaining A1 , A2 , ...Ak matrices. 2) Let Z denote the input image (scrambled image) and R the output image (decoded plain image). A1 is the rst generation produced by the GL. Set row = 1, column = 1. 3) For all (i, j) such that A1 (i, j) = 1, take the gray value of pixel Z(i, j), put it in R(row, column), and increment (row, column) to point to the next pixel in the input image, in column-rst order. 4) For q = 2, . . ., k, for all i, j such that Aq (i, j) = 1 and An (i, j) = 0 (for n = 1, . . ., q - 1), take the gray value of pixel Z(i, j), put it in R(row, column), and increment (row, column) to point to the next pixel. 5) Take the gray value of the remaining pixels in Z in column rst order and put them in column-rst order in those R(row, column) where, for all q = 1, 2 , . . ., k, Aq (i, j) = 0. We can also use double scrambling to increase the security that is, rst image is scrambled in the horizontal direction, then it is scrambled in the vertical direction.To recover the original image, we execute the inverse of the scrambling algorithm using as keys the initial random conguration A0 and the number of iterations k. IV. M ETHOD OF I MPLEMENTATION We will be doing this project using M ATLAB R simulation.For the 7th semester we will be implementing this on greyscale images.The images are loaded as matrices in M ATLAB R .This can be exteneded to colour images.For the 8th semester we will be extending the project to video scrambling. V. I MPLEMENTATION C HALLENGES Number of stages of scrambling is limited in M ATLAB R .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.If RGB images are used then the matrix will be three dimensional and accordingly the computation will be memory consuming. VI. C URRENT S TATUS Game of life algorithm has been successfully implemented for grey scale images in M ATLAB R . We have read in and scrambled a number of image les using this method and decoded the same. VII. O BSERVATIONS AND R ESULTS All the images were scrambled for twenty generations.

Fig. 4: Scrambling using Game of Life Algorithm (rst step)

where (i , j ) = (i 1, j ), (i + 1, j ), (i, j 1), (i, j + 1) and P (i, j ) denotes the gray value at position (i, j). After computing the gray difference for every pixel in the image, except the pixels at the edges, we can compute the whole images average neighborhood gray difference by summing and averaging: E [GD(i, j )] =
M 1 i=2 N 1 j =2

GD(i, j )

(M 2)X (N 2)

The gray value degree is dened by GDD = E (GD(i, j )) E (GD(i, j )) E (GD(i, j )) + E (GD(i, j ))

where E(GD(i,j))and E(GD(i,j)) denote the average neighborhood gray differences of the input and scrambled images, respectively III. F ORMULATION OF THE P ROBLEM A. Scrambling With the Game of Life Adjacent pixels in an image have a strong correlation, which must be reduced to scramble the image.We will be performing pixel scrambling using several Game of Life generations.The algorithm can be described as follows 1) An [M X M] GL automaton is set up with an initial random conguration A0 and is set to run for k generations, thus obtaining A1 , A2 , ...Ak matrices. 2) Let Z denote the input image (plain image) and R the output image (scrambled image). A1 is the rst generation produced by the GL. Set row = 1, column = 1. 3) For all (i, j) such that A1 (i, j) = 1, take the gray value of pixel Z(row, column), put it in R(i, j), and increment (row, column) to point to the next pixel in the input image, in column-rst order. 4) For q = 2, . . ., k, for all i, j such that Aq (i, j) = 1 and An (i, j) = 0 (for n = 1, . . ., q - 1), take the gray value of pixel Z(row, column), put it in R(i, j), and increment (row, column) to point to the next pixel. 5) Take the gray value of the remaining pixels in Z and put them in column-rst order in those R(i, j) where, for all q = 1, 2 , . . ., k, Aq (i, j) = 0.

Fig. 5: Original Grey Scale Image of lena

Fig. 8: Scrambled Image of the boat

Fig. 6: Scrambled Image of lena

Fig. 9: Original Grey Scale Image of a rino

Fig. 7: Original Grey Scale Image of a boat

Fig. 10: Scrambled Image of the rino

Fig. 11: Original Grey Scale Image of graphics

Fig. 12: Scrambled Image of the graphics

We have also found out the grey value degree of each images for different generations and these are tabulated as follows no. of generations 1 5 20 100 lena 0.9979 0.9983 0.9989 0.9984 boat 0.7128 0.4618 0.6801 0.8446 rino 0.9847 0.9938 0.9991 0.9987 graphics 1.0000 1.0000 1.0000 1.0000

IX. CONCLUSION Our experimental results reveal several characteristics of the proposed algorithm. First, we can provide high security by scrambling pixel locations using double scramblingrst scrambling the image in horizontal order and then scrambling the result in vertical order. Second, this method enables excellent condentiality. That is, scrambling can break the correlation between adjacent pixels, making it difcult for attackers to crack. An attacker cannot break the encrypted image even if the algorithm is open. When we use complex GL behavior, the rate of encryption and decryption obviously improved because of the high degree of the diffusion processthat is, the correlativity of the adjacent pixels decreases. The restoration process can also be easily carried out following the inverse steps with the precise keys. Lastly, the proposed algorithm is suitable for any size digital image and can be used to encrypt binary, grayscale, and color images. In the future we intend to test this procedure with other types of multimedia les, such as video les. We expect that CA of the GL type will also be useful for scrambling these other le formats. R EFERENCES
[1] F. Maleki et al, An Image Encryption System by Cellular Automata with Memory, Proc. 3rd Intl Conf. Availability, Reliability, and Security, IEEE CS Press, 2008, pp. 1266-1271 [2] S. Wolfram, Theory and Applications of Cellular Automata, World Scientic , 1986. [3] S. Wolfram, A New Kind of Science, Wolfram Media, 2002 [4] N. Jiping et al, A Digital Image Scrambling Method Based on AES and Error-Correcting CodeProc. Intl Conf. Computer Science and Software Eng., vol. 3, IEEE CS Press, 2008, pp. 677-680. [5] R. Ye and H. Li,A Novel Image Scrambling and Watermarking Scheme Based on Cellular Automata, Proc. Intl Symp. Electronic Commerce and Security,IEEE CS Press, 2008, pp. 938-941. [6] Chen G, Hu Q (2010), An audio scrambling method based on combination strategy.In: Proc. international conference on computer science and information technology (ICCSIT), Chengdu,China, pp 6266 [7] Huang HC, Chen YH (2009) Genetic ngerprinting for copyright protection of multicast media. Soft Comput 13(4):383391, IEEE Transactions on Computers, Vol. 42, pp. 118-122,1993.

TABLE I: GDD It is very good to get a value close to one for Grey value degree(GDD).For the image le,graphics, 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. most of the neghbouring pixels were of the same colour).From the table it is clear that, most of the time, we need to only use values as small as ve to get a good scrambling of the pixels. VIII. W ORK S CHEDULE The Project work has been divided into 4 stages :

A. Interim Evaluation 7th Semester 1) Literature Survey Cellular Automata Algorithm for Game of Life. Converting images into greyscale 2) MATLAB Simulation Studies Converting images into matrices Code for Game of Life Algorithm

B. 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.

C. Interim Evaluation 8th Semester 1) Literature Survey Audio scrambling Video scrambling

D. Final Evaluation 8th Semester 1) Matlab simulation Code for video scrambling

You might also like