1 Introduction

Cryptographic paradigm used for image encryption is visual cryptography [28], first introduced by Moni Naor and Adi Shamir in 1994. The traditional (k,n) visual secret sharing scheme encodes a binary secret image into n shares using two basis matrices generated explicitly. Further, original secret is revealed by stacking any k or more shares. Here, k out of n shares are printed on transparencies and stacked together to reveal the secret so it is called as (k,n)-threshold scheme of visual cryptography. The stacking operation is analogous to the OR operation that is why traditional visual cryptography is referred as OR-based visual cryptography. Informally, after creating the shares printed on transparencies and assigned to equal number of participants in such a way that each and every participant receives only a single share. Only secret will be revealed if any k or more than k shares are stacked together else individual or less than k participants are not able to reveal the secret, even if they are allowed to use infinite computational power as well as cryptographic knowledge.

The traditional visual cryptography was suffering from various issues such as meaningless shares, perfect reconstruction of black pixels, contrast of the revealed secret image, cheating by the participants, pixel expansion, explicit codebook requirement and direct non-applicability of the scheme to the gray-scale image. Based on the pioneer work of Moni Naor and Adi Shamir, many issues such as quality of shares [37, 43], perfect reconstruction of black pixels [1, 19], contrast of the reconstructed secret image [2, 15] and cheating prevention [9, 10, 16, 17, 20, 23, 31, 38] are extensively studied by researchers. To resolve the problem of pixel expansion two approaches, namely probabilistic and random-grids are available in the literature. Probabilistic approach [11, 25] have no pixel expansion, but recovered secret image suffers from contrast-loss due to which quality of revealed secret image is poor.

Random grids approach to encrypt binary secret image into two noise-like share images first introduced by Kafri and Keren [18]. Extended capabilities for random grids visual cryptography such as general access structures [3, 21, 44],multiple random grids [33], multiple secrets [5, 8, 32], (k,n) threshold schemes [6, 49], verifiable shares [4, 48], improving visual quality of revealed secret image [41, 46], user-friendly shares [7, 14, 24, 30] are investigated. Poor quality of revealed images is still persisted because contrast of the OR-based visual secret sharing schemes can achieve at most 1/2.

To further improve the visual quality of the revealed images some XOR-based schemes were developed. An XOR-based visual secret sharing schemes decode the secret image using the XOR operator among the shares. These schemes use, light weight, computational devices for decoding purpose instead of the human visual system. Such scheme reconstructs secret with better visual quality as well as resolves the problem of pixel alignment [27]. Recently, many research works [12, 13, 26, 29, 34,35,36, 39, 40, 42, 45, 47] based on XOR operation has been reported.

Tuyls et al. [39, 40] proposed a visual cryptography system that uses polarization of light in which operation of decryption is mathematically described by XOR operation. Wu et al. [42] proposed a visual secret sharing using random grids which generate meaningful shares for a binary secret image. Wu et al. [47] presented another work using random grids to share the binary secret with two decoding (OR and XOR) options. Wu and Son [45] generalized random grid based visual secret sharing for the binary secret image with an XOR operation based decoding. In 2014, Liu et al. [26] proposed an optimal (2,n) scheme based on XOR operation in which various issues such as meaningless, explicit codebook requirement, pixel expansion still remain. In 2015, Ou et al. [29] proposes an XOR-based visual secret sharing scheme which generates non-expansible meaningful shares for a binary or halftone image. This scheme is not directly suitable for grayscale images because firstly it pre-process grayscale images by halftone techniques [51], due to which quality of secret image degrades prior to encryption. Deshmukh et al. [12] proposed a scheme to encrypt multiple secrets by using an XOR operation and arithmetic modulo to create shares. Singh [34] performed comparative analysis between XOR of messages with the LSB and XOR of the message with a secret key, concluded that the XOR of LSB is more efficient than another. Singh et al. [35] proposed an XOR-based visual secret sharing scheme for binary secret image with unique meaningful shares. Fu et al. [13] proposed visual secret sharing scheme to realize the perfect recovery of the secret image. It is based on random generation of intermediate images which are further used to encrypt a secret image. Tan et al. [36] proposes a visual secret sharing scheme based on QR codes which generates robust and meaningful shadows.

Literature analysis shows that most of the above mentioned scheme deals with binary or halftone image and the quality of the revealed secrets is still an issue.

In this paper, we focus on how to encrypt a gray secret image directly without converting into halftone image. Proposed XOR-based visual secret sharing scheme using pixel vectorization, diffuses and disguise secret image into a number of random looking shares distributed to participants in such a way that each participant receives only one share and have no clue about the secret. Secret image can be revealed by XOR-ing all share received from participants. Also applicable to binary image, reconstructs the original secret image without clarity-loss when all shares are available without tamper.Three novel algorithm construction matrix generation (Algorithm 1), division of a construction matrix into basis matrices (Algorithm 2) and (n,n) − V CSXOR visual secret sharing scheme (Algorithm 3) have been proposed to achieve the intended objective.

figure a
figure b
figure c

The highlighted contributions of the proposed scheme are as follows:

  • Pixel vectorization: The idea of pixel vectorization is introduced, used with implicit codebook to encrypt a secret image.

  • Applicability: Unlike other visual secret sharing schemes which converts grayscale image into a halftone image prior to feeding as input to the scheme, the proposed scheme directly applicable to the grayscale secret image.

  • No limit on number of participants: The proposed scheme is not restricted to a specific number of participants. It is suitable for any n, n ≥ 2 number of participants to resolve any related real world problem.

  • No pixel expansion: The proposed scheme diffuses and disguise secret image into multiple number of random looking images of the same size, hence resolves the pixel expansion consequently minimum storage and transmission time required.

  • Implicit codebook generation: There is no requirement of explicit codebook generation because the proposed scheme generates codebook at run time depending upon the number of participants, hence no need to store codebook.

  • Reveals secret image perfectly: The proposed scheme reconstructs each and every pixel of secret image from the respective pixels of the shares without clarity-loss if they are not tempered. Hence, the contrast of the reconstructed secret image is 100% which fulfills the intended objective of secret sharing.

  • Reveals quality secret image: The quality of an image depends on the number of bits associated with each and every pixel of the image. Since binary and halftone images are made of single bit per pixels, hence not sufficient to represent the high quality phenomenon. While grayscale images associates 8 bits per pixel which are sufficient to represent any high quality phenomenon. The proposed scheme takes binary as well as 8 bit grayscale images as secret image. And in revealing process, reconstructs each and every bit (0 or 1) associated with all the pixels of the secret image perfectly. Hence, revealed secret image is same as input secret image.

