Automatic inspection system and method for security risk of two-dimensional code printed along with book

By encrypting and automatically inspecting the QR code printed in the book, the problem of the existing technology inability to effectively inspect the security risks of QR codes is solved, and the security encryption of QR codes and anti-pirated version of the book is achieved.

CN119808807AActive Publication Date: 2025-04-11CITIC UNITED CLOUD TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510299110.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-13
Publication Date
2025-04-11
Estimated Expiration
2045-03-13

AI Technical Summary

Technical Problem

The existing technology cannot effectively inspect the security risk of QR codes printed with books, resulting in the easy leakage of QR code information and the high risk of book piracy.

Method used

A method of automatic inspection of security risks for printing QR codes for books with books is adopted. By obtaining the book QR code information, converting it into plain text QR code using the public QR code algorithm, and encrypting the plain text QR code using a private encryption algorithm to generate a cipher text QR code. The method includes obtaining the coordinates of the encrypted point, inverting the data to generate a ciphertext QR code, and scanning and decoding the QR code through the verification module to determine the encryption status of the QR code.

Benefits of technology

It realizes the secure encryption of QR code printing in books, ensures that the QR code information is not easy to be leaked, reduces the risk of book piracy, and avoids piracy due to irregular updates of private encryption algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119808807A_ABST
    Figure CN119808807A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic inspection system and method for security risks of two-dimensional codes printed along with books. The method comprises the following steps: acquiring book two-dimensional code information, and converting the book two-dimensional code information into a plaintext two-dimensional code by using a public two-dimensional code algorithm; using a private encryption algorithm to process the first row and the first column of data of the plaintext two-dimensional code to obtain an encryption point coordinate; data at the encryption point coordinates corresponding to the plaintext two-dimensional code is inverted, and a ciphertext two-dimensional code is generated; printing or pasting the ciphertext two-dimensional code on the surface of a book; scanning and converting the ciphertext two-dimensional code by using a public two-dimensional code algorithm, and if recognizable book two-dimensional code information is obtained, indicating that the two-dimensional code is not encrypted, and sending out an alarm; scanning and converting the ciphertext two-dimensional code by using a private encryption algorithm, and if recognizable book two-dimensional code information is obtained, indicating that the two-dimensional code is qualified, and giving out a prompt; and if the unidentifiable book two-dimensional code information is obtained, indicating that the two-dimensional code is wrong, and sending out an alarm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of data security technology, and in particular relates to a system and method for automatically inspecting the security risks of two-dimensional codes printed along with books. Background Art

[0002] Books are printed or pasted with QR codes, but the QR codes are usually generated in plain text, which makes it easy for information to be leaked and used by book pirates. Although there are existing solutions to encrypt QR code information, due to the wide geographical distribution of books, the existing technology cannot enable book users and managers in various places to easily inspect the security risks of QR codes printed with books. Summary of the invention

[0003] The present invention provides a method for automatically inspecting the security risks of a two-dimensional code printed with a book, the method comprising the following steps:

[0004] S101. Obtain the book QR code information and convert it into a plain text QR code using a public QR code algorithm;

[0005] S102. Use a private encryption algorithm to process the first row and first column of the plaintext QR code to obtain the coordinates of the encryption point; the private encryption algorithm is updated irregularly;

[0006] S103. Reverse the data at the coordinates of the encrypted point corresponding to the plaintext QR code to generate a ciphertext QR code;

[0007] S104. Print or paste the encrypted QR code on the surface of the book;

[0008] S105. Use a public QR code algorithm to scan and convert the encrypted QR code. If recognizable book QR code information is obtained, it means that the QR code is not encrypted and a warning is issued;

[0009] S106. Scan and convert the ciphertext QR code using a private encryption algorithm. If a recognizable book QR code is obtained, the QR code is qualified and a prompt is issued; if an unrecognizable book QR code is obtained, the QR code is wrong and a warning is issued;

[0010] Further, step S101 specifically includes:

[0011] S1011. Get the book QR code information and confirm the encoding format according to the book QR code information type;

[0012] S1012. Encode the book QR code information data and convert the book QR code information data into binary data;

[0013] S1013. Add error correction code and use BCH Code Reed - Solomon error correction algorithm to process binary data to generate error correction codewords;

[0014] S1014. Construct the final data, arrange the binary data and error correction codewords, and arrange the binary data and error correction codewords into blocks according to the QR code specification;

[0015] S1015. Fill data, fill the binary data and error correction codeword into the QR Code matrix;

[0016] Specifically,

[0017]

[0018] in, is the data matrix of the plaintext two-dimensional code obtained, For the book QR code information, It is the QRCode encoding algorithm function. is the error correction algorithm, It is the QR code data.

[0019] Furthermore, step S101 further includes:

[0020] S1016. Select the mask mode for data masking;

[0021] S1017. Add format information and version information, the format information includes error correction level and mask mode.

[0022] Further, step S102 specifically includes:

[0023] S1021. Concatenate the first row and first column of the plaintext QR code into a string S, and use a hash function to encrypt the string S to generate a key key;

[0024] S1022. Use the AES encryption algorithm to encrypt the string S again with the key key.

[0025]

[0026] in, is the string obtained after encryption, The string obtained by concatenating the first row and the first column of data. is the AES encryption algorithm, is a hash encryption function;

[0027] S1023. The encrypted character string is grouped according to the size of the QR code, and each group corresponds to a coordinate (x, y).

[0028]

[0029]

[0030] in, is the string obtained after encryption, , Respectively The horizontal and vertical coordinate values ​​of the encrypted coordinates, is the number of coordinates, , is the ceiling function, is the length of the encrypted string, is the side length of the plaintext QR code, represent After grouping The sum of the group values ​​for the group.

[0031] Further, step S103 specifically includes:

[0032] According to the encrypted point coordinates, the data at the corresponding position in the plaintext QR code is reversed.

[0033]

[0034] in for The data corresponding to the plaintext QR code at the position, the data is 0 or 1, Represents the exclusive-or operation.

[0035] Further, step S105 specifically includes:

[0036] S1051. Perform grayscale and binarization preprocessing operations on the scanned image;

[0037] S1052. Determine the position and direction of the QR code by identifying the positioning group and separator features in the QR code;

[0038] S1053. According to the QR Code encoding rules, the data area in the QR code is decoded to extract the original data information;

[0039] S1054. Perform error correction processing on the decoded data using the BCH Code Reed-Solomon error correction algorithm to restore the correct data information. If the decoded data information meets the format and content requirements of the book QR code, it means that the QR code is not encrypted and a warning is issued;

[0040] The specific process includes the following:

[0041]

[0042] in, To identify the results, To obtain the book QR code image, is the image preprocessing function, It is the QR Code decoding algorithm.

[0043] Further, step S106 specifically includes:

[0044] S1061. Perform grayscale and binarization preprocessing operations on the scanned image;

[0045] S1062. Determine the position and direction of the QR code by identifying the positioning group and separator features in the QR code;

[0046] S1063. Use the private encryption algorithm and key key used in step S102 to perform an inverse operation on the first row and first column of the QR code data to obtain the coordinates of the decryption point;

[0047] S1064. Perform an inversion operation on the data at the decryption point coordinates in the ciphertext two-dimensional code to restore the plaintext two-dimensional code data;

[0048] S1065. Decode the restored plaintext QR code using the QR Code decryption algorithm, extract the book QR code information, and compare and verify it with the book information stored in the system. If they are consistent, the QR code is qualified and a prompt is issued; if they are inconsistent or cannot be decoded, it means that the QR code is wrong and a warning is issued;

[0049] The specific process includes:

[0050]

[0051] in, To identify the results, It is the QR Code decoding algorithm. is the obtained book QR code image, is the image preprocessing function, The key used by the encryption algorithm. It is the inverse operation function of the encryption algorithm.

