Anti-counterfeiting identification method based on two-dimensional code
Through a multi-layer nested encryption and cloud verification system, combined with invisible watermarks and anti-counterfeiting knife cutting ring, the problem of QR code being easily cracked and relying on dedicated equipment is solved, achieving high security and convenient anti-counterfeiting recognition, and improving user experience and popularity.
Patent Information
- Application Number
- CN202510466788.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2025-08-19
AI Technical Summary
The existing QR code anti-counterfeiting technology has the problem that encryption at rest is easily cracked, copied, tampered and forged, and relies on special equipment for scanning and verification, which leads to inconvenience in consumers' use.
A multi-layer nested encryption algorithm is used to generate dynamic QR codes, combining invisible watermarks and anti-counterfeiting knife cutting rings, using a smartphone camera to scan and pass the cloud verification system to ensure information security and uniqueness.
It improves the security and anti-counterfeiting effect of QR code information, simplifies the verification process, improves user experience and application popularity, and reduces implementation costs.
Smart Images

Figure CN120509903A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of anti-counterfeiting technology, and in particular to an anti-counterfeiting identification method based on a QR code. Background Art
[0002] With the rapid development of the global economy and the diversification of market demands, the circulation of counterfeit and substandard goods has become an increasingly serious problem, resulting in significant economic losses and reputational risks for consumers and manufacturers. Particularly in industries such as food, pharmaceuticals, luxury goods, and electronics, counterfeiting and counterfeiting not only disrupt market order but also pose a threat to public health and safety. While traditional anti-counterfeiting methods, such as anti-counterfeiting labels, laser engraving, and holograms, can provide some degree of protection, they often suffer from high technical barriers, high costs, and complex implementation. In recent years, QR code technology, as a mature and popular form of identity authentication, has been widely adopted across various industries, particularly in areas such as product traceability and payment verification.
[0003] However, when the existing technology is actually used, the existing QR code anti-counterfeiting technology still has the problem that the QR code static encryption is easy to crack, copy, tamper with and forge, resulting in unsatisfactory anti-counterfeiting effect. In addition, most of the existing QR code anti-counterfeiting systems rely on special equipment for scanning and verification. The inconvenience of consumers' use has also become a major bottleneck for promotion and application. Summary of the Invention
[0004] The purpose of the present invention is to provide an anti-counterfeiting identification method based on QR codes to solve the problems that static encryption of QR codes is easy to crack, copy, tamper with and forge, and that most of them rely on special equipment for scanning and verification, which is inconvenient for consumers to use.
[0005] To achieve the above object, the present invention provides the following technical solution: an anti-counterfeiting identification method based on a QR code, comprising the following steps:
[0006] S1. Generate anti-counterfeiting QR code:
[0007] Collecting product characteristic information to generate a unique identifier, wherein the characteristic information includes at least a production batch number, geographic coordinates, and a timestamp;
[0008] A multi-layer nested encryption algorithm is used to encrypt the unique identifier to generate an encrypted data packet;
[0009] Embed the encrypted data package into the product QR code to generate a dynamic QR code, and embed the invisible watermark anti-counterfeiting feature into the high-frequency area of the QR code;
[0010] Adding an anti-counterfeiting knife-cut ring and a fluorescent material printing hidden information containing a CRC-32 encoded matrix positioning mark to the QR code;
[0011] S2. Mobile terminal verification:
[0012] Scan the QR code on the product with your smartphone camera;
[0013] Performing parallel verification on the two-dimensional code image;
[0014] Automatically identify and parse QR code information;
[0015] Parse and decrypt the encrypted data packet, and verify the validity of the QR code information through the server;
[0016] Extract the invisible watermark anti-counterfeiting features and the image features of the hidden information printed by the fluorescent material, and calculate the feature matching degree;
[0017] Verify whether the anti-counterfeiting knife-cut ring data matches;
[0018] If and only if the data comparison is consistent and the feature matching degree exceeds the preset threshold, it is judged to be authentic;
[0019] S3, server evidence update:
[0020] All valid anti-counterfeiting QR code information is encrypted and stored in the cloud database;
[0021] The server uses a secure communication protocol to ensure that data transmission is not tampered with;
[0022] The database is updated in real time to ensure the timeliness and accuracy of the QR code information.
[0023] Preferably, the step S1 of collecting product feature information to generate a unique identifier specifically includes: using UUIDv4 to generate a random unique identifier.
[0024] Preferably, the step S1 of collecting product feature information to generate a unique identifier specifically includes: generating a unique identifier based on a SHA-3 hash algorithm in combination with a timestamp and a product serial number.
[0025] Preferably, the multi-layer nested encryption algorithm in step S1 is specifically:
[0026] The unique identifier is encrypted using the AES-256 algorithm combined with the PBKDF2 key derivation algorithm to form encrypted data;
[0027] The data encrypted with the AES-256 algorithm is encrypted twice using the RSA-4096 public key to form an encrypted data packet.
[0028] Preferably, the specific operation of embedding the encrypted data packet into the product QR code in step S1 is:
[0029] Convert the encrypted data packet into binary format through Base64 encoding;
[0030] Embed binary data into a QR code to generate a dynamic QR code.
[0031] Preferably, in step S1, embedding the invisible watermark anti-counterfeiting feature into the high-frequency area of the QR code is specifically:
[0032] DCT is used to embed invisible watermark information into the high-frequency area of the QR code.
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] The present invention ensures the security of QR code information through multiple encryption and DCT watermark technology, making it difficult to be cracked and forged. By combining anti-counterfeiting feature patterns and watermarks, the anti-counterfeiting effect is further enhanced. At the same time, all QR code information is stored in a cloud database, and the validity, accuracy and legality are verified in real time to ensure uniqueness and immediacy. It only requires scanning with a smartphone camera, breaking the reliance on dedicated hardware and simplifying operations. Users only need to open the anti-counterfeiting application to achieve instant verification, thereby improving user experience and application popularity. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 The figure is a flow chart of the overall structure of the anti-counterfeiting identification method based on QR code of the present invention. DETAILED DESCRIPTION
[0036] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0037] Example 1
[0038] See also Figure 1 The present invention provides a technical solution: an anti-counterfeiting identification method based on a QR code, comprising the following steps:
[0039] S1. Generate anti-counterfeiting QR code:
[0040] Collecting product characteristic information to generate a unique identifier, wherein the characteristic information includes at least a production batch number, geographic coordinates, and a timestamp, wherein collecting the product characteristic information to generate the unique identifier specifically comprises: generating a random unique identifier using UUIDv4;
[0041] A multi-layer nested encryption algorithm is used to encrypt the unique identifier to generate an encrypted data packet. The multi-layer nested encryption algorithm is specifically as follows:
[0042] The unique identifier is symmetrically encrypted using the AES-256 algorithm, and the key is derived using the PBKDF2 algorithm;
[0043] The encrypted data is asymmetrically encrypted using the RSA-4096 public key to form a digital envelope structure. The RSA-4096 public key is issued by a trusted certificate authority.
[0044] The encrypted data packet is embedded in the product QR code to generate a dynamic QR code, and the invisible watermark anti-counterfeiting feature is embedded in the high-frequency area of the QR code using DCT (discrete cosine transform). The embedding strength coefficient α satisfies 0.2≤α≤0.35. After 500 sets of sample tests, when α=0.25, the watermark maintains an NC value of 0.92±0.03 under attacks such as JPEG compression (QF=70) and Gaussian noise (σ=0.02), and the PSNR>42dB. That is, when α∈[0.2,0.35], the watermark robustness and visual invisibility achieve the best balance. The normalized correlation coefficient NC value is calculated during watermark extraction. When NC>0.85, it is determined to be a valid watermark. The specific operation of embedding the encrypted data packet into the product QR code is as follows:
[0045] Convert the encrypted data packet into binary format through Base64 encoding;
[0046] Embed binary data into a QR code to generate a dynamic QR code;
[0047] An anti-counterfeiting knife-cut ring is added to the QR code. The anti-counterfeiting knife-cut ring is a ring-shaped microstructure, formed by a laser engraving process with a line width of 50μm and an intermittent concentric circle structure. The fracture rate is 30%-40%, and the fracture locations are randomly distributed and recorded in the encrypted data packet. In image recognition, it appears as a fracture texture with specific geometric features, increasing the difficulty of counterfeiting. At the same time, hidden information is printed with fluorescent material containing a CRC-32 encoded matrix positioning mark. Specifically, a ring-shaped check code printed with ultraviolet fluorescent ink is added. The check code includes CRC-32 cyclic redundancy check bits and a matrix positioning mark that appears under ultraviolet light with a wavelength of 365nm.
[0048] S2. Mobile terminal verification:
[0049] After the user scans the QR code with the smartphone camera, the anti-counterfeiting application (App) on the phone will automatically recognize and interpret the QR code. The mobile app goes through the following steps when recognizing the QR code:
[0050] The QR code image information is captured by the mobile phone camera, and the application converts the image into digital data and decodes it;
[0051] The application verifies the encrypted information and dynamic authentication code in the QR code to check its legitimacy. The server verifies the validity of the QR code information and determines whether the QR code is authentic and valid.
[0052] The application uses a specific image processing algorithm to determine whether the invisible watermark anti-counterfeiting feature pattern and the image of the hidden information printed with fluorescent material in the QR code are consistent with the information in the database, ensuring that the QR code has not been tampered with;
[0053] Verify whether the anti-counterfeiting knife-cut ring data matches;
[0054] If and only if the data comparison is consistent and the feature matching degree exceeds the preset threshold, it is judged to be authentic;
[0055] S3, server evidence update:
[0056] All valid anti-counterfeiting QR code information is encrypted and stored in the cloud database. All valid anti-counterfeiting QR code information, including product information, production batch, expiration date, etc., is encrypted and stored in the anti-counterfeiting database. When consumers scan the QR code and verify it, the application sends the QR code information to the cloud server, and the server compares and verifies the QR code information with the data in the cloud database.
[0057] The server uses a secure communication protocol to ensure that data transmission is not tampered with. All data transmission uses encryption protocols such as SSL / TLS to ensure the security of user information and QR code verification information. The data in the QR code uses dynamic encryption and digital signature technology. Even if the QR code is copied or tampered with, the recognition system can effectively detect it. At the same time, when the user scans the QR code through the mobile application, the cloud verification system will judge the validity of the QR code in real time, including whether it has been tampered with, forged or expired. At the same time, when the user uses the anti-counterfeiting application, he or she may need to perform identity authentication (such as mobile phone number binding, fingerprint recognition, etc.), further enhancing the security of the system;
[0058] User feedback and tips:
[0059] After the user scans the QR code and completes the verification through the mobile app, the system will provide corresponding feedback based on the verification results:
[0060] Verification passed: If the QR code information is consistent with the record in the cloud database and the anti-counterfeiting information is successfully verified, the system will prompt the user that "this product is authentic" and display relevant product information.
[0061] Verification failed: If the QR code information is invalid, forged, or inconsistent with the database record, the system will prompt the user "The product cannot be verified" or "The QR code information is abnormal" and recommend that the user contact the merchant or manufacturer for further verification
[0062] The database is updated in real time to ensure the timeliness and accuracy of the QR code information. The server synchronizes the database every 30 seconds and monitors product status change events through the message queue.
[0063] Example 2
[0064] The difference from the first embodiment is that:
[0065] S1. Generate anti-counterfeiting QR code:
[0066] Collect product feature information to generate a unique identifier, where the feature information includes at least a production batch number, geographic coordinates, and a timestamp. Collecting product feature information to generate a unique identifier specifically includes: generating a unique identifier based on a SHA-3 hash algorithm combined with a timestamp and a product serial number.
[0067] This invention addresses the problem that static encrypted QR codes are easily cracked, copied, tampered with, and forged:
[0068] The application of multiple encryption technologies ensures the security of the QR code information by using UUIDv4 to generate a random unique identifier, or by combining the timestamp and product serial number with the SHA-3 hash algorithm. Multiple encryption algorithms, including AES-256 and RSA, are used to ensure the security of the QR code information. Furthermore, an invisible watermark is embedded in the QR code using DCT, further increasing the difficulty of counterfeiting. This multiple encryption technology makes the QR code information difficult to crack, copy, or tamper with, significantly improving the accuracy of anti-counterfeiting identification.
[0069] Use of anti-counterfeiting feature patterns and watermarks: Anti-counterfeiting feature patterns and watermarks are embedded in the QR code. These feature patterns are more difficult to forge, making the QR code more difficult to copy or tamper with, further enhancing the anti-counterfeiting effect.
[0070] Integrating a cloud-based verification system: All QR code information is stored in a centralized anti-counterfeiting database. When a user scans a QR code, the app sends the code information to a cloud server for verification. This cloud-based verification system quickly verifies the validity of the QR code, the accuracy of the product information, and its legitimacy, ensuring the uniqueness and timeliness of each QR code, further enhancing the reliability of the anti-counterfeiting system.
[0071] Addressing the bottleneck of consumer inconvenience caused by reliance on dedicated equipment
[0072] Scanning with a smartphone camera: Consumers can scan the QR code with their smartphone camera, and the anti-counterfeiting app on their phone will automatically recognize and interpret the code. This method breaks through the traditional anti-counterfeiting identification method's reliance on dedicated hardware, lowering the barrier to entry and allowing consumers to easily verify product authenticity without carrying additional dedicated equipment.
[0073] Improved user experience: Users simply open the anti-counterfeiting app and scan the QR code for instant verification. This simple and convenient operation significantly improves the user experience and app adoption. Consumers can quickly verify product authenticity, effectively reducing the losses and distrust associated with purchasing counterfeit goods.
[0074] This invention also incorporates cloud-based database verification, allowing users to obtain real-time verification results after scanning the QR code, ensuring the timeliness of the information. This cloud-based verification system can quickly identify the validity of the QR code, as well as the accuracy and legality of the product information, effectively reducing the circulation of counterfeit and substandard products. The combination of dynamic QR codes and database verification ensures the uniqueness and immediacy of each QR code, further enhancing the reliability of the anti-counterfeiting system.
[0075] By combining mobile phone cameras with QR code technology, traditional anti-counterfeiting techniques eliminate the need for expensive specialized equipment or complex production processes. QR codes are inexpensive to produce and can be scanned and verified using standard mobile phone apps, resulting in low implementation costs. This makes them affordable for small and medium-sized businesses, promoting widespread adoption of anti-counterfeiting technology.
[0076] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus.
[0077] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. An anti-counterfeiting identification method based on a QR code, characterized by: The following steps are involved: S1. Generate anti-counterfeiting QR code: Collecting product characteristic information to generate a unique identifier, wherein the characteristic information includes at least a production batch number, geographic coordinates, and a timestamp; A multi-layer nested encryption algorithm is used to encrypt the unique identifier to generate an encrypted data packet; Embed the encrypted data package into the product QR code to generate a dynamic QR code, and embed the invisible watermark anti-counterfeiting feature into the high-frequency area of the QR code; Adding an anti-counterfeiting knife-cut ring and a fluorescent material printing hidden information containing a CRC-32 encoded matrix positioning mark to the QR code; S2. Mobile terminal verification: Scan the QR code on the product with your smartphone camera; Performing parallel verification on the two-dimensional code image; Automatically identify and parse QR code information; Parse and decrypt the encrypted data packet, and verify the validity of the QR code information through the server; Extract the invisible watermark anti-counterfeiting features and the image features of the hidden information printed by the fluorescent material, and calculate the feature matching degree; Verify whether the anti-counterfeiting knife-cut ring data matches; If and only if the data comparison is consistent and the feature matching degree exceeds the preset threshold, it is judged to be authentic; S3, server evidence update: All valid anti-counterfeiting QR code information is encrypted and stored in the cloud database; The server uses a secure communication protocol to ensure that data transmission is not tampered with; The database is updated in real time to ensure the timeliness and accuracy of the QR code information.
2. The anti-counterfeiting identification method based on a QR code according to claim 1, characterized in that: The step S1 of collecting product feature information to generate a unique identifier specifically includes: using UUIDv4 to generate a random unique identifier.
3. The anti-counterfeiting identification method based on a QR code according to claim 1, characterized in that: The step S1 of collecting product feature information to generate a unique identifier specifically includes: generating a unique identifier based on a SHA-3 hash algorithm combined with a timestamp and a product serial number.
4. The anti-counterfeiting identification method based on a QR code according to claim 1, characterized in that: The multi-layer nested encryption algorithm in step S1 is specifically: The unique identifier is encrypted using the AES-256 algorithm combined with the PBKDF2 key derivation algorithm to form encrypted data; The data encrypted with the AES-256 algorithm is encrypted twice using the RSA-4096 public key to form an encrypted data packet.
5. The anti-counterfeiting identification method based on a QR code according to claim 1, characterized in that: The specific operation of embedding the encrypted data packet into the product QR code in step S1 is: Convert the encrypted data packet into binary format through Base64 encoding; Embed binary data into a QR code to generate a dynamic QR code.
6. The anti-counterfeiting identification method based on a QR code according to claim 1, characterized in that: The step S1 of embedding the invisible watermark anti-counterfeiting feature into the high-frequency area of the QR code is specifically as follows: DCT is used to embed invisible watermark information into the high-frequency area of the QR code.