CN107918791B - Two-dimensional code generating and decoding method and device in two-dimensional code copying process - Google Patents

Two-dimensional code generating and decoding method and device in two-dimensional code copying process Download PDF

Info

Publication number
CN107918791B
CN107918791B CN201711131923.0A CN201711131923A CN107918791B CN 107918791 B CN107918791 B CN 107918791B CN 201711131923 A CN201711131923 A CN 201711131923A CN 107918791 B CN107918791 B CN 107918791B
Authority
CN
China
Prior art keywords
image
dimensional code
authentication information
gray
information
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
CN201711131923.0A
Other languages
Chinese (zh)
Other versions
CN107918791A (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.)
Shenzhen University
Original Assignee
Shenzhen University
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 Shenzhen University filed Critical Shenzhen University
Priority to CN201711131923.0A priority Critical patent/CN107918791B/en
Publication of CN107918791A publication Critical patent/CN107918791A/en
Application granted granted Critical
Publication of CN107918791B publication Critical patent/CN107918791B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06037Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06046Constructional details
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/146Methods for optical code recognition the method including quality enhancement steps
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3226Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using a predetermined code, e.g. password, passphrase or PIN

Abstract

The application relates to a method for generating and decoding a two-dimensional code in a copying process, which combines a communication channel model and physical equipment characteristics of the two-dimensional code in a scanning-printing process, after original two-dimensional code information is coded and modulated and before entering a communication channel for transmission, authentication information is superposed on the original information in an artificial noise mode and is transmitted into the communication channel together, the two-dimensional code after image restoration and the two-dimensional code after noise removal are compared and analyzed, the authentication information can be extracted from a receiving end, and the authentication information is decoded by using an agreed key and a decoding technology, so that the authentication of the two-dimensional code is finished, and the safety of the two-dimensional code in the communication process is improved.

Description

