Secure QR Code Scheme Based On Visual Cryptography: Xiaohe Cao, Liuping Feng, Peng Cao and Jianhua Hu
Secure QR Code Scheme Based On Visual Cryptography: Xiaohe Cao, Liuping Feng, Peng Cao and Jianhua Hu
Abstract—With the wide application of QR code, the security and QR codes[1]. S. Khairnar used extended visual
problem of QR code is serious, such as information leakage cryptography technique to solve the problem of phishing and
and data tampering. In order to solve the QR information done the relevant validation. The method of visual encryption
security problem, this paper proposed a secure QR code schema combined with QR code is mentioned more than once. A lot of
based on visual cryptography. The QR code is divided into two researchers have done the experiment to confirme the
share images that can be transmitted separately. The generation feasibility of this method. M.A. Kute, Ms. Ashvini, and M. D.
of the two share images is based on the pseudo-random matrix, Deokar described a scheme using the visual cryptography and
that is, the pixels in the two share images are determined by the QR code in their paper[2]. S. Falkner, P. Kieseberg, D. E.
corresponding values in the pseudo-random matrix. The two
Simos proposed an e-voting authentication scheme[3]. This
share images can be stacked simply to restore the information.
Simulation results show that the QR code image can be well
approach is based on visual cryptography as the work frame
hidden, and it can be restored effectively. and also combined with QR codes, focusing on the usability. D
Li, Z Liu, and LH Cui proposed scheme for identification
Keywords-QR code; visual cryptography; secret sharing; photos based on QR Code and Visual Cryptography[4]. The
pseudo-random modulation visual cryptography scheme is applied to generate the secret
images from the feature values in their research.
I. INTRODUCTION
Visual cryptography is a new secret sharing technology. It
In recent years, the QR code is widely used. First, the QR improves the secret share images to restore the complexity of
code is easy to be computer equipment identification, for the secret, relying on human visual decryption. Compared with
example, mobile phones, scanning guns. Second, QR code has traditional cryptography, it has the advantages of concealment,
a large storage capacity, anti-damage strong, cheap and so on. security, and the simplicity of secret recovery. The method of
Because of the advantages of the QR code, it is used in many visual cryptography provided high security requirements of the
areas. Train ticket real-name authentication uses QR code to users and protects them against various security attacks. It is
approve identity. In the supermarket, commodity packaging is easy to generate value in business applications.
now also in the application of QR code to distinguish true or
false. Scanning the QR code to pay attention to WeChat public In this paper, we proposed a secure QR code scheme to
number or download App. Now, QR code is the most popular protect the user's information not be stolen using visual
application. And the mainstream mode of payment is to encryption technology. The scheme can be applied in the fields
complete the Alipay or WeChat pay by scanning the QR code. of document management, customs security system, medical
QR code logos are almost full of our lives anywhere. With the medicine and other fields.
wide application of QR code, the security problem of QR code The organization of this paper is as follows. In Section II,
is serious, such as information leakage and data tampering. The we explained the basic principles and methods of visual
coding rules of the QR code are gradually being familiar to the cryptography technology. We proposed the security QR code
researchers. Some attackers according to the encoding rules scheme based on visual cryptography in Section III, and
forged the same code for the QR code pattern through illegal evaluated the performance through experimental results in
operation. For example, the pirates can obtain personal Section IV. Finally, we concluded this paper in Section V.
information (such as name, ID number) just through the waste
real-name system of train tickets, then they can forge a same II. VISUAL CRYPTOGRAPHY
code pattern ticket with the same encoding to pass the ticket
Visual cryptography is a cryptographic technique which
verification. The use of QR code is no longer safe. Therefore,
allows visual information (pictures, text, etc.) to be encrypted
in order to make the QR code authentication more safe and
in such a way that the decryption can be performed by human
reliable to use, the introduction of new technology is urgently
visual without the aid of computers [5]. In 1994, M. Naor and
needed. Many researchers are devoted to study the safe and
A. Shamir firstly introduced visual cryptography and provided
reliable QR code authentication.
their constructions of visual cryptographic solutions for the
S. Khairnar proposed a new authentication scheme for general k out of n secret sharings problem at their paper[6].
secure OTP(One Time Password) distribution in phishing
Visual cryptography scheme is a method to encode a secret
website detection through EVC(extended visual cryptography)
image into n noise-like shadow images called share images,
and the share images need some processing to reconstruct the III. THE NEW SCHEME OF VISUAL CRYPTOGRAPHY ON THE
secret image[7]. The detailed principle of visual encryption is QR CODE SECURITY
that the secret image is divided into several share images by
In this section, We will introduce our secure QR code
cryptographic operations and distributed to different
scheme. In order to hide the QR code information, we proposed
participants. The pixels of each share image appear to be
an improved visual encryption technology based on the existing
randomly distributed[8]. Decryption is possible by stacking an
visual encryption technology to realize the concealment of the
adequate number of shares. The secret image will be revealed
QR code pattern. Through this method of encryption, the
and can be decoded by the human visual system (HVS) on the
information hidden in QR code is more difficult to be accessed
condition of the absence of any complicated computation or
by forgers. So as to achieve the purpose of hidden information
replacement algorithms[7]. Moreover, no knowledge of
more secure.
sophisticated cryptographic techniques is needed for the
encryption and decryption processes. However, the secret The QR code with hidden information is the original secret
image will be invisible if the number of stacked shares is less image, using a special encryption method that pseudo-random
than t. This is so called (t,n)-threshold visual cryptography matrix combined with visual cryptography algorithm to
scheme ((t,n)-VCS)[9]. generate two shared images. Steps are as follows.
Consider the simplest two-out-of-two visual threshold A. The Collections of the Encoding Matrices C0 and C1
scheme where each pixel of the image is encoded into a pair of
subpixels in each of the two shares. If the pixel is white, one of The two collections of the encoding boolean matrices C0
the two columns tabulated under the white pixel in Fig. I. is and C1 , respectively, representing a white pixel and a black
selected. If the pixel is black, one of the two columns tabulated pixel of the original secret image.
under the black pixel is selected. In each case, the selection is
performed by randomly flipping a fair coin, such that each B. Generation of a Pseudo-Random Matrix
column has equal probability to be chosen. Then, the first two Generate a pseudo-random matrix of the same size as the
pairs of subpixels in the selected column are assigned to share original secret image, which is in the range of 0~3, each value
A and share B, respectively[10]. Now consider the corresponds to the basic matrix of C0 and C1 , respectively.
superposition of the two shares as shown in the last row of Fig.
I. The basic matrix in C1 is XORed by the basic matrix in C0
and the all-1 matrix.
C. Selection of the Basic Matrix
The pixel matrix of the share image is the basic matrix
selected from C0 or C1 , but the chosen rule is determined by the
participation of the pseudo-random matrix.
a) When generating the share image A, the rule as follows:
the position of pixel (including white pixels and black pixels)
in the secret image are mapped to the corresponding position in
the pseudo-random matrix, and then selected the corresponding
basic matrix from C0 according to the value in the pseudo-
random matrix.
FIGURE I. CONSTRUCTION OF A TWO-OUT-OF-TWOVC SCHEME: A b) When generating the share image B, the rule is slightly
SECRET PIXEL CAN BE ENCODED INTO TWO SUBPIXELS IN
EACH OF THE TWO SHARES
different when white pixels and black pixels mapped to the
pseudo-random matrix.
The greatest advantage of this decryption process is that it If the case of white pixel, the rule is as follows: the position
is only through the human vision system. No complex of the white pixel in the secret image is mapped to the
computations and knowledge of Visual Cryptography Scheme corresponding position in the pseudo-random matrix, and then
is required. the corresponding basic matrix is selected from the
In the visual encryption scheme proposed by Naor and C0 according to the value in the pseudo-random matrix.
Shamir, share image A pixels in the basic matrix are randomly
selected, while share image B pixels are to select the other In the case of a black pixel, the rule is as follows. The
basic matrix. These two basic matrices are a pair of. The result position of the black pixel in the secret image is mapped to the
of their encryption is to generate two gray images, which can corresponding position in the pseudo-random matrix, and the
not see the original image information of the two images. So corresponding basic matrix is selected from C1 according to the
the information in secret images can not be obtained. value in the pseudo-random matrix.
D. Reconstructed Secret Image
In the reconstructed secret image, a white or black pixel in
the original secret image is represented by one sub-pixel.
434
Advances in Intelligent Systems Research, volume 133
The basic matrices of the collections of the encoding IV. EXPERIMENTAL RESULTS AND ANALYSIS
matrices C0 and C1 are as follows: Based on the process described above, we constructed a
two-out-of-two visual cryptography experimental scheme. This
0 1 0 1 0 1 1 0 1 0 1 1 0 1 1 0 experiment is based on MATLAB platform. The original image
1 0 1 0 1 0 0 1 0 1 0 1 1 0 0 1 is a 120×120 binary QR image, it is as shown in Fig III. (a).
C0
0 1 0 1
0
1 1 0
1
0 1 0
1
0 0 1
1 0 1 0 1 1 0
1 0 0 1 0 1 0 0 0
1 0 1 0 1 0 0 1 0 1 0 0 1 0 0 1
0 1 0 1 0 1 1 0 1 0 1 0 0 1 1 0
C1
0 1 0 1 0 0 1 0 1 0 1 0 1 1 0
1
0 1 0 1 0 1 1 0 1 0 1 1 1 0 0 1
The principle of pixel superposition based on AND in this
scheme is shown in Fig. II
(a) (b)
(c) (d)
FIGURE III. TWO-OUT-OF-TWO VC SCHEME: (A) THE SECRET
IMAGE WAS ENCODED INTO (B), (C) THE TWO SHARES, AND
WAS (D) DECODED BY SUPERIMPOSING THESE TWO SHARES
WITH 50% LOSS OF CONTRAST. (A) SECRET IMAGE. (B)
SHARE A. (C) SHARE B. (D) DECODED IMAGE
435
Advances in Intelligent Systems Research, volume 133
436