The rest of the paper is organized as follows: Section 2 describes the background and preliminaries. Proposed work is explained in Section 3. Experimental results and analysis are presented in Section 4. Comparison with the state-of-the-art approaches is given in Section 5 followed by conclusion in Section 6. Various notations used and their descriptions are given in Table 1.

Table 1 Notations and their descriptions

2 Background and preliminaries

The brief overview of the concepts such as fundamental concept of visual cryptography, bit representation of pixel values, its vectorization and preliminary definitions which have been used in the proposed approach are discussed in Sections 2.12.22.3 and 2.4 respectively.

2.1 Fundamental concept of visual cryptography

Visual Cryptography deals with methods and techniques to securely share a secret image between the participants of a group. Let S be a secret image and \(\mathcal {P}={\{P_{1}, P_{2},..., P_{n}\}}\) be a group of n participants. Objective of visual cryptography is to encode the secret image S into n random images called shares in such a way that no clue about original secret image can be drawn from individual shares. Each participant of the group \(\mathcal {P}\) receives only one share. Whenever any k, 2 ≤ kn shares are processed in a particular way, information about the secret image can be revealed [28].

2.2 Bit representation of pixel value

Let S be a Nr × Nc digital image and its pixel values are represented by K bits, K = 1 for binary image and K = 8 for gray image. Let S(i,j),1 ≤ iNr,1 ≤ jNc, be a pixel of the digital image S, represented by S(i,j) = [Vk....V2V1], k = 1 to 8. To compute the integer pixel value of the pixel S(i,j), (1) is used.

$$ S{(i,j)}=\sum\limits_{k=1}^{8}(V_{k}\times 2^{k-1}) $$
(1)

2.3 Pixel vectorization

Various existing visual secret sharing schemes which deals with grayscale secret image firstly converts them into halftone images, then consider the resultant image as a secret image. The halftone image is a single bit per pixel image, but creates illusion of being grayscale. Thus, the quality of the sharing image is reduced in comparison to the original secret image. To overcome the problem of the reduction in quality of secret image which occurs due to converting grayscale secret image into a halftone image we use the concept of pixel vectorization. Pixel vectorization is a K bit binary representation of a pixel of an image, where K is the maximum number of bits that can represent all the gray-scale levels. For example, if S be an 8 bit grayscale image, it means the integer pixel value of each pixel of image S is in the range from 0 to 255. Now suppose we have to vectorize the pixel with integer pixel value 30. Here, 8 bit vector representation of the integer pixel value 30 is V = [0 0 0 1 1 1 1 0]. In case of binary secret image pixel vectorization of 0 or 1 will be represented as V = [0] or V = [1] respectively. Because only one bit per pixel is required to represent a binary image.

2.4 Preliminary definitions

Some preliminary definitions are incorporated to analyze the performance of the proposed scheme.

Definition 1

(Average light transmission) [29] For a certain pixel S(i,j),1 ≤ iNr,1 ≤ jNc in the binary secret image S which is Nr × Nc in size, the probability of pixel S(i,j) being is white, called prob(S(i,j) = 1), represents the light transmission of pixel S(i,j), which is denoted as T(S(i,j)) = 1 and T(S(i,j)) = 0, for black pixel. Average light transmission of S is given by

$$ T(S)=\frac{{\sum}^{N_{r}}_{i=1}{{\sum}^{N_{c}}_{j=1}}S(i,j)}{N_{r} \times N_{c}} $$
(2)

Definition 2

(Area representation) [29] Let X(1) (resp.X(0)) be the area of all the white (resp. black) pixels in image X, where X = X(1) ∪ X(0) and X = X(1) ∩ X(0) = ϕ. Therefore Y (1) (resp.Y (0)) is the corresponding area of all the white (resp. black) pixels in image Y.

Definition 3

(Contrast of the revealed secret image) [29] The contrast of the revealed secret image S{⊕,1,....,n} = S1 ⊕ .... ⊕ Sn with respect to the original secret image S is

$$ \alpha_{xor} = \frac{T(S_{\{\oplus,1,....,n\}}[S(1)])-T(S_{\{\oplus,1,....,n \}}[S(0)])}{1+T(S_{\{ \oplus,1,....,n\}}[S(0)])} $$
(3)

where ⊕ is a Boolean exclusive-OR operation, and S1,....,Sn are shares of the secret image S.

3 Proposed work

Proposed scheme provides an elegant method to diffuse and disguise a binary or grayscale secret image into random looking shares. It eradicates the major limitations of the state-of-the-art approaches such as direct non-applicability of the scheme to securely share grayscale images, poor contrast, pixel expansion and explicit codebook, demarcation on the number of participants. The most of the existing visual secret sharing schemes used for encrypting binary or halftone images which are not sufficient to convey more information. The OR based visual secret sharing schemes suffers with the contrast - loss. The expanded shares pass overhead of storing and requires more storage. The restriction on the number of participants, limits the applicability and scope of the scheme. The explicit codebook used for encrypting posses overhead of storing it. The proposed scheme resolves all these problems. The proposed scheme encrypts grayscale image using implicitly generated codebook, reveals secret image perfectly (no contrast-loss), generates non-expansible shares and there is no demarcation on the number of participants. Although proposed approach generates overhead of converting pixels of the sharing image into integer pixel values before the encryption. The framework of the proposed model is depicted in Fig. 1. The methodology of the proposed approach involves: implicit construction matrix generation (Algorithm 1), division of a construction matrix into basis matrices (Algorithm 2) and proposed (n,n) − V CSXOR visual secret sharing scheme (Algorithm 3) in the Sections 3.13.23.3 respectively. Further, revealing process (Algorithm 4) and verification and analysis is traced in the Sections 3.4 and 3.5 respectively.

Fig. 1
figure 1

Framework of the proposed approach

figure d

3.1 Construction matrix generation

The proposed scheme is flexible enough for any number of participants. So as per the need of the problem, the number of participants can be decided. Let secret image S be to be shared between n participants. To share the secret image S between n participants a matrix of order 2n × n is required, which will be used to construct basis matrices for the scheme. Steps for construction matrix generation are given in Algorithm 1.

