# Robust Visual Secret Sharing Scheme Applying to QR Code

Authors: Longdan Tan; Kesheng Liu; Xuehu Yan; Lintao Liu; Tianqi Lu; Jinrui Chen; Feng Liu; Yuliang Lu
Journal: Security and Communication Networks
 (2018)

---

## Abstract

Different color patterns of quick response (QR) codes, such as RGB, grayscale, and binary QR codes, are widely used in applications. In this paper, we propose a novel XOR-based visual secret sharing (VSS) scheme using grayscale QR codes as cover images and binary QR code as secret image. First, all the codewords of the secret QR code image are encoded inton temporary binary QR code images, which are substituted for the second significant bit planes of the grayscale QR code cover images to generate n shares. Each share is a grayscale QR code image, which can be decoded by a standard QR code decoder, so that it may not attract the attention of potential attackers when distributed in the public channel. The secret image can be recovered by XORing the codewords regions of QR codes which are extracted from the second significant bit planes of the grayscale shares. More importantly, the proposed scheme is robust to JPEG compression, addition of different noises, rotation, resizing, and cropping, which is useful in practice. The effectiveness and robustness of our scheme are shown by the experimental results. The application of QR code is suitable for wireless multimedia data security.


---

## Body

## 1. Introduction

Quick response(QR) code is a kind of two-dimensional matrix codes used widely in all walks of life recently, for the advantages of its speed reading, error correction capability, multiple-format data representing, high capacity compared to one-dimensional codes, and so on. And the application of QR code is suitable for wireless multimedia data security.QR code image is a binary image in general, each pixel in the image has only two possible values or gradation levels, which is represented by black and white(B&W) or monochrome image. By graying binary QR code image, we can obtain grayscale QR code image. Each pixel of grayscale QR code image takes up 8 bits of storage space. Keeping the most significant bit plane of the grayscale QR code image unchanged and then replacing the other less significant ones with secret bits could implement information hiding in grayscale QR code image.The main idea of visual cryptography (VC) [1], also known as visual secret sharing (VSS), is to split a secret image into numerous shares (also called share images or shadow images). Each share reveals no information on the original secret image separately, and only a specific amount of qualified shares could reconstruct the secret image. The secret image would be lost when storing and transmitting in a single image carrier which could be damaged easily, so that we may fail to extract the secret image. But, VSS can overcome the problem to a certain degree [2].The threshold-based VSS was first proposed by Shamir [3] and Blakley [4]. Sharing one binary secret image into n corresponding random shares and then distributing them to n participants are the way to share. More than or equal to k shares are superimposed to reveal the secret image visually. However, less than k participants would reveal no information on the original secret image by stacking or inspecting their shares. The advantage of VSS in [1] is that it is easier to recover the secret image by stacking a specific amount of shares using HVS without any cryptographic knowledge and computations. However, the characteristics of pixel expansion and codebook (basic matrices) design may be be problematic in some situations.Since Kafri and Keren proposed Random grid (RG)-based VSS [5–7], it has received much more attention, in which the pixel expansion problem is not exist and codebook design is not required. The secret image is shared into noise-like shares with the same size of the secret image. The decryption method is the same as traditional VSS, i.e., stacking. However, the background of the reconstructed image becomes darker and darker when more and more shares are stacked in OR-based VSS (OVSS) based on RG.XOR-based VSS (XVSS) can solve the problem of RG-based OVSS [8], since the decryption method is to perform XOR operation on the shares with a light weight computational device to reconstruct the secret image. By applying the XVSS, better image contrast and quality can be obtained [6, 9].Due to the advantage of VSS and QR code, some combinations of them have been proposed by many researchers recently. Jonathan and Yan [12] authenticated the shares using a QR code. Wang et al. [13] proposed a scheme through embedding QR codes into the best region of given shares to prevent cheating. Chow et al. [11] proposed a (n, n) threshold scheme for cases that n is no less than 3, in which the secret image and cover images are all binary QR codes with the same version and the same level of error correction. Wan et al. [10] proposed a scheme that deeply integrated the QR code error correction mechanism with the theory of VSS and the region shared with the secret image is continuous. Chen et al. [14] proposed a VSS scheme with high security and flexible access structures for QR code applications. Chow et al. [15] investigated a method to distribute shares through embedding them into QR codes cover by a secure way using cryptographic keys. However, robustness is not considered in the above mentioned schemes, which is important in practice. The threshold is greater than 2 in [11], and the problem of image quality uniformity is not taken into account in paper [10].Nowadays, more and more QR codes are used on mobile phones. A possible scenario to convey secret information securely in the network is described below. It is unsafe to transmit secret information in the public channel without protection, and mobile devices are widely used nowadays. Thus we encode secret information in QR code, which is shared inton different QR code cover images to generate n corresponding shares. Then the shares are transmitted in different channels over a network from one mobile phone to anther mobile phone. When JPG compression and recoding, Gaussian noise and other image attacks occur during the transmission, if the shares are robust to the attacks, secret information would be recovered, while less than n shares cannot reveal any information on the secret image. The decoding results of shares are identical with those of cover images, so they will not come into notice.The schemes above are not suitable for the scenario. So, we propose a novel robust secret sharing scheme for(n,n) threshold that n is not less than 2. This scheme integrates the QR code error correction mechanism with the theory of XVSS, and all the QR codes are with the same version and level of error correction. First, all the codewords of a secret QR code image are encoded into n temporary binary QR code images. Then the n temporary binary QR code images are substituted for the second significant bit planes of the grayscale cover QR code images to output n shares. The selection of codewords of secret QR code is random and each share can be decoded by a standard QR code reader, which can reduce the likelihood of suspicion and potential attacking. Since the modifications of grayscale QR codes are the second significant bit planes and the error correction mechanism of QR code, the scheme is robust to the conventional image attacks.The rest of the paper is organized as follows. QR codes and XOR-based VSS are introduced in Section2. The secret image sharing, recovering algorithm, and analyses are described in Section 3. Section 4 demonstrates the experimental results, comparisons and test. Finally, Section 5 is the conclusion of this paper.