Two-dimensional code generating and decoding method and device in two-dimensional code copying process
Technical Field
The invention relates to a method and a device for generating and decoding a two-dimensional code in a copying process.
Background
In recent years, two-dimensional codes have become a general information carrier, have the characteristics of large amount of stored information, wide application range, strong noise and interference resistance and the like, are continuously popularized along with the popularization of smart phones, and are particularly widely applied to the aspects of identity authentication, network transmission, electronic certificates, bills and the like. However, operations such as generation, copying, transmission, and reception of the two-dimensional code have many vulnerabilities and are easily broken, counterfeit, and abused by people, so how to improve the security of the two-dimensional code, particularly the security during copying, is a major concern at present. Nowadays, there are several methods for improving security mainly for generating and copying a two-dimensional code.
And controlling the generation and the copying of the two-dimensional code by using a special printing material or process. Special printing materials, such as holographic (holographic) materials and polymeric liquid crystal materials having unique optical characteristics, through a printing process may be used to print the two-dimensional code to prevent it from being copied. Special printing inks may also be applied to the printing of the two-dimensional code, for example uv fluorescent inks, to make the printed two-dimensional code invisible under visible light to prevent it from being copied. Special production processes can also be used to enhance the security of the two-dimensional code, for example, special halftone printing techniques can generate a two-dimensional code hidden under visible light.
And controlling the generation and reading of the two-dimensional code by using an encryption algorithm and a security protocol. An asymmetric key encryption algorithm (for example, RSA algorithm) and a PKI public key encryption system can be used to control the generation of two-dimensional codes and verify the authenticity of information thereof, for example, chinese patents CN201110054417.2 and CN201410520353.4 adopt an asymmetric key encryption algorithm in the process of two-dimensional code transmission or manufacture, and Wang et al apply such a system with encryption protection to the construction of anti-counterfeiting platforms in Using Modified Digital halfning technology to design invasion 2D Barcode by encrypted Detection. The chaos Equation (Chaotic Equation) can be used in the generation process of the two-dimensional code identity number to ensure the uniqueness and the non-batch duplication of the random character string, so that the generation of the two-dimensional code is effectively controlled finally. Similarly, the AuthPaper system has applied the ECDSA digital signature algorithm therein to prevent document counterfeiters from tampering with the content therein. In addition to encryption algorithms, researchers have also proposed some security protocols based on communication architectures to enhance the security of displayed two-dimensional codes. For example, researchers have proposed a communication protocol called "all or nothing" based on a duplex communication system of a mobile device front camera and a display screen. Only when the receiver can obtain the transmitted and received signals at the same time, the information of the two-dimensional code in the channel can be decoded, and the confidentiality of the information is further enhanced.
And controlling the generation of the two-dimensional code by using a digital watermarking technology. Digital watermarking technology can embed information related to a two-dimensional code in a two-dimensional code image. For example, image frequency information of a two-dimensional code is directly decomposed by using DCT and DFT, and watermark information which is not easily perceived by naked eyes can be embedded in the image frequency information. After the two-dimensional code image is shot, the two-dimensional code image can be decoded and the authenticity of the digital watermark information can be evaluated at the same time. Similarly, digital watermarks may also be stored in the DWT domain. For example, chinese patent CN201710187615.3 embeds watermark information in a logo image of a Two-dimensional Code, Two-Level QR Code for private message Sharing and Document Authentication of Tkachenko et al, and Towards a reactive channel Model for Security Analysis of Authentication using Graphical Codes of Baras et al all propose a method for ensuring watermark information to be more robust, and modify the overall brightness of a partial module to store a digital signature of the Two-dimensional Code content by using the information redundancy of the Two-dimensional Code. Tkachenko et al comprehensively considers the robustness and capacity of watermark information in the center Bias Measure for high sensitivity QR Code Recognition, and modifies the model of the Module to store the watermark information by using the distortion tolerance of each Module in the decoding process of the two-dimensional Code.
And controlling the generation and the replication of the two-dimensional code by using a pattern with a copy detection characteristic or a physical unclonable characteristic. For the sake of decoding stability, the conventional two-dimensional code is composed of black and white block units large enough. However, such designs are easily copied. Some patterns with more detailed features can be used in the design of two-dimensional codes to resist the most direct scan-print form of replication. Copy Detection of black and white units with high density is used to form graphics, and log normal distribution is used as a key model of printing-scanning channel in the Detection process. In addition to black and white binary images, grayscale images can also be used in the copy detection pattern. The decision of copy detection can be based on the variation characteristics of the gray-scale image in the Printing-scanning channel, mainly including the high-frequency characteristics of the image, such as extracting the Feature Set based on the sharpness of the image in the methods a Feature Set for Robust Printing-Imaging Cycle device identification using Structured Printing references by Gaubatz et al. The color pattern contains information of four channels of CMYK, compared to a grayscale image. After copying, the characteristics of the colors (color mean, variance, entropy, etc. in the module) can generate obvious differences. In addition to the above detailed pattern features, a physical unclonable function in a printed document is also used to identify illegal copies of the printed document. The Physical Unclonable Function (PUF) is a random variation generated by printing equipment and paper, and features of the PUF are easy to extract and analyze but not easy to copy and forge. For example, the random variation of printed toner and Paper as noted by the Counterfeit detection Paper PUF and Mobile Cameras of Wong et al, and the A surface of Forensics characteristics Methods of Khanna et al, and the microroughness of Paper as noted by the Printer and Scanner tools of Chiang et al.
A specific information storage ciphertext is used, for example, the chinese patent No. cn201110113881.x stores the ciphertext as error correction code information separately, avoids a data area of a two-dimensional code, and has an independent ciphertext transmission function; the Chinese patent CN201610945368.4 stores the encrypted information as mask information with an identification function, and performs related binary operation with the information of the two-dimensional code, thereby covering the data of the original two-dimensional code and improving the transmission safety; the US patent US201514662377A converts the encrypted information into picture information, and embeds it in a two-dimensional code, which is combined with the two-dimensional code image into a picture for transmission.
The above methods can enhance the security of the two-dimensional code to different degrees, but also bring some problems.
On one hand, the advantage of the two-dimensional code in universality is reduced. The two-dimensional code is manufactured by special printing materials or processes, the control of the generation process can be strengthened to resist illegal copying of the two-dimensional code, but the universality of the two-dimensional code is inevitably reduced (the production cost of the two-dimensional code is increased and the dependency on special equipment is increased). The main advantages of two-dimensional codes compared to the same kind of technologies (e.g. RFID and smart sensors) are their very low cost and flexibility independent of special hardware. Therefore, the method based on special printing materials or processes can greatly reduce the competitiveness of the two-dimensional code in large-scale application in the internet of things.
On the one hand, increases the complexity of use. Compared with the traditional two-dimension code, the scheme based on the algorithm or the security protocol such as encryption, digital watermarking and the like can control the unauthorized generation of the two-dimension code and the illegal tampering of the data, but the complexity of the system is increased. Taking the encryption and watermarking algorithm as an example, the complexity is mainly embodied in the following two aspects: first, in the process of generating and controlling a two-dimensional code by using an asymmetric encryption algorithm and a digital signature technology, Public Key Infrastructure (PKI) needs to be arranged. The security of each user's private key must be guaranteed and the corresponding public key must be distributed through a secure communication channel. Secondly, in the process of information use, a decryption step or an information extraction step of the two-dimensional code is additionally added.
On the one hand, the contradiction between illegal copy resistance and universal applicability cannot be effectively solved. Most importantly, even if the two-dimensional code applies a copy detection pattern and a physical unclonable function, or the above security (encryption and digital watermarking) algorithm, it is difficult to prevent a counterfeiter from copying the two-dimensional code under the system framework of the internet of things. The image features extracted based on the physically unclonable function relate to details in the printout image. In order to accurately capture the characteristics, the verification environment of the two-dimensional code needs to be limited to a certain extent, which is not in accordance with the general applicability of the internet of things. For example, the verified document is placed in a relatively fixed distance and lighting environment. On the other hand, the security algorithm only guarantees the reliability of the information in the two-dimensional code in the aspect of information encryption, and cannot change the visibility of the information in the two-dimensional code, so that illegal copying is difficult to effectively resist. Further, since the copy detection pattern generally judges the authenticity of the image based on the attenuation of high-frequency information, the copying apparatus (high-precision scanner, copier, etc.) used by an attacker tends to have higher resolution and more complete retention of high-frequency information. Therefore, it is difficult to prevent a counterfeiter from copying the authentication device while ensuring its general type.
One aspect encroaches on the storage and operating space of other data. Particularly, the two-dimensional code occupies a certain storage space, and the data volume carried by the two-dimensional code is constant, so that the fact that the encrypted information or the encrypted data occupies the storage space of the two-dimensional code means that the code forming quantity of the two-dimensional code is reduced, and the application range of the two-dimensional code is narrowed. In addition, other information spaces also need a sufficient amount of information to effectively complete data processing, such as error correction information areas, and the like, and occupying these data areas results in insufficient retention of these control information, thereby indirectly reducing the number of codes of the two-dimensional code.
In view of the above, in recent years, two-dimensional codes have been recognized as a problem in generation and copy control, and some solutions have been proposed, and effective control has been brought about in generation control. However, the comprehensive performance of these methods in ensuring the uniqueness of the two-dimensional code, i.e., resisting illegal copying, still needs to be further improved. In the face of increasingly serious product counterfeiting and a relatively preliminary two-dimensional code source-tracing anti-counterfeiting system framework, a new theory and technical scheme for improving the security of the two-dimensional code to resist illegal copying need to be actively explored.
Disclosure of Invention
At present, people are not limited to the addition of public numbers and the payment of commodity expenses for the use of the two-dimensional codes, and people pay more and more attention to the safety problem of the two-dimensional codes while the two-dimensional codes are widely used. In order to improve the safety of the two-dimensional code in the copying process, the invention provides the following technical scheme.
The invention relates to a two-dimension code generating method in the two-dimension code copying process, which comprises the following steps: converting original information into bit stream by coding mode; converting the bit stream into an image gray value of the original information; loading authentication information and generating an image gray value of the authentication information; superposing the image gray value of the authentication information to the image gray value of the original data to form a superposed gray image; and adding an image searching pattern beside the superposed image gray scale to generate a two-dimensional code.
In the two-dimensional code generation method according to the present invention, the loading authentication information includes authentication information having a white noise characteristic.
In the two-dimensional code generation method, the generated two-dimensional code is mixed with channel noise in the transmission process.
In the two-dimensional code generation method according to the present invention, superimposing the image gray scale value of the authentication information on the image gray scale value of the raw data includes superimposing the image gray scale value of the raw information and the image gray scale value of the authentication information in a center alignment manner.
In the two-dimensional code generating method according to the present invention, the superimposing the image gradation value of the authentication information on the image gradation value of the raw data includes superimposing the image gradation value of the raw information and the image gradation value of the authentication information at positions where they are superimposed in a dispersed manner.
In the two-dimensional code generation method according to the present invention, the superimposing the image gray scale value of the authentication information on the image gray scale value of the raw data includes setting a superimposing position of the image gray scale value of the raw data and the image gray scale value of the authentication information in a manner known by both parties, agreed by both parties, or negotiated by both parties, and is not disclosed to the outside.
In the two-dimensional code generating method according to the present invention, superimposing the image gradation value of the authentication information on the image gradation value of the raw data includes superimposing the image gradation value of the raw data and the image gradation value of the authentication information in a predetermined pattern.
In the two-dimensional code generating method according to the present invention, the superimposing the image gray scale value of the authentication information on the image gray scale value of the raw data includes superimposing the image gray scale value of the raw information and the image gray scale value of the authentication information at a designated gray scale value.
The second aspect of the invention relates to a two-dimensional code decoding method in a two-dimensional code copying process, which comprises the following steps: acquiring a two-dimensional code; restoring the shape distortion, the color distortion and/or the brightness distortion of the two-dimensional code gray image in a communication channel through an image restoration step to obtain a first gray image of the two-dimensional code; demodulating the first gray image according to a signal modulation method in the two-dimensional code generation step, removing channel noise and authentication information to obtain a second gray image of the two-dimensional code, and obtaining the authentication information through the first gray image and the second gray image; performing source decoding operation on the demodulated second gray level image to obtain an original bit stream without noise; and converting the noiseless original bit data into a noiseless two-dimensional code gray value through secondary coding and secondary modulation.
In the two-dimensional code decoding method, the first gray level image of the two-dimensional code is demodulated according to a signal modulation method in the two-dimensional code generation step, channel noise and authentication information are removed, and the method further comprises the following step of correcting error codes introduced by a channel in a decoding mode.
The two-dimensional code decoding method according to the present invention further includes a step of performing a difference operation between the first grayscale image before decoding and the second grayscale image after decoding to obtain the channel noise and the authentication information.
The two-dimensional code decoding method according to the present invention further includes a step of separating the authentication information from the channel noise by using a BCH decoding method.
The third aspect of the present invention relates to a two-dimensional code generating apparatus in a two-dimensional code copying process, including: a bitstream generation module: converting original information into bit stream by coding mode; an image conversion module: converting the bit stream into an image gray value of the original information; the authentication information loading module: loading authentication information and generating an image gray value of the authentication information; an image superimposition module: superposing the image gray value of the authentication information to the image gray value of the original data to form a superposed gray image; two-dimensional code generation module: and adding an image searching pattern beside the superposed image gray scale to generate a two-dimensional code.
The fourth aspect of the present invention relates to a two-dimensional code decoding apparatus in a two-dimensional code copying process, including: an acquisition module: acquiring a two-dimensional code; and an image restoring module: restoring the shape distortion, the color distortion and/or the brightness distortion of the two-dimensional code gray image in a communication channel through an image restoration step to obtain a first gray image of the two-dimensional code; demodulating the first gray image according to a signal modulation method in the two-dimensional code generation step, removing channel noise and authentication information to obtain a second gray image of the two-dimensional code, and obtaining the authentication information through the first gray image and the second gray image; and a decoding demodulation module: performing source decoding operation on the demodulated second gray level image to obtain an original bit stream without noise; a secondary coding modulation module: and converting the noiseless original bit data into a noiseless two-dimensional code gray value through secondary coding and secondary modulation.
The two-dimensional code decoding device according to the present invention further includes a noise separation module: and separating the authentication information from the channel noise by adopting a BCH decoding method.
The invention combines the communication channel model and the physical equipment (scanning and printing equipment) characteristics of the two-dimensional code in the scanning-printing process, after the original two-dimensional code information is coded and modulated and before the original two-dimensional code information enters the communication channel for transmission, the authentication information is superposed on the original information in the form of artificial noise and is transmitted into the communication channel, the authentication information can be extracted from a receiving end by comparing and analyzing the two-dimensional code after image restoration and the two-dimensional code after noise removal, and the decoding of the authentication information is completed by using the agreed secret key and the decoding technology, thereby completing the authentication of the two-dimensional code and improving the safety of the two-dimensional code in the communication process.
Drawings
FIG. 1 is a schematic block diagram illustrating two-dimensional code generation and decoding during two-dimensional code replication of the present invention;
fig. 2 is a flowchart illustrating a two-dimensional code generation method in a two-dimensional code copying process of the present invention;
fig. 3 is a flowchart illustrating a two-dimensional code decoding method in a two-dimensional code copying process of the present invention;
fig. 4 is a structural diagram showing a two-dimensional code generating apparatus in a two-dimensional code copying process of the present invention;
fig. 5 is a block diagram showing a two-dimensional code decoding apparatus in the two-dimensional code copying process of the present invention.
Detailed Description
Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. In the following description, the same components are denoted by the same reference numerals, and redundant description thereof is omitted. The drawings are schematic and the ratio of the dimensions of the components and the shapes of the components may be different from the actual ones.
FIG. 1 is a schematic block diagram illustrating two-dimensional code generation and decoding during two-dimensional code replication of the present invention; fig. 2 is a flowchart illustrating a two-dimensional code generation method in a two-dimensional code copying process of the present invention.
In this embodiment, as shown in fig. 1, the two-dimensional code generation method and decoding principle in the two-dimensional code copying process include encoding, modulating, authenticating, de-authenticating, demodulating, decoding, and other processes, and the channel in the generation and acquisition processes is also shown in the figure.
In this embodiment, as shown in fig. 2, the two-dimensional code generation method and the decoding method in the two-dimensional code copying process may include the following steps: bitstream generation step 201: the original information is converted into a bit stream by a coding mode. In this embodiment, the original information input by the user may be of many types, including information such as characters, web addresses, pictures, business cards, etc., and the information may be converted into a bitstream by encoding. In order to further compress data and improve transmission efficiency, bit streams can be processed by adopting source coding, and channel coding is also needed to improve the reliability of data transmission.
In this embodiment, the method further includes an image conversion step 202: the bitstream is converted into image gray values of the original information. Authentication information loading step 203: and loading the authentication information and generating an image gray scale value of the authentication information.
In this embodiment, the authentication information may be in various types, such as a common ciphertext form, watermark information, and the like, and may also generate noise with white noise characteristics, particularly white noise with statistically independent characteristics, so that this manner not only can add the authentication information to be hidden to the original data to the maximum extent with less interference, but also is convenient for the acquiring party to separate the authentication information.
In the present embodiment, the method further includes an image superimposing step 204: and superposing the image gray value of the authentication information on the image gray value of the original data to form a superposed gray image. The process of loading the authentication information is generally performed by means of superposition, and other types of operations, such as exclusive-or, and, concatenation, etc., may be used. And superposing the image gray value of the authentication information on the image gray value of the original data to form a superposed gray image.
In this embodiment, the method further includes a two-dimensional code generation step 205: and adding an image searching pattern beside the superposed image gray scale to generate a two-dimensional code.
In the present embodiment, as shown in fig. 1, the channel is a schematic data channel through which the two-dimensional code passes from generation to acquisition in the copying process. Typically, such channels are transmission type, but may also represent the process from generation to acquisition. For example, after the two-dimensional code is generated, the user presents the two-dimensional code on a paper medium by printing, for example, on a billboard, and other authorized users can acquire the two-dimensional code by shooting or scanning, and the process of generating → printing → scanning can be considered as passing through a channel.
In the embodiment, the two-dimensional code passing through the channel inevitably mixes with channel noise, and the noise may be caused by light, brightness, shadow, refraction, distortion, blur, sharpening, deficiency and the like. Generally, the two-dimensional code has strong error correction capability, but after the two-dimensional code is acquired, noise on an image can be removed through filtering, or modulation, or demodulation, and the noise is often channel noise.
In the present embodiment, in the process of loading the authentication information, loading may be performed in an overlay manner, and the present invention considers selecting an overlay position, selecting an overlay angle, or selecting another overlay manner as a way to avoid being illegally copied. The superposition may be performed in some ways, for example.
In the present embodiment, in terms of the position of the superposition, the image grayscale value of the original information and the image grayscale value of the authentication information may be superposed in a center-aligned manner; the authentication information can be dispersed and overlapped at the corners of the image; the authentication information may be elongated and superimposed along a side line of the two-dimensional code. Particularly, the superposed position may not be disclosed to the outside, and the superposed position is set and acquired by using a mode known by both parties, or agreed by both parties, or negotiated by both parties, so as to further avoid the malicious third party from copying, and improve the security of the authentication information.
In the present embodiment, in view of the superimposed pattern, the authentication information may be superimposed after forming a predetermined pattern; the authentication information may also be superimposed in a specified pattern, for example, a "circular ring" pattern may be used to superimpose the authentication information. Particularly, the superimposed pattern may not be disclosed to the outside, and the superimposed pattern is set and acquired in a manner that both parties know, or that both parties agree, or that both parties negotiate, so that a malicious third party is further prevented from copying, and the security of the authentication information is improved.
In the present embodiment, in view of the superimposition, the authentication information may be superimposed by rotating the authentication information by a different angle after the pattern is determined. Particularly, the superimposed angle may not be disclosed to the outside, and the superimposed angle is set and acquired in a manner that both sides know, or that both sides agree, or that both sides negotiate, so that a malicious third party is further prevented from copying, and the security of the authentication information is improved.
In this embodiment, in view of other superimposing methods, the superimposing may be performed according to the designated gray-level value, for example, the superimposing is performed on all the modules having the gray-level value of 100. Particularly, the superimposed gray scale may not be disclosed to the outside, and the superimposed gray scale is set and obtained in a manner that both parties know, or that both parties agree, or that both parties negotiate, so that a malicious third party is further prevented from copying, and the security of the authentication information is improved.
In addition, the above multiple possibilities of superposition may be further combined, for example, processing from the position of superposition and the pattern of superposition may be considered at the same time, in which case, the position of superposition may be selected as a corner, for example, and the pattern of superposition may be selected as a square, a circle, or a specific pattern, for example.
Fig. 3 is a flowchart illustrating a two-dimensional code decoding method in a two-dimensional code copying process of the present invention.
In this embodiment, as shown in fig. 3, after the two-dimensional code passes through the channel and is acquired, the two-dimensional code needs to be decoded, and the decoding step includes, corresponding to the step in the two-dimensional code generation process: in an acquisition step 208, a two-dimensional code is acquired. In this embodiment, the two-dimensional code can be acquired by various possible methods. For example, the two-dimensional code is obtained by shooting or scanning, or a two-dimensional code picture can be obtained by pre-storing, downloading, instant transmitting, receiving an email, and the like, and then the two-dimensional code is extracted by using a picture processing program.
In this embodiment, the method further includes a restoring step 209, where the acquired two-dimensional code image is subjected to an image restoring step to restore the shape distortion, color distortion and/or brightness distortion of the two-dimensional code grayscale image in the communication channel, so as to obtain a first grayscale image of the two-dimensional code.
In this embodiment, the method further includes a removing step 210: and restoring the shape distortion, the color distortion and/or the brightness distortion of the two-dimensional code gray image in a communication channel by the acquired two-dimensional code image through an image restoration step to obtain a first gray image of the two-dimensional code. In the middle of generating the two-dimensional code to acquiring the two-dimensional code, the channel may cause some errors to be generated, and the errors need to be corrected through decoding.
In the present embodiment, the second grayscale image corresponds to the image data before the authentication information is loaded during the generation process, and therefore, the channel noise and the authentication information can be obtained by performing the difference operation between the first grayscale image before decoding and the grayscale image after decoding. In this case, the BCH decoding method needs to be adopted to separate the authentication information from the channel noise.
In this embodiment, the method further includes a decoding/demodulation step 211: and carrying out source decoding operation on the demodulated second gray level image to obtain an original bit stream without noise.
In this embodiment, the method further includes a secondary decoding and modulating step 212: and converting the noiseless original bit data into the noiseless two-dimensional code gray value through secondary coding and secondary modulation. And finally, the encryption and authentication of the information coded by the user are completed by decoding the authentication information.
In order to implement the method, the above steps are implemented by using corresponding functional modules and are embedded into a device to be implemented. Fig. 4 is a block diagram showing a two-dimensional code generating apparatus in the two-dimensional code copying process of the present invention.
As shown in fig. 4, the two-dimensional code generating device in the two-dimensional code copying process according to the present embodiment includes a bit stream generating module 301: converting original information into bit stream by coding mode; the original information input by the user can be of various types, including characters, web addresses, pictures, business cards and the like, and the information can be converted into a bit stream through encoding. In order to further compress data and improve transmission efficiency, bit streams can be processed by adopting source coding, and channel coding is also needed to improve the reliability of data transmission.
In this embodiment, an image conversion module 302 is further included, which converts the bitstream into image grayscale values of the original information.
In this embodiment, the system further includes an authentication information loading module 303, which loads the authentication information and generates an image grayscale value of the authentication information. The authentication information can be in various types, such as common ciphertext forms, watermark information and the like, and noise with white noise characteristics, particularly white noise with statistical independence characteristics, can be generated, so that the authentication information to be hidden can be added to original data to the maximum extent with small interference, and an acquirer can separate the authentication information conveniently.
In this embodiment, the apparatus further includes an image superimposing module 304, which superimposes the image grayscale value of the authentication information on the image grayscale value of the original data to form a superimposed grayscale image. The process of loading the authentication information is generally performed by means of superposition, and other types of operations, such as exclusive-or, and, concatenation, etc., may be used. And superposing the image gray value of the authentication information on the image gray value of the original data to form a superposed gray image.
In the present embodiment, the two-dimensional code generation module 305 is further provided to generate a two-dimensional code by adding a seek pattern to the superimposed image gradation.
In the present embodiment, the channel in the two-dimensional code copying process is generally of a transmission type, but may represent a process from generation to acquisition. For example, after the two-dimensional code is generated, the user presents the two-dimensional code on a paper medium by printing, for example, on a billboard, and other authorized users can acquire the two-dimensional code by shooting or scanning, and the process of generating → printing → scanning can be considered as passing through a channel.
In the embodiment, the two-dimensional code passing through the channel inevitably mixes with channel noise, and the noise may be caused by light, brightness, shadow, refraction, distortion, blur, sharpening, deficiency and the like. Generally, the two-dimensional code has strong error correction capability, but after the two-dimensional code is acquired, noise on an image can be removed through filtering, or modulation, or demodulation, and the noise is often channel noise.
In the present embodiment, in the process of loading the authentication information, loading may be performed in an overlay manner, and the present invention considers selecting an overlay position, selecting an overlay angle, or selecting another overlay manner as a way to avoid being illegally copied. The superposition may be performed in some ways, for example.
In the present embodiment, in terms of the position of the superposition, the image grayscale value of the original information and the image grayscale value of the authentication information may be superposed in a center-aligned manner; the authentication information can be dispersed and overlapped at the corners of the image; the authentication information may be elongated and superimposed along a side line of the two-dimensional code. Particularly, the superposed position may not be disclosed to the outside, and the superposed position is set and acquired by using a mode known by both parties, or agreed by both parties, or negotiated by both parties, so as to further avoid the malicious third party from copying, and improve the security of the authentication information.
In the present embodiment, in view of the superimposed pattern, the authentication information may be superimposed after forming a predetermined pattern; the authentication information may also be superimposed in a specified pattern, for example, a "circular ring" pattern may be used to superimpose the authentication information. Particularly, the superimposed pattern may not be disclosed to the outside, and the superimposed pattern is set and acquired in a manner that both parties know, or that both parties agree, or that both parties negotiate, so that a malicious third party is further prevented from copying, and the security of the authentication information is improved.
In the present embodiment, from the viewpoint of superimposition, the authentication information may be superimposed by rotating the authentication information by a different angle after the pattern is determined. Particularly, the superimposed angle may not be disclosed to the outside, and the superimposed angle is set and acquired in a manner that both sides know, or that both sides agree, or that both sides negotiate, so that a malicious third party is further prevented from copying, and the security of the authentication information is improved.
In this embodiment, in view of other superimposing methods, the superimposing may be performed according to the designated gray-level value, for example, the superimposing is performed on all the modules having the gray-level value of 100. Particularly, the superimposed gray scale may not be disclosed to the outside, and the superimposed gray scale is set and obtained in a manner that both parties know, or that both parties agree, or that both parties negotiate, so that a malicious third party is further prevented from copying, and the security of the authentication information is improved.
In addition, the above multiple possibilities of superposition may be further combined, for example, processing from the position of superposition and the pattern of superposition may be considered at the same time, in which case, the position of superposition may be selected as a corner, for example, and the pattern of superposition may be selected as a square, a circle, or a specific pattern, for example.
Fig. 5 is a block diagram showing a two-dimensional code decoding apparatus in the two-dimensional code copying process of the present invention.
In the present embodiment, as shown in fig. 5, after the two-dimensional code passes through the channel and is acquired, the two-dimensional code needs to be decoded, and the present embodiment provides a two-dimensional code decoding device in the two-dimensional code copying process, corresponding to the steps in the two-dimensional code generation process. Which includes acquiring the two-dimensional code by the acquisition module 401. Generally, the two-dimensional code is obtained by shooting or scanning, or a two-dimensional code picture can be obtained by pre-storing, downloading, instant transmission, mail receiving and the like, and then the two-dimensional code is extracted by using a picture processing program.
In this embodiment, the image restoring module 402 is further included: and restoring the shape distortion, the color distortion and/or the brightness distortion of the two-dimensional code gray image in a communication channel by the acquired two-dimensional code image through an image restoration step to obtain a first gray image of the two-dimensional code.
In this embodiment, the noise removal and authentication information module 403 is further included: and demodulating the first gray image according to a signal modulation method in the two-dimensional code generation step, removing channel noise and authentication information to obtain a second gray image of the two-dimensional code, and obtaining the authentication information through the first gray image and the second gray image. In the middle of generating the two-dimensional code to acquiring the two-dimensional code, the channel may cause some errors to be generated, and the errors need to be corrected through decoding.
In the present embodiment, the second gray scale image corresponds to the image data before the authentication information is loaded in the generation process, and therefore, the channel noise and the authentication information can be obtained by performing the difference operation between the first gray scale image before decoding and the second gray scale image after decoding. In this case, the BCH decoding method needs to be adopted to separate the authentication information from the channel noise.
In this embodiment, after the authentication information is loaded on the two-dimensional code, the two-dimensional code can be separated in various ways. Generally, there may be some ways for separating information from an image, such as an edge sharpening method, a gradient descent method, a pixel difference method, and so on, by which loaded authentication information can be separated from an image, and finally corresponding authentication information is obtained.
If the authentication information is noise with white noise characteristics, the authentication information and the channel noise need to be separated from the two-dimensional code together by filtering, modulating or demodulating, but in this case, the authentication information and the channel noise are separated as a whole, so that the authentication information and the channel noise need to be further separated. Generally, the authentication information may be separated using a BCH decoding technique, thereby obtaining separate authentication information.
In this embodiment, the decoding and demodulating module 404 is further included: and carrying out source decoding operation on the decoded second gray level image to obtain a noise-free original bit stream.
Secondary decoding modulation module 405: and converting the noiseless original bit data into the noiseless two-dimensional code gray value through secondary coding and secondary modulation. And finally, the encryption and authentication of the information coded by the user are completed by decoding the authentication information.
In addition, in the present embodiment, the present invention further includes the following modules: the error correction module 406: the errors introduced by the channel are corrected by decoding. The difference operation module 407: and performing difference operation on the first gray image before decoding and the second gray image after decoding to obtain channel noise and authentication information. The noise separation module 408: separating the authentication information from the channel noise by adopting a BCH decoding method, and the authentication module 409: and the encryption and authentication of the information coded by the user are completed by decoding the authentication information.
The invention combines the communication channel model and the physical equipment (scanning and printing equipment) characteristics of the two-dimensional code in the scanning-printing process, after the original two-dimensional code information is coded and modulated and before the original two-dimensional code information enters the communication channel for transmission, the authentication information is superposed on the original information in the form of artificial noise and is transmitted into the communication channel, the authentication information can be extracted from a receiving end by comparing and analyzing the two-dimensional code after image restoration and the two-dimensional code after noise removal, and the decoding of the authentication information is completed by using the agreed secret key and the decoding technology, thereby completing the authentication of the two-dimensional code and improving the safety of the two-dimensional code in the communication process.
While the invention has been specifically described above in connection with the drawings and examples, it will be understood that the above description is not intended to limit the invention in any way. Those skilled in the art can make modifications and variations to the present invention as needed without departing from the true spirit and scope of the invention, and such modifications and variations are within the scope of the invention.