In Algorithm 1 function de2bi(i − 1,n) is used to convert decimal number (i − 1) into a row vector of n bits. This row vector is n bit binary equivalent of decimal number (i − 1) in reverse order. For example de2bi(5,8) = [1 0 1 0 0 0 0 0]. After executing Algorithm 1, obtained matrix Cn contains the binary codes of decimal number from 0 to 2n − 1. Next step is to divide matrix Cn into two 2n− 1 × n sub-matrices \(C_n^{even}\) and \(C_n^{odd}\), where matrix \(C_n^{even}\) includes those row vectors of Cn whose hamming weight wh(.) is an even number while \(C_n^{odd}\) includes row vectors whose hamming weight is an odd number.

3.2 Division of construction matrix

This section provides pseudo-code to divide construction matrix Cn into two sub matrices \(C_n^{even}\) and \(C_n^{odd}\). For illustration, matrix C3 for three participants, generated by Algorithm 1 and its sub-matrices \(C_3^{even}\) and \(C_3^{odd}\) generated by Algorithm 2 are given below. \(C_3 =\left [\begin {array}{ccc}0&0&0\\0&0&1\\0&1&0\\ 0&1&1\\1&0&0\\1&0&1\\ 1&1&0\\1&1&1 \end {array}\right ]_{8\times 3}, C_3^{even} = \left [\begin {array}{ccc} 0&0&0\\0&1&1\\ 1&0&1\\1&1&0 \end {array}\right ]_{4\times 3} \text {and} C_3^{odd} = \left [\begin {array}{ccc} 0&0&1\\0&1&0\\ 1&0&0\\1&1&1 \end {array}\right ]_{4\times 3}\)

3.3 Proposed: (n,n) − V C S XOR visual secret sharing scheme

The flow diagram of the proposed secret sharing scheme is depicted in Fig. 2. Firstly, a pixel of the secret image is picked out, converted to integer value called as an integer pixel value of that pixel. Later on pixel vectorization is carried out. Now, pick out a single bit from the vector representation of the pixel to encrypt it with the help of basis matrices. The choice of basis matrices depends on the color 0 (white) and 1 (black) of the bits. After that, on the basis of a random number a row the selected basis matrix is chosen. Side by side, assign value under the first column of that row to first vector A1, value under the second column of that row to second vector A2 and so on. Likewise, all the bits are to be encrypted of that pixel. After that values of the vectors are calculated using bit representation (1). Next step is to assign these vector values to corresponding positions of the shares are generated. This procedure is repeated for all the pixels of the secret image to obtain final shares. The intuitive idea of the proposed secret sharing scheme is given in Algorithm 3. The procedure for sharing secret pixel S(i,j) = d, where d is an integer pixel value of secret pixel S(i,j) of the secret image S, illustrated here. First of all converts d into K bit binary numbers, where K is the number of bits required to represent all the grayscale of the secret image. Value of K is 1 for binary secret image and 8 for grayscale secret image. Here the function bitget() is used to convert d into k bit vector V. The function bitget(d,k) provided by MATLAB to extract kth bit of the binary representation of decimal number d from LSB. For example bitget(204,1) = 0, where, 0 is the first bit from the LSB side. Now consider kth bit Vk of vector V, let us assume Vk = 0, then choose \(C_n^{even}\) to construct vector bits \(A^1_k, A^2_k,..., A^n_k\). Further to select the row vector of the \(C_n^{even}\) matrix, function randi(2n) is used, where randi(2n) is MATLAB function which generates random integer numbers with equal probability from 1 to 2n. Let randi(2n− 1) = te, where, n − 1 is the number of row vectors in the \(C_n^{even}\) matrix, subsequently compute \(A^1_k, A^2_k,..., A^n_k\) as, \(A^1_k=C_n^{even}(t^e,1)\), \(A^2_k=C_n^{even}(t^e,2),...,\) and \(A^n_k=C_n^{even}(t^e,n)\).

Fig. 2
figure 2

Flowchart of proposed (n,n) − V CSXOR visual secret sharing scheme using pixel vectorization

On the other hand, when Vk = 1, then according to Algorithm 3, choose \(C_n^{odd}\) matrix to construct vector bits \(A^1_k, A^2_k,..., A^n_k\), after that to choose row vector from \(C_n^{odd}\) matrix, generate a random number to, such that randi(2n− 1) = to, then compute \(A^1_k, A^2_k,..., A^n_k\) as, \(A^1_k= C_n^{odd}(t^o,1)\), \(A^2_k=C_n^{odd}(t^o,2),....,\) and \(A^n_k=C_n^{odd}(t^o,n)\). After processing all the bits of the vector V, compute integer values of the vectors A1, A2,...., An by using (1) as, \(A^1={\Sigma }_{k=1}^8 (2^{k-1}\times A^1_k)\), \(A^2={\Sigma }_{k=1}^8 (2^{k-1}\times A^2_k)\),..., and \(A^n={\Sigma }_{k=1}^8 (2^{k-1}\times A^n_k)\). Next is to assign values of A1, A2,...., and An to respective location of the shares S1,S2,..., and Sn as, S1(i,j) = A1, S2(i,j) = A2,..., and Sn(i,j) = An.

The same process is repeated for every pixel of the secret image S to get the final shares S1,S2,..., and Sn.

3.4 Revealing secret image

To reconstruct the secret image responsible authorized entity collects all the shares from the participants and ensures that they are not tampered. After that Algorithm 4 can be used, which performs XOR operation between all the shares and reveals the secret image.

3.5 Verification and analysis of the proposed approach

To ensure efficacy of a newly proposed visual secret sharing scheme, it must satisfy the basic conditions which are security and contrast condition. To ensure effectiveness of the proposed scheme, theoretical analysis of Algorithm 3 is given bellow. Theorems 1 and 2 demonstrates that Algorithm 3 is a valid construction for the proposed scheme.

Lemma 1

Given n shares S1,....,Sn, generated from Algorithm 3, each of which is a random-noise like image and gives no clue about the secret image S: T(Sk[S(0)]) = T(Sk[S(1)]) = 1/2, where k = 1,....,n.

Proof

