Multiple Schemes for Mobile Payment Authentication Using QR Code and Visual Cryptography

QR code (quick response code) is used due to its beneficial properties, especially in the mobile payment field. However, there exists an inevitable risk in the transaction process. It is not easily perceived that the attacker tampers with or replaces the QR code that contains merchant’s beneficiary account. Thus, it is of great urgency to conduct authentication of QR code. In this study, we propose a novel mechanism based on visual cryptography scheme (VCS) and aesthetic QR code, which contains three primary schemes for different concealment levels. The main steps of these schemes are as follows. Firstly, one original QR code is split into two shadows using VC multiple rules; secondly, the two shadows are embedded into the same background image, respectively, and the embedded results are fused with the same carrier QR code, respectively, using XOR mechanism of RS and QR code error correction mechanism. Finally, the two aesthetic QR codes can be stacked precisely and the original QR code is restored according to the defined VCS. Experiments corresponding to three proposed schemes are conducted and demonstrate the feasibility and security of the mobile payment authentication, the significant improvement of the concealment for the shadows in QR code, and the diversity of mobile payment authentication.


Introduction
With the rapid development of global wireless networks and the growing popularity of mobile devices, such as mobile phones, tablet PCs, and handheld computers, the user's work and daily life become more and more convenient.Mobile payment as a quick payment way is prevalent in some rising markets [1].Furthermore, QR code, a new technology of information storage, transferring, and recognition, can be decoded by mobile phone anywhere and thus has been widely used in some security sensitive applications [2] such as payments [3][4][5].Now QR code payment becomes one of the most mainstream in the mobile payment market.However, there exist some security risks using this means of payment.For example, QR code is stuck on the wall of one shop, which represents the merchant's beneficiary account.There exists no anticounterfeiting function in QR code.Thus, one cheater can tamper with the private data of QR code using his own bank account without any notification.Thus, the funds are transferred to the attacker's account during each subsequent deal.To further decrease the economic loss of the merchants caused by the described behavior and improve the security of mobile payment authentication process for the general customers, the proposed mechanism in this study is applied to practical scenario as shown in Figure 1.Three primary entities are considered: the shop, cloud server, and mobile phone.The QR code carrying the original secret is split into shadow 1 and shadow 2 on the basis of a (2, 2) VCS.QR 1 is the fusion result of shadow 1 and carrier QR code.The generation of QR 2 is similar to QR 1 .Moreover, QR 1 is stored in the cloud server while QR 2 is stuck on the wall of the shop.The mobile phone holder photographs QR 2 and then scans QR 2 to acquire QR 1 from the distributed cloud server.Subsequently, the mobile phone simulates the vision characteristic [6] of VCS to stack QR 1 and QR 2 .The original QR code is restored and can be accessed by the holder.
QR code presents some significant features, such as small size and the abilities to carry large and various data (such as images, text, symbols, and other types of information).These   features can make up for the shortcoming of traditional VCS that only decodes a simple image.Therefore, some related researches [8][9][10][11] on security authentication based on the combination of QR code and VCS have been conducted in recent years.In these papers QR code is split into several shadows by using VCS since both of VCS and QR code are composed of black and white dots.Besides, VCS used in ecommerce, bank secure login authentication, and so on has been studied [7,9,12].Also, Yang et al. proposed that the split two shadows were stored, respectively, in the mobile client and cloud server to achieve the mobile phone authentication.The two shadows can also be stacked together and the original QR code is restored as shown in Figure 2(a).If the scheme [13] is applied on specific QR code payment, the shadows are only vulnerable.
In this study, the shadows are hidden in an undetectable state using the QR code background fusion on such basis [13].Specifically, two shadows are respectively embedded into two similar images and the results are fused with two identical carrier QR code by using QR code background fusion strategy.The two fusion QR codes can be stacked precisely since QR code presents the characteristics of automatic identification and independent positioning.The stacked result is the original QR code in carrier QR code [11].One example of our experiment results is shown in Figure 2(b).
The main contributions of this paper are three schemes with different principles and concealment levels for mobile payment authentication: (1) In order to make the QR code as holistic as possible after the shadow is embedded, Scheme I operates on the basic unit of QR module and adopts the XOR mechanism of Reed-Solomon (RS).In this scheme the original QR code is split into two shadows using the proposed nonexpansion (2, 2)-VCS; the shadows have the same size with the original QR code.
(2) To decrease the visual difference between the shadow and its surrounding region of the carrier QR code in Scheme I, a two-level fusion strategy with a background image and an aesthetic QR code strategy are proposed in Scheme II.The first-level fusion process is to hide the shadow in the background image and the second is to fuse the carrier QR code with the special region in the fused background image using XOR mechanism of RS.
(3) Scheme II only supports the fusion of binary background image.To achieve better aesthetic effect and concealment, the fusion strategy is adapted between the carrier QR code and extracted regions of interest (ROI) by the error correction mechanism of QR code in Scheme III.Specifically, the saliency map and module layout are used to figure out the saliency values, based on which the appropriate modules are selected as ROI.The obtained ROI is the local region in the background image replaced by the shadow.
The rest of this paper is organized as follows.Section 2 introduces VCS and QR code.The detailed descriptions of the three proposed schemes and their corresponding experiments are given in Section 3. The analysis of authentication security and conclusions are presented in Section 4.