Claims (8)

1. A two-dimension code generation method in a two-dimension code anti-counterfeiting process comprises the following steps:
converting original information into bit stream by coding mode;
converting the bit stream into an image gray value of the original information;
loading authentication information and generating an image gray value of the authentication information, wherein the authentication information is authentication information with white noise characteristics;
superposing the image gray value of the authentication information to the image gray value of the original data to form a superposed gray image;
adding an image searching pattern beside the superposed image gray scale to generate a two-dimensional code,
wherein, the superimposing the image gray value of the authentication information on the image gray value of the original data includes: the superposition position of the image gray scale value of the original information and the image gray scale value of the authentication information is in a dispersed form or the image gray scale value of the original information and the image gray scale value of the authentication information are superposed in a specified pattern and rotated by different angles.
2. The two-dimensional code generation method of claim 1, comprising:
and the generated two-dimensional code is mixed with channel noise in the transmission process.
3. The two-dimensional code generation method according to any one of claims 1 to 2, wherein superimposing the image grayscale value of the authentication information on the image grayscale value of the original data includes:
the superposition position of the image gray value of the original information and the image gray value of the authentication information is set in a mode that both sides know, or both sides agree, or both sides negotiate, and is not disclosed to the outside.
4. A two-dimensional code decoding method in a two-dimensional code copying process comprises the following steps:
acquiring a two-dimensional code;
restoring the shape distortion, the color distortion and/or the brightness distortion of the two-dimensional code gray image in a communication channel through an image restoration step to obtain a first gray image of the two-dimensional code;
demodulating the first gray image according to a signal modulation method in a two-dimensional code generation step, removing channel noise and authentication information to obtain a second gray image of the two-dimensional code, obtaining the authentication information through the first gray image and the second gray image, demodulating the first gray image according to the signal modulation method in the two-dimensional code generation step, removing the channel noise and the authentication information, and correcting error codes introduced by a channel in a decoding mode;
performing source decoding operation on the demodulated second gray level image to obtain an original bit stream without noise;
converting the noiseless original bit data into a noiseless two-dimensional code gray value through secondary coding and secondary modulation,
and performing difference operation on the first gray image before decoding and the second gray image after decoding to obtain the channel noise and the authentication information.
5. The two-dimensional code decoding method according to claim 4, further comprising the steps of:
and separating the authentication information from the channel noise by adopting a BCH decoding method.
6. A two-dimensional code generating device in a two-dimensional code copying process comprises the following components:
a bitstream generation module: converting original information into bit stream by coding mode;
an image conversion module: converting the bit stream into an image gray value of the original information;
the authentication information loading module: loading authentication information and generating an image gray value of the authentication information, wherein the authentication information is authentication information with white noise characteristics;
an image superimposition module: superposing the image gray value of the authentication information to the image gray value of the original data to form a superposed gray image;
two-dimensional code generation module: adding an image searching pattern beside the superposed image gray scale to generate a two-dimensional code,
wherein, the superimposing the image gray value of the authentication information on the image gray value of the original data includes: the superposition position of the image gray scale value of the original information and the image gray scale value of the authentication information is in a dispersed form or the image gray scale value of the original information and the image gray scale value of the authentication information are superposed in a specified pattern and rotated by different angles.
7. A two-dimensional code decoding device in a two-dimensional code copying process comprises:
an acquisition module: acquiring a two-dimensional code;
and an image restoring module: restoring the shape distortion, the color distortion and/or the brightness distortion of the two-dimensional code gray image in a communication channel through an image restoration step to obtain a first gray image of the two-dimensional code;
noise removal and authentication information module: demodulating the first gray image according to a signal modulation method in a two-dimensional code generation step, removing channel noise and authentication information to obtain a second gray image of the two-dimensional code, obtaining the authentication information through the first gray image and the second gray image, demodulating the first gray image according to the signal modulation method in the two-dimensional code generation step, removing the channel noise and the authentication information, and correcting error codes introduced by a channel in a decoding mode;
and a decoding demodulation module: performing source decoding operation on the demodulated second gray level image to obtain an original bit stream without noise;
a secondary coding modulation module: converting the noiseless original bit data into a noiseless two-dimensional code gray value through secondary coding and secondary modulation,
and performing difference operation on the first gray image before decoding and the second gray image after decoding to obtain the channel noise and the authentication information.
8. The two-dimensional code decoding apparatus according to claim 7, further comprising:
a noise separation module: and separating the authentication information from the channel noise by adopting a BCH decoding method.
CN201711131923.0A 2017-11-15 2017-11-15 Two-dimensional code generating and decoding method and device in two-dimensional code copying process Active CN107918791B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711131923.0A CN107918791B (en) 2017-11-15 2017-11-15 Two-dimensional code generating and decoding method and device in two-dimensional code copying process

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711131923.0A CN107918791B (en) 2017-11-15 2017-11-15 Two-dimensional code generating and decoding method and device in two-dimensional code copying process