[0052] The present invention also relates to an automatic inspection system for security risks of two-dimensional codes printed on books, the system adopts the automatic inspection method for security risks of two-dimensional codes printed on books as described above, and the system comprises:

[0053] The conversion module is used to obtain the book QR code information and convert it into a plain text QR code using a public QR code algorithm;

[0054] An encryption module, used to process the first row and first column of the plaintext two-dimensional code using a private encryption algorithm to obtain the encrypted point coordinates; the private encryption algorithm is updated irregularly;

[0055] A generation module, used for inverting the data at the coordinates of the encrypted points corresponding to the plaintext QR code to generate a ciphertext QR code;

[0056] The verification module is used to first use a public QR code algorithm to scan and convert the ciphertext QR code. If recognizable book QR code information is obtained, it means that the QR code is not encrypted and a warning is issued; then, use a private encryption algorithm to scan and convert the ciphertext QR code. If recognizable book QR code information is obtained, it means that the QR code is qualified and a prompt is issued; if unrecognizable book QR code information is obtained, it means that the QR code is wrong and a warning is issued.

[0057] The present invention also relates to a computer program product, which includes a computer program. The computer program is executed by a processor and is used to execute the automatic inspection method for security risks of two-dimensional codes printed with books as described above.

[0058] The present invention also relates to a computer-readable storage medium, which is used to store a computer program. The computer program is executed by a processor to execute the automatic inspection method for security risks of two-dimensional codes printed with books as described above.

[0059] The technical solution of the present invention realizes the security guarantee of the QR code printed with the book by extracting the key features of the QR code and adopting a private algorithm for encryption processing. Moreover, since the private algorithm is easy to share, it can meet the requirements of book users and managers in various places to easily inspect the security risks of the QR code printed with the book, and the private algorithm can be updated from time to time to change the encryption method and avoid piracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 The present invention is a structural block diagram of an automatic inspection system for security risks of two-dimensional codes printed with books. DETAILED DESCRIPTION

[0061] The present invention will be further described below in conjunction with the accompanying drawings. The following examples are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the scope of protection of the present invention. It should be pointed out that the following detailed description is exemplary and is intended to provide further explanation of the present invention.

[0062] Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those generally understood by those of ordinary skill in the art to which the present invention belongs. It should be noted that the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0063] Embodiment 1 of the present invention relates to a method for automatically inspecting the security risks of a two-dimensional code printed with a book, the method comprising the following steps:

[0064] S101. Obtain the book's QR code information and convert it into a plain text QR code using a public QR code algorithm.

[0065] The specific process includes the following:

[0066] S1011. Obtain the book's QR code information and confirm the encoding format according to the book's QR code information type.

[0067] S1012. Encode the book's two-dimensional code information data and convert the book's two-dimensional code information data into binary data.

[0068] S1013. Add error correction code and use BCH Code Reed-Solomon error correction algorithm to process binary data to generate error correction codewords.

[0069] S1014. Construct the final data, arrange the binary data and the error correction codewords, and arrange the binary data and the error correction codewords into blocks according to the specifications of the QR code.

[0070] S1015. Fill data, fill the binary data and error correction codeword into the QR Code matrix.

[0071] S1016. Select a mask mode to perform data mask processing.

[0072] S1017. Add format information and version information, the format information includes error correction level and mask mode.

[0073] Specifically,

[0074]

[0075] in, is the data matrix of the plaintext two-dimensional code obtained, For the book QR code information, It is the QRCode encoding algorithm function. is the error correction algorithm, It is the QR code data.

[0076] S102. Use a private encryption algorithm to process the first row and first column of data in the plaintext QR code to obtain the encrypted point coordinates.

[0077] The private encryption algorithm is updated irregularly.

[0078] Specifically include:

[0079] S1021. Concatenate the first row and first column of the plaintext QR code into a string S, and use a hash function to encrypt the string S to generate a key key.

[0080] S1022. Use the AES encryption algorithm to encrypt the string S again with the key key.

[0081]

