Next Article in Journal
Advancing the Industrial Sector Energy Transition with Hybrid Solar Systems: Evaluation of Small Winemaking in Ecuador
Previous Article in Journal
Technology of the Biological Treatment of Mine Water at the Kohinoor II Mine
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Proceeding Paper

RG-Based (k, n)-Threshold Visual Cryptography with Abilities of OR and XOR Decryption †

Department of Computer Science and Information Engineering, National Chi Nan University, Nantou 545, Taiwan
*
Author to whom correspondence should be addressed.
Presented at the IEEE 5th Eurasia Conference on Biomedical Engineering, Healthcare and Sustainability, Tainan, Taiwan, 2–4 June 2023.
Eng. Proc. 2023, 55(1), 65; https://doi.org/10.3390/engproc2023055065
Published: 7 December 2023

Abstract

:
A (k, n) visual cryptography (VCS) is used to build a system for secret sharing. The system divides a secret image (S) into n shares and recovers S by stacking shares bigger than or equal to k, while shares below k provide no information about S. The fundamental idea of VCS is that, rather than relying on mathematical or cryptographic skills, human vision can be used to decrypt the secret image. Typically, a Boolean OR operation can be used to indicate the stacking action in a VCS. The reconstructed secret image gradually darkens as more shares are stacked. However, this intractable issue can be overcome by designing an XOR-based VCS that uses the Boolean XOR operator rather than the OR operation. This indicates that by using the XOR-based VCS, higher image quality can be attained. Because the XOR operation requires the use of additional equipment, scholars consider that when no equipment is available, the traditional OR operation can still be used to reveal the secret images. That is, the secret image can be decrypted without a computing device by stacking enough shares, and if a lightweight computing device is available, a better-quality image can be produced via an XOR operation. In 2015, an RG-based (k, n) VCS to restore the secret image by using an OR or XOR operation was proposed. In this study, we improve the scheme and design a new (k, n) VCS, called (k, n) 2D_VCS to encrypt a secret image into n shares. The secret image can be recovered when k or more shares are gathered and stacked (OR operation) together or when an XOR procedure is utilized. Both the theoretical proof and experimental results show that the quality of the restored image obtained by our method is better than that of the previous methods.

1. Introduction

The Visual Cryptography Scheme (VCS) was suggested in 1995 for distributing secrets [1]. A binary secret image can be recovered by encrypting it into n random images (shares) and then stacking those n shares. They also developed a threshold k-out-of-n VCS method, (k, n)-threshold VCS. Encrypting a secret image in binary into n shares and then stacking any k or more than k shares (kn) can reconstruct the secret image. Fewer than k shares cannot provide any clues about the binary secret image.
Visual secret sharing (VSS) by random grids (RG) was introduced by Kafri and Keren in 1987 [2]. It eliminates the secret pixel expansion issue, and this approach does not demand codebook designs, which is the disadvantage of Naor and Shamir’s scheme [1]. Random grids mean that we obtain every pixel by randomly selecting between 1 (opaque or black) and 0 (transparent or white). In 2009, Shyu gave a scheme of (n, n) RG-based VCS [3]. Chen and Tsao constructed a (k, n) RG-based VCS [4]. Then, Guo, Liu, and Wu improved Chen and Tsao’s scheme in 2013 [5]. The stacking operation in a VCS is denoted by a Boolean OR operation. However, the more shares of stacking, the darker the reconstructed image. An XOR-based VCS can solve this problem, as a better recovered image quality can be obtained when using an XOR operation instead of an OR operation. A new idea was suggested in Ref. [6]. In their method, OR or XOR is optionally used to restore the secret image when restoring the binary secret image. As a result, the secret image can be restored when computing resources are limited by stacking k or more shares (using an OR operation). When computing resources are available, a secret image of higher quality can be obtained (using an XOR operation). We improved their scheme by designing a new (k, n) VCS that can also extract binary secret images by OR or XOR operations and achieved a better quality of restored images than their scheme.
This paper is structured as follows. The related work is presented in the next section, the suggested scheme, (k, n) 2D_VCS is presented in Section 3, and an analysis of the (k, n) 2D_VCS is shown in Section 4. Section 5 and Section 6 show the experimental results and conclusion, respectively.

2. Related Work

2.1. (2, 2) RG-Based VCS