Every column vector in \(C_n^{even}\)(\(C_n^{odd}\)) generated by Algorithm 2 always has hamming weight equal to 2n− 2(2n− 2), it means number of 1 and 0 are same in every column vector. It implies matrices \(C_n^{even}\)(\(C_n^{odd}\)) have equal number of 1 and 0 with probability of being 1 or 0 is 1/2 for each element in the matrix. According to Algorithm 3, secret pixel S(i,j) assigned to do, firstly converted to a K bit binary number(pixel vectorization). To construct n vector bits \(A^1_k,....,A^n_k\) for every bit Vk of the secret pixel S(i,j), a row vector would be arbitrarily selected from \(C_n^{even}(C_n^{odd})\) with equal probability 1/2n− 1. Thus a bit 0 or 1 are assigned to \(A^1_k,....,A^n_k\) with probability 1/2 and no matter that, the bit Vk is 1 or 0, hence we have prob\((A^n_k=1)=1/2\) and prob\((A^n_k=0)=1/2\). By Definitions 1 and 2 , we have \(T(A^i_k[V(0)])=T(A^i_k[V(1)])=1/2 ,(i=1,...,n)\). After that, using vector bits \(A_k^n, k=1,...,8\), values A1,...,An are computed by using (1), assigned to share pixels S1(i,j),...,Sn(i,j), implies that T(Sk[S(0)]) = T(Sk[S(1)]) = 1/2. Therefore have no clue about the secret pixel, except random noise like image. □

Lemma 2

Given n shares S1,...,Sn, each of which is random noise like image, generated using Algorithm 3, the XOR-Ed result of any p(p < n) shares \(S_{\{\oplus ,x_1,....,x_p\}}=S_{x_1}\oplus ....\oplus S_{x_p}\) gives no clue about the secret image S: \(T(S_{\{\oplus ,x_1,....,x_p\}}[S(1)]) = T(S_{\{\oplus ,x_1,....,x_p\}}\) [S(0)]) = 1/2.

Proof

For a K bit secret image S(i,j)(K = 1 for binary and K = 8 for gray-scale image). Let n be the number of participants. According to Algorithm 3, S(i,j) assigned to variable d, which is further converted to vector V such that V = [V8V7V6V5V4V3V2V1]. Every bit Vk, where k = 1,2...,8, encoded into vector bits \(A^1_k,...,A^n_k\). Let p vector bits from \(A^1_k,...,A^n_k\) are denoted by \(A^{j_1}_{k},...,A^{j_p}_{k}\), where \(\{j_1,...,j_p\} \subsetneq \{1,....,n\}\) and row vector Vr with p elements \(A^{j_1}_{k},...,A^{j_p}_{k}\) given as \(V_r=[A^{j_1}_{k},A^{j_2}_{k}...,A^{j_p}_{k}\)], j = 1,2,...,8.

When Vk = 0, a row vector [x1,....,xp] would be randomly chosen from matrix \(C_n^{even}(1:2^{n-1},[x_1,....,x_p]) \) with equal probability 1/2n− 1, and assigned to Vr. We know that, number of row vectors with even hamming weight is equal to the row vector with odd hamming weight in the matrix \( C_n^{even}(1:2^{n-1},[x_1,....,x_p])\). It is known that, XOR-Ed result of the row vector with even hamming weight is 0 while it is 1 for row vectors with odd hamming weight. Hence, row vector from matrix \(C_n^{even} (1:2^{n-1} [x_1,...., x_p]) \) with p elements will produce a random number 0 or 1 with probability 1/2. Thus, the probability of row vector Vr leading to white pixel is 1/2, given as prob\((A^{\{\oplus ,x_1,....,x_p\}}[V_k=0])=1/2\).

On the other hand, when Vk = 1, a row vector would be randomly chosen from matrix \(C_n^{odd}(1:n,[x_1,....,x_p])\) with equal probability 1/2n− 1, and assigned to Vr. Similarly, in the matrix \(C_n^{odd}(1:2^{n-1},[x_1,....,x_p])\) we have an equal number of row vectors with even and odd hamming weight. As a consequence, probability of row vector Vr leading to black pixel is 1/2, such that prob\((A^{\{\oplus ,x_1,....,x_p\}}[V_k=1])=1/2\). According to Definitions 1 and 2, we have \(T(A^{\{\oplus ,x_1,....,x_p\}}[V_k=0])=(A^{\{\oplus ,x_1,....,x_p\}}[V_k=1])=1/2\).

Now, according to Algorithm 3, A1,....,Ap are computed using (1), assigned to \(S_{x_1}(i,j),....,S_{x_p}(i,j)\) such that \(S_{x_1}(i,j) \leftarrow A^1,....,S_{x_p}(i,j) \leftarrow A^p\). Here, probability of vector bits \(A^1_k,....,A^p_k\) is 1/2 therefore values A1,...,Ap are random. Therefore, \(T(S_{\{\oplus ,x_1,....,x_p\}}[S(1)])=T(S_{\{\oplus ,x_1,....,x_p\}}[S(0)])=1/2\). Hence, an XOR-Ed result by any p,(p < n) shares \(S_{\{\oplus ,x_1,....,x_p\}}= S_{x_1}\oplus ....\oplus S_{x_p} \) have no clue about the secret image. □

Lemma 3

Given n shares S1,...,Sn, each of which is random noise like image, generated using Algorithm 3, the XOR-Ed result by n shares S{⊕,1,...,n} = S1 ⊕ ... ⊕ Sn can visually reconstruct the secret image S: T(S{⊕,1,...,n}[S(1)]) > T(S{⊕,1,...,n}[S(0)]).

Proof

For a K bit secret image S(i,j)(K = 1 for binary and K = 8 for grayscale image). Let n be the number of participants. According to Algorithm 3, S(i,j) assigned to variable d, which is converted to vector V such that V = [V8V7V6V5V4V3V2V1]. Let Vr be a row vector with n elements \(A^1_k,...,A^n_k\) such that \(V_r=[A^1_k,...,A^n_k]\), where \(A^n={\sum }_{k=1}^8(2^{k-1} \times A_k^n)\). When Vk = 0, a row vector would be chosen from matrix \(C_n^{even}\) with equal probability 1/2n− 1, and the chosen vector is then assigned to Vr, its hamming weight is always an even number because any row vector in the matrix \(C_n^{even}\) always have an even number of 1. Thus XOR-Ed result by all bits \(A^1_k,...,A^n_k\) is always 0. As a result, we obtain T(A{⊕,1...,n}V [0]) = 0.

On the other hand, when Vk = 1, a row vector would be randomly chosen from matrix \(C_n^{odd}\) with equal probability 1/2n− 1 and assigned to Vr, no matter which row vector is selected from the matrix \(C_n^{odd}\), its hamming weight is always an odd number because any row vector in the matrix \(C_n^{odd}\) always has odd number of 1. Thus XOR-Ed results of all the elements are always 1. Hence we obtain T(A{⊕,1...,n}V [1]) = 1.