[0082] in, is the string obtained after encryption, The string obtained by concatenating the first row and the first column of data. is the AES encryption algorithm, A hash encryption function.

[0083] S1023. The encrypted character string is grouped according to the size of the QR code, and each group corresponds to a coordinate (x, y).

[0084]

[0085]

[0086] in, is the string obtained after encryption, , Respectively The horizontal and vertical coordinate values ​​of the encrypted coordinates, is the number of coordinates, , is the ceiling function, is the length of the encrypted string, is the side length of the plaintext QR code, represent After grouping The sum of the group values ​​for the group.

[0087] S103. Reverse the data at the coordinates of the encryption point corresponding to the plaintext two-dimensional code to generate a ciphertext two-dimensional code.

[0088] The result of the above reversal, visually speaking, is that the small squares at the corresponding points in the plain text QR code turn from black to white or from white to black.

[0089] Specifically include:

[0090] According to the encrypted point coordinates, the data at the corresponding position in the plaintext QR code is reversed.

[0091]

[0092] in for The data corresponding to the plaintext QR code at the position, the data is 0 or 1, Represents the exclusive-or operation.

[0093] S104. Print or paste the encrypted QR code on the surface of the book.

[0094] S105. Use a public QR code algorithm to scan and convert the encrypted QR code. If recognizable book QR code information is obtained, it means that the QR code is not encrypted and a warning is issued.

[0095] Specifically include:

[0096] S1051. Perform grayscale and binarization preprocessing operations on the scanned image.

[0097] S1052. Determine the position and direction of the QR code by identifying the positioning group and separator features in the QR code.

[0098] S1053. According to the coding rules of the QR Code, the data area in the QR code is decoded to extract the original data information.

[0099] S1054. Use the BCH Code Reed-Solomon error correction algorithm to perform error correction processing on the decoded data and restore the correct data information. If the decoded data information meets the format and content requirements of the book QR code, it means that the QR code is not encrypted and a warning is issued.

[0100] The specific process includes the following:

[0101]

[0102] in, To identify the results, To obtain the book QR code image, is the image preprocessing function, It is the QR Code decoding algorithm.

[0103] S106. Use a private encryption algorithm to scan and convert the ciphertext QR code. If recognizable book QR code information is obtained, it means that the QR code is qualified and a prompt is issued; if unrecognizable book QR code information is obtained, it means that the QR code is wrong and a warning is issued.

[0104] This step specifically includes:

[0105] S1061. Perform grayscale and binarization preprocessing operations on the scanned image.

[0106] S1062. Determine the position and direction of the QR code by identifying the positioning group and separator features in the QR code.

[0107] S1063. Use the private encryption algorithm and key key used in step S102 to perform an inverse operation on the first row and first column data of the QR code to obtain the coordinates of the decryption point.

[0108] S1064. Perform a reverse operation on the data at the decryption point coordinates in the ciphertext QR code to restore the plaintext QR code data.

[0109] S1065. Decode the restored plaintext QR code using the QR Code decryption algorithm, extract the book QR code information, and compare and verify it with the book information stored in the system. If they are consistent, the QR code is qualified and a prompt is issued; if they are inconsistent or cannot be decoded, it means that the QR code is wrong and a warning is issued.

[0110] The specific process is as follows:

[0111]

[0112] in, To identify the results, It is the QR Code decoding algorithm. is the obtained book QR code image, is the image preprocessing function, The key used by the encryption algorithm. It is the inverse operation function of the encryption algorithm.

[0113] Embodiment 2 of the present invention relates to a system for automatically inspecting the security risks of two-dimensional codes printed on books. The system adopts a method for automatically inspecting the security risks of two-dimensional codes printed on books as in Embodiment 1, as shown in the attached Figure 1 As shown, the system comprises:

[0114] The conversion module is used to obtain the book QR code information and convert it into a plain text QR code using a public QR code algorithm.

