Multi-secret Sharing Visual Cryptography Scheme Based on XOR Algorithm Yanyan Han1, Shuai Ji2, Wencai He3 and Yao Zhang2 (1. Department of Scientific Research, Beijing electronic science & technology institute, Beijing 100070, China) (2. Communication Engineering Department, Xidian University, Xi'an 710071, China) (3. Communication Engineering Department, Beijing electronic science & technology institute, Beijing 100070, China) Abstract — XOR algorithm can be used to improve the recovery effects of visual cryptography scheme. In this paper, we present a multi-secret visual cryptography scheme by using the matrices of the (k, k)-VCS. We can reveal multiple secret images perfectly by the XOR algorithm and shifting operation on the shares. The visual qualities of recovered images are ideal without any pixel expansion. Keywords — Visual cryptography, Multiple secret images, XOR algorithm, No pixel expansion. I. Introduction As a new secret sharing technique, visual cryptography scheme (VCS) was introduced by Naor and Shamir in Euro-Crypt conference in 1994 [1]. In the (k, n)-VCS, a secret image is encoded into n shares, which consist of some random binary patterns. Then stacking any k or more than k shares can reveal the secret image by human visual system without any computation. However, if the number of shares is less than k, any information about the secret image cannot be caught. In recent years, there are a lot of achievements about VCS [2-6]. However, the schemes above can only extract a secret image. Nowadays, a visual cryptography with extra ability of reveal more data was proposed by Fang [7]. However, the pixel expansion is serious and the contrast is low. After, Huang [8] proposed a non-expanded VCS based on block encoding [9], which encodes a black-and-white image into the same size of share images as the original secret image. But it only can be applied on the (2, 2)-VCS. In this paper, we propose a multi-secret (k, k)-VCS for gray images based on XOR algorithm. Through halftone technology and encryption algorithm, we generate k shares. Simply stacking the k shares can reveal a secret image; later, fix one of the shares and move the next share half down, we can extract another two small images. We can see that the number of the recovered image is 2(k-1)+1. Compared with the original visual cryptography scheme, the scheme is increasing the number of secret images. Each participant only needs to keep a share and they can recover lots of images. The scheme reduces the difficulty of manage the shares. It is simple with good security and the recovery secret image is characterized by the good contrast without pixel expansion. II. Related Work In this paper, the proposed scheme adopts the (k, k)-VCS which is based on XOR algorithm [10]. Structuring matrix set ๐ถ0 , ๐ถ1, which express white pixels and black pixels fundamental matrix set in the secret image. And structuring white and black pixels fundamental matrix set ๐0 , ๐1 in the sharing images, which select from matrix set ๐ถ0, ๐ถ1 respectively and randomly. In the reconstruction of the secret image, a white pixel or a black pixel of the original secret image is expressed as a subpixel. The ๐ถ0 , ๐ถ1 for (2, 2)-VCS and (3, 3)-VCS are as shown in Eq. (1) and Eq. (2): ๐ถ0 = ๐ถ0 ๏ฉ1 0๏น ๏ช1 0๏บ , ๐ถ1 = ๏ซ ๏ป ๏ฉ1 0๏น ๏ช0 1 ๏บ ๏ซ ๏ป (1) ๏ฉ1 1 0 0๏น ๏ฉ0 0 1 1 ๏น ๏ช 0 1 0๏บ (2) ๏ช ๏บ = ,๐ถ = 1 ๏ช ๏บ ๏ช0 1 0 1 ๏บ ๏ช๏ซ1 0 0 1๏บ๏ป ๏ช๏ซ0 1 1 0๏บ๏ป 1 III. The Design of Scheme In this paper, we propose a novel visual cryptography scheme without any pixel expansion for gray images. The proposed scheme can hide a big secret image and 2(k-1) small secret images which are a quarter of the big one. In this paper, let k=3. Firstly, we use halftone technology to process all of the five secret gray images respectively and transform them into binary images. Halftone is a method to transform an image with gray level into a binary image. In this paper, we use the Floyd-Steimberg error diffusion [11] to get the halftone images. Then we use XOR algorithm to generate three shares. The shares have the following three properties: (a) stacking the three shares will obtain the big secret images; (b) stacking any two of them will obtain nothing; (c) if we fix one of the shares and then move the next share half down, we will obtain another two secret images. The detail method is given as following. 1. Process of Encryption The input is a 512×512 gray image P1 and four 256×256 gray images P2 , P3 , P4 , P5. Firstly, we process the gray images P1 , P2 , P3 , P4 and P5 into binary images. Then, the encryption of the secret image is as shown in the following steps. (1) For each coordinate (i, j) in the area where {(i, j)|256≤i≤511, 0≤j≤511} do the following: (1a) Randomly assign “1” and “0” to S1 (๐, ๐) and S2 (๐, ๐); (1b) If secret image P1 (๐, ๐) is a white pixel, then S3 (๐, ๐) = S1 (๐, ๐) ⊕ S2 (๐, ๐) ⊕ 0; otherwise, S3 (๐, ๐) = S1 (๐, ๐) ⊕ S2 (๐, ๐) ⊕ 1. (“⊕” denotes XOR algorithm). (2) For each coordinate (i, j) in the area where {(i, j)|0≤i≤255, 0≤j≤255} do the following: (2a) If P2 (๐, ๐) is a white pixel, then copy the S1 (๐ +256, j) to S2 (๐, ๐); otherwise, copy the complement of S1 (๐ +256, j) to S2 (๐, ๐); (2b) If P3 (๐, ๐) is a white pixel, then copy the S2 (๐ +256, j) to S3 (๐, ๐); otherwise, copy the complement of S2 (๐ +256, j) to S3 (๐, ๐); (2c) If P1 (๐, ๐) is a white pixel, then S1 (๐, ๐) = S2 (๐, ๐) ⊕ S3 (๐, ๐) ⊕ 0; otherwise, S1 (๐, ๐) = S2 (๐, ๐) ⊕ S3 (๐, ๐) ⊕1. (3) For the remaining area (where {(i, j)|0≤i≤255, 256≤j≤511}) do the following: (3a) If P4 (๐, ๐) is a white pixel, then copy the S1 (๐ +256, j) to S2 (๐, ๐); otherwise, copy the complement of S1 (๐ +256, j) to S2 (๐, ๐); (3b) If P5 (๐, ๐) is a white pixel, then copy the S2 (๐ +256, j) to S3 (๐, ๐); otherwise, copy the complement of S2 (๐ +256, j) to S3 (๐, ๐); (3c) If P1 (๐, ๐) is a white pixel, then S1 (๐, ๐) = S2 (๐, ๐) ⊕ S3 (๐, ๐) ⊕ 0; otherwise, S1 (๐, ๐) = S2 (๐, ๐) ⊕ S3 (๐, ๐) ⊕1. Share images S1 ๏ผ S2 and S3 are obtained. 2. Process of Recovery The recovery of the secret image is as shown in the following steps: (1) Through the XOR algorithm, the secret image P1 is recovered after stacking the three shares. (2) Fix share S1 and move share S2 half down, it can reveal the image P2 and P4 . Fix share S2 and move share S3 half down, it can reveal the image P3 and P5 . IV. Simulation Results In Fig. 1, it shows the five secret images. In Fig. 2, it shows the three shares ๐1 , ๐2 and ๐3. Fig. 3(a) is the result of stacking ๐1 , ๐2 and ๐3; Fig. 3(b) is the result of stacking ๐1 with shifted ๐2 ; Fig. 3(c) is the result of stacking ๐2 with shifted ๐3. (c) Share S3 Fig. 2 The Share Images (a) Image P1 (a) ๐1 ⊕ ๐2 ⊕ ๐3 (b) Image P2 (c) Image P3 (d) Image P4 (e) Image P5 Fig. 1 Original Secret Images (b) ๐1 ⊕ "๐ โ๐๐๐ก๐๐ ๐2 " (a) Share S1 (c) ๐2 ⊕ "๐ โ๐๐๐ก๐๐ ๐3 " Fig. 3 The Result of Stacking V. (b) Share S2 Performance Analysis In this paper, a visual cryptography with multiple secret images was proposed. In (k, k)-VCS, stacking all of the k shares, we can obtain a secret image which is the same size of the shares. Fix the i-th share and move the (i+1)-th share half down, we can extract another two small images which are 1/4 of the shares (i=1, 2, …, k-1). In order to improve the quality of recovery images and reduce the pixel expansion, we use XOR algorithm. 1. Capability Analysis According to the simulation results, there is no pixel expansion and the contrast is ideal. It also can reveal more images after shifting. An extended visual cryptography scheme for extract more images was proposed in previous studies. In Fang’s scheme [7], when we fix the first share and shift the other share for certain units, we can obtain the extra data. But the pixel expansion is serious and it only deals with binary image. In Huang’s scheme [8], although it solves the problem of pixel expansion, but the contrast is low. Compared with [7, 8], our scheme has a great improvement on the recovery effect. The shares and the recovery images are as the same size as the original images and there is no pixel expansion. The contrast of the recovered image is ideal. Therefore, this scheme has significant improvement. 2. Security Analysis To share a white (black) pixel, we randomly choose one of the matrices in ๐ถ0 (๐ถ1). The chosen matrix defines the color of the subpixels in each one of the sharing image. If the scheme satisfies the following three conditions, we consider that the scheme has security. (1) For any S in ๐ถ0, the “XOR” ๐ of k rows satisfies ๐ป(๐) ≤ ๐ − ๐ผ๐. (2) For any S in ๐ถ1, the “XOR” ๐ of k rows satisfies ๐ป(๐) ≥ ๐. (3) For any subset {๐1, ๐2,…, ๐๐ } of {1, 2, …, the same matrices with the same frequencies. The first two conditions imply that by stacking of k shares, we can gain the secret image. And the third condition implies that by stacking of fewer than k shares, even an infinitely powerful cryptanalyst cannot gain any advantage in deciding whether the shared pixel was white or black. This means that the (k, k)-VCS which is proposed in this paper is safety. 3. The Extension of This Scheme In this paper, we reveal the big secret image after stacking the k shares. If we fix one of the shares and move down the next share for 1/2, we will obtain another two secret images. The number of the secret image which we recover is 2(k-1)+1. Therefore, we can extend the scheme. For example, we adopt the similar encryption method and fix one of the shares and move down the next share for (1-1/u), we will obtain another u secret images. The number of the secret image which we recover is u(k-1)+1. (u is the number of small images we revealed after stacking two shares). We can conclude that the quantity of the secret images are no less than 2(k-1)+1. k} with ๐ < ๐, the two collections of q×m matrices ๐ท๐ก for t ∈ {0, 1} obtained by restricting each k × m matrix in ๐ถ๐ก (where t = 0, 1) to rows ๐1, ๐2,…, ๐๐ are References indistinguishable in the sense that they contain VI. Conclusions In this paper, we discuss a multi-secret VCS for gray images which are based on XOR algorithm. This scheme can be applied on any k. We generate k sharing images which have a random distribution of black and white pixels, and we also can recover lots of secret images. The visual qualities of recovered images are ideal without any pixel expansion. But the disadvantage of this scheme is that it also has a problem of aligning the two shares. [1] M. Naor, A. Shamir. Visual cryptography. Advances in Cryptography: EUROCRYPT, LNCS, vol. 950, pages 1-12, 1995. [2] Ateniese G, Blundo C, De Santis A, Stinson DR. [3] [4] [5] [6] [7] [8] [9] [10] [11] Visual cryptography for general access structures. Inf Comput 129(2), pages 86–106, 1996. Droste S. New results on visual cryptography. Proc Adv Cryptogr LNCS 1109, pages 401–415, 1996. Shyu SJ, Chen MC. Optimum pixel expansions for threshold visual secret sharing schemes. IEEE Trans Inf Forensics Secur 6(3), pages 960–969, 2011. Hou YC. Visual cryptography for color images. Pattern Recognit 36(7), pages 1619–1629, 2003. Liu F, Wu CK, Lin XJ. Color visual cryptography schemes. IET Inf Secur 2(4), pages 151–165, 2008 W.P. Fang, J.C. Lin. Visual cryptography with extra ability of hiding confidential data. Journal of Electronic Imaging, vol. 15, No. 2, 2006. Y.J. Huang, J.D. Chang. Non-expanded visual cryptography scheme with authentication. IEEE 2nd International Symposium on Next-Generation Electronics (ISNE), 2013. Y.J. Huang, C.C. Lee, H.C. Wu, J.D. Chang, C.S. Tsai, Y.T. Tsao. Novel non-expanded visual cryptography scheme with block encoding. Journal of Computers, vol. 22, No. 2, pages 61-71, 2011. P. Tuyls, H.D.L. Hollmann, J.H. Vanlint. XOR-based visual cryptography schemes. Designs, Codes and Cryptography, pages 169-186, 2005. R.W. Flaoyd, L. Steinberg, An adaptive algorithm for spatial grayscale, Soc. Inf. Display, pages 75-77, 1976.