Since, \(S_1(i,j) \leftarrow A^1,....,S_n(i,j) \leftarrow A^n\). Therefore T(A{⊕,1...,n}[Vk = 0]) = 0 and T(A{⊕,1...,n}[Vk = 1]) = 1 implies that T(S{⊕,1,...,n}|[S(0)]) = 0 as well as T(S{⊕,1,...,n} |[S(1)]) = 1. It is clearly obvious that, T(S{⊕,1,...,n}[S(1)]) − T(S{⊕,1,...,n}|[S(0)]) = 1 − 0 = 1. Hence, T(S{⊕,1,...,n}[S(1)]) > T(S{⊕,1,...,n}[S(0)])). An XOR-Ed results visually reconstructs the secret image. □

Theorem 1

Let S1,....,Sn be the n shares generated using Algorithm 3. Algorithm 3 is said to be a valid construction for XOR-based n out n scheme (n,n) − V CSXOR, if the following conditions are satisfied.

  • Every share is a random-noise like share and have no clue about the secret image S : T(Sk[S(0)]) = T(Sk[S(1)]) = 1/2, where k = 1,....,n.

  • The XOR-Ed result by any p,(p < n) shares \(S_{\{\oplus ,{x_{1}}...., S_{x_{p}}\}}=S_{x_{1}}\oplus ....\oplus S_{x_{p}}\) is a random noise like image and have no clue about the secret image S: \(T(S_{\{\oplus ,x_{1},....,x_{p}\}}[S(1)])=T(S_{\{\oplus ,x_{1},....,x_{p}\}}[S(0)])=1/2\).

  • XOR-Ed result by n shares visually reconstruct secret image S: T(S{⊕,1,...,n}[S(1)]) > T(S{⊕,1,...,n}[S(0)])).

Theorem 2

Given n shares S1,....,Sn, generated by Algorithm 3, will reveal a secret image loss-less if the contrast of revealed secret image is 1, given by αxor = 1.

Proof

From the proof of lemma 3, we have T(S{⊕,1,...,n}|[S(1)]) = 1, and T(S{⊕,1,...,n}| [S(0)]) = 0. By Definition 3, the contrast of XOR-Ed result can be obtained by

$$ \alpha_{xor} = \frac{T(S_{\{\oplus,1,....,n\}}[S(1)])-T(S_{\{\oplus,1,....,n \}}[S(0)])}{1+T(S_{\{ \oplus,1,....,n\}}[S(0)])}=\frac{1-0}{1+0}=1 $$

4 Experimental results and analysis

Feasibility and histogram analysis of the experimental results are described in Sections 4.1 and 4.2 respectively. Performance analysis is described in Section 4.3. Validity analysis through numerical illustrations is described in Section 4.4. Security against attacks is described in Section 4.5 followed computational complexity in Section 4.6.

4.1 Feasibility

Feasibility of the proposed scheme is evaluated by experiments on binary and grayscale images. Herein Figs. 3 and 5 binary secret images and in Figs. 4 and 6 grayscale secret image is used. Experimental results of the case (2,2) by Algorithm 3 unfold in Fig. 3. Image Fig. 3a is a secret image 128 × 128 in size, images Fig. 3b and c are shares and (d) is reconstructed image. Experimental results of the case (2,2) for the standard grayscale image (Leena image) is unfolding in Fig. 4, here image (a) is a secret image 128 × 128 in size, images (b) and (c) are shares (d) is reconstructed image. Figure 5, show the experimental results of the case (3,3) by Algorithm 3, images Fig. 5a and e are secret and reconstructed images respectively, while (b), (c) and (d) are shares. Experimental results of the case (3,3) for gray-scale secret images are depicted in Fig. 6. Image Fig. 6a is the input image, images Fig. 6b–d are shares and (e) is reconstructed secret image. All the share images have the same size as the size of secret image. Experimental results show that proposed scheme is feasible for both the binary and grayscale secret images.

Fig. 3
figure 3

Experimental results of the (2, 2) case for binary image by Algorithm 3. a Secret image, b Share S1, c Share S2, d Revealed secret image (S1S2)

Fig. 4
figure 4

Experimental results of the (2, 2) case for grayscale image by Algorithm 3. a Secret image, b Share S1, c Share S2, d Revealed secret image (S1S2)

Fig. 5
figure 5

Experimental results of the (3,3) case for binary image by Algorithm 3. a Secret image, b Share S1, c Share S2, d Share S3, e Revealed secret image (S1S2S3)

Fig. 6
figure 6

Experimental results of the (3,3) case for gray-scale image by Algorithm 3. a Secret image, b Share S1, c Share S2, d Share S3, e Revealed secret image (S1S2S3)

4.2 Histogram analysis

Histograms are a type of bar plot for numeric data that group the data into bins. The number of bins in the histogram depends on the image type. In histogram for binary there is only 2 bins and gray image uses 256 bins. Figure 7 is showing histograms of secret images and revealed secret images of the Figs. 345 and 6. Here, it is obvious that histograms of the secret image and revealed secret image of concerned figures are similar, concludes that secret image and revealed secret images of concerning figures are identical.

Fig. 7
figure 7

Histograms of the secret image and revealed secret image: a Secret image b revealed secret image of Fig. 3, c Secret image d revealed secret image of Fig. 4, e Secret image f revealed secret image of Fig. 5, g Secret image h revealed secret image of Fig. 6

4.3 Performance analysis

To evaluate the performance of the proposed scheme, it is required to carry out a quantitative analysis of the experimental results. In the simulation of the proposed scheme four experiments are carried out, two for the binary secret image and the other two for gray secret image. Therefore, to carry out the performance analysis of the experimental results different quality metrics are required. In the case of binary image the quality metrics such as precision, recall, F-measure, balanced classification rate, balance error rate and negative rate matrix are used. And, to measure the quality of revealed secret image in the case of gray image quality metrics such as maximum absolute error (MAE), mean square error (MSE) and peak signal-to-noise ratio (PSNR) is used. A brief description of these parameters is given below:

Objective evaluation parameters or quality metrics are quantitative error measurement parameters between the respective pixels of the images. Let us suppose that S and \(S^{\prime }\) are binary secret image and revealed (output) binary image respectively. There are some test results NTP, NFP, NTN and NTP which are represented as true positive, false positive, true negative and false negative respectively. Here, NTP, NFP, NTN and NTP are defined as follows:

True Positive (NTP): When pixel value at corresponding location in both the S and \(S^{\prime }\) is same and equal to 1 then this case is called true positive, and total number of location count of such type of pixels is denoted by NTP.

