Informatica 37 (2013) 285-293 285 Bit-projection Based Color Image Encryption using a Virtual Rotated View Brahim Nini University of Oum El-bouaghi, Po. Box 358, 04000. Algeria. Tel. +213 661 487 057 E-mail: b.nini@univ-oeb.dz Keywords: image encryption, bit permutation, pixel substitution, projection, security Received: April 10, 2013 This paper presents a novel algorithm for a color image encryption which involves simultaneously two operations in one: permutation and substitution of pixels. It uses the rows and columns of images' bits as transformation units. Each bit is regarded as an observed entity having a light ray which intersects a new rotated image. The intersection position is used to paste the corresponding bit. Such projection makes the pixels' bits migrate between each other which generate a cipher image. Despite its simplicity, the algorithm shows a great resistance against many kinds of attacks through its sensitivity to the initial values used in encryption. Povzetek: Opisan je nov algoritem za kodiranje barvnih slik. 1 Introduction It becomes commonly known that any important data exchange, mainly through a network, should be subject to a previous encryption in order to avoid its misuse. The particular case of images and videos attracts more attention due to the bulk of direct interpreted information they hold. There are three major kinds of methods used to construct secure encryption algorithms: permutation, substitution, and their combining form. The first kind, called in other works confusion, is an image shuffling which makes the content hidden and confusing. The second one, called in other works diffusion, is the coding of all pixels' values by new values instead of the original ones. The aim of both techniques, either used separately or combined, is to make the retrieval of the original image by attackers either impossible or very difficult. Unfortunately, totally secure cryptographic algorithms are difficult to build because solutions can always be found to defeat them. Many kinds of algorithms have been extensively addressed in the literature. Recently, chaotic systems have been widely used in data encryption [5, 6, 7, 16, 17, 18]. Many ideas are proposed. The one presented in [6], for instance, is based on image permutation and proposes the scrambling/permuting binary bit of every pixel with pseudo-random number sequence generated by chaotic logistic map. Another method is proposed in [5]. It is a cryptographic algorithm which uses Maximum Distance Separable (MDS) matrices as part of its diffusion element. From another point of view, many other kinds of algorithms are proposed [8, 9, 11, 14, 15]. For instance, a position permutation algorithm by magic cube transformation for the permutation process is used in [8]. It is based on a transformation of magic cube's face values. It was proposed by [14] who improves it through consecutive work. Furthermore, another approach is proposed in [11] which is based on combinations of hybrid magic cubes which are generated from a magic square and two orthogonal Latin squares. Likewise, a matrix scrambling is used in [15]. It is based on shifting and exchanging rule of bi-column bi-row circular queue. In sum, several ideas are used for the purpose of image encryption algorithms development and each one has its advantages and drawbacks. In the reference [19], one may find out many recent advances in the field through the presented survey. Though the quality of many works, results improvement is always required. For this, some works are oriented to analysis and/or refining of existing algorithms [2, 3, 4, 10, 12, 13]. These works focus on finding out weaknesses of developed methods and the way they can be strengthen. In [12] for instance, some means are proposed to strengthen the overall performance of the security of Fridrich's algorithm. Though there is no general model for security analysis suitable for all cryptosystems using different methods, some means are used to measure the strength of security and the speed of encryption process. They are based on the study of the behavior of encryption algorithms against attacks. The key and encrypted content are then analyzed whether they are safe or not against brute force, statistical, known plaintext, select plaintext, differential, and other attacks. Following the domain's stream, this work proposes a new idea of color image encryption extending a previous one [1]. The latter was limited to an image permutation for its encryption purpose; but this one generalizes it to 286 Informatica 37 (2013) 315-338 N. Meghanathan et al. image encryption. It merges both permutation and substitution of pixels in one indiscernible operation. In this work, an image is considered as rows and columns of bits. Each bit is regarded as an observed entity having a light ray. On another hand, a virtual viewer, who is assumed revolving about the middle axis of the image, involves a new view of the image that looks as if it is rotated so that its plane is perpendicular to the direction of the view. Such view is used as a new image onto which a projection is done. Accordingly, the intersection of a virtual bit's light ray to the viewer with the rotated image is used as the position of projection. This makes the bits moving within different pixels. Since the same idea of projection in the former work [1] is used, the same effects are met. The projection process leads to some parts of the original image having their projection positions either out of bounds or being the same. The former case is evident due to the image plane surface limits. The latter is so, because the computed positions should be rounded to their nearest integers, and hence, some bits may have the same target positions. So, in order to avoid information loss, only one bit is projected in each position and the others are delayed together with out-projected bits. As a result, the new reconstructed image contains many holes where some positions are undefined, i.e., not originating from the original image. The idea of the proposed algorithm consists in refilling these holes by the delayed bits in a reverse order. Our algorithm is nearly close in its function to the one proposed in [9] in that it repeats the permutation process several times with different values of the key. The difference is that, in our case, the key does not change dynamically during the permutation process, but might have different combining forms. Moreover, the proposed algorithm holds some important features that make it a powerful encryption technique. This is proved through some measures based on some means proposed in [12] and detailed later. Moreover, this algorithm's features are challenging comparatively to other works in the following ways: - The algorithm is based on a key whose parts are the parameters of a virtual viewer's position. Hence, the values of the key are understandable and measurable physical quantities, - The encryption process does not rely on the key values only. Their combining form is also important. It has a flexible structure which is not previously established and depends on the user's choices, - Permutation and substitution are combined within the same operation, - The algorithm does not depend on the machine's precision neither in encryption nor in decryption processes. It uses very low precision in computing and provides high sensitivity. The rest of the paper is organized as follows. The next section explains the projection process. It gives the underneath mathematical basis of the proposed projection. The third section explains how an image is encrypted. It gives the algorithm, its complexity, the structure of the used key, and explains how the reverse process of decryption is done. The fourth section gives an analysis about the key space values and its sensitivity. The fifth section is interested in the analysis of the resistance of the algorithm against some types of attacks. Finally, a conclusion is given summarizing the work and its extensions. 2 Projection process Figure 1 shows a cut of the reference position from which an image is assumed to be viewed in its normal appearance, and another view's position rotated about the central axis. The latter position involves a rotated plane that is perpendicular to the direction of the viewer's position onto which the image is to be projected. Such position is defined by its inclination angle from the reference one. I N^ Original image /\ / Not viewed part (out) / in the target image / 1 V / Empty part (hole) in i y yU the target image i /\ J \ 1 / v X!/ ■ m / One position from which an image can be viewed ^^ Reference position to view the image in its current form Figure 1: Transformation of an original image into a new one when viewed from another position. Figure 2: Projection of an original point P0 onto Pt in the new image. The projection process is based on two assumptions. Firstly, the image is considered as three color planes in their low level data arrangement; i.e. the rows of each plane are vectors of bits where pixels are the groups of consecutive b bits depending on the image's gray level, and columns are the bits of the same order of image's columns of pixels. Secondly, each bit is assumed having Bit-projection Based Color Image Encryption. Informatica 37 (2013) 285-293 287 a light ray that converges towards the viewer's position. Such ray crosses the rotated plane at a given point which is displaced from the bit's initial position. The new position is then used to paste the bit's value. Figure 2 gives the schema of how a point P0 is projected at the position Pt when the viewer moves around the central axis of the image from the position V0 to the position Vt. Therefore, the achievement of the projection relies on the mathematical expression which governs the amount of OPt. Let the angle between the directions of the reference position and the new one be 9 (figure 2). This angle is the same between the original image plane and the rotated one. Let now A be the perpendicular projection of P0 on OVt. Using AOPtVt and AAOP0, it is easy to see that AP0 = OP0. cosO, and OA = OP0. sine. Using these expressions, and based on the truth of expression (1): OPL = ov1 AP„ AV (1) cot {arctan {jV) — The projection of each line or column of the original image on a new one has some effects. If the angle 9 is small, a set of collated bits on the border, called P0Ut, are projected outside the boundary of the new image (figure 3(a)). This creates stretched lines or columns with many spread undefined bits, since a reduced number of bits become spread over the whole line or column. If d is big, it results in an undefined part in the projected image (figure 3(b)). Furthermore, due to the rounding of the estimated value of OPt to its nearest integer, some bits are going to have the same projection positions, especially when an empty part is created for a big 9. In this case, only one bit is pasted at the shared position and the others are not. All those which are not pasted create the set called Prep. The two sets, P0Ut and Prep, are initially delayed from projection. As a result, the obtained image might contain several undefined bits called holes. the amount of OPt can be computed for the half part of the image being on the same side of the viewer's position (2): ovt. op0 . cose OPt =-t-0--(2) t OVt-OP0. sine w This theory is applied in either horizontal or vertical direction. Hence, expression (2) is used to project the bits of each half line or half column of the original image onto the same half line or half column of the new image. So, each bit in the original image at the position P0 is projected onto the position Pt. Such transformation needs two basic parameters to be known: the angle e and the distance OV0 = OVt. Practically, we take the value of the distance as being d. lc where lc stands for the number of lines or columns, and d is a real such that d > -. The ' 2 latter condition is important since it ensures that OVt -OP0. sine ^ 0, because in this case we get sine = — = 0 b OP° d-20p° = 2d > 1 which is impossible according to the OPo previous condition. The case where sine = 1 is meaningless since it is practically impossible. It gives e = making the projection of the whole image being one point and encryption process is reduced to inversion of bits' positions. Note that the relationship (3) that links Pt and P0 on the opposite side of the viewer's position is so complicated, and consequently, has a negative impact on the algorithm complexity and time processing. This is why, the only expression used in this work on both sides of an image is (2), and since expression (3) is not used, it is given without demonstration. OPt. sine OP0 = OPt. cose + t Figure 3. Effects of 6 and d on the projection: (a) some bits are projected outside, (b) part of the border remains empty. The value of el which is the limit between those that create either P0Ut or an empty part is given when OPt and OP0 become equal. In other words, if e > el then P0Ut = 0. So, eL is the angle when OP0 = OPt = lj-. 2 d. l c2. c 0S 91 2 d. l c—l c.s i n 9 \ (4) Expressing this condition in (2) gives lc = which results in the following equation: 2d. co s et + s in et = 2d The solution of (4) is the one of: 2 cos(e t- p) = ^== + 4 d2 where tanfi = —. The solution to (5) is then: e, = arc cos + arctan (— 1 Wl + 4d 2) \2d) and lim e, = 0 (5) (6) (7) 1 r ■ \ \ \ \ \ \ \ -V (3) Figure 4: Graph of 6, related to function (6). The graph of l (figure 4) shows that the bigger is, i.e. the viewer is far from the image, the smaller l is. In the graph of figure 4, the plot of the function where i d >2 is the only part of our interest. 288 Informatica 37 (2013) 315-338 N. Meghanathan et al. 3 Image encryption 3.1 Cipher procedure The first step of shuffling procedure is the projection of each line or column on the same line or column respectively of the new image. This goes through a vector calculation linking original to target bits' positions according to expression (2). For the lines, all bits are pasted in their new estimated positions. However, not all columns of bits are concerned with vertical projection. The bits of high and middle orders of each pixel are the only ones concerned. This leads to an exchange of only these bits between the pixels of the same column. This is so because if all bits of pixels are used, the projection has a tendency to glide a whole line of pixels the same way. The vertical projection becomes then a simple shift of the image. Moreover, the bits of high order are the most probable to make a significant change on pixels even though this depends on the content of each one. 00010000 01100000 01100011 11001110 01 16 96 99 206 86 010 101 100 010 ... 00101001 00100010 ... 001 110 001 110 ... 173 74 . 34... V7 Vertical projection 10000101 10000110 . 10101101 01001010 . 00101001 00100010 . 00011110 00010110 . 133 134 . 173 74... 34 . 30 22 . Figure 6: A sample of vertical projection resulting in the bits (3 and 7 of each pixel) shifted in vertical direction to the bottom and some ones (white) reintroduced from the top. The right column shows the corresponding decimal values. To sample what has been explained, let us consider figures 5 and 6. When the transformation is applied in horizontal direction, some bits of each pixel either shift or migrate towards another one of the same line, and consequently, all pixels of each line change their values (figure 5). Likewise, when the projection is applied in vertical direction, the exchange of bits is done between the pixels' bits of one column (figure 6). In this case, only the bits of high and middle orders are projected as this is explained later. The shuffling procedure of an image is, in general, based on repeating n times the cycle of new image projection and reinsertion of delayed bits. In fact, several repetitions of such process on the successively new obtained images are enough to get a complete cipher image. Furthermore, the algorithm combines several couples (9, d) in several ways. It may apply the shuffling procedure alternatively in vertical and horizontal directions with different values, i.e. (9X, dx) and (Qy, dy), at different steps with different number of each, and with different combinations for each color plane of the image. Ji: (a) Original m I y (b) Projected and filled I Figure 5: A sample of horizontal projection resulting in the bits shifted to the left (for this case) and some ones (white) reintroduced from the right. The next step after image projection is to fill the created holes with the delayed bits, i.e. Pout and/or Prep. To do so, each bit is reintroduced into the opposite half part from which it does not originate and in an opposite order of its stacking. In addition, Pout are reintroduced first in order to be stretched out in the image because they are initially contiguous. Then, Prep are simply pasted into the remaining holes in a similar way of Pout (Figure 7). 00001101 00000110... 13 6... Figure 7: An original image (a) and its projected one (b) using 9 = 1° and d = 0.5 for both horizontal and vertical directions. 3.2 Permutation and substitution of pixels The power of the previously described process is that it results in both permutation and substitution of image's pixels (figures 5 and 6). In fact, as it is already explained, due to the projection process, the bits are displaced from their positions. At first glance, the consecutive pixel's bits are dragged together. This can be seen as pixels' movement resulting in a confusion procedure. From another point of view, pixels do not move really, they are the bits which do it. So, depending on 9, some bits of each pixel are going to move to another one. Thus, each pixel gets a new value; i.e. it is substituted or diffused. This is what happens mainly in vertical projection. Consequently, based on both points of view, the pixels' values can be considered changing when moving. This is what creates a simultaneous permutation and substitution of pixels within one operation without being discernible. 3.3 Key structure In this work, the parameters 9 and d serve as parameters of encryption key. They are used in couple at any step of shuffling. Therefore, different forms of the key may be used, and can be as complex as needed. For this, the algorithm does not depend on any structure. It can be adapted easily to anyone. Considering our experimentations, the adopted structure is as follows: Bit-projection Based Color Image Encryption. Informatica 37 (2013) 285-293 289 [obiter] [Vi] [hi] [0X,.....0Xv, ][dXi.....d_ ] [0yi 0yh. ][dyidyhi ] The used structure implies a global number of iterations (nbiter) applied to local couples vertically (vt) and horizontally (h). Each of which is of the form (0axiSi, daxisi), where axis = x or y. As an example of its use, figure 8 shows the encryption of the image of figure (7(a)) with two different keys. The one of figure (8(b)) is a special case where each color plane is scrambled apart with different key values. As it is clear, the used key is compounded of many parts having different sizes. For each angle, 1 bit is used for the integer part and 10 bits for the decimal part. Since the distance is a multiple of the line or column's length, it uses 4 bits for the integer part and 8 bits for the decimal part. In sum, each couple (9, d) uses a total of 25 bits together with two bits used for the number of local couples (9, d) in a given direction. The total number of global iterations uses 6 bits allowing the maximum of 64 iterations which might be highly paid in term of execution time. The size of the key is then 6+25(v;+h;) bits. At least, this size is 56 bits. The division by 2 is due to the consideration of (8) on only one half of the image. In horizontal direction, the projection is applied on lines being N vectors. Thus, let p be the cost of changing one bit, the complexity is then LpN2. In vertical direction, it is 2pN2 since only two bits of each pixel are concerned. For the whole algorithm, the complexity is then (yi+Lh{)(a+3b) NL + hipLN2 + Vi 2pN2 and with an iteration time n, it becomes: (Vi + Lhi )(a + 3b) —-^--N + np(htL + 2Vi )N2 (9) For vertical direction processed the same way of horizontal one, we get: (Vi + h,)(a + 3b) —-^-J- LN + np(hi + Vi )LN2 (10) In its lowest level of security, this algorithm uses a key compounded of two couples (9, d), one for each direction. In this case, ht = vt = 1 which makes the complexity being (a + 3b) (-+-) N + np(L + 2)N2. Compared to the ones of the three compared algorithms in [12], this complexity is lower than the lowest one of Baker map algorithm which is 2(a + b)N2 + n(a + b)N2. As can be seen, (-+-) << N which makes the other coefficients negligible. Even if all bits of each pixel are considered in vertical direction, the complexity (a + 3b)LN + 2npLN2 remains the lowest. (a) Key = K1 (b) Key = K1/K1 + 1/K1 + 2 Figure 8: Scrambling of the image in figure 7(a). (a) is shuffled using K1 = [4,1, — ,2.0,1,-,1.6], but in (b) K1 18 3 is used for only the color plane R. G and B color planes use K1 where each couple (9, d) is increased respectively by the values (1, 1) and (2, 2). 3.4 Algorithm complexity The basis of the whole process is equation (2). Considering that OV0 = OVt = d. lc, the expression becomes: d. lc. OP0. cos9 OPt =----(8) t d. lc-OP0. sin9 In (8), two multiplications, one division, and one subtraction are uses. This is so, because d. lc. cos9 and sin9 are computed once at the beginning. So, taking N x N-sized image, computing complexity of projection calculation for a key of (vt+hj) couples (9, d) is (Vj+Lhj)(a+3b) ... . „ -N, where a is the cost of a subtraction 2 operation, b is the one of a multiplication or division operation, and L is the number of each pixel's bits. We get Lhi because in horizontal direction the computing is related to bits, whereas in vertical one it is related to regular lines. 3.5 Reconstruction of the original image The retrieval of the original image is based on a reverse process of its encryption. Knowing the values of encryption key, the reconstruction of the original image follows exactly the reverse steps. In other words, the algorithm piles up the operations which are then executed from the last one to the first one having its steps reversed for the following points: - lines - columns. For instance, if for a given step of the encryption process the lines were scrambled first then the reconstruction should begin by the columns first, - d and 9. This is the case when the key form uses different values for these parameters at the same iteration. For instance, if (d1, 91) and (d2, 92) are two couples of values used in this order for image encryption, the order (d2, 92)-(d1, 01) should be used during the decryption, Considering Pout and Prep, they are first identified through the initially created holes in the cipher-image. The reverse operation consists then in copying the bits at the positions of the holes from the encrypted image into their initial positions in the reconstructed image. This is done with respect to the reverse order of their initial copy during image encryption. This is evident for Pout. For Prep, however, the algorithm should differentiate between the first bits which were directly projected and those which were delayed. So, the latter are the only ones that are retrieved from the holes. In sum, these operations are executed whenever they were done during the encryption process for either Pout or Prep. 290 Informatica 37 (2013) 315-338 N. Meghanathan et al. 4 Key analysis 4.1 Key space The numbers of significant values of 9 and d together with their combining form have direct effects on the possible values of a key. These last are in close relation to the sensitivity of encryption to the key values. In the following, a presentation of the key space according to the used structure in our experiments then to its general form is given. According to the chosen structure of the key, one can see that the key subspace of the couple (9, d) is 2n.212 = 223. For a maximum number of local different couples being 3, this value becomes (223)3 = 269. Since this is applied in horizontal and vertical directions with different values, the total number is 269.269 = 2138. This is for a key size of 156 bits. If different keys are used for each color plane, the total number is then 2138.2138.2138 = 2414. Additionally, if different keys are used at different iteration times n, this value increases to become (2138)n or (2414)n. According to the general form of the key, let the number of values of 9 be 9V and those of d be dv. The space values of a couple (9, d) is 9V x dv. For a number of different couples used in a combining form of the key, this becomes (9V x dv)(hi+vi~>. If different keys are used for each color plane, we get (9V x dv)3(hi+vi~>. Moreover, if different keys are used in different iterations, then the key space becomes (9V x dv)3n(hi+vi) which is very big. Furthermore, if high level of security is not required, dv may be very big. As can be seen, the key space increases with h, vt, and n. However, not all possible values of 9 and d are used for secure encryption. The next section explains the raisons. Hence, the choice of ht. vL. and n depends on the required security and complexity. So, for high level of security and when some values of 9 and d are avoided, the values of hL. vL. and n should increase, and vice versa. Note that all next experiments use hL = vt = 1 and n < 4 which provide the lowest security level of key structure in order to show the power of this algorithm. 4.2 Key sensitivity In order to specify the significant values of a key that lead to a given level of security against differential attack, some experiments have been done. One of them is the use of ciphertext difference rate (Cdr) defined in [12, 17] and adapted to our case for color images as: = ZcjDiffc (Y, Diffc (Y, Y2)) r 6NM Whereas index c indicates one color plane R, G, or B and Diffc (Ac, Bc) = YJYJDifVc<^Ac(i,j),Bc a j)) (12) i j and Difpc(Ac (i,j), Bc (i, j)) = (1 if Ac(i,j) *BC(i,j) (13) (0 if Ac(i,j) = Bc( i,j) Y is the cipher image of size N x M under a key K, Yt under the key K + AK. and Y2 under the key K — AK. Figure 9: Cdr computing based on a slight difference of 9 using 3 iterations and (a) A9 = 0.001° (b) Ad = 0.01. In our tests, we used A9 = 0.001° for 9 (figure 9(a)) and Ad = 0.01 for d (figure 9(b)) separately. In these experiments, the structure of the very low security of the key is used; i.e. each key has only one and the same couple ( , ) for each direction and for all color planes. Figure 9(a) shows that for 9 £ [20°. .89°], the security of the proposed cryptosystem is acceptable against brute-force attacks since Cdr > 90%. Figure 9(b) shows again this power when d £ [0.5. .3] for approximately the whole 9 range. Note that these results are obtained for only three iterations. This is as good as Cat map algorithm in [12] which is the best of the three presented algorithms according to this test. Consequently, for high level of security, it is advisable not to use all values of and . In this case, 9 £ [20°. .89°], d £ [0.5. .3] and four iterations are the most advised. What is important in the algorithm is that for such high level of security, it does not require high cost. In addition, the key sensitivity is of high level since a difference of 171000 for 9 and 1/100 for d has Figure 10: Dr computing based on A9 = (10 3)° using (a) n=1 and (b) n=4. The previous results are supported by other conducted experiments which aim to specify the tolerance interval ±A and ±A of decryption sensitivity. These experiments have been conducted according to two ways. The first one is subjective. It consists in considering the opinions of some people whether they are able or not to identify the content of the decrypted image using an erroneous key. This shows that the values of (10-3)° for 9 and 10-2 for d are the limits of image identification if some particular values are avoided. In other words, ±10-3 and ±10-2 are the tolerance intervals in order for the use of a false key does not decrypt the image. Bit-projection Based Color Image Encryption. Informatica 37 (2013) 285-293 293 (a) (b) Figure 11: Dr computing based on Ad = 10 2 using (a) n=1 and (b) n=4. Based on these results, the second tests are based on the computing of the difference between the original image and the decrypted one. For this, we propose the calculation of the decryption rate (Dr) as: zcDiffc (y, n Dr = 3NM (14) when an empty part is created. Moreover, the sensitivity is more important for 9 < 9t than the one of 9 > 9t except for some very small values of 9 as has been already noticed. Note also that the graphs of figures 12 and 13 highlights again the sensitivity of the cryptosystem to 9 than to d. (a) (b) The function Diffc is defined in (12), Y is the original image, and Y' is the decrypted image using the key K' = K ± AKt, (i = 9, d). K is the encryption key and AKi =(10-3 or 10-2) is the slight change of only one occurrence of one parameter of K. These tests use the form of the key which is of the very low security level as in Cdr tests. The graphs of figures (10) and (11) show the obtained results. The used iteration time is either 1 or 4. As can be seen in all cases, Dr increases with the number of iteration time n. The graph of figure 10 is obtained for A9 = (10-3)° and Ad = 0, and the one of figure 11 for A9 = 0° and Ad = 10-2. What is noticeable for the graph of figure 10 is that for 9 > 20°, Dr remains very acceptable even when d increases, whereas in figure 11, it falls off quickly for big values of d. This leads us to conclude again that the decryption process is more sensitive to 9 than to d. Throughout the conducted experiments, it can be concluded that small iterations (< 3) and small values of 9 £ [1°. .10°] are not advisable for high security if the used key is of low security level. 4.3 Effect of 0i on encryption To study the effect of 9t on the encryption, Cdr and Dr are again considered. Since 9t exists for each value of 9 related to a specific distance d, we used to vary 9t from 10° to 80°, compute the corresponding d, and evaluate Cdr and Dr with regard to all angles of the interval eh ± j° (i = 10°. .80°, j = 1°. .10°). For this purpose, expression (4) which links 9L to d is used to determine each dt related to a given 9t . In this case, we get: sin9l d = 2(1 -COS9,) (15) Through the graphs of figures 12 and 13, one can see that for good Dr and Cdr, the best values are obtained for 9 < 9L and the quality decreases for 9 > 9L, even though those of Cdr are not so notable. In other words, the results of this cryptosystem are better when Pout are not empty and its efficiency decreases with the creation of an empty part but remains very acceptable. This is logic since Pout leads to more scrambling of bits than Figure 12: Dr computing for every 9t £ [10°. .80°] using 3 iterations based on (a) A9 = (10-3)° and (b) Ad = 10-2. (a) (b) Figure 13: Cdr computing for every 9t £ [10°. .80°] using 3 iterations based on (a) A9 = (10-3)° and (b) Ad = 10-2. S ( « 1 ! (a) red (b) green (c) blue (d) red (e) green (f) blue Figure 14: Colour histograms of the two previous images: (a), (b), and (c) of the original image (Figure 7(a)), and (d), (e), and (f) of its corresponding encrypted form (Figure 8(b)). 5 Resistance against other attacks 5.1 Statistical attack Figure (8(b)) shows the result of the encryption process applied to the image of figure (7(a)), and their histograms are shown in figure 14. It is clear that the histograms of the two images, from statistical point of view, are significantly different. The ones of the encrypted image are flat and totally misleading, whereas those of the original image are curved. Moreover, figures (15), (16), and (17) show other images which were used in our experiments, and on which this encryption algorithm is applied. These images 292 Informatica 37 (2013) 315-338 N. Meghanathan et al. have been chosen based on the different shapes their color histograms have. It is clear that the histograms of the original images and encrypted ones are totally different. Even though the ones of the three images are of different forms, those of encrypted images are completely flat. (a) Original (b) Encrypted ■ (a) Original (b) Encrypted |iJJ J K NIF Nie (c) red (d) green (e) blue (f) red (g) green (h) blue Figure 16: Histograms of an original image (a) and its encrypted form (b) where the histograms of the former ((a), (c), and (d)) have approximately one peak. Another feature the algorithm should resist is select plaintext attack. It is commonly used to analyze plaintext sensitivity; i.e. the effect of the algorithm on parts with little differences. To test such feature, we use pixel change rate (Per) defined in [12] and adapted to our case as: Per = YcDiffc (Y, Y") 3NM (16) ■M-&mm ; ■ is I (a) Original (b) Encrypted HI m mm ■IF" IIIPz^ iïïiïï ;sî53j iïïiïï (c) red (d) green (e) blue (f) red (g) green (h) blue Figure 15: Histograms of an original image (a) and its encrypted form (b) where the histograms of the former ((c), (d), and (e)) have several peaks concentrated in the middle. 5.2 Select plaintext attack (c) red (d) green (e) blue (f) red (g) green (h) blue Figure 17: Histograms of an original image (a) and its encrypted form (b) where the histograms of the former ((a), (c), and (d)) have many peaks spread out along the dynamic range. In this case, Y and Y" are encryption results using the same key of images I and (I + AI). AI is a slight change in one bit for instance; i.e. an image and its transformed one having one bit different are ciphered. The graph in figure 18 shows that this algorithm maintains Per at a stable level depending on the initial change. This is explained by the fact that initial bits of L — 1 the original images are the same about for one pixel different. Since there are no significant differences, the two images evolve the same way during encryption. Even though Per does not reach 100%, it remains so important being > 64% in all cases. -1 pixel change ---+1 charge Figure 18: Per graph when a slight change happens to each pixel of an image. 6 Conclusion A new algorithm of image encryption based on a geometrical transform is presented. The algorithm projects an original image on a plane perpendicular to the direction of a given view's position. It considers the image as rows and columns of bits. So, the projection of each bit is done on the position where its light ray Bit-projection Based Color Image Encryption. Informatica 37 (2013) 285-293 293 intersects the perpendicular plane to the direction of the view. As a result, a cipher process takes place. This process is repeated several times to ensure a given level of security. The strength of the algorithm depends mainly on the structure of the used key. The core of the algorithm is based on two parameters: the angle of view and the distance of the viewer from the image. They are used in couples, and combined in many ways so that the combination itself becomes a key. Hence, the power of this algorithm is that the combinations depend on the genuineness of the user. The efficiency of this algorithm is demonstrated through several tests. Its key sensitivity from many points of view is about (10-3)° for the angle and 10-2 for the distance. Moreover, its resistance to many common attacks is proved through many graphs of the very low level of security provided by both key structure and values. Further extensions for this work may be made in different directions. One of them is the study of the algorithm resistance to different attacks apart from the security considerations. For example, to what extent an encrypted image may resist to JPEG compression in order to reconstruct the original one since the initial bits are not explicitly changed. The structure of the key is also important. One possible improvement is to make a formal study of it. Another important study is about the general form of the projection. It may be part of the key. References [1] B. Nini and C. Melloul (2011), Pixel Permutation of a Color Image Based on a Projection from a Rotated View. JDCTA: International Journal of Digital Content Technology and its Applications, Vol. 5, N° 4, pp. 302-312. [2] Chengqing Li, Kwok-Tung Lo (2009). Security analysis of a binary image permutation scheme based on Logistic map. http://arxiv.org/pdf /0912.1918 [3] Chengqing Li (2008). On the Security of a Class of Image Encryption Scheme. Int. Symposium on Circuits and Systems, IEEE, pp. 3290-3293. [4] Ercan Solak, Cahit Cokal and Olcay Taner Yildiz (2010). Cryptanalysis of fridrich's chaotic image encryption. International Journal of Bifurcation and Chaos, DOI: 10.1142/S0218127410026563, Vol. 20, n° 5, pp. 1405-1413. [5] Daemen, J., and Rijmen, V. (2002). The Design of Rijndael: AES - The Advanced Encryption Standard. Springer,. [6] G. Ye (2009). Image scrambling encryption algorithm of pixel bit based on chaos map. Pattern Recognition Letters, DOI: 10.1016/j. patrec. 11.008. [7] Haojiang Gao, Yisheng Zhang, Shuyun Liang, and Dequn Li (2006). A new chaotic algorithm for image encryption. Chaos, Solitons and Fractals 29, pp. 393-399. [8] Jianbing Shen, Xiaogang Jin, and Chuan Zhou (2005). A Color Image Encryption Algorithm Based on Magic Cube Transformation and Modular Arithmetic Operation. PCM, Part II, LNCS, Y.S. Ho and H.J. Kim (Eds.), 3768, pp. 270-280. [9] John Vreugdenhil, Kane Iverson, and Raj Katti (2009). Image Encyption Using Dynamic Shuffling and XORing Processes. IEEE International Symposium on Circuits and Systems, ISCAS, pp. 734-737. [10] Li C., Li S., Zhang D., and Chen G (2004). Cryptanalysis of a Chaotic Neural Network Based Multimedia Encryption Scheme. Advances in Multimedia Information Processing - PCM Proceedings, Part III, LNCS, Vol. 3333, pp. 418425. [11] Sapiee Jamel, Tutut Herawan, and Mustafa Mat Deris (2010). A Cryptographic Algorithm Based on Hybrid Cubes, ICCSA, Part IV, LNCS 6019, pp. 175-187. [12] Shiguo Lian, Jinsheng Sun, Zhiquan Wang (2005). Security Analysis of A Chaos-based Image Encryption Algorithm. Physica A: Statistical and Theoretical Physics, Elsevier, 351(2-4): pp. 645661. [13] Shujun Li, Chengqing Li, Guanrong Chen, and Kwok-Tung Lo (2008). Cryptanalysis of the RCES/RSES image encryption scheme. The Journal of Systems and Software, DOI:10.1016/j.jss.2007.07.037, pp. 1130-1143. [14] Trenkler M. (2005). An Algorithm for making Magic Cubes, The n ME Journal, vol. 12, n°2, pp. 105-106. [15] Wu, S., Zhang, Y., and Jing, X. (2005). A Novel Encryption Algorithm based on Shifting and Exchanging Rule of Bi-Column Bi-row Circular Queue. International Conference on Computer Science and Software Engineering. IEEE, Los Alamitos. [16] Zhang Linhua, Liao Xiaofeng, and Wang Xuebing (2005). An image encryption approach based on chaotic maps, Chaos, Solitons and Fractals 24, pp. 759-765, [17] Shiguo Lian, Jinsheng Sun, Zhiquan Wang (2005). A Block Cipher Based on a Suitable Use of the Chaotic Standard Map. International Journal of Chaos, Solitons and Fractals, Elsevier, 26(1): 117129. [18] Yaobin Mao, Guanrong Chen and Shiguo Lian (2004). A Novel Fast Image Encryption Scheme Based on the 3D Chaotic Baker Map, International Journal of Bifurcation and Chaos, World Scientific Publishing, vol. 14, no. 10, pp. 3613-3624. [19] Komal D Patel, Sonal Belani (2011). Image encryption using different techniques: A review. International Journal of Emerging Technology and AdvancedEngeneering, vol. 1 no. 1, pp. 30-34.