## 2. Preliminaries

### 2.1. QR Codes

A QR code symbol [17] consists of a square array consisting of square modules, which is developed by Denso Corporation of Japan in September 1994. The standard [16] defines forty versions of QR code versions ranging from version one to version forty. Different versions of QR code are comprised of different quantities of modules. QR code version 1 is made up of 21∗21 modules. From version 1, each version has 4 modules per side more than the previous version. For example, version 7 is made up of 45∗45 modules.A QR code [16] consists of functional patterns and encoding regions. The encoding region includes data and error correction codewords, format information and version information. The functional patterns consist of alignment, timing, finding patterns, and separation. The amounts of data and error correction codewords and error correction blocks are relying on the version and level of error correction of the QR code. The quiet zone is the blank region around QR code that is important for reading the QR code, encoding input data stream into an array of data codewords with 8-bits length. Error correction codewords also with 8-bits length are generated by using Reed-Solomon error control algorithm which is added to the back of the data codewords.Depended on the QR version and the level of error correction, data codewords and error correction codes are arranged in different error correction blocks. The level of error correction is divided into four categories:L~7%, M~15%, Q~25%, and H~30%. The higher the level of error correction is, the stronger the error correction ability will be. But, high level of error correction requires larger QR version to encode the same input data stream, since the proportion of error correction codewords is larger than lower level in the same version. For example, the error correction characteristics of version 7 and 8 are shown in Table 1.Table 1
The characteristics of QR code version 7 and version 8.
Version Total codewords Error correction level Number of error correction codewords Number of blocks Error correction code perblock∗ (c, k, r) 7 196 L 4 2 (98, 7810)  M 72 4 (49, 31, 9)  Q 108 2 (32, 14, 9) 4 (33, 15, 9)  H 130 4 (39, 13, 13) 1 (40, 14, 13)  8 242 L 48 2 (121, 97, 12)  M 88 2 (60, 38, 11) 2 (61, 39, 11)  Q 132 4 (40, 18, 11) 2 (41, 19, 11)  H 156 4 (40, 14, 13) 2 (41, 15, 13) ( c , k , r )   ∗  :c=total number of codewords; k=total number of datawords; r=error correction capacity.In Table1, the error correction blocks are given as (c,k,r), where c is the total amount of codewords, k is the amount of codewords and r is the error correction ability. Note that the (c,k,r) values are different for certain level of error correction in some QR code versions. It can be found that there are 5 error correction blocks in version 7 with an level of error correction of H. The (c,k,r) values for the first four blocks are (39,13,13) where the value for the last one is (40,14,13).The layout of the codewords for each error correction block is in an interleaving manner, and error correction codewords are appended to the end of corresponding data codewords. Since the characteristic of this layout, the QR code decoding ability can be improved for the case of the possibility of localized damages. Figure1 shows the layout of QR code version 7 with the level of error correction of H. After encoding all the codewords, a data mask is required to be applied to the encoding area. There are eight data mask patterns options for balancing the light and dark modules and avoiding the confusion encoding area with functional patterns.Figure 1
The structure of QR code version 7.The layout of the codewords and the error correction capability are important for us to share the secret QR code images in the proposed scheme.


### 2.2.(n,n) Threshold XOR-Based VSS

The scheme of(n,n) threshold XOR-based VSS is to share a secret image into n corresponding noise-like shares in n participants and each share in every participant is different from each other. Then, the secret image can recover losslessly only by XORing n shares with a computational device with XOR ability. Less than n participants cannot obtain any information about the original secret image by inspecting or stacking their shares.Figure2 shows (2,2) XOR-based VSS application example. The generation phase is the same as that of (2, 2) RG-based VSS, while the recover method is to XOR two shares instead of stacking the shares to reveal the original secret image. By XORing the shares, the secret image can be recovered losslessly.Figure 2
( 2,2 ) XOR-based VSS application example.


## 2.1. QR Codes

A QR code symbol [17] consists of a square array consisting of square modules, which is developed by Denso Corporation of Japan in September 1994. The standard [16] defines forty versions of QR code versions ranging from version one to version forty. Different versions of QR code are comprised of different quantities of modules. QR code version 1 is made up of 21∗21 modules. From version 1, each version has 4 modules per side more than the previous version. For example, version 7 is made up of 45∗45 modules.A QR code [16] consists of functional patterns and encoding regions. The encoding region includes data and error correction codewords, format information and version information. The functional patterns consist of alignment, timing, finding patterns, and separation. The amounts of data and error correction codewords and error correction blocks are relying on the version and level of error correction of the QR code. The quiet zone is the blank region around QR code that is important for reading the QR code, encoding input data stream into an array of data codewords with 8-bits length. Error correction codewords also with 8-bits length are generated by using Reed-Solomon error control algorithm which is added to the back of the data codewords.Depended on the QR version and the level of error correction, data codewords and error correction codes are arranged in different error correction blocks. The level of error correction is divided into four categories:L~7%, M~15%, Q~25%, and H~30%. The higher the level of error correction is, the stronger the error correction ability will be. But, high level of error correction requires larger QR version to encode the same input data stream, since the proportion of error correction codewords is larger than lower level in the same version. For example, the error correction characteristics of version 7 and 8 are shown in Table 1.Table 1
The characteristics of QR code version 7 and version 8.
Version Total codewords Error correction level Number of error correction codewords Number of blocks Error correction code perblock∗ (c, k, r) 7 196 L 4 2 (98, 7810)  M 72 4 (49, 31, 9)  Q 108 2 (32, 14, 9) 4 (33, 15, 9)  H 130 4 (39, 13, 13) 1 (40, 14, 13)  8 242 L 48 2 (121, 97, 12)  M 88 2 (60, 38, 11) 2 (61, 39, 11)  Q 132 4 (40, 18, 11) 2 (41, 19, 11)  H 156 4 (40, 14, 13) 2 (41, 15, 13) ( c , k , r )   ∗  :c=total number of codewords; k=total number of datawords; r=error correction capacity.In Table1, the error correction blocks are given as (c,k,r), where c is the total amount of codewords, k is the amount of codewords and r is the error correction ability. Note that the (c,k,r) values are different for certain level of error correction in some QR code versions. It can be found that there are 5 error correction blocks in version 7 with an level of error correction of H. The (c,k,r) values for the first four blocks are (39,13,13) where the value for the last one is (40,14,13).The layout of the codewords for each error correction block is in an interleaving manner, and error correction codewords are appended to the end of corresponding data codewords. Since the characteristic of this layout, the QR code decoding ability can be improved for the case of the possibility of localized damages. Figure1 shows the layout of QR code version 7 with the level of error correction of H. After encoding all the codewords, a data mask is required to be applied to the encoding area. There are eight data mask patterns options for balancing the light and dark modules and avoiding the confusion encoding area with functional patterns.Figure 1
The structure of QR code version 7.The layout of the codewords and the error correction capability are important for us to share the secret QR code images in the proposed scheme.