In 1987, Kafri and Keren firstly proposed (2, 2) RG-based VCS [2], Algorithm 1, to encrypt a binary image S, and their algorithm output two shares B1 and B2, which looked like random grids. After superimposing them, the secret image S was reconstructed by using the Human Visual System (HVS) without specific computational and cryptographic knowledge.
Algorithm 1 KK [2]
Input:Secret binary image S.
Output:Two shares B1, B2.
Step 1.Generate the first share B1 randomly selecting 0 or 1 for each pixel of B1.
Step 2.Based on the pixels S[i, j] of S and the pixel B1[i, j] of B1,
the pixel value B2[i, j] of share B2 is calculated by
B2[i, j] = B 1 i , j , i f   S i , j = 0 B 1 i , j ¯ , i f   S i , j = 1 .

2.2. (k, n) RG-Based VCS

As mentioned above, a scheme of (k, n) RG-based VCS, Algorithm 2, was proposed in 2011 [4]. For comparison with the proposed scheme, we rewrite their algorithm as follows. Note that it is essentially the same as their original algorithm.
Algorithm 2 CT [4]
Input:A secret binary image S.
Output:n shares (B1, B2, …, Bn).
Step 1.For each position [i, j], repeat Steps 2–4:
Step 2.Randomly select from {0, 1} to generate n random pixels b1, b2, …, bn.
Step 3.If S[i, j] ≠ b1b2 ⊕ … ⊕ bk ,   then   b k = b k ¯ .
Step 4.Rearrange the above n bits b1, b2, …, bn into B1[i, j], B2[i, j], …, Bn[i, j] randomly.
Step 5.Output (B1, B2, …, Bn).

3. Proposed Scheme

A new (k, n) RG-based VCS used with two decryption methods (OR and XOR) for binary images is presented, called (k, n) 2D_VCS. Algorithm 2 only considers the case of stacking k shares and does not consider the case of stacking more than k shares. Furthermore, additional consideration is required to fully restore the original secret image when collecting all the shares. Therefore, we add two steps, resulting in the following algorithm.
Algorithm 3 differs only in Steps 4 and 5 from Algorithm 2. These two steps lead to important consequences. Step 4 of Algorithm 3 makes the reconstructed image clearer when staking t (k < tn) shares. Step 5 of Algorithm 3 makes it possible to fully recover the secret image after collecting all n shares. Since we do not change the first k shares constructed by Algorithm 2, when Algorithm 3 stacks k shares, the quality of the reconstructed image is similar to that by Algorithm 2. When stacking t shares, the probability of recovering the secret image is 1/C(n, t) (nk + 1), which makes the proposed scheme more clearly recover the secret using the XOR operator for tacking k < t < n shares. Therefore, compared to earlier studies, the method has a higher quality of the recovered image and improved ability to recover the secret image with both XOR and OR operations. Figure 1 depicts the suggested scheme’s schematic.
Algorithm 3 (k, n) 2D_VCS.
Input:An M × N secret binary image S.
Output:n shares (B1, B2, …, Bn).
Step 1.For each position [i, j], repeat Steps 2–6.
Step 2.Randomly select from {0, 1} to generate n random pixels b1, b2, …, bn.
Step 3.If S[i, j] ≠ b1b2 ⊕ … ⊕ bk ,   then   b k = b k ¯ .
Step 4.Select a number t randomly from {k + 1, k + 2, …, n}. If S[i, j] ≠ b1b2 ⊕ … ⊕ bt ,   then   b t = b t ¯ .
Step 5.If S[i, j] ≠ b1b2 ⊕ … ⊕ bn ,   then   b n = b n ¯ .
Step 6.Randomly rearrange these n bits b1, b2, …, bn into B1[i, j], B2[i, j], …, Bn[i, j].
Step 7.Output (B1, B2, …, Bn)
Therefore, we can directly stack enough shares (≥k) to recover the binary secret image via HVS. Computers enable us to obtain more accurate secret images. However, when less than k shares are acquired, any clue about the binary secret image cannot be found.

4. Analysis