False Positive (NFP): When binary pixel value of particular location in S which is 1 altered 0 in corresponding location of the \(S^{\prime }\) this case is called true negative and total number of such type of pixels is denoted by NFP.

True Negative (NTN): When pixel value at corresponding location in both the S and \(S^{\prime }\) is same and equal to 0 then this case is called true negative, and total number of location count of such type of pixels is denoted by NTN.

False Negative (NFN): When binary pixel value of particular location in S which is 0 altered to 1 in corresponding location of the \(S^{\prime }\) this case is called false negative and total number of such type of pixels is denoted by NFN.

On the basis of these test results various metrics are calculated to evaluate similarity between binary input image and binary output image. Some of the most important metrics are defined below.

Negative Rate Matrix (NRM): NRM depends on pixel-wise inequality between input image S and output image \(S^{\prime }\), defined as

$$ NRM=\frac{NR_{fu}+NR_{fp}}{2} $$
(4)

where

$$ NR_{fn}=\frac{N_{FN}}{N_{FN}+N_{TP}} $$
(5)

and

$$ NR_{fp}=\frac{N_{FP}}{N_{FP}+N_{TN}} $$
(6)

Between two identical images the value of NRM is always 0.Recall/Sensitivity:

$$ Recall=\frac{N_{TP}}{N_{TP}+N_{FN}} $$
(7)

Between two identical images the value of Recall will be 1.Precision:

$$ Precision=\frac{N_{TP}}{N_{TP}+N_{FP}} $$
(8)

Between two identical images the value of Precision will be 1.F-Measure:

$$ FM=\frac{2\times Recall \times Precision}{Recall+Precision} $$
(9)

Between two identical images the value of F-Measure will be 1.Specificity:

$$ Specificity=\frac{N_{TN}}{N_{TN}+N_{FP}} $$
(10)

Between two identical images the value of Specificity will be 1.

Balanced Classification Rate(BCR)/Area Under the Curve(AUC):

$$ BCR= 0.5\times (Specificity+Sensitivity) $$
(11)

Between two identical images the value of BCR/AUC will be 1.

Balanced Error Rate (BER): :
$$ BER=100\times(1-BCR) $$
(12)

Between two identical images the value of the BER is 0.

Structural Similarity Index (SSIM): :
$$ SSIM(x,y)=\frac{(2\cdot \mu_{x}\cdot \mu_{y}+c_{1})(2\cdot \sigma_{xy}+c_{2})}{({\mu_{x}^{2}}+{\mu_{y}^{2}}+c_{1})({\sigma_{x}^{2}}+{\sigma_{y}^{2}}+c_{2})} $$
(13)

where μx, μy, \({\sigma _{x}^{2}}\), \({\sigma _{y}^{2}}\) and σxy refers to average value of x, average value of y, variance of x, variance of y, covariance of x and y respectively. The value of SSIM is 1 for two identical images and vary from -1 to + 1.

Effectiveness of visual cryptography scheme judged on these objective evaluation parameters. The visual cryptography scheme is said to be effective, if the values of these parameters reach towards their ideal values on comparison between input and output image.

Definition 4

Maximum Absolute Error (MAE): It is defined as the maximum absolute difference between the respective pixels of the original image and the reconstructed or obtained by any other modification. Let S(M,N) and S’(M,N) are input and output images, then MAE is defined as

$$ MAE=MAX(abs(S(i,j)-S^{\prime}(i,j))) $$
(14)

where, 1 ≤ iM and 1 ≤ iM

Definition 5

Mean Square Error (MSE) : It represents the cumulative squared error between original and obtained image. It is given by following equation

$$ MSE=\frac{{\sum}_{i=1,j=1}^{M,N}[S(i,j)-S^{\prime}(i,j)]^{2}}{M \times N} $$
(15)

When original and obtained images are same, value of MSE will be 0. It means lower the value of MSE, lower the difference between original and obtained image

Definition 6

Peak Signal to Noise Ratio (PSNR): This ratio measures the quality of the reconstructed image with respect to the original image. Higher the PSNR, better the quality of the reconstructed image. It is calculated by the following equation

$$ PSNR=10 \times \log_{10}\Big(\frac{R^{2}}{MSE}\Big) dB $$
(16)

Where, R is the maximum fluctuation in the input image data type. It is 1 for double-precision floating-point data type, and 255 for 8 bit unsigned data type. PSNR value will be \(\infty \) for two identical images.

Experiments and ideal values of the quality metrics for the binary image are listed in Table 6 and for gray image in Table 7. Here, it is clear that experimental and ideal values of the various quality metrics are same, which means revealed secret image is same as an original secret image in all the cases.

4.4 Validity and numerical analysis

By using the concept of the proposed scheme two examples are illustrated to ensure effectiveness and validity of the proposed scheme. In example 1, a single pixel grayscale secret image is shared among three participants. In example 2, a single pixel grayscale secret image is shared between two participants. The proposed scheme is valid construction if the results of XOR-Ed all the shares in both the examples reconstructs the original secret image.

Example 1

This example demonstrates secret sharing of the proposed scheme for n = 3 participants, where the integer pixel value of the single pixel grayscale secret image is 204.

4.4.1 Encryption

Since number of participants are n = 3. Therefore, we have to generate construction matrix C3 using Algorithm 1. After that divide C3, into \(C_{3}^{even}\) and \(C_{3}^{odd}\) using Algorithm 2.

Now apply the instructions given in Algorithm 3 to encrypt the secret image.

Given d = 204, convert d into 8 bit binary representation and assign it to vector V as, \(V=\left [\begin {array}{cccccccc}1&1&0&0&1&1&0&0 \end {array}\right ]\)

Here, V8 = 1, V7 = 1, V6 = 0, V5 = 0, V4 = 1, V3 = 1, V2 = 0 and V1 = 0. Here, Tables 2 and 3 are prepared with respect to the matrices \(C_{3}^{even}\) and \(C_{3}^{odd}\) generated, by Algorithm 2. The next step is table selection for encryption purpose and selection of a particular row of the selected table based on random number t. Now consider V8 = 1 ≠ 0, hence select Table 3, next compute a random number t as, to = randi(23 − 1), let us assume t0 = randi(23 − 1) = 2 is returned, then select second row of the Table 3 and assign respective values to \({A^{1}_{8}}\), \({A^{2}_{8}}\) and \({A^{3}_{8}}\) as given below \({A^{1}_{8}}=0\), \({A^{2}_{8}}=1\) and \({A^{3}_{8}}=0\). Similarly, for V7 = 1 ≠ 0, hence select Table 3, next execute the function t0 = randi(23 − 1), let it be t0 = 3, it means take the third row of Table 3 and compute \({A^{1}_{7}}\), \({A^{2}_{7}}\) and \({A^{3}_{7}}\) as, \({A^{1}_{7}}=1\), \({A^{2}_{7}}=0\) and \({A^{3}_{7}}=0\), in the same way select every Vk, where k = 1 to 8. The resultant values of \({A^{1}_{k}}\), \({A^{2}_{k}}\) and \({A^{3}_{k}}\) for every Vk are given in Table 4. Now compute integer values of the vectors A1, A2 and A3, according to (1).Computation of A1

$$ \begin{array}{@{}rcl@{}} A^{1}&=&{A^{1}_{8}}\times2^{7}+{A^{1}_{7}}\times2^{6}+{A^{1}_{6}}\times2^{5}+{A^{1}_{5}}\times2^{4}+{A^{1}_{4}}\times2^{3}+{A^{1}_{3}}\times2^{2}+{A^{1}_{2}}\times2^{1}\\&&+{A^{1}_{1}}\times2^{0}\\ \Rightarrow A^{1}&=&0\times2^{7}+1\times2^{6}+0\times2^{5}+1\times2^{4}+1\times2^{3}+1\times2^{2}+0\times2^{1}+1\times2^{0}\\ \Rightarrow A^{1}&=&93 \end{array} $$

Computation of A2

$$ \begin{array}{@{}rcl@{}} A^{2}&=&{A^{2}_{8}}\times2^{7}+{A^{2}_{7}}\times2^{6}+{A^{2}_{6}}\times2^{5}+{A^{2}_{5}}\times2^{4}+{A^{2}_{4}}\times2^{3}+{A^{2}_{3}}\times2^{2}+{A^{2}_{2}}\times2^{1}\\&&+{A^{2}_{1}}\times2^{0}\\ \Rightarrow A^{2}&=&1\times2^{7}+0\times2^{6}+0\times2^{5}+1\times2^{4}+0\times2^{3}+1\times2^{2}+1\times2^{1}+0\times2^{0}\\ \Rightarrow A^{2}&=&150 \end{array} $$

Computation of A3

$$ \begin{array}{@{}rcl@{}} A^{3}&=&{A^{3}_{8}}\times2^{7}+{A^{3}_{7}}\times2^{6}+{A^{3}_{6}}\times2^{5}+{A^{3}_{5}}\times2^{4}+{A^{3}_{4}}\times2^{3}+{A^{3}_{3}}\times2^{2}+{A^{3}_{2}}\times2^{1}\\&&+{A^{3}_{1}}\times2^{0}\\ \Rightarrow A^{3}&=&0\times2^{7}+0\times2^{6}+0\times2^{5}+0\times2^{4}+0\times2^{3}+1\times2^{2}+1\times2^{1}+1\times2^{0}\\ \Rightarrow A^{3}&=&7 \end{array} $$
Table 2 Table with respect to random number t for \(C_{3}^{even}\)
Table 3 Table with respect to random number t for \(C_{3}^{odd}\)
Table 4 Table for computation of A1, A2 and A3

Now, assign values of A1, A2 and A3 to respective location of the shares S1, S2 and S3. Hence, integer values of generating shares are as follows, S1 = 93, S2 = 150 and S3 = 7.

4.4.2 Decryption

To reveal the secret pixel, apply Algorithm 4 to the shares S1,S2 and S3. To do so, perform an XOR-operation between S1 and S2 as temp = S1S2, ⇒ temp = 93 ⊕ 150 ⇒ temp = 203, now, perform an XOR operation between temp and S3 as, Rd = tempS3Rd = 203 ⊕ 7 ⇒ Rd = 204, value of Rd is same as input secret image d. It means Proposed scheme recovers secret image without any loss.

Example 2

This example demonstrates the secret sharing of the proposed scheme for the n = 2 participants, where the integer pixel value of the single pixel grayscale secret image is 160.

4.4.3 Encryption

Here number of participants n = 2, therefore, create construction matrix C2 for n = 2, by executing Algorithm 1, and \(C_{2}^{even}\), \(C_{2}^{odd}\) by executing Algorithm 2.

$$ C_{2}=\left[\begin{array}{cc}0&0\\0&1\\1&0\\1&1 \end{array}\right]_{4 \times 2}, C_{2}^{even}=\left[\begin{array}{cc}0&0\\1&1 \end{array}\right]_{2 \times 2}, C_{2}^{odd}=\left[\begin{array}{cc}0&1\\1&0 \end{array}\right]_{2 \times 2} $$

Now, use Algorithm 3 to generate secret shares. To do so first convert d into 8 bit binary numbers and assign it to vector V, hence \(V=\left [\begin {array}{llllllll}1&0&1&0&0&0&0&0 \end {array}\right ]\) for further processing follows Table 5, which is created using matrices \(C_{2}^{even}\) and \(C_{2}^{odd}\). From Table 5,

Table 5 Table for computation of A1 and A2

\(A^{1}={A^{1}_{8}}\times 2^{7}+{A^{1}_{7}}\times 2^{6}+{A^{1}_{6}}\times 2^{5}+{A^{1}_{5}}\times 2^{4}+{A^{1}_{4}}\times 2^{3}+{A^{1}_{3}}\times 2^{2}+{A^{1}_{2}}\times 2^{1}+{A^{1}_{1}}\times 2^{0}\)A1 = 197 \(A^{2}={A^{2}_{8}}\times 2^{7}+{A^{2}_{7}}\times 2^{6}+{A^{2}_{6}}\times 2^{5}+{A^{2}_{5}}\times 2^{4}+{A^{2}_{4}}\times 2^{3}+{A^{2}_{3}}\times 2^{2}+{A^{2}_{2}}\times 2^{1}+{A^{2}_{1}}\times 2^{0}\)A2 = 0 × 27 + 1 × 26 + 1 × 25 + 0 × 24 + 0 × 23 + 1 × 22 + 0 × 21 + 1 × 20A2 = 101 assign values of A1 and A2 to respective locations of the shares S1 and S2. Hence, S1 = A1 = 197, S2 = A2 = 101.

4.4.4 Decryption