Publications (2)

Publication Number Publication Date
CN107918791A CN107918791A (en) 2018-04-17
CN107918791B true CN107918791B (en) 2020-10-09

Family

ID=61895641

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711131923.0A Active CN107918791B (en) 2017-11-15 2017-11-15 Two-dimensional code generating and decoding method and device in two-dimensional code copying process

Country Status (1)

Country Link
CN (1) CN107918791B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108597357A (en) * 2018-05-07 2018-09-28 苏州市彩衣真空镀膜有限公司 A kind of concealed anti-false anti-copying Quick Response Code and its manufacture craft
CN110544091A (en) * 2018-05-29 2019-12-06 北京意锐新创科技有限公司 Payment method and device for supporting financial grade
CN110544083A (en) * 2018-05-29 2019-12-06 北京意锐新创科技有限公司 two-dimensional code display method and device based on mobile payment equipment
CN109447210B (en) * 2018-09-25 2021-10-12 北京奇艺世纪科技有限公司 Two-dimensional code generation method, two-dimensional code reading method and two-dimensional code reading device
CN109840576A (en) * 2019-01-18 2019-06-04 深圳大学 The generation method and coding/decoding method of anti-copying two dimensional code based on segmentation insertion
CN109861815A (en) * 2019-01-18 2019-06-07 深圳大学 The bootlegging channel modeling method and system of two dimensional code
CN110033067B (en) * 2019-03-31 2020-06-02 深圳大学 Anti-copy two-dimensional code and anti-counterfeiting authentication method of two-dimensional code
CN110166248B (en) * 2019-05-07 2022-05-24 太原理工大学 Optical PUF system based on chaotic signal
CN111242874B (en) * 2020-02-11 2023-08-29 北京百度网讯科技有限公司 Image restoration method, device, electronic equipment and storage medium
CN114742910A (en) * 2022-04-20 2022-07-12 浙江沃得威数字技术服务有限公司 Image generation method, storage medium and computer terminal

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5111310A (en) * 1990-12-04 1992-05-05 Research Technologies Corporation, Inc. Method and apparatus for halftone rendering of a gray scale image using a blue noise mask
CN100388309C (en) * 2006-06-21 2008-05-14 北京交通大学 Print domain trademark anti-counterfeit method based on digital watermark technology
CN101847251B (en) * 2010-06-13 2011-10-26 电子科技大学 Digital watermark embedding and extraction method based on chaos sequences
CN106529637B (en) * 2016-10-28 2019-06-25 深圳大学 A kind of the anti-copy implementation method and realization system of two dimensional code