The proposed scheme’s security is theoretically shown, and its performance is evaluated in terms of the visual aspect. First, we review useful tools and analyze the proposed scheme with these tools. We refer to definitions from previous works.
Definition 1.
(Average light transmission [3]). The probability that a given pixel, x, in the binary image X is transparent. Let Prob (x = 0) denote the light transmission of pixel x, which is shown by the symbol l[x]. The average light transmission of image X, with the size M × N, is expressed as
L X 1 M × N i = 1 M j = 1 N l [ X [ i ,   j ] ]
So, l[x] = 0 for an opaque pixel x, l[x] = 1 for a transparent pixel x. Also, we say L[B] = 1/2 for a random grid B normally.
Definition 2.
(Contrast [3]) The visual quality will determine how effectively the reconstructed image is recognized by human eyes. Contrast  α  is expressed as
α = L [ B [ S ( 0 ) ] ] L [ B [ S ( 1 ) ] ] 1 + L [ B [ S ( 1 ) ] ]
where S(0) (S(1), respectively) stands for all of S’s transparent (opaque, respectively) pixels, and B[S(0)] (B[S(1)], respectively) for all of the encrypted pixels from S(0) (S(1), respectively).
Definition 3. 
(Visually recognizable) When L[B[S(1)]] < L[B[S(0)]], the contrast of the restored image α > 0, and the binary secret image S is recognized. Moreover, if α = 1, the recovered image B is the same as the original image S.
Definition 4. 
(Security).When L[B[S(0)]] = L[B[S(1)]], the light transmission of the transparent part of the original image is the same as that of the opaque part of the original image. That means no clue about the original secret image S can be recognized from the reconstructed image B. Therefore, if α = 0 when less than k shares are collected, the approach is secured since no information of S is retrieved.
Table 1 lists all possibilities for sharing pixels when k = 3 and n = 4 of the (k, n) 2D_VCS, which is used to show this scheme is secured and visually recognizable.
Lemma 1.
Algorithm 3 (k, n) 2D_VCS gives a (k, n) RG-based VCS with two decryption methods (OR and XOR) when k = 3 and n = 4. That is, Algorithm 3 satisfies the (1) security and (2) visually recognizable conditions.
Proof. 
The following is divided into two parts to prove: (1) We must prove that stacking less than k = 3 shares (including one share) fails to yield any information regarding the binary secret image. From Table 1, Table 2, Table 3 and Table 4 are induced, where bxy means bxby, and bxy means bxby for any integers 1 ≤ x < y ≤ 4. Similar notations are used later for stacking more than two shares.
Table 2, Table 3 and Table 4 show that α is 0 for any possible case; therefore, the proposed (k, n) 2D_VCS is safe when (k, n) = (3, 4). For proving Equation (2), we need to show that stacking k = 3 or 4 shares recovers the binary secret image S. Table 5 and Table 6 show the correctness.
According to Table 5 and Table 6, the average α all > 0, which means that the proposed (3, 4) RG-based VCS is visually recognizable. Hence, the proof is complete.□
Then, the following theorem can be obtained. Due to the page limit, we skip the proof.
Theorem 1.
Algorithm 3 (k, n) 2D_VCS is a (k, n) RG-based VCS of two decryption methods (OR and XOR).
Table 7 and Table 8 show the theoretical contrast of the (k, n) 2D_VCS for stacking 2 ≤ pn shares for any 2 ≤ kn ≤ 6. We obtain these two tables by analyzing each case using a method similar to that in Lemma 1, which shows nothing is found when staking less than k shares, and the secret image S is revealed when staking more than or equal to k shares.

5. Experimental Results

The results of the (k, n) 2D_VCS when (k, n) = (2, 4), (3, 4), and (3, 5) are obtained in this section. The 300 × 300 pixels images in those experiments are utilized for original secret images and shares. Figure 2 shows the result for the proposed (2, 4) 2D_VCS. Figure 2a shows the secret image S, and Figure 2b–e show the four random-noise-like shares B1, B2, B3, and B4. The recovered binary images based on the OR operator are shown in Figure 2f–h. The recovered binary images based on the XOR operator are shown in Figure 2i–k.
Similarly, the experimental findings for the suggested (3, 4) and (3, 5) 2D_VCS are shown in Figure 3 and Figure 4. Both (a) are the original binary secret images. Figure 3b–e and Figure 4b–f are random shares. Figure 3f–h and Figure 4g–j show the recovered binary images based on the OR operator. Then, Figure 3i–k and Figure 4k–n are the recovered binary images based on the XOR operator.
We present more results in Table 9 and Table 10. Compared to Table 7 and Table 8, the theoretical analysis with the proposed method is more accurate.

6. Comparison and Conclusions

An RG-based (k, n) VCS restoring the secret image using OR or XOR operation was presented by Yan et al. [6]. We compared their scheme with the (k, n) 2D_VCS. The experimental outcome of Yan et al.’s scheme for the (k, n) = (2, 4) is shown in Figure 5. The results in Figure 2 and Figure 5 show the better visual quality of the proposed scheme, especially when staking three shares and using the XOR operator on them ((j) in both figures). Thus, an RG-based (k, n)-threshold visual cryptography with XOR and OR decryption capabilities, called (k, n) 2D_VCS, is proposed to restore the secret image in a human visual system (OR) and computer visual system (XOR). The results are better than all previous studies. Future work will be carried out to design other RG-based (k, n) threshold VCSs with better contrast of the restored image and demonstrate that the scheme is theoretically safe and correct.