## 2.2.(n,n) Threshold XOR-Based VSS

The scheme of(n,n) threshold XOR-based VSS is to share a secret image into n corresponding noise-like shares in n participants and each share in every participant is different from each other. Then, the secret image can recover losslessly only by XORing n shares with a computational device with XOR ability. Less than n participants cannot obtain any information about the original secret image by inspecting or stacking their shares.Figure2 shows (2,2) XOR-based VSS application example. The generation phase is the same as that of (2, 2) RG-based VSS, while the recover method is to XOR two shares instead of stacking the shares to reveal the original secret image. By XORing the shares, the secret image can be recovered losslessly.Figure 2
( 2,2 ) XOR-based VSS application example.


## 3. Proposed Robust VSS Appling to QR Codes

### 3.1. The Main Idea

In this section, we propose an(n,n) threshold XVSS scheme based on QR code. The secret image is a binary QR code, whose codewords are all shared into the codewords of n different binary QR codes with the same version and level of error correction, where their functional patterns are the same. All codewords of the secret image are shared with the theory of XVSS. Then the n binary QR codes are substituted for the second significant bit plane of n grayscale QR code cover images with the same version and level of error correction to generate n grayscale QR code shares. The messages in grayscale cover images are different from each other, the grayscale QR code shares can be decoded by a standard QR code decoder.The secret QR code image can be recovered by extracting the secondary significant bit planes ofn gray QR code images to generate n binary QR code images firstly and then XORing white and dark modules in the codewords region of the n binary images, adding the functional patterns, version, and format information later. All the codewords can be recovered and the decoding result of the reconstructed secret image is identical with that of the secret image.Since the version and level of error correction of all the QR codes are the same, codewords are at the same position and functional pattern are the same. Taking the(2,2) threshold scheme as an example, Figure 3 illustrates the grayscale QR code shares generation of the proposed scheme.Figure 3
The idea of the grayscale QR code shares generation in our(2,2) threshold scheme.


### 3.2. The Sharing Phase

When sharing the secret QR code image into arbitrary binary QR code images, we only encrypt the codewords region while other parts are identical with the binary QR code images, then replace the second significant bit planes of the grayscale QR code cover images with the encrypted binary QR code images. All the QR code images have the same version and level of error correction. The corresponding algorithm steps are described in Algorithm1.Algorithm 1:Proposed robust VSS applying to QR codes.
Input: A binary secret QR code image S; n different binary temporary QR code images T1,T2,⋯,Tn; n different binary QR code cover images C1,C2,⋯,Cn; the threshold parameters (n,n)(n≥2); the error correction characteristics (c,k,r) Output:  n grayscale shares SC1,SC2,⋯,SCn ( 1 ) Generate n grayscale shares GC1,GC2,⋯,GCn by graying n binary QR code images C1,C2,⋯,Cn. ( 2 ) Averagely and randomly divide the serial of total c codewords into n subsets denoted as A1,A2,⋯,An, and the number of each set is n1,n2,⋯,ni,⋯,nn, where n1+n2+⋯+ni+⋯+nn=c. ( 3 ) Serial v of the codeword in the secret image S is denoted as cwsv, and the serial v of the codeword in the Ti is denoted as cwiv. ( 4 )   for  i=1 to n  do ( 5 )  for each codeword v in Ai  do ( 6 )   if  cwsv≠cw1v⨁⋯⨁cwiv⨁⋯⨁cwnv   then ( 7 ) Modify the codeword of binary QR code image Ti as cwiv=~cwiv; ( 8 )   end if (9)  end for (10)end for ( 11 )   for  i=1 to n  do ( 12 ) Replace the second significant bit plane of grayscale QR code image GCi with the modified QR code image Ti, and replace the last six significant bit planes with random binary numbers to generate grayscale share SCi. ( 13 )   end for ( 14 ) Output n grayscale shares SC1,SC2,⋯,SCn.In Algorithm1, the codewords of the secret QR code are divided averagely and shared randomly into n different temporary binary QR code images. The artificial modification of shares is not perceptible. The shares can be decoded by a standard QR code.


### 3.3. The Recovery Phase