Preliminary
2.1.Visual Cryptography.Visual cryptographic scheme (VCS) is a generalization of secret sharing and was first proposed by Naor and Shamir in 1995 in their scheme [14].An original halftone image is divided into  shared images and each shared image is printed on a transparent film, such that any  films stacked together can restore the original image.However, for the case with less than  films, the original image cannot be restored.This program mainly uses the human visual system of color approximation principle.Therefore, the secret image restoration can be implemented by a simple film superposition without any password calculation.
Each pixel of the images is divided into smaller blocks.There is always the same number of white and black blocks.If a pixel is divided into two parts, there are one white and one black block.If the pixel is divided into four equal parts, there are two white and two black blocks.In Figure 3 a pixel is divided into four parts, and it has two different states.If the pixel is white, it can be divided into two blocks and each block has a black pixel and a white pixel.When the secret image is split, the block is randomly filled into two shadows.When the two blocks are superimposed together, gray blocks appear to simulate the white pixels.If the pixel is black, the two blocks are complementary.When the two blocks are superimposed, they present black pixels.Thus, shadow images that are split by secret image become a chaotic maps and no information can be inferred from the secret image.Secret images can be restored when the two shadows overlay.Moreover, the stacking process does not require any calculations.

RS Code Encoding Mechanism.
The  bits RS code contains  data bits, as parity code for the rest of the word.The QR code is generated by RS code.The generation process of QR code with RS code is presented as follows.Firstly, the length of data region is  in RS code according to the input text; secondly, the input text is encoded based on the encoding rules of RS code; the region filled by those code words are considered as the valid data region, and its length is .If the code words cannot completely fill the data region, a terminator (0000) is adopted.The padding bits are used to fill the extra data region known as the invalid data region and its length is  − .Moreover, the RS code generates  parity bits according to the  data bits.Finally, the generated RS code combining with the timing pattern and alignment pattern performs XOR operations with mask [15].Then the standard QR code is generated.
Figure 4 shows the distribution of RS code in the QR code.Pink and green parts are the data region with length of , and the orange part is the parity region with length of .The remaining parts are filled by timing pattern and alignment pattern.The pink part is the valid data region with length of ; the green part is the invalid data region with length of − after the terminator.
Black and white modules are randomly distributed in QR code, which is a property of QR code.Submodules of VCS are also randomly distributed, but submodule is from image decomposition.Compared with VCS, randomness in QR codes appears natural.Concealment will be better in QR code if we want to hide information.

Construction of PBVM.
A series of RS codes can be acquired by Gauss Jordan elimination method [16].Those RS codes formulate a matrix and its previous section of the matrix is a unit vector matrix.On this basis, the concept of positive basis vector matric (PBVM) is proposed, in which m message bits t parity bits p padding bits Figure 4: RS code distribution in QR code.
each line is a RS code; the previous  bits are data region and the rear  bits are parity region.The subregion of  *  in the front of the whole matrix is a unit vector matrix (as shown in Figure 5).PBVM is used to modify the data region of RS codes.