Author Contributions

Conceptualization, J.S.-T.J. and Y.-R.L.; methodology, J.S.-T.J.; software, Y.-R.L.; validation, J.S.-T.J. and Y.-R.L.; formal analysis, J.S.-T.J. and Y.-R.L.; investigation, J.S.-T.J. and Y.-R.L.; data curation, Y.-R.L.; writing—original draft preparation, Y.-R.L.; writing—review and editing, J.S.-T.J.; visualization, Y.-R.L.; supervision, J.S.-T.J.; project administration, J.S.-T.J.; funding acquisition, J.S.-T.J. and Y.-R.L. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Ministry of Science and Technology of the Republic of China grant number MOST 110-2221-E-260-003, and 110-2813-C-260-005-E. And The APC was funded by MOST 110-2221-E-260-003.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Data sharing is not applicable to this article.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Naor, M.; Shamir, A. Visual cryptography. In Workshop on the Theory and Application of Cryptographic Techniques; Springer: Berlin/Heidelberg, Germany, 1994. [Google Scholar]
  2. Kafri, O.; Keren, E. Encryption of pictures and shapes by random grids. Opt. Lett. 1987, 12, 377–379. [Google Scholar] [CrossRef] [PubMed]
  3. Shyu, S.J. Image encryption by multiple random grids. Pattern Recognit. 2009, 42, 1582–1596. [Google Scholar] [CrossRef]
  4. Chen, T.; Tsao, K. Threshold visual secret sharing by random grids. J. Syst. Softw. 2011, 84, 1197–1208. [Google Scholar] [CrossRef]
  5. Guo, T.; Liu, F.; Wu, C. Threshold visual secret sharing by random grids with improved contrast. J. Syst. Softw. 2013, 86, 2094–2109. [Google Scholar] [CrossRef]
  6. Yan, X.; Wang, S.; Niu, X.; Yang, C.N. Random grid-based visual secret sharing with multiple decryptions. J. Vis. Commun. Image Represent. 2015, 26, 94–104. [Google Scholar] [CrossRef]