Base on XORing operation, the data of the recovery QR code image could be lossless. Suppose thatn grayscale shares are provided, we can get the pixels in the second significant bit planes from shares to create n binary QR code images. Then we read the version and level of error correction by a QR decoder. We perform XOR operation on the encoding regions of n binary images, after that putting the bits in other regions based on the version and level of error correction. In this way, we can create a QR code image whose message is the same as that of the secret image. The recovery phase is described in Algorithm 2.Algorithm 2:Secret image recovery of the proposed scheme.
Input:  n shares SC1,SC2,⋯,SCn; threshold parameters (n,n)(n≥2); Output: the reconstructed secret QR code image S′. ( 1 )  for  i=1 to n  do ( 2 ) Read the secondary plane of share SCi to create binary QR image as Si ( 3 )   end for ( 4 ) Read the version as v and level of error correction noted as l of image S1 with QR code decoder. ( 5 ) Based on v and l, we can get the total number of the codewords in S1 as c according to the standard [16]. For each codeword in Si note as cwij. ( 6 )  for  j=1 to c  do ( 7 )  cwj=cw1j⨁⋯⨁⋯⨁cwnj, cwj is the result of XORing operation. ( 8 )  end for ( 9 ) Create the bits in other regions based on the version and level of error correction, after that put them and the bits of codeword c w j ( 1 ≤ j ≤ c ) together into a new image to reconstruct a QR code image S′. ( 10 ) Output the image S′.


### 3.4. Analyses

In this section, we present some theoretical analyses about the properties of our scheme. Firstly, the grayscale QR code shares generated by Algorithm1 and the secret QR code image reconstructed by Algorithm 2 can be decoded by a QR decoder. Secondly, although the shares are damaged to some degree or have some noise, the secret QR image could be decoded. Thirdly, the threshold in our scheme threshold is (n,n)(n≥2).The grayscale shares are generated by replacing the secondary planes with the binary QR codes in which shared the secret image by Algorithm1, when a QR code decoder reading the grayscale QR code, thresholding the grayscale image in the first place. The thresholding way in different QR code decoder may be not the same, but the simplest and common one is to set the number of 128 as the threshold, so when remaining the most significant digits of the pixel values in grayscale QR code cover images unchanged, the grayscale shares could be decoded.If the 6 bits behind the secondary bit of each pixel value are changed in the range from000000 to 111111, the value in the secondary bit will not be changed. So when the last 6 bits are kept in the range from 000000 to 111111 although some noise added, the second significant bit plane replaced with secret image will not be affected, and the secret image can still be rebuilt. Because QR codes have the ability to correct errors, even if the modules are damaged or dirty in the error correction capacity range, the secret QR image could be decoded.The error correction characteristics are(c,k,r); when we share the codewords of secret QR image, the number of codewords c is divided into n(n≥2) sets averagely and randomly. Modifying the codewords of temporary QR codes according to steps (4)-(10) in Algorithm 1 to generate n binary QR code images and then replace the second significant bit planes of the grayscale QR code cover images with the binary QR code images to generate n shares. Each share can be scanned by QR code decoder. When recovering the secret QR code image, the second significant bit planes are extracted from n shares to create n binary QR code images, performing XOR operation on the codewords regions of n binary QR code images, so that the codewords of the secret QR code image would be lossless. Put the bits in other regions to reconstruct the secret image. Since the codewords of the secret QR code image are lossless, the message of the reconstructed image decoded by a QR code decoder would be the same as that of secret image. So, we can achieve the threshold of (n,n).


## 3.1. The Main Idea

In this section, we propose an(n,n) threshold XVSS scheme based on QR code. The secret image is a binary QR code, whose codewords are all shared into the codewords of n different binary QR codes with the same version and level of error correction, where their functional patterns are the same. All codewords of the secret image are shared with the theory of XVSS. Then the n binary QR codes are substituted for the second significant bit plane of n grayscale QR code cover images with the same version and level of error correction to generate n grayscale QR code shares. The messages in grayscale cover images are different from each other, the grayscale QR code shares can be decoded by a standard QR code decoder.The secret QR code image can be recovered by extracting the secondary significant bit planes ofn gray QR code images to generate n binary QR code images firstly and then XORing white and dark modules in the codewords region of the n binary images, adding the functional patterns, version, and format information later. All the codewords can be recovered and the decoding result of the reconstructed secret image is identical with that of the secret image.Since the version and level of error correction of all the QR codes are the same, codewords are at the same position and functional pattern are the same. Taking the(2,2) threshold scheme as an example, Figure 3 illustrates the grayscale QR code shares generation of the proposed scheme.Figure 3
The idea of the grayscale QR code shares generation in our(2,2) threshold scheme.


## 3.2. The Sharing Phase

When sharing the secret QR code image into arbitrary binary QR code images, we only encrypt the codewords region while other parts are identical with the binary QR code images, then replace the second significant bit planes of the grayscale QR code cover images with the encrypted binary QR code images. All the QR code images have the same version and level of error correction. The corresponding algorithm steps are described in Algorithm1.Algorithm 1:Proposed robust VSS applying to QR codes.
Input: A binary secret QR code image S; n different binary temporary QR code images T1,T2,⋯,Tn; n different binary QR code cover images C1,C2,⋯,Cn; the threshold parameters (n,n)(n≥2); the error correction characteristics (c,k,r) Output:  n grayscale shares SC1,SC2,⋯,SCn ( 1 ) Generate n grayscale shares GC1,GC2,⋯,GCn by graying n binary QR code images C1,C2,⋯,Cn. ( 2 ) Averagely and randomly divide the serial of total c codewords into n subsets denoted as A1,A2,⋯,An, and the number of each set is n1,n2,⋯,ni,⋯,nn, where n1+n2+⋯+ni+⋯+nn=c. ( 3 ) Serial v of the codeword in the secret image S is denoted as cwsv, and the serial v of the codeword in the Ti is denoted as cwiv. ( 4 )   for  i=1 to n  do ( 5 )  for each codeword v in Ai  do ( 6 )   if  cwsv≠cw1v⨁⋯⨁cwiv⨁⋯⨁cwnv   then ( 7 ) Modify the codeword of binary QR code image Ti as cwiv=~cwiv; ( 8 )   end if (9)  end for (10)end for ( 11 )   for  i=1 to n  do ( 12 ) Replace the second significant bit plane of grayscale QR code image GCi with the modified QR code image Ti, and replace the last six significant bit planes with random binary numbers to generate grayscale share SCi. ( 13 )   end for ( 14 ) Output n grayscale shares SC1,SC2,⋯,SCn.In Algorithm1, the codewords of the secret QR code are divided averagely and shared randomly into n different temporary binary QR code images. The artificial modification of shares is not perceptible. The shares can be decoded by a standard QR code.