XOR Mechanism of RS.
According to the literature [16], it is proved that RS code has the features of XOR operation, which means a new RS code can be acquired using two different RS codes by performing XOR operation, and the new RS code still conforms to the standard form.For example, given the following RS codes with data bits  = 3 and parity bits  = 2, the two RS codes are RS1 = 10010 and RS2 = 01011; then, to perform the XOR operation RS3 = RS1 ⊕ RS2 = 11001, it also can be observed that RS3 is also a valid RS code.

Authentication Schemes for QR Code Payment
Because QR code and shadows of VCS are both composed of white/black dots, we can combine VCS with QR code to implement security authentication scheme.Firstly, VCS is used for authentication of QR code.Then security for payment will be further improved if shadow of VCS can be concealed into the QR code undetectably.In order to conceal shadow into QR code, some aesthetic QR code methods are adopted.Sections 3.1, 3.2, and 3.3 introduce some authentication schemes for QR code payment, in which VCS based on QR module, fusion with background image based on XOR mechanism of RS, and error correction mechanism of QR are used, respectively.

Scheme I Based on QR Module and XOR Mechanism of RS.
The original QR code is split into two halftone images as shadows at pixel level.When one shadow is embedded to the carrier QR code directly, the aesthetic QR code is noticeable because of the visual difference of white/black dots.Thus, it is easy to be suspected and then it results in malicious attacks.Therefore, in order to have a better concealment, a new splitting shadows mechanism based on QR code module is designed.The shadow is embedded into the carrier QR code based on XOR mechanism of RS. Figure 6 shows the overall framework, which can be described as follows.
(1) The Generation of Shadows.Considering that the module is taken as the basic unit in QR encoding and decoding, each module of the original QR code is divided into two modules according to the defined rule (Figure 6).If the original QR code module is white, the obtained module pairs must be consistent: both white modules (as shown in the 2nd column in Figure 6).When this pair is stacked, a white module appears.On the other hand, if the original QR code module is black, the obtained module pairs must be complementary (as shown in the 3th and 4th columns in Figure 6).When these complementary pairs are stacked, a black module appears.Each module of the original QR code is handled according to the above defined rules and two shadows are obtained.The two shadows  1 and  2 have the same size as the original QR code  1 .The proposed VCS can provide better concealment for the subsequent fusion process.(3) The Stack of QR Code.Then, we stack the two QR codes  3 and  4 .The original QR code  1 appears in the stacked QR code  5 and can be decoded precisely.
The flowchart of Scheme I is shown in Figure 7.Some experiments are conducted and results are listed in Table 1.
From the front two rows in Table 1, we can find that the modules in the shadow are distinctly different from the surrounding region of the carrier QR code.In order to solve the problem, we need to modify the data region of the original QR code to increase the number of black modules as much as possible.For example, the better result is given in the last row of Table 1.

Scheme II Based on VCS and Fusion Strategy of Background
Image by XOR Mechanism of RS.However, Scheme I has some flaws.For example, there are somewhat differences between the modified region and the surrounding region.Such flaw can cause attackers' suspicion easily and reduce the security of QR code to some extent.So, we propose an improved scheme based on VCS and fusion strategy of background image with XOR mechanism of RS.In Scheme II, the two shadows are embedded into the same background image, respectively.Then, the QR code is fused with the obtained background image based on XOR mechanism of RS.The details are described as follows.
(3) Fusion of Background Image and Carrier QR Code.The background images ( 2 and  3 ) and the QR code are fused with XOR mechanism of RS.The fusion steps are described as follows.Firstly, background images are grayed using the  method of weighted mean and partitioned into several blocks according to the size of QR code module.Secondly, the consistency between every block and its corresponding QR code module is evaluated by comparing their gray value.Then, XOR operation is executed for QR code with PBVM if the comparison result is different.Lastly, the QR code and the background image should fused.The detailed fusion strategy formula is described as follows: where  = 0 represents that the background image that is completely replaced;  = −1 or 1 represents the central region of the specified module which is replaced by the corresponding region of the QR code, and the other region of the specified module is replaced by corresponding region of background image.  represents gray average of gray block. 0 represents binary threshold, which is obtained by Otsu's method.  is the module of QR code;   = 1 represents white block whereas   = 0 represents black block.
(4) The Stack of QR Code.The two aesthetic QR codes ( 3 and  4 ) are stacked.The original QR code in the stacked QR code  5 appears and can be decoded accurately.The flowchart of the Scheme II is given in Figure 8.The embedded QR code ( 2 and  3 ) can be decoded accurately.The small QR code in the fused QR code can be decoded.The secret information can be gained perfectly through decoding the smaller QR code.
For example, when a blank background image is chosen, the result of Scheme II is shown in Figure 9.
From Figure 8, we find that the shadows appear abruptly in the QR code.In this case, the QR code is attacked easily.Thus, the security of QR code is hard to ensure.The selection of background image is crucial.The better results will be tested in Table 2 by selecting some special binary background image.
From Table 2, we find the shadows are hidden with no affection in the binary background images.This scheme has good security and concealment.It is suitable for mobile payment.