[0115] The encryption module is used to process the first row and first column data of the plaintext two-dimensional code using a private encryption algorithm to obtain the coordinates of the encryption point; the private encryption algorithm is updated irregularly.

[0116] The generating module is used to invert the data at the coordinates of the encrypted points corresponding to the plaintext two-dimensional code to generate a ciphertext two-dimensional code.

[0117] The verification module is used to first use a public QR code algorithm to scan and convert the ciphertext QR code. If recognizable book QR code information is obtained, it means that the QR code is not encrypted and a warning is issued; then, use a private encryption algorithm to scan and convert the ciphertext QR code. If recognizable book QR code information is obtained, it means that the QR code is qualified and a prompt is issued; if unrecognizable book QR code information is obtained, it means that the QR code is wrong and a warning is issued.

[0118] Embodiment 3 of the present invention relates to a computer program product, which includes a computer program. The computer program is executed by a processor to execute a method based on multimodal intelligent sorting of Embodiment 1.

[0119] Embodiment 4 of the present invention relates to a computer-readable storage medium, which is used to store a computer program. The computer program is executed by a processor to execute a method based on multimodal intelligent sorting of Embodiment 1.

[0120] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the protection scope of the present invention.

Claims

1. A method for automatically inspecting the security risks of QR codes printed on books, characterized in that: The method comprises the following steps: S101. Obtain the book QR code information and convert it into a plain text QR code using a public QR code algorithm; S102. Use a private encryption algorithm to process the first row and first column of the plaintext QR code to obtain the coordinates of the encryption point; the private encryption algorithm is updated irregularly; S103. Reverse the data at the coordinates of the encrypted point corresponding to the plaintext QR code to generate a ciphertext QR code; S104. Print or paste the encrypted QR code on the surface of the book; S105. Use a public QR code algorithm to scan and convert the encrypted QR code. If recognizable book QR code information is obtained, it means that the QR code is not encrypted and a warning is issued; S106. Use a private encryption algorithm to scan and convert the ciphertext QR code. If recognizable book QR code information is obtained, it means that the QR code is qualified and a prompt is issued; if unrecognizable book QR code information is obtained, it means that the QR code is wrong and a warning is issued.

2. According to claim 1, a method for automatically inspecting the security risks of a two-dimensional code printed with a book is characterized in that: Step S101 specifically includes: S1011. Get the book QR code information and confirm the encoding format according to the book QR code information type; S1012. Encode the book QR code information data and convert the book QR code information data into binary data; S1013. Add error correction code and use BCH Code Reed - Solomon error correction algorithm to process binary data to generate error correction codewords; S1014. Construct the final data, arrange the binary data and error correction codewords, and arrange the binary data and error correction codewords into blocks according to the QRcode specification; S1015. Fill data, fill the binary data and error correction codeword into the QR Code matrix; Specifically, ; in, is the data matrix of the plaintext two-dimensional code obtained, For the book QR code information, It is the QR Code encoding algorithm function. is the error correction algorithm, It is the QR code data.

3. The method for automatically inspecting the security risks of a two-dimensional code printed with a book according to claim 1, characterized in that: Step S101 further includes: S1016. Select the mask mode for data masking; S1017. Add format information and version information, the format information includes error correction level and mask mode.

4. The method for automatically inspecting the security risks of a two-dimensional code printed with a book according to claim 1, characterized in that: Step S102 specifically includes: S1021. Concatenate the first row and first column of the plaintext QR code into a string S, and use a hash function to encrypt the string S to generate a key key; S1022. Use the AES encryption algorithm to encrypt the string S again with the key key. ; in, is the string obtained after encryption, The string obtained by concatenating the first row and the first column of data. is the AES encryption algorithm, is a hash encryption function; S1023. The encrypted character string is grouped according to the size of the QR code, and each group corresponds to a coordinate (x, y). ; ; in, is the string obtained after encryption, , Respectively The horizontal and vertical coordinate values ​​of the encrypted coordinates, is the number of coordinates, , is the ceiling function, is the length of the encrypted string, is the side length of the plaintext QR code, represent After grouping The sum of the group values ​​for the group.