## 3.3. The Recovery Phase

Base on XORing operation, the data of the recovery QR code image could be lossless. Suppose thatn grayscale shares are provided, we can get the pixels in the second significant bit planes from shares to create n binary QR code images. Then we read the version and level of error correction by a QR decoder. We perform XOR operation on the encoding regions of n binary images, after that putting the bits in other regions based on the version and level of error correction. In this way, we can create a QR code image whose message is the same as that of the secret image. The recovery phase is described in Algorithm 2.Algorithm 2:Secret image recovery of the proposed scheme.
Input:  n shares SC1,SC2,⋯,SCn; threshold parameters (n,n)(n≥2); Output: the reconstructed secret QR code image S′. ( 1 )  for  i=1 to n  do ( 2 ) Read the secondary plane of share SCi to create binary QR image as Si ( 3 )   end for ( 4 ) Read the version as v and level of error correction noted as l of image S1 with QR code decoder. ( 5 ) Based on v and l, we can get the total number of the codewords in S1 as c according to the standard [16]. For each codeword in Si note as cwij. ( 6 )  for  j=1 to c  do ( 7 )  cwj=cw1j⨁⋯⨁⋯⨁cwnj, cwj is the result of XORing operation. ( 8 )  end for ( 9 ) Create the bits in other regions based on the version and level of error correction, after that put them and the bits of codeword c w j ( 1 ≤ j ≤ c ) together into a new image to reconstruct a QR code image S′. ( 10 ) Output the image S′.


## 3.4. Analyses

In this section, we present some theoretical analyses about the properties of our scheme. Firstly, the grayscale QR code shares generated by Algorithm1 and the secret QR code image reconstructed by Algorithm 2 can be decoded by a QR decoder. Secondly, although the shares are damaged to some degree or have some noise, the secret QR image could be decoded. Thirdly, the threshold in our scheme threshold is (n,n)(n≥2).The grayscale shares are generated by replacing the secondary planes with the binary QR codes in which shared the secret image by Algorithm1, when a QR code decoder reading the grayscale QR code, thresholding the grayscale image in the first place. The thresholding way in different QR code decoder may be not the same, but the simplest and common one is to set the number of 128 as the threshold, so when remaining the most significant digits of the pixel values in grayscale QR code cover images unchanged, the grayscale shares could be decoded.If the 6 bits behind the secondary bit of each pixel value are changed in the range from000000 to 111111, the value in the secondary bit will not be changed. So when the last 6 bits are kept in the range from 000000 to 111111 although some noise added, the second significant bit plane replaced with secret image will not be affected, and the secret image can still be rebuilt. Because QR codes have the ability to correct errors, even if the modules are damaged or dirty in the error correction capacity range, the secret QR image could be decoded.The error correction characteristics are(c,k,r); when we share the codewords of secret QR image, the number of codewords c is divided into n(n≥2) sets averagely and randomly. Modifying the codewords of temporary QR codes according to steps (4)-(10) in Algorithm 1 to generate n binary QR code images and then replace the second significant bit planes of the grayscale QR code cover images with the binary QR code images to generate n shares. Each share can be scanned by QR code decoder. When recovering the secret QR code image, the second significant bit planes are extracted from n shares to create n binary QR code images, performing XOR operation on the codewords regions of n binary QR code images, so that the codewords of the secret QR code image would be lossless. Put the bits in other regions to reconstruct the secret image. Since the codewords of the secret QR code image are lossless, the message of the reconstructed image decoded by a QR code decoder would be the same as that of secret image. So, we can achieve the threshold of (n,n).


## 4. Experiments and Comparisons

In this section, experiments and comparisons are taken into account to evaluate the effectiveness of the proposed scheme.


### 4.1. Image Illustration

In our experiments, the simulation environment of the proposed scheme is python language. Figure4 is the (2,2) threshold XOR-based VSS on grayscale QR code of version 7 with level of error correction H. Figure 4(a) is the original secret image S and Figures 4(g) and 4(h) and GC1 and GC2 are grayscale QR code cover images obtained by graying Figures 4(b) and 4(c) and C1 and C2, respectively. Figures 4(d), 4(e), 4(f), 4(j), and 4(k) are responding decoding results of Figures 4(a), 4(b), 4(c), 4(g), 4(h). Figures 4(i) and 4(m) are the grayscale QR code shares, SC1 and SC2. Figures 4(l) and 4(o) are the decoding results of them. Figure 4(n) is the reconstructed secret QR code image S′, and Figure 4(p) is the decoding result of S′.Figure 4
Our(2,2) threshold XOR-based VSS on QR code of version 7 with level of error correction H.
(a)
S (b)
C 1 (c)
C 2 (d)
The decoding information ofS (e)
The decoding information ofC1 (f)
The decoding information ofC2 (g)
G C 1 (h)
G C 2 (i)
S C 1 (j)
The decoding information ofGC1 (k)
The decoding information ofGC2 (l)
The decoding information ofSC1 (m)
S C 2 (n)
S ′ (o)
The decoding information ofSC2 (p)
The decoding information ofS′Figure5 is our (4,4) threshold XOR-based VSS on grayscale QR code of version 17 with level of error correction H. Figures 5(b)–5(e), C1, C2, C3, and C4 are input binary QR code cover images. Figures 5(f)–5(i), SC1, SC2, SC3, and SC4, are grayscale shares. Figure 5(j) is the reconstructed QR code image and Figure 5(k) is the decoding result of S and S′.Figure 5
Our(4,4) threshold XOR-based VSS on grayscale QR code of version 17 with level of error correction H.
(a)
S (b)
C 1 (c)
C 2 (d)
C 3 (e)
C 4 (f)
S C 1 (g)
S C 2 (h)
S C 3 (i)
S C 4 (j)
S ′ (k)
The decoding information ofS′ and SThe reconstructed secret QR code imageS′ in Figures 4 and 5 are recovered by performing XOR operation on the codewords region of QR code image in the second significant bit planes of shares, then adding the functional patterns, version and format information together. The shares and the reconstructed secret image could be decoded by a QR code decoder, and the decoding result of the reconstructed secret image is identical with that of the secret QR code image.


### 4.2. Comparisons with Related Works

Figure6 is our (3,3) threshold XOR-based VSS on QR code with version 4 and level of error correction H. Figure 6(a) is the secret image S. Figures 6(b)–6(d) are input binary QR code cover images, C1, C2, and C3. Figures 6(e)–6(g) are grayscale shares, SC1, SC2, and SC3. Figure 6(h) is the reconstructed secret image S′. Figure 6(i) is the decoding result of Figures 6(a) and 6(h).Figure 6
Our(3,3) threshold XOR-based VSS on QR code of version 4 with level of error correction H.
(a)
S (b)
C 1 (c)
C 2 (d)
C 3 (e)
S C 1 (f)
S C 2 (g)
S C 3 (h)
S ′ (i)
The decoding information ofS′ and SFigure7 shows the VSS in [10]. Figure 7(a) is the secret image S. Figures 7(b)–7(d) are binary QR code cover images, C1, C2, and C3. Figures 7(e)–7(g) are the decoding results of Figures 7(b)–7(d). Figures 7(h)–7(j) are binary QR shares, SC1, SC2, and SC3. Figure 7(k) is the reconstruct secret image in QR code, S′.Figure 7
( 3,3 ) threshold VSS on QR code of version 4 with level of error correction H In [10].
(a)
S (b)
C 1 (c)
C 2 (d)
C 3 (e)
The decoding information ofC1 (f)
The decoding information ofC2 (g)
The decoding information ofC3 (h)
S C 1 (i)
S C 2 (j)
S C 3 (k)
S ′The secret image in Figure7 is encrypted from the coordinate of (7,7) to right down corner of QR code image. The size of secret image is smaller than the QR code, and the secret image is shared in a continuous region of the cover images, threshold value is no less than 2. The QR code images are all binary images. The secret image in our scheme is shared dispersive, high image quality and high imperceptibility can be achieved. The secret image has the same size with the cover images, and the shares are grayscale QR code images.Figure8 shows the VSS in [11]. Figure 8(a) is the secret image S. Figures 8(b)–8(d) are binary QR code cover images, C1, C2, C3. Figures 8(e)–8(g) are binary QR shares, SC1, SC2, SC3. Figure 8(h) is the reconstruct secret image in QR code S′. Figure 8(i) is the decoding result of Figures 8(a) and 8(i).Figure 8
( 3,3 ) threshold VSS on QR code of version 4 with level of error correction H In [11].
(a)
S (b)
C 1 (c)
C 2 (d)
C 3 (e)
S C 1 (f)
S C 2 (g)
S C 3 (h)
S ′ (i)
The decoding information ofS′ and SThe shares in Figure8 are binary QR code images. The secret QR code image could be reconstructed through XORing the white and black modules contained in the encoding region of the n QR code shares and then padding the bits in other regions. The threshold in paper [11] is not less than 3. In our scheme, the shares are grayscale QR code images and the secret image could be recovered by XORing the bits contained in the codewords regions of the second significant bit planes of n shares and then adding the function patterns, version, and format information. The threshold in our scheme is not less than 2.Compared to the schemes in [10, 11], our scheme takes into account the advantage of threshold value greater than 2, high image quality, and high imperceptibility.


### 4.3. Robust Test

In the proposed technique, all the images are QR codes, which have their own abilities to correct errors, and the plane modification is the second significant bit plane of the grayscale image, in this way, the algorithm is robust to conventional image attacks. Taking our(2,2) threshold scheme to resist Gaussian noise as an example, addition of different noises to the two shares to test the robustness of the scheme is shown by Figure 9.Figure 9
The performance of our shares with Gaussian noises.
(a)
S C 1 (b)
S C 2 (c)
S C 1 with Gaussian noise (0,1) (d)
S C 2 with Gaussian noise (0, 1) (e)
S 1 ′ reconstructed from shares with Gaussian noise (0, 1) (f)
S C 1 with Gaussian noise (0, 8) (g)
S C 2 with Gaussian noise (0, 8) (h)
S 2 ′ reconstructed from shares with Gaussian noise (0,8) (i)
The decoding information ofS1′ and S2′ (j)
The difference between Figure4(a) and S1′ (k)
The difference between Figure4(a) and S2′Figures9(a) and 9(b) are shares in Figure 4, SC1, and SC2. Figures 9(c) and 9(d) are shares added with Gaussian noise(mean=0,variance=1), Figure 9(e) is the reconstructed secret image from Figures 9(c) and 9(d), S1′. Figures 9(f) and 9(g) are shares added with Gaussian noise(mean=0,variance=8), Figure 9(h) is the reconstructed secret image from Figures 9(f) and 9(g), S2′. Figure 9(i) is the decoding result of S1′ and S2′. Figure 9(j) displays the differences between S in Figure 4(a) and S1′, and the differences between S in Figure 4(a) and S2′ is showed in Figure 9(k). When the value of variance is in range from 0 to 8, the reconstructed QR code could be decoded, the greater the variance, the greater the difference. When the value of variance is larger than 9, the reconstructed QR code could not be decoded. The decoding result of S1′ and S2′ is the same as the decoding result of Figure 4(a), so that our scheme is robust to some noises.Different attacks such as JPEG compression, rotation, resizing, and cropping are tested to further show the robustness. Whether the reconstructed secret QR code image can be decoded correctly when attacks are applied on shares is summarized in Table2. We can see from Table 2 that we can resist some conventional attacks to certain degree, including JPEG compression, Gaussian noise, rotation, resizing, and cropping. These attacks may exist during shares transmission, so our scheme is very meaningful for practical application.Table 2
Performance of proposed technique against various attacks.
Type of Attack Parameter Whether S ′ can be decoded correctly (yes/no)? Type of Attack Parameter Whether S ′ can be decoded correctly (yes/no)? JPEG Compression Q = 90 yes Rotation 15° yes Q =85 yes 30° yes Q = 8 yes 45° yes Q = 75 yes 60° yes Q = 70 no 75° yes  Gaussian Noise Mean = 0,Variance =1 yes Resizing 0.8 yes Mean = 0,Variance =2 yes 1.1 yes Mean = 0,Variance =3 yes 1.4 yes Mean = 0,Variance =4 yes 1.7 yes Mean = 0,Variance =5 yes 2.0 yes  Gaussian Noise Mean = 0,Variance =6 yes Cropping 1/100 yes Mean = 0,Variance =7 yes 1/25 yes Mean = 0,Variance =8 yes 9/100 yes Mean = 0,Variance =9 no 4/25 yes 1/4 yes 9/25 no


