1 Introduction

Information security (IS) always provides ways to protect information from the unauthorized parties or cyber thieves. Information could be in the form of text, image or video. Cryptography a part of IS provides security to the text information by encryption algorithms such as data encryption standard (DES), Rivest–Shamir–Adleman (RSA) encryption and advanced encryption standard (AES) etc., However such encryption schemes cannot be applied on image data due to its complex or numerous pixel data. Information hiding, part of IS became a solution to the image security. Steganography and water marking algorithms are used to hide the pixel data in the image with cover images and embedding text or image in the classified data to protect its copyright. In 1994, Naor and Shamir have introduced Visual Secret Sharing (VSS) Scheme or called Visual Cryptography. VSS has two functions namely, share generation phase and reconstruction phase. In the share generation phase, the pixel data is encrypted and are divided into subpixels to generate share images [1]. The shares are then given to the members. In the reconstruction phase, the shares are stacked to reveal the classified image. Stacking was initially done by physically stack the transparent layers or digitally stacking the shares using logical XOR operations [2, 3]. In this basic VSS scheme, \((n,n)\) scheme uses n shares to reconstruct the image whereas \((k,n)\) uses k out of n shares where \(k<n\) required to reconstruct the image [4].

Researchers have done intensive study on VSS schemes. Study shows that the VSS scheme can be applied to binary, grayscale and color images [5, 6]. Pixels are divided into subpixels and raises pixel expansion issues [7,8,9]. Quality of the shares is reduced due to pixel expansion issues [10]. Reducing the quality of the share increases security issues [11,12,13]. The shares are shared among the members and image is disclosed at reconstruction phase using physical layers of sheets or digitally stacking all shares using logical XOR operations. The quality of the shares affects the quality of the image revealed. The image revealed needs to be verified to check whether all the shares are authenticated one. If any of the unauthorized member adds a share, the VSS scheme, must ensure the classified images is not revealed and to identify the unauthorized access. It also, happens when one or more of the authorized members cheat the system by providing a wrong share to reveal the image. Such cheating needs to be identified [14,15,16]. The revealed image needs to ensure the revealed image is reconstructed from authentic sources of members and the shares are not tampered or modified. To verify the revealed image, techniques have been adopted by verifying the image with the help of trusted third parties (TTP) [8, 17,18,19,20,21]. The TTP holds the original classified image and the revealed image is compared. Additional shares to authenticate the member has also been used [22,23,24]. This raised the computational complexity of the scheme. Additional pixels also added with the encrypted pixel that increases the pixel expansion issues. Adding stamping with the shares also prevents the cheating issues. However, such process is complex one.

From the analysis of literature study, this research work gains the following objectives: The cheating prevention mechanism must.

  1. (i)

    Work independently rather depending on the TTP.

  2. (ii)

    Ensure no additional pixel expansion as it reduces the quality of the shares.

  3. (iii)

    Authenticate the integrity of the revealed classified image.

  4. (iv)

    Reduce the computational complexity of the encryption and decryption process.

  5. (v)

    Confirm no additional share is required, as security of such additional share is a concern

In this paper, a new cheating prevention by self-authentication (CPS) is proposed and the outcomes of this research work are listed as follows: The proposed CPS ensures:

  1. (i)

    To send a single grayscale classified image \((GCI)\) securely from source \(({E}_{S})\) to the destination \(({E}_{D})\).

  2. (ii)

    To embed the shares with color cover images \((CCI)\) to generate meaningful shares.

  3. (iii)

    To generate additional new key share to reveal the \(GCI\) in the \(RP\).

  4. (iv)

    To authenticate the revealed \(GCI\) for its integrity in authenticator side \(({E}_{A})\).

  5. (v)

    To maintain the quality of the \(GCI\) in RP without pixel expansion issues.

  6. (vi)

    To reduce the computational complexity to reveal the \(GCI\).

In this research paper, Sect. 2 is explained with the design of the proposed CPS and its algorithm, Sect. 3 shows the implementation and working model of the proposed CPS. Section 4 analyses the results obtained from test messages and the comparative analysis with existing techniques.

2 Design of Proposed CPS

The proposed CPS has three functions namely, share generation phase \((GP)\), revealing phase \((RP)\) and verification phase \(\left(VP\right)\) in \({E}_{S}\), \({E}_{D}\) and \({E}_{A}\) respectively. The proposed CPS securely sends a single grayscale GCI from \({E}_{S}\) to \({E}_{D}\). The size of the GCI is considered to be \(R\times C\) where \(R\) rows and C columns in matrix format. The pixel values of GCI lie from \(0\) to \(255\).The proposed architecture of CPS is shown in Fig. 1.

Fig. 1
figure 1

Architecture of proposed CPS

In the revealing side, the shares are received from the members. There could be a chance of being a malicious outsiders or malicious insiders, commonly known as malicious actors (MA) participating in the revealing phase. Malicious insiders refer to the members who are authenticated members but try to cheat others by tampering or modifying the share received. Malicious outsiders refer to the members who are intruders in the communication and try to cheat others by acting as an authenticated member by providing fake shares. The encrypted pixel values and key are extracted from the shares received. Using the key retrieved, a new decryption key is generated in this phase. The decryption key is used to decrypt the pixel values and the reconstructed classified image (RCI) is obtained. The decryption also generates an integrity check key (ICK). Finally, in the verification phase, the ICK is used to verify whether the RCI revealed is authentic one or not. The size of ICK is same as of the size of RCI.

2.1 Share Generation Phase (GP)

The algorithm for the share generation phase is given in this section. A grayscale GCI is considered with size \(R\times C\). The working structure of GP is shown in Fig. 2.

Fig. 2
figure 2

Share generation phase

The working of share generation phase is explained step by step as follows:

Step 1

An encryption key matrix (EKM) is generated from set of predefined prime numbers \((E)\) with size same as of the GCI. The element \({EKM}_{(x,y)}\) is considered to be a secret key (SK) and is generated using Eq. (1). \((x,y)\) represents the row and column number of the matrix and \(0\le x,y\le 255\).

$$SK\to rand\left\{{E}_{p}\vee \left({E}_{p}\times {E}_{q}\right)\right\}, {E}_{p}\in \left\{\text{7,11,13}\right\} , p\ne q$$
(1)

The values to generated randomly to create a confusion map to provide a better security. SK is divided into 3 secret sub keys (SSK) that to be distributed to the members of participation. The SSK generation is obtained from Eqs. (2, 3 and 4). \(m\) is chosen to be a threshold value and is fixed to be 100. A small three-digit number is considered.

$$\underbrace {{SSK}}_{1} \to \left\{ {\begin{array}{*{20}l} {0,} \hfill & {\forall \,SK \le m} \hfill \\ {1,} \hfill & {otherwise} \hfill \\ \end{array} } \right.$$
(2)
$$\underbrace {{SSK}}_{2} \to \left\{ {\begin{array}{*{20}l} {mod\left( {SK,\,10} \right),} \hfill & {\forall \,SK \le m} \hfill \\ {mod\left( {\frac{{SK}}{{10}},\,10} \right),} \hfill & {otherwise} \hfill \\ \end{array} } \right.$$
(3)
$$\underbrace {{SSK}}_{3} \to \left\{ {\begin{array}{*{20}l} {\frac{{SK}}{{10}},} \hfill & {\forall \,SK \le m} \hfill \\ {mod\left( {SK,\,10} \right),} \hfill & {otherwise} \hfill \\ \end{array} } \right.$$
(4)

Step 2

The SSK are important in this communication as all the members will have this SSK individually. Without the SSK the GCI cannot be revealed. GCI is encrypted and encrypted confidential data (ECD) is obtained using Eq. (5).

$${ECD}_{x,y} \to {GCI}_{x,y} \times {SK}_{x,y}$$
(5)

Step 3

The \(n\) shares of the proposed CPS are in black color as the values of each share ranges from\(0 to 9\). The shares are converted into meaningful shares by using cover images [25]. The cover images are considered to be color images CCI and are not related with the GCI. The CCI are separated as Red (R), Green (G), Blue (B) channels. Each channel of the CCI are acting as individual image. \({CCI}_{1}, {CCI}_{2}, {CCI}_{3}\) are divided in to channels as \({{CCI}_{1}}^{R}, {{CCI}_{1}}^{G}, C{{CI}_{1}}^{B}\), \({{CCI}_{2}}^{R}, {{CCI}_{2}}^{G}, {{CCI}_{2}}^{B}\) and \({{CCI}_{3}}^{R} , {{CCI}_{3}}^{G}, {{CCI}_{3}}^{B}\) and are labeled as \({C}_{1}, {C}_{2},{C}_{3}, {C}_{4}, {C}_{5}, {C}_{6}, {C}_{7}, {C}_{8}, {C}_{9}\). Each channel pixel ranges between 0 and 255.

Step 4

The ECD is divided into number of shares using simple mod operations. The digits of the ECD is calculated recursively and are considered to be base shares (BS) and the SSK are considered to be key shares (KS). The proposed CPS supports \((n,n)\) VCS. The BS forms (b, n) VCS where \(b <n\) and \(b\) is the maximum available digits in the EKM. KS forms \((k,n)\) VCS where \(k<n\) and \(b+k=n\). In this scheme, \(b,k and n\) represent the number of shares generated using BS, KS and the CPS respectively. The BS share values are the array of values represented as \({ECD}_{[ ]}=[{E}_{n},{E}_{n-1}, \dots {E}_{2},{E}_{1}]\).

Step 5

The \(n\) shares of the proposed CPS is embedded with the CCI channels using LSB embedding method. In this proposed CPS, all of the members are considered to be an admin or key persons to hold the KS and BS. In this case, the shares are generated using (6) and (7). Let

$${share}^{j}\to \left({C}_{j}-\left(mod\left({C}_{j},10\right)\right)+ECD\left[j-1\right]\right) \forall 1\le j\le n \,and\, {C}_{j}\ne R \,channel$$
(6)
$$share^{k} \to \left( {C_{k} - \left( {mod\left( {C_{k} ,10} \right)} \right) + \underbrace {{SSK}}_{i}} \right) \forall 1\le k\le n, {C}_{k}\in R\, channel, 1\le i\le 3$$
(7)

Step 6

The share channels are combined together to get the color share images (CSI). They look like the CCI and carry the encrypted pixel values of the GCI and the SK.

The CSI are communicated to the members of the transaction or communication system over ONC. The CSI are meaningful to decrease the opportunities available to the MA by guessing or getting a suspicious image.

2.2 Revealing Phase (RP)

In this phase, the CSI are collected together and the GCI is reconstructed by decrypting the pixel data. In this phase, a new decryption key (DK) is generated from the SSK shared among the shares and the data is decrypted. The reconstructed confidential image (RCI) is then analysed for its performance and genuineness. The working structure of RP is shown in Fig. 3.

Fig. 3
figure 3

Revealing phase

The process of RP is explained step by step as follows:

Step 1

The shares are received at the revealing phase. These shares are color in nature. The channels are separated and the individual channels are holding the encrypted data. The Red, Green and Blue channels of \({\text{CSI}}_{1},{\text{CSI}}_{2}, {\text{CSI}}_{3}\) as \({\text{CSI}}_{1R},{\text{CSI}}_{2R}, {\text{CSI}}_{3R}, {\text{CSI}}_{1G},{\text{CSI}}_{2G}, {\text{CSI}}_{3G}, {\text{CSI}}_{1B},{\text{CSI}}_{2B}, {\text{CSI}}_{3B}\).

Step 2

The encrypted values are obtained by LSB extraction process and the values are assigned in \({\text{S}}_{1R},{S}_{2R}, {S}_{3R}, {S}_{1G},{S}_{2G}, {S}_{3G}, {S}_{1B},{S}_{2B}, {S}_{3B}\) from the shares \({\text{CSI}}_{1R},{\text{CSI}}_{2R}, {\text{CSI}}_{3R}, {\text{CSI}}_{1G},{\text{CSI}}_{2G}, {\text{CSI}}_{3G}, {\text{CSI}}_{1B},{\text{CSI}}_{2B}, {\text{CSI}}_{3B}\) respectively using (8).

$${S}_{[i,x ]} \to mod\left({CSI}_{[i,x]}, 10\right), 1\le i\le 3 \,and\, x\in \{G,B\}$$
(8)

The received KS values are obtained from Eqs. (9). KS initially assigned as \(zero\).

$$\underbrace {{SSK}}_{i} \to mod\left( {CSI_{{[i,x]}} ,10} \right),\;1 \le i \le 3\,and\,x \in \{ R\}$$
(9)

Step 3

A new DK is generated using the equation Eqs. (10). \({T}_{c}\) is a constant defined in the RP.

$$DK = \left\{ {\begin{array}{*{20}c} {\frac{{T_{c} }}{{\underbrace {{SSK}}_{2} \times 10 + \underbrace {{SSK}}_{3}}},\quad \forall \underbrace {{SSK}}_{1} = 0} \\ {\frac{{T_{c} }}{{\underbrace {{SSK}}_{3} \times 10 + \underbrace {{SSK}}_{2}}},\quad otherwise} \\ \end{array} } \right.$$
(10)

Step 4

The received BS value is obtained from \({S}_{[i,G]}, and {S}_{[i,B]},\) Eq. (11). BS is initially set as \(zero\).

$$BS = BS \times 10+{S}_{[i,x]}, 1\le i<3 \,and\, x\in \{G,B\}$$
(11)

\(BS\) is the encrypted image pixel data obtained from the shares received.

Step 5

The decrypted confidential image (DCI) is obtained using Eq. (12).

$$DCI\to DK \times BS$$
(12)

The RCI is revealed from the DCI using Eq. (15). \(l\) is the maximum length of DCI pixel data.

In the proposed CPS, parity data are generated and added along with the pixel data in the SP itself. Parity data are part of the encrypted data of the GCI. No additional data are added in the CPS. In the RP, the RCI is obtained and an Integrity Check Key (ICK) matrix of size \(R\times C\) is also obtained containing the parity data. The ICK is used to verify the RCI. ICK is obtained using Eq. (13).

$$RCI\to mod(DCI, {10}^\frac{l}{2} )$$
(13)
$$ICK \to {\raise0.7ex\hbox{${DCI}$} \!\mathord{\left/ {\vphantom {{DCI} {10^{{\frac{l}{2}}} }}}\right.\kern-\nulldelimiterspace} \!\lower0.7ex\hbox{${10^{{\frac{l}{2}}} }$}}$$

\(l\) is obtained using Eqs. (14) and (15).

$${P}_{max}\to \underset{1\le i,j\le \mathit{i*j}}{\mathit{max}}DCI$$
(14)
$$l \to \left\lfloor {(log_{{10}} \left| {P_{{max}} } \right|) + 1} \right\rfloor$$
(15)

The obtained RCI needs to be verified for its integrity in the verification phase.

2.3 Verification Phase (VP)

In the proposed CPS, Verification phase takes the RCI and ICK generated from VP as input. The pixel values are gone under parity check and each pixel in RCI is matched with the ICK. The working of VP is given in Fig. 4.

Fig. 4
figure 4

Verification phase

The step by step process of VP is given as follows:

Step 1

A new error code \(({E}_{code})\) matrix with size same as of GCI is generated. The value of each row and column would be filled by checking the ICK with RCI using Eq. (16).

$${E}_{code}\to \left\{\begin{array}{c}0,\quad ICK=RCI\\ 1, \quad otherwise\end{array}\right.$$
(16)

Step 2

in this step, the \({E}_{code}\) is verified whether it is a NULL matrix or not and it is obtained using Eq. (17).

$$verification=\left\{\begin{array}{l}Authenticated, {E}_{code}^{\left(i,j\right)}=0,\quad \forall i,j \,and\quad 0\le i,j\le R\times C\\ mistrust, \quad otherwise\end{array}\right.$$
(17)

If the \({E}_{code}\) is a NULL matrix then the RCI is considered to be from the authenticated source and the RCI do not expose any threat to the classified image. Otherwise, the RCI considered to be from an unauthenticated source and the data is under mistrust. In this proposed CPS, the verification is done with the encrypted image data. No additional shares or data is added for verification. The GCI itself verifies the authenticity of the RCI.

3 Result Analysis

The proposed CPS consists of share generation phase, revealing phase and verification phase. In GP, the GCI is divided in to number of shares by encrypting the pixel data with the help of a SK. In the RP, the GCI is reconstructed by decrypting the pixel data using a new key generated from the shares received. The proposed CPS is analysed and the performance is evaluated. The images at each stage is analysed for its quality and security. The proposed CPS is tested with sample test images. Grayscale images of various sizes \(256 \times 256\), \(512 \times 512\) and \(256 \times 512\) have been tested on this proposed CPS. The results have been recorded and analysed and the results shows successful implementation of the CPS. Two images of size \(512 \times 512\) are considered here as the GCI and three-color images of size \(512 \times 512 \times 3\) are considered here as CCI. The images are shown in Fig. 5.

Fig. 5
figure 5

a Classified grayscale image. bd Color cover images

The color cover image has three channels namely Red(R), Green (G) and Blue (B). the three channels of the Lena image are shown in Fig. 6.

Fig. 6
figure 6

color channels separated from Lena color image

The channels act as an individual image and the pixel values ranges from 0 to 255.

3.1 Transformation of GCI Using CPS

The primary objective of this proposed CPS is to authenticate the RCI for its genuineness and the image is not tampered during the communication. Also, the proposed CPS do not add any kind of noise along with the pixel data, hence, the quality of the image is maintained while revealing the image in RP. The transformation of the GCI in the proposed CPS is shown in Fig. 7.

Fig. 7
figure 7

Transformation of GCI in the proposed CPS

3.2 Quality of Images

The proposed CPS analyses the quality of the image based on the performance metrics mean square error (MSE), peak signal to noise ratio (PSNR), Structural Similarity Index (SSIM) and Universal Image Quality Index (UIQI). All these metrics compares the RCI with GCI. MSE represents the cumulative squared error value in each pixel compared to the original [26, 27]. It is measured using Eq. (18).

$$MSE = \frac{\sum_{R,C}{[{RCI}_{(i,j)}- {GCI}_{(i,j)}]}^{2} }{R\times C}$$
(18)

MSE tends to zero shoes that both images are identical. PSNR shows the quality of the image compared to the original one. PSNR is measured in decibel (dB). An image with PSNR > 30 dB is considered to be in good and acceptable quality. PSNR with infinite value shows the identical images [10]. It is measured using Eq. (19).

$$PSNR=10 {\text{log}}_{10}\left(\frac{{(255)}^{2}}{MSE}\right)$$
(19)

SSIM and UIQI are used to check the quality of the images using luminance, contrast and structure of the images. These values are ranges between − 1 and + 1. In this, + 1 stands for identical images and – 1 for images with no correlation [11, 28]. SSIM and UIQI are measured using Eqs. (20 and 21).

$$UIQI = \frac{(4\times {\mu }_{GCI} {\mu }_{RCI}{\mu }_{GCI,RCI})}{({\mu }_{GCI}^{2}+{\mu }_{RCI}^{2} ) ({\sigma }_{GCI}^{2} +{\sigma }_{RCI}^{2} )}$$
(20)
$$SSIM = \frac{(2{\mu }_{GCI}{\mu }_{RCI}+C1) (2{\sigma }_{GCI,RCI}+C2)}{({\mu }_{GCI}^{2}+{\mu }_{RCI}^{2}+C1) ({\sigma }_{GCI}^{2}+{\sigma }_{RCI}^{2}+C2)}$$
(21)

where \(\sigma\) shows the standard deviation and \(\mu\) denotes mean values. The overall UIQI and SSIM are measured by the average value measured [12, 13].

In this proposed CPS, initially, the GCI is compared with the RCI and the values are tabulated in Table 1.

Table 1 Quality metrics measured for RCI

Table 1 shows that the GCI test images are identical to RCI test images in this proposed CPS. There is no pixel loss is reported if the communication is secured one. The quality of the cover CCI images are compared with the share images and the results of PSNR and MSE are shown in Tables 2 and 3 respectively. CSI(x)R shows the Red channel of color share image. X represents the number representing the color share image. Similarly, CCI(x) R represents the color cover image.

Table 2 PSNR measured between CCI and CSI
Table 3 MSE measured between CCI and CSI

From Tables 2 and 3, it is observed that the quality of the shares after embedding the encrypted pixel data is good and are in acceptable range. The cumulative pixel errors show minimal noise added with the CCI while converting into shares. The quality of the shares plays a major role in the security of the shares. When the quality of the share lowers, the malicious actors are attracted towards it. Hence, the proposed CPS maintains the quality of the shares. Also, the proposed CPS do not add any additional pixel to expand the size. Pixel expansion issues are solved in this CPS to improve the quality of the shares.

3.3 Security

The proposed CPS is claimed to transmit the pixel data securely from the source to destination. The pixel data is encrypted in the GP and are embedded into the CCI to generate shares. The share channels are compared with the GCI and the results have been recorded and are organized as graph in Fig. 8.

Fig. 8
figure 8

Histogram analysis of GCI and CSI

Figure 8 shows the histogram analysis of the GCI and the CSI are compared and shows that the shares are showing completely different structure. It provides additional security to the shares. GCI is also compared with individual channels of the shares and are shown in Fig. 9.

Fig. 9
figure 9

Histogram analysis of GCI and CSI Red (R), Green (G) and Blue (B) channels

Result shows that the shares and GCI do not have any common structure and the share channels do not reveal any GCI data. The GCI pixels are randomly encrypted based on the EKM. The randomness provides security to the shares. MA will not be able to reconstruct the GCI without all the shares. Even if all the shares are available, without the RP, the MA ca not be able to reveal the DK and so the GCI. Thus, the proposed CPS provides security to the shares.

Additionally, the GCI is divided into shares and are covered with CCI. The color cover images reduce the number of shares and provides security, as the MA may not able to guess the grayscale secret image.

3.4 Computational Complexity

The proposed CPS maintains the quality of the shares and the reconstructed RCI without complex operations. Simple multiplication and modular operations are used in the RP to reveal the secret. The share values are embedded into the channels of the CCI to reduce the number of shares. The share embedding is done by LSB method with simple operations [7]. The proposed CPS uses simple mathematical operations in share generation and revealing phase. The verification phase uses simple comparison of pixel values to verify the integrity of the RCI [29]. The computational complexity of the proposed CPS is measured as \(\Theta {\text{n}}^{2}\). The time taken for the revealing of RCI is given in Table 4 for the test images.

Table 4 Comparative analysis of proposed CPS

Table 4 shows that the time taken by the proposed CPS is less than the existing schemes as simple mathematical operations are performed for encryption and decryption rather complex dithering, halftoning process.

3.5 Cheating Verification

The primary objective of this research paper is to identify the cheating process. The proposed CPS provides an unambiguous result in the form of authentication “successful authentication” or “mistrust”. The proposed CPS has been tested the test images with forged shares to check whether the proposed CPS identifies the occurrences of cheating. The obtained result of a single test image with multiple forged shares is shown in Fig. 10.

Fig. 10
figure 10

Cheating verification in the proposed CPS

Figure 10 shows that the authenticated shares to the participants are marked ‘True’ and the faked shares are marked as ‘False’. The RP generates the RCI with these shares. In the VP, the \({E}_{code}\) is generated and is checked whether it’s a NULL matrix or not. If it’s a NULL matrix then the RCI is considered to be an authenticated one and else, it’s from a mistrust source. The proposed CPS authenticates each of the test images successfully and authenticate the trusted source. The proposed CPS has been tested in an intranet that consists of many interlinked local area networks as well as leased lines in the wide area network. The proposed CPS has been tested in individual computer systems also. However, the results recorded do not affect the performance of the proposed CPS as discussed.

3.6 Comparative Analysis

The proposed CPS is compared with the existing techniques and the features are analysed. Table 5 shows the comparative analysis of the proposed CPS with existing systems.

Table 5 Comparative analysis of proposed CPS

4 Conclusion

Firstly, the proposed CPS is aimed to communicate the grayscale confidential image from source to destination securely by generating random meaningful shares in the source by embedding the share pixel values in the color cover images. Individual shares do not reveal any pixel data. A new key is generated form the received shares in the revealing phase to reconstruct the secret. Secondly, the proposed CPS has the objective to verify the revealed image for its integrity. The test results show that the proposed CPS verifies the authenticity of the revealed image efficiently by giving unambiguous message. Thirdly, the proposed CPS maintains the quality of the revealed image without any noise and the shares with minimal noise. The results show that the quality of the shares is in the acceptable range. Lastly, the proposed CPS do not have any pixel expansion issues and the computational cost of the CPS is less compared to the existing schemes as, simple arithmetic operations are used to reveal the image.