Also Published As

Publication number Publication date
CN107918791A (en) 2018-04-17

Similar Documents

Publication Publication Date Title
CN107918791B (en) Two-dimensional code generating and decoding method and device in two-dimensional code copying process
Tkachenko et al. Two-level QR code for private message sharing and document authentication
CN106529637B (en) A kind of the anti-copy implementation method and realization system of two dimensional code
JP4137084B2 (en) Method for processing documents with fraud revealing function and method for validating documents with fraud revealing function
US7561308B2 (en) System and method for decoding digital encoded images
US20050036651A1 (en) Digital anti&minus forging method
US20070076868A1 (en) Method and apparatus for image encryption and embedding and related applications
JP2004127297A (en) Bar code having extended visibility, system and method thereof
KR20030038677A (en) Authentication watermarks for printed objects and related applications
CN107835332B (en) It is superimposed the two-dimensional code generation method and device of man made noise's information
Alajmi et al. Steganography of encrypted messages inside valid QR codes
JP4143441B2 (en) Information processing method and apparatus, computer program, and computer-readable storage medium
Zhang et al. A high-quality authenticatable visual secret sharing scheme using SGX
Xie et al. Low-cost anti-copying 2D barcode by exploiting channel noise characteristics
Mayer et al. Fundamentals and applications of hardcopy communication
Tkachenko Generation and analysis of graphical codes using textured patterns for printed document authentication
WO2019095172A1 (en) Qr code generating and decoding method and apparatus in qr code copying process
Gomez‐Krämer Verifying document integrity
Borges et al. Document image processing for paper side communications
JP5850370B2 (en) Printed material production method, printed material and authenticity determination method
WO2019095173A1 (en) Method and device for generating two-dimensional code superimposed with artificial noise information
Mayer et al. Text Watermarking
JP2003187292A (en) Method and system for certifying print, and print in which identification information and visible information are padded
Mayer et al. Informed coding for color hardcopy watermarking
EP1259078A1 (en) Method of marking a multimedia document having improved robustness

Legal Events

Date Code Title Description
PB01 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