## 4.1. Image Illustration

In our experiments, the simulation environment of the proposed scheme is python language. Figure4 is the (2,2) threshold XOR-based VSS on grayscale QR code of version 7 with level of error correction H. Figure 4(a) is the original secret image S and Figures 4(g) and 4(h) and GC1 and GC2 are grayscale QR code cover images obtained by graying Figures 4(b) and 4(c) and C1 and C2, respectively. Figures 4(d), 4(e), 4(f), 4(j), and 4(k) are responding decoding results of Figures 4(a), 4(b), 4(c), 4(g), 4(h). Figures 4(i) and 4(m) are the grayscale QR code shares, SC1 and SC2. Figures 4(l) and 4(o) are the decoding results of them. Figure 4(n) is the reconstructed secret QR code image S′, and Figure 4(p) is the decoding result of S′.Figure 4
Our(2,2) threshold XOR-based VSS on QR code of version 7 with level of error correction H.
(a)
S (b)
C 1 (c)
C 2 (d)
The decoding information ofS (e)
The decoding information ofC1 (f)
The decoding information ofC2 (g)
G C 1 (h)
G C 2 (i)
S C 1 (j)
The decoding information ofGC1 (k)
The decoding information ofGC2 (l)
The decoding information ofSC1 (m)
S C 2 (n)
S ′ (o)
The decoding information ofSC2 (p)
The decoding information ofS′Figure5 is our (4,4) threshold XOR-based VSS on grayscale QR code of version 17 with level of error correction H. Figures 5(b)–5(e), C1, C2, C3, and C4 are input binary QR code cover images. Figures 5(f)–5(i), SC1, SC2, SC3, and SC4, are grayscale shares. Figure 5(j) is the reconstructed QR code image and Figure 5(k) is the decoding result of S and S′.Figure 5
Our(4,4) threshold XOR-based VSS on grayscale QR code of version 17 with level of error correction H.
(a)
S (b)
C 1 (c)
C 2 (d)
C 3 (e)
C 4 (f)
S C 1 (g)
S C 2 (h)
S C 3 (i)
S C 4 (j)
S ′ (k)
The decoding information ofS′ and SThe reconstructed secret QR code imageS′ in Figures 4 and 5 are recovered by performing XOR operation on the codewords region of QR code image in the second significant bit planes of shares, then adding the functional patterns, version and format information together. The shares and the reconstructed secret image could be decoded by a QR code decoder, and the decoding result of the reconstructed secret image is identical with that of the secret QR code image.


## 4.2. Comparisons with Related Works

Figure6 is our (3,3) threshold XOR-based VSS on QR code with version 4 and level of error correction H. Figure 6(a) is the secret image S. Figures 6(b)–6(d) are input binary QR code cover images, C1, C2, and C3. Figures 6(e)–6(g) are grayscale shares, SC1, SC2, and SC3. Figure 6(h) is the reconstructed secret image S′. Figure 6(i) is the decoding result of Figures 6(a) and 6(h).Figure 6
Our(3,3) threshold XOR-based VSS on QR code of version 4 with level of error correction H.
(a)
S (b)
C 1 (c)
C 2 (d)
C 3 (e)
S C 1 (f)
S C 2 (g)
S C 3 (h)
S ′ (i)
The decoding information ofS′ and SFigure7 shows the VSS in [10]. Figure 7(a) is the secret image S. Figures 7(b)–7(d) are binary QR code cover images, C1, C2, and C3. Figures 7(e)–7(g) are the decoding results of Figures 7(b)–7(d). Figures 7(h)–7(j) are binary QR shares, SC1, SC2, and SC3. Figure 7(k) is the reconstruct secret image in QR code, S′.Figure 7
( 3,3 ) threshold VSS on QR code of version 4 with level of error correction H In [10].
(a)
S (b)
C 1 (c)
C 2 (d)
C 3 (e)
The decoding information ofC1 (f)
The decoding information ofC2 (g)
The decoding information ofC3 (h)
S C 1 (i)
S C 2 (j)
S C 3 (k)
S ′The secret image in Figure7 is encrypted from the coordinate of (7,7) to right down corner of QR code image. The size of secret image is smaller than the QR code, and the secret image is shared in a continuous region of the cover images, threshold value is no less than 2. The QR code images are all binary images. The secret image in our scheme is shared dispersive, high image quality and high imperceptibility can be achieved. The secret image has the same size with the cover images, and the shares are grayscale QR code images.Figure8 shows the VSS in [11]. Figure 8(a) is the secret image S. Figures 8(b)–8(d) are binary QR code cover images, C1, C2, C3. Figures 8(e)–8(g) are binary QR shares, SC1, SC2, SC3. Figure 8(h) is the reconstruct secret image in QR code S′. Figure 8(i) is the decoding result of Figures 8(a) and 8(i).Figure 8
( 3,3 ) threshold VSS on QR code of version 4 with level of error correction H In [11].
(a)
S (b)
C 1 (c)
C 2 (d)
C 3 (e)
S C 1 (f)
S C 2 (g)
S C 3 (h)
S ′ (i)
The decoding information ofS′ and SThe shares in Figure8 are binary QR code images. The secret QR code image could be reconstructed through XORing the white and black modules contained in the encoding region of the n QR code shares and then padding the bits in other regions. The threshold in paper [11] is not less than 3. In our scheme, the shares are grayscale QR code images and the secret image could be recovered by XORing the bits contained in the codewords regions of the second significant bit planes of n shares and then adding the function patterns, version, and format information. The threshold in our scheme is not less than 2.Compared to the schemes in [10, 11], our scheme takes into account the advantage of threshold value greater than 2, high image quality, and high imperceptibility.