Scheme III Based on VCS and Fusion Strategy of Background Image with Error Correction Mechanism of QR.
Scheme II is implemented with XOR mechanism of RS.However, the selected background image is only valid for binary image.In order to enlarge the selectable background image, XOR mechanism adopted in Scheme II is replaced by error correction mechanism of QR code.Thus, Scheme III is designed as shown in Figure 10.
In Scheme III, a color background image is selected.Local region of the color background image is replaced by one shadow as shown in Figure 10.Then, the selected carrier QR code and the modified background image are fused with the method of error correction mechanism.The shadow is hidden in the carrier QR code.It is hard to notice the hidden shadow and the security is enhanced.When two aesthetic QR codes are stacked, the original QR code appears and can be decoded accurately.The main differences are stated in the second step and the third step compared with Scheme II.
(2) The Selection of Color Background Image.In Scheme III, the background image is selected widely.The color image has rich information, such as texture, color, and shapes, which can be utilized sufficiently to hide the shadows.The region of interest (ROI) in the background image is selected and replaced by the shadows.The modified background image is obtained.
(3) Fusion Strategy of Background Image and QR Code.The error correction mechanism of QR code can be adopted to fuse the modified background image and the carrier QR code.The details are described as follows.
Firstly, the positions of modules of the carrier QR code are marked as module layout.The saliency map is generated according to ROI.The saliency map and module layout are used to figure out saliency values and then sort and select proper modules as changeable regions.The hierarchical module replacement rules are proposed.
Secondly, the binary operation for the modified background image is done.The modified background image is partitioned into blocks as the size of QR code module.
Thirdly, the block in the ROI with the corresponding QR code module is compared.The corresponding module is modified if the comparison result is different.The modification rule is as follows: if the module is white, it is replaced directly by black module.Otherwise, it is replaced directly by white module.
Finally, the third step is repeated for every module in the ROI.The modified background image is fused with the carrier QR code as the method of Scheme II.Some related experimental results with Scheme III are listed in Table 3.Compared with Scheme II, the background images present a variety of diversity, including grayscale and color images.Due to the rich background images, the shadows are perfectly fused into the background image to further strengthen the concealment of shadow.The attacker would not pay much attention to the fused QR code.Therefore, the

Figure 1 :
Figure 1: One practical scenario of mobile payment authentication.

2 )
The Fusion of Carrier QR Code and Shadows.Given one carrier QR code and shadow  1 , the local region of carrier QR code with the same size as  1 is modified with XOR mechanism of RS.The related rows in PBVM are obtained if the modules between shadow  1 and the QR code  2 are different.One XOR operation is executed between RS of the module and RS of the carrier QR code to generate a new RS.To insert shadow 1 and shadow 2 into the carrier QR code, the processing steps are described as follows.For each module   in shadows 1 or 2, it will be compared with the original module   in carrier QR code.If modules   and   are different, the XOR operation will be executed to change module   .Meanwhile, the related rows in PBVM are obtained to generate a new RS in carrier QR code.After all of the different modules are processed an aesthetic QR code  3 is generated.The aesthetic QR code  4 is obtained with  2 in a similar way.
Mechanism of QR Code.QR code is divided into 40 versions according to the image size.Version 1 consists of 21 * 21 modules; every following version compared to the previous version increases four modules for each side.
In different versions of QR code, each version of QR code has four error correction levels, expressed with , , , and ; the corresponding error correction capacities are 7%, 15%, 25%, and 30%, respectively.In this paper, we will use error correction mechanism to realize the blend of QR code and background image.

Table 1 :
Results of Scheme I.