To decrypt the secret image use Algorithm 4,hence Rd = S1S2Rd = 197 ⊕ 101 ⇒ Rd = 160. It is same as the original secret image (Table 6 and 7).

Table 6 Values of various objective evaluation parameters for revealed secret images of Figs. 3 and 5
Table 7 Values of various evaluation parameters for revealed secret images of Figs. 4 and 6

4.5 Security against attacks

The proposed scheme generates meaningless shares due to which subject of suspect for the assailants. Therefore, participants can tamper the content of the shares. Now, a question arises, how shares resist disclosing of information over various attacks which an attacker can do intentionally or unintentionally. A brief description of possible attacks and resistivity of the shares to overcome the effect of the attacks and its impact on revealed secret image is given below:

  • Passive Attacks: A passive attack attempts to divulge or use information without affecting to resource. Possible passive attacks are release of message contents and traffic analysis. Since the proposed scheme generates meaningless shares which have no clue about the secret image [28]. It means attacker or individual participants are not able to disclose the contents of the shares even if they have high computational power. Traffic analysis occurs when an attacker monitors source of information during transmission. When shares are transmitted from participants to intended authority for the purpose of decryption, then the attacker can determine the location and identity but information remains unrevealed.

  • Active Attacks: Active attacks involve tampering with the contents of the shares. The contents of the shares could be altered by the participants or attackers during transmission with the intention of harm or denial of service to the system. This alteration will reflect in the revealed secret image.

4.6 Computation complexity

For the assessment of the performance of a particular visual secret sharing scheme, it is required to compute the computation complexity of that scheme. The performance of the visual secret sharing assessed on the complexity of decryption. Hence, it is desired to calculate the computational complexity of the proposed scheme. When XOR decryption is applied computational complexity of decryption is proportional to the number of XOR-Ed shares. Let n be the number of shares, computational complexity of decryption is \(\mathcal {O}(n)\). The computation complexity assessment of the proposed scheme in comparison to some state-of-the-art approaches is tabulated in Table 8. Here, it is obvious that in comparison to schemes [22, 50] based on Shamir’s method [28] which requires the evaluation of polynomials and interpolation, proposed scheme requires less time for decryption. The OR-based visual secret sharing schemes [6, 14, 33] shown in table is \(\mathcal {O}(1)\)requires no computation for decryption. The computational complexity for decryption of the proposed and other XOR-based schemes [26, 29, 35, 40, 45] is relatively higher than that of OR-based schemes. However, the advantageous feature of XOR-based visual secret sharing schemes are that the quality of revealed secret image is superior to OR-based schemes and solves pixel alignment problem.

Table 8 Comparison with other schemes on the basis of computational complexity for the decryption

5 Comparison with the state-of-the-art approaches

The proposed scheme is compared with some state-of-the-art approaches on the basis of subjective evaluation parameters such as the type of the scheme, secret image type, the content of the shares, pixel expansion and contrast-loss. To understand it clearly, brief descriptions about these subjective parameters are as follows:

  1. 1.

    Type: Visual secret sharing schemes are categorized into three types (2,n), (k,n) and (n,n) which can reveal secret image by using any 2 or more, any k or more and only n out of n shares respectively.

  2. 2.

    Decryption: There are three ways, namely OR operation, XOR operation and compute to reveal the secret. The visual secret sharing schemes which reveal secret on the basis of compute, requires additional information.

  3. 3.

    Secret image type: There is four types such as binary, grayscale, grayscale converted to halftone (G-half) and color image converted to halftone (C-half) of secret images are taken into interest by the researchers.

  4. 4.

    Pixel expansion: Visual secret sharing schemes either generate expanded (larger than the secret image) or non-expansible shares (same size as secret image).

  5. 5.

    Contrast-loss: Visual secret sharing schemes suffers with contrast-loss or not and is responsible for quality of shares as well as revealed secret image.

  6. 6.

    Content of the shares: Visual secret sharing schemes either generates meaningless or meaningful shares. Here, meaningless shares are just noise-like images. The meaningful shares carry some additional information which is useful to ease the management, but still filled with some noisy pixels.

  7. 7.

    Revealed image quality: The quality of the revealed secret image (RIQ) is measured in terms of Low, High and Varying. Here, Low means quality of revealed secret image is poorer than the secret image. High means quality of revealed secret image is same as that of the secret image. Varying means quality varies depending upon the underlying operation to reveal the secret image.

Comparable values for these parameters of the proposed scheme and state-of-the-art approaches are given in Table 9. The schemes proposed by Shyu et al. [33], Chen et al. [6], and Guo et al. [14] are OR-based visual cryptography schemes used to share the binary secret, reconstructs secrets with low contrast due to which quality of the revealed secret image is poor. Although the scheme proposed by Gue et al. generates meaningful shares which facilitates to manage shares easily. The schemes proposed by Tuyls et al. [40], Wu et al. [45], Liu et al. [26], Ou et al. [29] and Singh et al. [35] are XOR-based visual cryptography schemes, limited to share binary or halftone secret image but reveals secret with high visual quality. Proposed scheme based on XOR operation applies to the both binary and grayscale secrets and reconstructs the secret image perfectly with high visual quality. From the Table 9, it is clear that unlike the other schemes the proposed scheme is the only scheme which is directly applicable to binary and grayscale images and reconstructs the secret image perfectly without clarity-loss(same to input secret image)

Table 9 Feature comparison with the state-of-the-art approaches

6 Conclusion and future scope

To deal with the situation where information associated with high quality image (gray) is at risk of disclosing in a single user system (participant, channel etc.). In this paper, an XOR-based (n,n) − V CSXOR visual secret sharing scheme using pixel vectorization is proposed. Which diffuses and disguise secret image into a number of random looking shares distributed to participants in such a way that each participant receive only one share and have no clue about the secret. The proposed scheme applies directly to grayscale secret image without converting to halftone image. The proposed scheme imposes no overhead of storing codebook, generates implicitly. Proposed scheme also resolves the problem of pixel expansion, restriction with the number of participants and lossy recovery of the secret image. It is also applied to binary image. To achieve the objective three algorithms, construction matrix generation (Algorithm 1), division of construction matrix (Algorithm 2) into basis matrices and (n,n) − V CSXOR visual secret sharing scheme (2) are developed. Numerical illustration and theoretical analysis are provided to validate the correctness of the scheme. Experimental results and analysis show that it is feasible for both binary and grayscale secret images. Results also compared with the state-of-the approaches on the basis of subjective evaluation parameters and computational complexity, found that proposed scheme performs better.