5. The method for automatically inspecting the security risks of a two-dimensional code printed with a book according to claim 1, characterized in that: Step S103 specifically includes: According to the encrypted point coordinates, the data at the corresponding position in the plaintext QR code is reversed. ; in for The data corresponding to the plaintext QR code at the position, the data is 0 or 1, Represents the exclusive-or operation.

6. The method for automatically inspecting the security risks of a two-dimensional code printed with a book according to claim 1, characterized in that: Step S105 specifically includes: S1051. Perform grayscale and binarization preprocessing operations on the scanned image; S1052. Determine the position and direction of the QR code by identifying the positioning group and separator features in the QR code; S1053. According to the QR Code encoding rules, the data area in the QR code is decoded to extract the original data information; S1054. Perform error correction processing on the decoded data using the BCH Code Reed-Solomon error correction algorithm to restore the correct data information. If the decoded data information meets the format and content requirements of the book QR code, it means that the QR code is not encrypted and a warning is issued; The specific process includes the following: ; in, To identify the results, To obtain the book QR code image, is the image preprocessing function, It is the QR Code decoding algorithm.

7. The method for automatically inspecting the security risks of a two-dimensional code printed with a book according to claim 1, characterized in that: Step S106 specifically includes: S1061. Perform grayscale and binarization preprocessing operations on the scanned image; S1062. Determine the position and direction of the QR code by identifying the positioning group and separator features in the QR code; S1063. Use the private encryption algorithm and key key used in step S102 to perform an inverse operation on the first row and first column of the QR code data to obtain the coordinates of the decryption point; S1064. Perform an inversion operation on the data at the decryption point coordinates in the ciphertext two-dimensional code to restore the plaintext two-dimensional code data; S1065. Decode the restored plaintext QR code using the QR Code decryption algorithm, extract the book QR code information, and compare and verify it with the book information stored in the system. If they are consistent, the QR code is qualified and a prompt is issued; if they are inconsistent or cannot be decoded, it means that the QR code is wrong and a warning is issued; The specific process includes: ; in, To identify the results, It is the QR Code decoding algorithm. is the obtained book QR code image, is the image preprocessing function, The key used by the encryption algorithm. It is the inverse operation function of the encryption algorithm.

8. A system for automatically inspecting the security risks of two-dimensional codes printed on books, the system adopts a method for automatically inspecting the security risks of two-dimensional codes printed on books as described in any one of claims 1 to 7, characterized in that: The system comprises: The conversion module is used to obtain the book QR code information and convert it into a plain text QR code using a public QR code algorithm; An encryption module, used to process the first row and first column of the plaintext QR code using a private encryption algorithm to obtain the encrypted point coordinates; A generation module, used for inverting the data at the coordinates of the encrypted points corresponding to the plaintext QR code to generate a ciphertext QR code; The verification module is used to first use a public QR code algorithm to scan and convert the ciphertext QR code. If recognizable book QR code information is obtained, it means that the QR code is not encrypted and a warning is issued; then, use a private encryption algorithm to scan and convert the ciphertext QR code. If recognizable book QR code information is obtained, it means that the QR code is qualified and a prompt is issued; if unrecognizable book QR code information is obtained, it means that the QR code is wrong and a warning is issued.

9. A computer program product, characterized in that The computer program product comprises a computer program, which is executed by a processor and is used to execute a method for automatically inspecting security risks of a two-dimensional code printed with a book as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is executed by a processor to execute the method for automatically inspecting the security risks of a two-dimensional code printed with a book as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Information encryption and decryption method based on two-dimensional code

    CN112134687A

  • Two-dimensional code processing method and device, electronic equipment and storage medium

    CN115248924A

  • Two-dimensional code construction method and device, decoding method and device, equipment and storage medium

    CN117371475A

  • Two-dimensional code offline verification method and system, and storage medium

    CN117857060A

  • Two-dimensional code and its scanning device

    JP2009093443A