Figure 1. Schematic of the proposed scheme.
Figure 1. Schematic of the proposed scheme.
Engproc 55 00065 g001
Figure 2. The experimental result of the proposed (2, 4) 2D_VCS.
Figure 2. The experimental result of the proposed (2, 4) 2D_VCS.
Engproc 55 00065 g002
Figure 3. The experimental result of the proposed (3, 4) 2D_VCS.
Figure 3. The experimental result of the proposed (3, 4) 2D_VCS.
Engproc 55 00065 g003
Figure 4. The experimental result of the proposed (3, 5) 2D_VCS.
Figure 4. The experimental result of the proposed (3, 5) 2D_VCS.
Engproc 55 00065 g004
Figure 5. The experimental result used the (2, 4) RG-based VCS proposed in [6].
Figure 5. The experimental result used the (2, 4) RG-based VCS proposed in [6].
Engproc 55 00065 g005
Table 1. All possibilities b1, b2, b3, b4 for the proposed (3, 4) RG-based VCS.
Table 1. All possibilities b1, b2, b3, b4 for the proposed (3, 4) RG-based VCS.
S[i, j]b1b2b3b4
00000
0110
1010
1100
10010
0100
1000
1110
Table 2. Contrast of each bit for Table 1.
Table 2. Contrast of each bit for Table 1.
S[i, j]b1b2b3b4
00000
0110
1010
1100
10010
0100
1000
1110
L[B[S(0)]]0.50.50.51
L[B[S(1)]]0.50.50.51
α0000
Table 3. Contrast of stacking any two bits using XOR operator for Table 1.
Table 3. Contrast of stacking any two bits using XOR operator for Table 1.
Sb1⊕2b1⊕3b1⊕4b2⊕3b2⊕4b3⊕4
0000000
110011
101101
011110
1010101
100110
111000
001011
L[B[S(0)]]0.50.50.50.50.50.5
L[B[S(1)]]0.50.50.50.50.50.5
α000000
Table 4. Contrast of stacking any two bits using OR operator for Table 1.
Table 4. Contrast of stacking any two bits using OR operator for Table 1.
SB1⊗2B1⊗3B1⊗4B2⊗3B2⊗4B3⊗4
0000000
110111
111101
111110
1010101
100110
111000
111111
L[B[S(0)]]0.250.250.50.250.50.5
L[B[S(1)]]0.250.250.50.250.50.5
α000000
Table 5. Contrast of stacking any three or four bits using XOR operator for Table 1.
Table 5. Contrast of stacking any three or four bits using XOR operator for Table 1.
Sb1⊕2⊕3b1⊕2⊕4b1⊕3⊕4b2⊕3⊕4b1⊕2⊕3⊕4
000000
01100
01010
00110
110111
11011
11101
10001
L[B[S(0)]]10.50.50.51
L[B[S(1)]]00.50.50.50
Average α0.18181
Table 6. Contrast of stacking any three or four bits using OR operator for Table 1.
Table 6. Contrast of stacking any three or four bits using OR operator for Table 1.
Sb1⊗2⊗3b1⊗2⊗4b1⊗3⊗4b2⊗3⊗4b1⊗2⊗3⊗4
000000
11111
11111
11111
110111
11011
11101
11111
L[B[S(0)]]0.250.250.250.250.25
L[B[S(1)]]00.250.250.250
Average α0.05260.25
Table 7. Contrast of the proposed (k, n) RG-based VCS using OR operator.
Table 7. Contrast of the proposed (k, n) RG-based VCS using OR operator.
(k, n)p = 2p = 3p = 4p = 5p = 6
(2, 4)0.06060.15790.375--
(3, 4)00.05260.25--
(4, 4)000.125--
(2, 5)0.03820.07860.11540.2083-
(3, 5)00.02040.06740.1875-
(4, 5)000.02270.125-
(5, 5)0000.0625-
(2, 6)0.02600.04920.06210.07040.1094
(3, 6)00.01060.02770.04950.1042
(4, 6)000.00740.02940.0938
(5, 6)0000.00990.0625
(6, 6)00000.0313
Table 8. Contrast of the proposed (k, n) RG-based VCS using XOR operator.
Table 8. Contrast of the proposed (k, n) RG-based VCS using XOR operator.
(k, n)p = 2p = 3p = 4p = 5p = 6
(2, 4)0.11110.18181--
(3, 4)00.18181--
(4, 4)001--
(2, 5)0.06740.04400.09301-
(3, 5)00.06900.14291-
(4, 5)000.14291-
(5, 5)0001-
(2, 6)0.04490.01670.02200.05711
(3, 6)00.03330.03010.07691
(4, 6)000.04550.11761
(5, 6)0000.11761
(6, 6)00001
Table 9. Average contrast for five experiments of the proposed method using OR operator.
Table 9. Average contrast for five experiments of the proposed method using OR operator.
(k, n)p = 2p = 3p = 4p = 5p = 6
(2, 4)0.059760.158590.37504--
(3, 4)00.053560.25135--
(4, 4)000.12456--
(2, 5)0.036240.075840.113620.20624-
(3, 5)00.021070.069150.18865-
(4, 5)000.021550.12336-
(5, 5)0000.06257-
(2, 6)0.025640.050440.062340.070230.1086
(3, 6)00.010710.026790.049970.10429
(4, 6)000.007470.029630.09385
(5, 6)0000.0090.06202
(6, 6)00000.03117
Table 10. Average contrast for five experiments of the proposed method using XOR operator.
Table 10. Average contrast for five experiments of the proposed method using XOR operator.
(k, n)p = 2p = 3p = 4p = 5p = 6
(2, 4)0.109010.181311--
(3, 4)00.182111--
(4, 4)001--
(2, 5)0.068570.044550.093441-
(3, 5)00.069450.143421-
(4, 5)000.141421-
(5, 5)0001-
(2, 6)0.044240.01680.021870.058631
(3, 6)00.031390.02890.077841
(4, 6)000.045540.116521
(5, 6)0000.120591
(6, 6)00001
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Lin, Y.-R.; Juan, J.S.-T. RG-Based (k, n)-Threshold Visual Cryptography with Abilities of OR and XOR Decryption. Eng. Proc. 2023, 55, 65. https://doi.org/10.3390/engproc2023055065

AMA Style

Lin Y-R, Juan JS-T. RG-Based (k, n)-Threshold Visual Cryptography with Abilities of OR and XOR Decryption. Engineering Proceedings. 2023; 55(1):65. https://doi.org/10.3390/engproc2023055065

Chicago/Turabian Style

Lin, Yu-Ru, and Justie Su-Tzu Juan. 2023. "RG-Based (k, n)-Threshold Visual Cryptography with Abilities of OR and XOR Decryption" Engineering Proceedings 55, no. 1: 65. https://doi.org/10.3390/engproc2023055065

Article Metrics

Back to TopTop