## 4.3. Robust Test

In the proposed technique, all the images are QR codes, which have their own abilities to correct errors, and the plane modification is the second significant bit plane of the grayscale image, in this way, the algorithm is robust to conventional image attacks. Taking our(2,2) threshold scheme to resist Gaussian noise as an example, addition of different noises to the two shares to test the robustness of the scheme is shown by Figure 9.Figure 9
The performance of our shares with Gaussian noises.
(a)
S C 1 (b)
S C 2 (c)
S C 1 with Gaussian noise (0,1) (d)
S C 2 with Gaussian noise (0, 1) (e)
S 1 ′ reconstructed from shares with Gaussian noise (0, 1) (f)
S C 1 with Gaussian noise (0, 8) (g)
S C 2 with Gaussian noise (0, 8) (h)
S 2 ′ reconstructed from shares with Gaussian noise (0,8) (i)
The decoding information ofS1′ and S2′ (j)
The difference between Figure4(a) and S1′ (k)
The difference between Figure4(a) and S2′Figures9(a) and 9(b) are shares in Figure 4, SC1, and SC2. Figures 9(c) and 9(d) are shares added with Gaussian noise(mean=0,variance=1), Figure 9(e) is the reconstructed secret image from Figures 9(c) and 9(d), S1′. Figures 9(f) and 9(g) are shares added with Gaussian noise(mean=0,variance=8), Figure 9(h) is the reconstructed secret image from Figures 9(f) and 9(g), S2′. Figure 9(i) is the decoding result of S1′ and S2′. Figure 9(j) displays the differences between S in Figure 4(a) and S1′, and the differences between S in Figure 4(a) and S2′ is showed in Figure 9(k). When the value of variance is in range from 0 to 8, the reconstructed QR code could be decoded, the greater the variance, the greater the difference. When the value of variance is larger than 9, the reconstructed QR code could not be decoded. The decoding result of S1′ and S2′ is the same as the decoding result of Figure 4(a), so that our scheme is robust to some noises.Different attacks such as JPEG compression, rotation, resizing, and cropping are tested to further show the robustness. Whether the reconstructed secret QR code image can be decoded correctly when attacks are applied on shares is summarized in Table2. We can see from Table 2 that we can resist some conventional attacks to certain degree, including JPEG compression, Gaussian noise, rotation, resizing, and cropping. These attacks may exist during shares transmission, so our scheme is very meaningful for practical application.Table 2
Performance of proposed technique against various attacks.
Type of Attack Parameter Whether S ′ can be decoded correctly (yes/no)? Type of Attack Parameter Whether S ′ can be decoded correctly (yes/no)? JPEG Compression Q = 90 yes Rotation 15° yes Q =85 yes 30° yes Q = 8 yes 45° yes Q = 75 yes 60° yes Q = 70 no 75° yes  Gaussian Noise Mean = 0,Variance =1 yes Resizing 0.8 yes Mean = 0,Variance =2 yes 1.1 yes Mean = 0,Variance =3 yes 1.4 yes Mean = 0,Variance =4 yes 1.7 yes Mean = 0,Variance =5 yes 2.0 yes  Gaussian Noise Mean = 0,Variance =6 yes Cropping 1/100 yes Mean = 0,Variance =7 yes 1/25 yes Mean = 0,Variance =8 yes 9/100 yes Mean = 0,Variance =9 no 4/25 yes 1/4 yes 9/25 no


## 5. Conclusion

This paper proposed a novel robust VSS scheme applying to QR code. In this scheme, all the codewords of the secret QR code image are split inton temporary binary QR codes randomly with the theory of XOR-based VSS, so shares with high image quality and high imperceptibility can be achieved in the end. Each share in our scheme can be decoded by a QR code decoder when distributing via public channels, which would avoid the attentions from potential attackers. Since all the images are QR codes, which have their own abilities to correct errors, and the plane modification is the second significant bit plane of the grayscale image, our scheme is robust to conventional image attacks, such as rotation, JPEG compression, Gaussian noise, resizing and cropping, when reconstructing the secret image, performing XOR operation on the bits of the codewords region in the second significant planes of the grayscale shares and adding the functional patterns, version, and format information together. There are no wrong codewords in the reconstructed secret QR code image, so the message of which is identical with that of the original secret image. The threshold of our scheme is (n,n)(n≥2). The reduction of the size of the shares will be the future work.



---

*Source: 4036815-2018-12-11.xml*