CN105718978B - QR code generation method and device, and decoding method and device - Google Patents

QR code generation method and device, and decoding method and device Download PDF

Info

Publication number
CN105718978B
CN105718978B CN201410728415.0A CN201410728415A CN105718978B CN 105718978 B CN105718978 B CN 105718978B CN 201410728415 A CN201410728415 A CN 201410728415A CN 105718978 B CN105718978 B CN 105718978B
Authority
CN
China
Prior art keywords
module
data
matrix
module matrix
code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410728415.0A
Other languages
Chinese (zh)
Other versions
CN105718978A (en
Inventor
王乾
陈懿
高志刚
孟繁杰
袁俊玲
屈国锋
王明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Aisino Corp
Original Assignee
Aisino Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Aisino Corp filed Critical Aisino Corp
Priority to CN201410728415.0A priority Critical patent/CN105718978B/en
Publication of CN105718978A publication Critical patent/CN105718978A/en
Application granted granted Critical
Publication of CN105718978B publication Critical patent/CN105718978B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a QR code generation method and device and a decoding method and device, wherein the QR code generation method comprises the following steps: encrypting data to be generated into a QR code to obtain ciphertext data; generating a first module matrix corresponding to the ciphertext data; and transforming the first module matrix to obtain a second module matrix. The QR code decoding method comprises the following steps: converting a first matrix module obtained by identifying a QR code to be decoded to obtain a second matrix module; decoding the second matrix module to obtain first data; and decrypting the first data to obtain second data represented by the QR code to be decoded. By the invention, the QR safety is improved.

Description

QR code generation method and device, and decoding method and device
Technical Field
The present invention relates to the field of computers, and in particular, to a method and an apparatus for generating a Quick Response (QR) code, and a method and an apparatus for decoding the QR code.
Background
Two-dimensional codes are widely applied in various industries, and have the remarkable advantages of large amount of stored information, various represented information, high reliability, strong secrecy and anti-counterfeiting performance and the like, so that a plurality of limitations of one-dimensional bar codes are made up. The two-dimensional code is classified according to the bar code pattern, and is generally classified into a matrix type and a stack type.
The QR code is a two-dimensional code which is widely applied at present and belongs to a matrix type two-dimensional code. The information contained in the QR codes is more and more extensive at present, and any QR code can be decoded by an identification program to obtain data, so that the problem of data information security exists. The QR code brings convenience to information acquisition, and meanwhile, data safety cannot be guaranteed. If the information contained in the QR code is important and the identification program cannot directly decode the data information, it is necessary to implement various security processes on the QR code.
Aiming at the problem of how to improve the security of the QR code in the related art, an effective solution is not provided at present.
Disclosure of Invention
The invention provides a QR code generation method and device, a QR code decoding method and device aiming at the problem of security of QR codes, and aims to at least solve the problem.
According to an aspect of the present invention, there is provided a method for generating a QR code, including: encrypting data to be generated into a QR code to obtain ciphertext data; generating a first module matrix corresponding to the ciphertext data; and transforming the first module matrix to obtain a second module matrix.
Optionally, transforming the first module matrix to obtain a second module matrix, including: and carrying out XOR operation on a pre-generated third module matrix and the first module matrix to obtain a second module matrix.
Optionally, the generating the third module matrix in advance includes: acquiring the size of the first module matrix; and generating a third module matrix with the same size as the first module matrix by using preset data.
Optionally, after transforming the first module matrix to obtain a second module matrix, the method further includes: and performing mask processing on the second module matrix.
According to another aspect of the present invention, there is provided a method of decoding a QR code, including: converting a first matrix module obtained by identifying a QR code to be decoded to obtain a second matrix module; decoding the second matrix module to obtain first data; and decrypting the first data to obtain second data represented by the QR code to be decoded.
Optionally, the transforming the first matrix module obtained by identifying the QR code to be decoded to obtain a second matrix module includes: and carrying out XOR operation on a pre-generated third module matrix and the first module matrix to obtain a second module matrix.
According to still another aspect of the present invention, there is provided a QR code generation apparatus including: the encryption module is used for encrypting the data to be generated into the QR code to obtain ciphertext data; the first generating module is used for generating a first module matrix corresponding to the ciphertext data; and the transformation module is used for transforming the first module matrix to obtain a second module matrix.
Optionally, the transformation module is configured to perform an exclusive or operation on a pre-generated third module matrix and the first module matrix to obtain a second module matrix.
Optionally, the apparatus further comprises:
and the third generation module is used for acquiring the size of the first module matrix and generating a third module matrix with the same size as the first module matrix by using preset data.
Optionally, the apparatus further comprises: and the processing module is used for performing mask processing on the second module matrix.
According to still another aspect of the present invention, there is provided a QR code decoding apparatus including: the conversion module is used for converting a first matrix module obtained by identifying the QR code to be decoded to obtain a second matrix module; the decoding module is used for decoding the second matrix module to obtain first data; and the decryption module is used for decrypting the first data to obtain second data represented by the QR code to be decoded.
Optionally, the transformation module is configured to perform an exclusive or operation on a pre-generated third module matrix and the first module matrix to obtain a second module matrix.
According to the method and the device, the data of the QR code to be generated is encrypted to obtain the ciphertext data, so that the safety of the data is ensured, then the password data is encoded to obtain the module matrix of the ciphertext data, the module matrix of the ciphertext data is transformed to obtain the encrypted module matrix, and the safety of the data is further ensured.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a flowchart of a QR code generation method according to an embodiment of the present invention;
fig. 2 is a block diagram of a configuration of a QR code generation apparatus according to an embodiment of the present invention;
fig. 3 is a flowchart of a decoding method of a QR code according to an embodiment of the present invention;
fig. 4 is a block diagram of a structure of a QR code decoding apparatus according to an embodiment of the present invention;
fig. 5 is a flow chart illustrating a process of generating a QR code according to an alternative example of the embodiment of the present invention; and
fig. 6 is a schematic diagram of a data structure involved in the generation process of a QR code according to an alternative example of the embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
In the following embodiments, the first, second and the like do not limit the order of precedence, but merely distinguish different objects. In addition, it is contemplated that the methods and apparatus in the following embodiments may be implemented by a computer program, which may be executed on a device including a processor and a memory, or may be executed on a distributed platform, and the present invention is not limited thereto.
According to one aspect of the embodiment of the invention, a QR code generation method and a QR code generation device are provided.
Fig. 1 is a flowchart of a QR code generation method according to an embodiment of the present invention, and as shown in fig. 1, the method includes steps 101 to 103:
step 101, encrypting data to be generated into a QR code to obtain ciphertext data;
102, generating a first module matrix corresponding to the ciphertext data;
and 103, transforming the first module matrix to obtain a second module matrix.
In an optional implementation manner of the embodiment of the present invention, the step 103 of transforming the first module matrix to obtain a second module matrix may include: and carrying out XOR operation on a pre-generated third module matrix and the first module matrix to obtain a second module matrix. In this alternative embodiment, the third module matrix may be considered to be the module matrix that acts as an encryption for the first module matrix.
Further, in an optional implementation manner of the embodiment of the present invention, the generating the third module matrix in advance may include: acquiring the size of the first module matrix; and generating a third module matrix with the same size as the first module matrix by using preset data. In this alternative embodiment, the preset data may be regarded as data for encrypting the first module matrix. With this alternative embodiment, the third module matrix and the first module matrix are made to be the same size, thereby facilitating the exclusive-or operation.
Of course, in the embodiment of the present invention, the third module matrix may also have a different size from the first module matrix.
In an optional implementation manner of the embodiment of the present invention, after the step 103 transforms the first module matrix to obtain a second module matrix, the method may further include: and performing mask processing on the second module matrix. By this embodiment, a uniform distribution of black and white modules of the module matrix can be achieved.
In this embodiment of the present invention, as an example, the encryption method used in encrypting the data to be generated into the QR code in step 101 may be an encryption method without changing the length, that is, the lengths before and after the data encryption are the same.
Fig. 2 is a block diagram of a QR code generation apparatus according to an embodiment of the present invention, and as shown in fig. 2, the apparatus mainly includes: the encryption module 210 is configured to encrypt data to be generated into a QR code to obtain ciphertext data; the first generating module 220 is connected to the encrypting module 210 and configured to generate a first module matrix corresponding to the ciphertext data; and the transforming module 230 is connected to the first generating module 220, and is configured to transform the first module matrix to obtain a second module matrix.
In an optional implementation manner of the embodiment of the present invention, the transformation module 230 is configured to perform an exclusive or operation on a pre-generated third module matrix and the first module matrix to obtain a second module matrix.
In an optional implementation manner of the embodiment of the present invention, the apparatus further includes: and a second generating module, connected to the transforming module 230, configured to obtain a size of the first module matrix, and generate a third module matrix with the same size as the first module matrix by using preset data.
Furthermore, in an optional implementation manner of the embodiment of the present invention, the apparatus further includes: and the processing module is connected with the transforming module 230 and is configured to transform the first module matrix to obtain a second module matrix, and then perform mask processing on the second module matrix.
According to another aspect of the embodiment of the invention, a QR code decoding method and device are provided. The decoding of the QR code corresponds to the generation of the QR code.
Fig. 3 is a flowchart of a QR code decoding method according to an embodiment of the present invention, and as shown in fig. 3, the method includes steps 301 to 303:
step 301, converting a first matrix module obtained by identifying a QR code to be decoded to obtain a second matrix module;
step 302, decoding the second matrix module to obtain first data;
and step 303, decrypting the first data to obtain second data represented by the QR code to be decoded.
Optionally, corresponding to the generation of the QR code, the transforming, in step 301, the first matrix module obtained by identifying the QR code to be decoded to obtain the second matrix module may include: and carrying out XOR operation on a pre-generated third module matrix and the first module matrix to obtain a second module matrix.
Decoding is the reverse process of generation, and the same parts as the generation process are not described herein again.
Fig. 4 is a block diagram of a QR code decoding apparatus according to an embodiment of the present invention, and as shown in fig. 4, the apparatus mainly includes: the transformation module 410 is used for transforming a first matrix module obtained by identifying a QR code to be decoded to obtain a second matrix module; the decoding module 420 is connected to the transforming module 410, and is configured to decode the second matrix module to obtain first data; and the decryption module 430 is connected to the decoding module 420, and is configured to decrypt the first data to obtain second data represented by the QR code to be decoded.
Optionally, the transformation module 410 is configured to perform an exclusive or operation on a pre-generated third module matrix and the first module matrix to obtain a second module matrix.
Decoding is the reverse process of generation, and the same parts as the generation process are not described herein again.
An alternative example of an embodiment of the invention is described below.
The embodiment of the invention provides a safer QR code generation method, so that the generated QR code can be successfully decoded only under the condition of a known generation method and a key, otherwise, an identification program cannot solve data.
In the embodiment of the invention, on one hand, the encryption algorithm is used for encrypting plaintext data, and on the other hand, the generated data module matrix is subjected to chaotic processing, so that the generated data module matrix cannot pass through an error correction method during normal error correction, the aim of outputting the decoded data is fulfilled, and a secondary security system in a data security link is formed. Readability is to ensure that the attribute characteristics of the QR code cannot be changed, and any available identification method can acquire the module matrix and the parameter information.
In order to ensure the safety and readability, the basic flow of the secondary safety QR code generation is shown in FIG. 5. As shown in fig. 5, the encryption algorithm encrypts plaintext data using the Key1 to generate a ciphertext QR code module matrix C. Using the Key2, a QR code K is generated. And performing XOR operation on the QR code C and the K as a data coding region module to obtain a transformation matrix, and finally generating a safe QR code S. The common QR code identification program can not decode and output the S code, and can correctly solve the plaintext data only under the condition of knowing two secret keys, and the process ensures enough guarantee on the safety. The whole encryption process is to the processing of the data coding region module in the QR code, the locator of the QR code and the parameter information module are not changed, thereby ensuring that the identification stage can not be carried out due to the data encryption transformation. The decoding process is shown as a dashed line process in fig. 5, which is the inverse of the generation. And after the mask of the safe QR code S is removed, the safe QR code S is subjected to modular XOR with a QR code matrix of a known Key Key2 to generate another modular matrix, namely a ciphertext matrix, and the ciphertext matrix is decoded and then decrypted by using a Key Key1 to obtain plaintext data.
The scheme of this example is described in detail below.
Encryption scheme
The encryption of plaintext data uses a rijndael symmetric encryption algorithm developed by belgium scientist Vincent Rijimen and Joan Daemen, whose key length may be 128 bits, 192 bits or 256 bits, making it more robust and reliable than DES, while the variability of the key length allows a more secure key length to be selected for different data volumes.
The Rijindael algorithm is block encryption, and encrypted data are divided into data blocks with the same length according to the length of a secret key and then subjected to iterative encryption transformation. If the ciphertext data is divided into the last insufficient packet length, padding data is added, so that the final ciphertext length is larger than or equal to the plaintext length. Because the Rijindael algorithm keys are large in length, the difference between the ciphertext length and the plaintext length is uncertain, and the maximum difference is more than 30 bytes. In the case that the data length of the plain text is less than the length of the last packet, if the data amount is close to or reaches a certain version of the QR code and the data amount that can be accommodated by error correction, the data amount of the ciphertext increases, so that the required version of the QR code to be generated is higher than the version of the plain text. This introduces uncertainty in the choice of the QR code version after encryption of the plaintext, and in some cases the QR code version needs to be fixed. To avoid this problem, a constant length encryption method is used to keep the ciphertext length consistent with the plaintext length.
When the length is larger than a block length and is not the plaintext with integral multiple of the block length, the plaintext part with integral multiple is encrypted once, and then the last part of bytes of the ciphertext is taken to be connected with the part of the plaintext which is not the last block to form a block length. Fig. 6 is a process of encrypting a plaintext 25 bytes in length using the rijndael algorithm 128-bit key.
As shown in fig. 6, the length of data to be encrypted is 25 bytes. After the first whole group (1-16 codes) is encrypted, the ciphertexts of the 10 th-16 th codes and the tail part (17-25 codes) are intercepted to form a whole group for encryption, and the ciphertexts obtained by encryption are connected with the 9 th code of the previous group. Among them, the 10 th to 16 th codes are actually subjected to secondary encryption, and secondary decryption should be performed also at the time of decryption. This scheme ensures, on the one hand, that the data is encrypted in 128-bit packets, and on the other hand, that the data length does not change after encryption. The decryption process is to perform decryption operations in the reverse order, so that corresponding plaintext can be obtained.
In order to ensure the plain text with the minimum key length which is less than the Rijindael symmetric encryption algorithm, namely the security of the data with the length less than 16 bytes, a DES symmetric encryption algorithm is adopted, and the key length is 64 bits. Here again, a constant length encryption scheme is used.
Second, ciphertext QR code generation
The QR code generation can be based on the coding rule of ISO _ IEC-18004-2006, and the encryption scheme of the method is realized on the basis of the generation step.
First, the required version is determined according to the length and type of plaintext data, such as digits, characters or bytes, and the error correction level. Since the ciphertext is a binary data stream, the QR code symbol encoding mode can only select an 8-bit byte mode. Therefore, no matter what type of plaintext is, the encoding also adopts an 8-bit byte mode to determine the QR code version capable of accommodating the data amount.
Secondly, different key lengths are selected according to the QR code version. The Rijindael algorithm is a block encryption mode, and the non-variable-length encryption method provided by the above method is used for ensuring that the QR code version of the ciphertext is consistent with the plaintext. Meanwhile, a longer key can be selected according to the amount of plaintext data, so that the safety is ensured. In the corresponding relation between the QR version and the maximum data information capacity, the version 1 of the '8-bit byte mode' is corrected into M, Q and H, the number of the accommodated bytes is 14, 11 and 7 respectively; the number of bytes that can be accommodated when version 2 error correction is H is 14. The byte lengths of the cipher keys are all smaller than the minimum length 128 bits of the Rijindael algorithm key, and a DES encryption method is adopted under the parameter conditions in order to ensure that the cipher text version is not promoted as much as possible. Where version 1 has an error correction capacity of only 7 bytes and DES is at least 8 bytes, version 2 is used in this case.
For other versions, three length keys are divided into different version intervals: versions 2 to 13 use 128 bit keys, versions 14 to 27 use 192 bit keys, and versions 28 to 40 use 256 bit keys.
And finally, generating a ciphertext module matrix from the ciphertext data according to the encoding rule. And carrying out data encoding on the ciphertext by using an 8-byte mode according to a QR code encoding rule. And generating a required number of error correction code words according to the error correction level, and adding the error correction code words into data coding. And then carrying out module arrangement in a matrix format to form a ciphertext module matrix. At this time, the module position of the format information is not filled and is not masked.
Third, cipher text module matrix transformation
The encryption of the data plaintext is the first step of security guarantee, namely data security guarantee. In order to make the generated QR code unable to decode to obtain ciphertext data when using a common decoding program, a method of module matrix transformation is adopted to make the decoding program unable to decode when the error correction link of decoding fails, and the decoding program unable to decode when the error correction link fails, so that the decoding result of the time cannot be output.
Selecting a section of proper known data string as a key for matrix transformation, generating a module matrix of the section of key according to the generation process of the module matrix of the ciphertext, and performing masking operation to generate a final QR code module matrix. The mode selection in data encoding can be arbitrary, the 8-byte mode does not need to be appointed to use, and the mode selection can be determined according to the key data format; the error correction is not necessarily the same as the ciphertext QR. The generation of the key module matrix is thus the complete generation process of the QR code.
And carrying out XOR operation on the generated key module matrix and the ciphertext module matrix. The matrix modules are divided into two colors "black" and "white" on the image, and each module is a bit in data expression, "black" represents 1, and "white" represents 0. The XOR of the two matrix modules is the XOR operation of the bit data at the corresponding position, and the obtained XOR result forms a transformation module matrix.
Because the two-dimensional matrix needs to perform exclusive-or operation at the corresponding position, the size of the module matrix for transforming the key is the same as that of the ciphertext module matrix, namely the same as the QR code version when the ciphertext matrix is generated. Therefore, the length of the key data is within the range of the data volume which can be accommodated by the corresponding QR code version, and if the key data exceeds the capacity, the version is promoted, so that the two module matrixes have different sizes, and the XOR operation cannot be performed. Several rules in selecting key data and generating process are proposed, which ensure that the difference between the transformation matrix after completing XOR operation and the cipher text matrix is far as possible, so that error correction cannot be performed by direct decoding.
In this example, the lowest version may be selected as the error correction version, so that the data information portion occupies the largest area in the matrix module, and the error correction station occupies a small portion. The amount of key data is as much as possible equal to the version and the capacity achieved by error correction, making the key module matrix layout more chaotic. The generated module matrix needs to be subjected to masking processing, so that black and white modules of the key matrix have uniform distribution.
After the XOR operation obtains the transformation module matrix, according to the QR generating rule, a mask graph is selected for the transformation module matrix, the mask graph is processed, and then the format information module (including the version and error correction when the ciphertext data is coded and the mask number) and the locator are placed at the specified position. Thus, the encrypted and transformed secondary security QR code is finally generated.
In the embodiment, the data is encrypted and plaintext data is encrypted by using a constant-length encryption method, so that the first guarantee of data security is realized. And generating a module matrix of data codes and error correction codes according to the version and the error correction by the ciphertext based on the QR code coding rule. And generating a QR code matrix by using another secret key, and carrying out module transformation processing of exclusive-OR operation on the QR code matrix, so that the error correction cannot be finished due to the transformation processing when the final module matrix is directly subjected to error correction. When the key module matrix is generated, the QR code version is consistent with the version of the generated ciphertext module, so that the XOR operation on the corresponding position can be performed when the matrix XOR is performed. Meanwhile, data for generating the secret key QR code can be ensured not to pass through direct error correction during final QR code decoding by following a certain principle.
From the above description, it can be seen that the present invention achieves the following technical effects: the method for generating the QR code has reliable safety guarantee, and the data has strong safety due to plaintext encryption. And meanwhile, the ciphertext module performs matrix transformation, so that the result cannot be output in normal decoding, and the method has the security of reading refusal. Safety processing is added in the QR code generation process, and the characteristics and parameter information of the generated QR code are not damaged. Therefore, the method can be quickly applied on the basis of the existing QR code generation method and identification method, and does not bring more cost on reconstruction. The encryption method with the unchanged length is applied to the symmetric encryption algorithm, so that the size of the encrypted QR code is kept the same as that of the QR code, and the condition of version change is not needed any more during application. Under the condition that the size of the original QR code is not changed, the safety is enhanced. The existing QR code can not be influenced in printing and recognition.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. A QR code generation method is characterized by comprising the following steps:
encrypting data to be generated into a QR code to obtain ciphertext data; the encryption is realized according to a constant-length encryption method of a Rijndael symmetric encryption algorithm;
grouping the plaintext of the data to be generated into the QR code according to a preset data amount according to a Rijndael symmetric encryption algorithm, and encrypting the plaintext of the data which is grouped into integral multiples for the first time to obtain an initial ciphertext; combining the last part of bytes of the initial ciphertext and the plaintext tail non-integer part of the data into a data size length of one byte, carrying out second encryption, and combining the second encryption result with the initial ciphertext to obtain ciphertext data;
generating a first module matrix corresponding to the ciphertext data;
and transforming the first module matrix to obtain a second module matrix.
2. The method of claim 1, wherein transforming the first module matrix to obtain a second module matrix comprises:
and carrying out XOR operation on a pre-generated third module matrix and the first module matrix to obtain a second module matrix.
3. The method of claim 2, wherein pre-generating the third module matrix comprises:
acquiring the size of the first module matrix;
and generating a third module matrix with the same size as the first module matrix by using preset data.
4. The method according to any of claims 1 to 3, wherein after transforming the first module matrix to obtain a second module matrix, further comprising:
and performing mask processing on the second module matrix.
5. A method for decoding a QR code, comprising:
converting a first module matrix obtained by identifying a QR code to be decoded to obtain a second module matrix;
decoding the second module matrix to obtain first data;
decrypting the first data to obtain second data represented by the QR code to be decoded; the decryption is realized according to a non-variable-length encryption method based on a Rijndael symmetric encryption algorithm.
6. The method according to claim 5, wherein transforming the first module matrix identified by the QR code to be decoded to obtain a second module matrix comprises:
and carrying out XOR operation on a pre-generated third module matrix and the first module matrix to obtain a second module matrix.
7. A QR code generation apparatus, comprising:
the encryption module is used for encrypting the data to be generated into the QR code to obtain ciphertext data; the encryption is realized according to a constant-length encryption method based on a Rijndael symmetric encryption algorithm;
the encryption module groups the plaintext of the data to be generated into the QR code according to a preset data amount according to a Rijndael symmetric encryption algorithm, and encrypts the plaintext of the data which is grouped into integral multiples for the first time to obtain an initial ciphertext; the encryption module makes the last part of bytes of the initial ciphertext and the plaintext tail non-integer part of the data form a data size length of one byte, carries out second encryption, and combines the second encryption result with the initial ciphertext to obtain ciphertext data;
the first generating module is used for generating a first module matrix corresponding to the ciphertext data;
and the transformation module is used for transforming the first module matrix to obtain a second module matrix.
8. The apparatus of claim 7, wherein the transforming module is configured to perform an exclusive-or operation on a pre-generated third module matrix and the first module matrix to obtain a second module matrix.
9. The apparatus of claim 7, further comprising:
and the second generation module is used for acquiring the size of the first module matrix and generating a third module matrix with the same size as the first module matrix by using preset data.
10. The apparatus of any one of claims 7 to 9, further comprising:
and the processing module is used for performing mask processing on the second module matrix before the QR code corresponding to the second module matrix is generated.
11. A QR code decoding apparatus, comprising:
the conversion module is used for converting a first module matrix obtained by identifying the QR code to be decoded to obtain a second module matrix;
the decoding module is used for decoding the second module matrix to obtain first data;
the decryption module is used for decrypting the first data to obtain second data represented by the QR code to be decoded; the decryption is realized according to a non-variable-length encryption method based on a Rijndael symmetric encryption algorithm.
12. The apparatus of claim 11, wherein the transforming module is configured to perform an exclusive-or operation on a pre-generated third module matrix and the first module matrix to obtain a second module matrix.
CN201410728415.0A 2014-12-03 2014-12-03 QR code generation method and device, and decoding method and device Active CN105718978B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410728415.0A CN105718978B (en) 2014-12-03 2014-12-03 QR code generation method and device, and decoding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410728415.0A CN105718978B (en) 2014-12-03 2014-12-03 QR code generation method and device, and decoding method and device

Publications (2)

Publication Number Publication Date
CN105718978A CN105718978A (en) 2016-06-29
CN105718978B true CN105718978B (en) 2020-04-24

Family

ID=56143206

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410728415.0A Active CN105718978B (en) 2014-12-03 2014-12-03 QR code generation method and device, and decoding method and device

Country Status (1)

Country Link
CN (1) CN105718978B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018090192A1 (en) * 2016-11-15 2018-05-24 深圳大学 Image encryption and decryption method and apparatus based on optical encryption and decryption technique
WO2019116396A1 (en) * 2017-12-16 2019-06-20 Seshaasai Business Forms Pvt. Ltd System and method to generate and read qr code thereof
CN109389198A (en) * 2018-09-05 2019-02-26 航天信息股份有限公司 A kind of invoice information storage method and system based on planar bar code technology
CN113240836A (en) * 2021-05-18 2021-08-10 新疆爱华盈通信息技术有限公司 Bluetooth lock connection method adopting two-dimensional code and related configuration system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011008693A (en) * 2009-06-29 2011-01-13 Chugoku Electric Power Co Inc:The Customer personal information booklet, customer personal information management system and method thereof
CN102270312A (en) * 2011-07-19 2011-12-07 北京中科联众科技股份有限公司 Method for making point bitmap, and goods-fleeing prevention verification method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011008693A (en) * 2009-06-29 2011-01-13 Chugoku Electric Power Co Inc:The Customer personal information booklet, customer personal information management system and method thereof
CN102270312A (en) * 2011-07-19 2011-12-07 北京中科联众科技股份有限公司 Method for making point bitmap, and goods-fleeing prevention verification method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于Ising模型的QR码加密算法;周庆,黄党志;《计算机应用》;20131001;第2-3页 *

Also Published As

Publication number Publication date
CN105718978A (en) 2016-06-29

Similar Documents

Publication Publication Date Title
TWI750223B (en) Blockchain encrypted radio frequency chip storage design method
US10009170B2 (en) Apparatus and method for providing Feistel-based variable length block cipher
AU2008327506B2 (en) Method and system for encryption of data
CN108377183B (en) XDR data information encryption method, device, equipment and medium
KR101393806B1 (en) Multistage physical unclonable function system
CN105556880A (en) Method and apparatus for secure communication
JP6588048B2 (en) Information processing device
CN116032474B (en) Safety protection system based on big data computer network
KR101989813B1 (en) Generating and verifying the alternative data in a specified format
CN105718978B (en) QR code generation method and device, and decoding method and device
CN111066077B (en) Encryption device, encryption method, decryption device, and decryption method
KR102169369B1 (en) Countermeasure method of first-order side-channel attack on lightweight block cipher and apparatus using the same
US20160013933A1 (en) Order-preserving encryption system, device, method, and program
CN110704854B (en) Stream type encryption method aiming at text data reserved format
CN114244507B (en) Quantum direct communication method, device, equipment and system based on single-path transmission
CN110663216A (en) Cryptographic apparatus and method
CN115766190B (en) Encryption method, decryption method and electronic equipment for arbitrary set elements
CN114844728B (en) Serialized data secure communication method and big data platform
CN106254304B (en) Method and system for facilitating secure communications
CN110889695A (en) Method and device for saving and recovering private data based on secure multi-party computing
JP5992651B2 (en) ENCRYPTION METHOD, PROGRAM, AND SYSTEM
Kumar et al. A novel approach for securing data in IoTcloud using DNA cryptography and Huffman coding algorithm
CN115632765A (en) Encryption method, decryption device, electronic equipment and storage medium
CN104393988A (en) Reversible data encryption method and device
US11196447B2 (en) Computer-implemented method for error-correction-encoding and encrypting of a file

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant