Tax control secure two-dimensional code coding, decoding processing method
Technical field
The present invention relates to electronic bill field of anti-counterfeit technology, particularly a kind of tax control secure two-dimensional code coding, decoding processing method.
Background technology
Electronic bill is the product of information age, it is based on computing machine and modern communications technology network, commercial fund information is stored among computer system with the form of electronic message, and form can be transmitted by electronic information and carry out transmitting and circulating, there is the gathering of paper bill to realize tradition, pay, circulate, finance, settle accounts, the function such as credit.Quick Response Code is exactly that electronic invoice a kind of electronic information very conventional at present transmits form, by the voucher code of electronic bill, note number, ticket contents information (such as organization, address, phone, fund amount, to make out an invoice time etc. ticket contents information, the ticket contents information that dissimilar electronic invoice comprises is not quite similar) etc. the relevant data message of electronic bill be recorded in Quick Response Code by the carrying of Quick Response Code coded treatment, other user reads Quick Response Code can obtain the relevant data message of the electronic bill that wherein records by being provided with the computing machine of Quick Response Code scanning recognition software or handheld device, realize exchange transmission and the circulation of electronic bill.
Although Quick Response Code is as very easy to use a kind of electronic information that electronic bill is conventional transmits form, but because the encoding and decoding of existing Quick Response Code are carried out based on public Quick Response Code code system agreement all simply, cause Quick Response Code to be replicated and distort all very easy; But, because electronic bill relates to commercial activity and fund flow, for electronic bill, often there is higher tax control safety requirements, but when adopting at present the transmission form of Quick Response Code as electronic bill, some lawless persons with regard to make use of Quick Response Code transreplication, the leak easily distorted transmits false electronic bill content information, reaches its illegal object such as to evade the tax.On the other hand, examination personnel can only carry out true and false examination by the Quick Response Code of mode to recorded electronic ticket contents information that network is online, namely after scanning obtains the electronic bill content information that carries of Quick Response Code, the bill query web of specifying also is logged in by computer equipment connecting Internet, the electronic bill data query system that the electronic bill content information carried by Quick Response Code is input to bill query web is inquired about, and judges the true and false of the electronic bill content information that Quick Response Code records according to Query Result.Such examination mode not only complex operation, there is hysteresis quality, and need to depend on internet, then cannot cannot realizing to electronic bill Quick Response Code the true and false examination work during connecting Internet network.Which results in, under prior art condition, need to obtain electronic bill type business processing immediately by Quick Response Code at some, or cannot under the applicable cases of connecting Internet network immediately at some, the electronic bill content information that just cannot record Quick Response Code carries out the true and false and distinguishes.Therefore, how to improve the tax control security performance of Quick Response Code, become planar bar code technology new study hotspot in electronic bill application.
Summary of the invention
For the above-mentioned deficiency of prior art, the object of the present invention is to provide a kind of tax control secure two-dimensional code code processing method, this tax control secure two-dimensional code code processing method is used for the Quick Response Code coding generating process of electronic bill, Quick Response Code can be improved to the confidentiality of electronic bill content information and tax control security, thus solve the tax control security flaw of existing planar bar code technology in electronic bill application.
For solving the problems of the technologies described above, realize goal of the invention, the technical solution used in the present invention is as follows:
Tax control secure two-dimensional code code processing method, comprises the steps:
1) acquisition needs by the voucher code of the electronic bill of tax control secure two-dimensional code record, note number and ticket contents information;
2) adopt the first cryptographic algorithm to be encrypted computing to described ticket contents information and obtain ticket contents enciphered message, then adopt the electronic signature algorithm computing preset to generate electronic signature to ticket contents enciphered message, and timestamp is added to this electronic signature;
3) adopt the second cryptographic algorithm to be encrypted computing described ticket contents enciphered message, electronic signature and timestamp, form the bill ciphertext that described electronic bill is corresponding;
4) adopt Quick Response Code encryption algorithm to carry out Quick Response Code coded treatment to the voucher code of described electronic bill, note number and bill ciphertext, generate the tax control secure two-dimensional code that described electronic bill is corresponding.
In above-mentioned tax control secure two-dimensional code code processing method, as a kind of preferred version, in described step 4, the Quick Response Code drawing shape of the tax control secure two-dimensional code generated by Quick Response Code encryption algorithm has following feature: this Quick Response Code drawing shape entirety is the lattice pixels figure of rectangle; Location code block is provided with at the angle place of described lattice pixels figure, four pixel limits place of the lattice pixels figure of described rectangle is respectively provided with a location boost line, two the location boost lines being wherein close in location code block are solid line location boost line, and two the location boost lines being away from location code block are dotted line location boost line; Described location code block and four regions of locating between boost lines are data message code word district; Described location code block and four location boost lines are used for as the graph area positioning mark of tax control secure two-dimensional code, and location code block and two solid lines locate the direction that position relationship that boost line and two dotted lines locate boost line is used to indicate tax control secure two-dimensional code; Described data message code word district is used for the data message carrying out the carrying of encoded recording needs according to the character code agreement set in described Quick Response Code encryption algorithm.
In above-mentioned tax control secure two-dimensional code code processing method, as a kind of preferred version, the feature that the Quick Response Code drawing shape that described tax control secure two-dimensional code adopts has also comprises: in the lattice pixels figure of described rectangle, another angle place outside angle, code block place, location is provided with checking code block; Described checking code block is for recording the unique corresponding anti-duplicating identifying code of this Quick Response Code drawing shape, and the picture element density of the anti-duplicating identifying code recorded in checking code block is at more than 600ppi.
In above-mentioned tax control secure two-dimensional code code processing method, as a kind of preferred version, the feature that the Quick Response Code drawing shape that described tax control secure two-dimensional code adopts has also comprises: be designated as additional function information code block adjacent to a pixel column of a dotted line location boost line in described data message code word district; Described additional function information code block is used for carrying out the self-defining additional information of encoded recording according to the character code agreement set in described Quick Response Code encryption algorithm.
In above-mentioned tax control secure two-dimensional code code processing method, as a kind of preferred version, described first cryptographic algorithm is state close SM1 algorithm, the close SM2 algorithm of state, the one in the public spoon cryptographic algorithm of des encryption algorithm, IDEA cryptographic algorithm, DSA Digital Signature Algorithm, RSA, AES Advanced Encryption Standardalgorithm, SHA1 Secure Hash Algorithm, MD5 Message Digest 5; Described second cryptographic algorithm is state close SM1 algorithm, the close SM2 algorithm of state, the one in the public spoon cryptographic algorithm of des encryption algorithm, IDEA cryptographic algorithm, DSA Digital Signature Algorithm, RSA, AES Advanced Encryption Standardalgorithm, SHA1 Secure Hash Algorithm, MD5 Message Digest 5; Described electronic signature algorithm is the one in the close SM2 algorithm of state, DSA Digital Signature Algorithm, the public spoon cryptographic algorithm of RSA, SHA1 Secure Hash Algorithm, MD5 Message Digest 5.
Correspondingly, present invention also offers the decoding processing method corresponding with above-mentioned tax control secure two-dimensional code code processing method, in order to carry out decoding process to the tax control secure two-dimensional code generated by above-mentioned tax control secure two-dimensional code code processing method, and the tax control security verification that just can complete in decode procedure tax control secure two-dimensional code, embody the tax control safe reliability of tax control secure two-dimensional code further.For realizing this object, the technical solution used in the present invention is as follows:
Tax control secure two-dimensional code decoding processing method, for carrying out decoding process to the tax control secure two-dimensional code that tax control secure two-dimensional code code processing method generates as claimed in claim 1; The method comprises the steps:
A) adopt the Quick Response Code recognizer corresponding to described Quick Response Code encryption algorithm to carry out Quick Response Code identifying processing to tax control secure two-dimensional code, obtain the voucher code of the electronic bill wherein recorded, note number and bill ciphertext;
B) adopt the algorithm for inversion of the second cryptographic algorithm to be decrypted computing to described bill ciphertext, obtain the ticket contents enciphered message of electronic bill, electronic signature and timestamp;
C) adopt described default electronic signature algorithm to carry out electronic signature computing to the ticket contents enciphered message that step b deciphering obtains, and the electronic signature of this electronic signature operation result step b being deciphered acquisition is compared; If the two is identical, then continue to perform steps d; If the two is different, then forbids exporting tax control secure two-dimensional code decoded result, and point out this tax control secure two-dimensional code to there is tax control potential safety hazard;
D) algorithm for inversion of the first cryptographic algorithm is adopted to be decrypted computing to described ticket contents enciphered message, obtain the ticket contents information of described electronic bill, the ticket contents information of the timestamp that the voucher code of the electronic bill then step a identification obtained, note number, step b deciphering obtain and this step deciphering acquisition is exported as tax control secure two-dimensional code decoded result.
In above-mentioned tax control secure two-dimensional code decoding processing method, as a kind of preferred version, in described step a, the concrete steps of tax control secure two-dimensional code being carried out to Quick Response Code identifying processing comprise:
A1) by fixation and recognition, the graph area of tax control secure two-dimensional code is obtained;
A2) graph area of the tax control secure two-dimensional code of acquisition is divided into N number of block figure, and records the distributing position of each block figure; Wherein, the value of N is be greater than 1 natural square;
A3) concurrently respectively code word identification is carried out to described N number of block figure; Wherein, to the code word identifying of each block figure be, first binary conversion treatment is carried out to block figure, then according to the binaryzation image pattern element value in the character code agreement set in described Quick Response Code encryption algorithm and the corresponding relation of code word, the block figure after binary conversion treatment is identified as corresponding block code word array;
A4) each block figure corresponding block code word array is carried out splicing according to the distributing position of corresponding block figure to recover, thus obtain the complete code array of the graph area of tax control secure two-dimensional code;
A5) according to the corresponding relation of the code word array in the character code agreement set in described Quick Response Code encryption algorithm and data message character, data message identification is carried out to described complete code array, obtain the data message recorded in tax control secure two-dimensional code.
In above-mentioned tax control secure two-dimensional code decoding processing method, as a kind of preferred version, described first cryptographic algorithm is state close SM1 algorithm, the close SM2 algorithm of state, the one in the public spoon cryptographic algorithm of des encryption algorithm, IDEA cryptographic algorithm, DSA Digital Signature Algorithm, RSA, AES Advanced Encryption Standardalgorithm, SHA1 Secure Hash Algorithm, MD5 Message Digest 5; Described second cryptographic algorithm is state close SM1 algorithm, the close SM2 algorithm of state, the one in the public spoon cryptographic algorithm of des encryption algorithm, IDEA cryptographic algorithm, DSA Digital Signature Algorithm, RSA, AES Advanced Encryption Standardalgorithm, SHA1 Secure Hash Algorithm, MD5 Message Digest 5; Described electronic signature algorithm is the one in the close SM2 algorithm of state, DSA Digital Signature Algorithm, the public spoon cryptographic algorithm of RSA, SHA1 Secure Hash Algorithm, MD5 Message Digest 5.
Compared to prior art, the present invention has following advantage:
1, the tax control secure two-dimensional code that generates of tax control secure two-dimensional code code processing method of the present invention, the Quick Response Code scanning recognition device with corresponding Quick Response Code recognizer processing power can be allowed directly to read voucher code and the note number of electronic bill, be convenient to exchange and the circulation of electronic bill, but directly cannot read the ticket contents information of electronic bill, enhance the confidentiality to ticket contents information.
2, in the tax control secure two-dimensional code that tax control secure two-dimensional code code processing method of the present invention generates, ticket contents information for electronic bill first adopts the first cryptographic algorithm to be encrypted computing and forms ticket contents enciphered message, also adopt the electronic signature algorithm computing preset to generate electronic signature to ticket contents enciphered message simultaneously, and timestamp is added to this electronic signature, therefore only the cryptographic calculation mode of the first cryptographic algorithm and the second cryptographic algorithm and corresponding secret key is being known, after just bill decrypt ciphertext may being obtained ticket contents enciphered message, deciphering obtains ticket contents information further, strengthen tax control secure two-dimensional code to the confidentiality of ticket contents information on the one hand, avoid unauthorized side obtain the ticket contents information of electronic bill easily and forge false electronic bill content information by the mode such as distorting, on the other hand, for authorized party, authorized party can be allowed to obtain decrypted rights or decryption condition, decode smoothly the ticket contents information thus the anti-counterfeiting performance strengthening tax control secure two-dimensional code that obtain the electronic bill recorded in tax control secure two-dimensional code.
3, in the tax control secure two-dimensional code that tax control secure two-dimensional code code processing method of the present invention generates, the electronic signature comprised in default electronic signature algorithm and bill ciphertext can be utilized for whether there is forgery according to checking ticket contents enciphered message, distort risk, by carrying out timestamp confirmation with the coding staff of tax control secure two-dimensional code, the true and false of tax control secure two-dimensional code can also be examined.
4, tax control secure two-dimensional code code processing method of the present invention; the tax control secure two-dimensional code generated that makes to encode thus has possessed multi-level tax control safeguard protection; improve the anti-tamper security performance of tax control secure two-dimensional code; and the electronic signature information wherein carried can as the instrument carrying out off-line authenticity verification under the condition departing from internet immediately; solve in prior art and receive the problem of network condition and time restriction with true and false examination during Quick Response Code transmission electronic bill information, effectively strengthen the tax control security of tax control secure two-dimensional code.
5, in tax control secure two-dimensional code code processing method of the present invention, preferably can also adopt a kind of Quick Response Code drawing shape with specific characteristic, make to adopt the Quick Response Code scanning recognition equipment of existing main flow Quick Response Code recognizer directly can not read the data message of record in tax control secure two-dimensional code coding, the tax control secure two-dimensional code conversion identification equipment needing to have this unique Quick Response Code image recognition ability just can read data message wherein, further enhancing the confidentiality of tax control secure two-dimensional code, also embody the monopoly of tax control secure two-dimensional code from Quick Response Code drawing shape simultaneously.
6, tax control secure two-dimensional code decoding processing method of the present invention, while the decryption processing of carrying out Quick Response Code identifying processing and cryptographic algorithm, also after ticket contents enciphered message being adopted described default electronic signature algorithm to carry out electronic signature computing, contrast verification is carried out in the original electronic signature comprised in electronic signature operation result and bill ciphertext, forge to judge whether the bill ciphertext of tax control secure two-dimensional code exists or distort risk, and forbid when there is risk exporting tax control secure two-dimensional code decoded result, not only prevent useful information in tax control secure two-dimensional code by illegal leakage, and can the true and false of contained electronic bill content information in the tax control of off-line examination immediately secure two-dimensional code under the online condition in internet do not relied on, thus improve tax control security further in the decoding link of tax control secure two-dimensional code.
7, in tax control secure two-dimensional code decoding processing method of the present invention, the mode by the identification of blockette parallel decoding can also be optimized, promote the efficiency of Quick Response Code identifying processing, reduce Quick Response Code identifying processing consuming time, thus optimize the overall execution efficiency of Quick Response Code decoding process.
Accompanying drawing explanation
Fig. 1 is the FB(flow block) of tax control secure two-dimensional code code processing method of the present invention;
Fig. 2 is a kind of preferred version exemplary plot of the Quick Response Code drawing shape of tax control secure two-dimensional code;
Fig. 3 is the another kind of preferred version exemplary plot of the Quick Response Code drawing shape of tax control secure two-dimensional code;
Fig. 4 is the FB(flow block) of tax control secure two-dimensional code decoding processing method of the present invention.
Embodiment
Below in conjunction with accompanying drawing, technical scheme of the present invention is further illustrated.
The Quick Response Code of prior art is adopted to carry out the transmission circulation of electronic bill content information, be difficult to ensure its anti-forgery security to electronic bill content information, and to the bill query web that the Quick Response Code authenticity verification examination containing electronic bill content information also only depends on internet and specifies in prior art, complex operation, check delayed, to network condition dependence, all bring opportunity to lawless person, thus bring difficulty for the tax control of electronic bill.Be directed to this, the present invention proposes a kind of tax control secure two-dimensional code code processing method, stronger maintaining secrecy and anti-counterfeiting performance is just possessed by the special coded treatment tax control secure two-dimensional code self generated that makes to encode thus, and self also carries examination information, thus brings tax control safety guarantee for this tax control secure two-dimensional code use in electronic bill application.The treatment scheme of tax control secure two-dimensional code code processing method of the present invention as shown in Figure 1, comprises the steps:
1) acquisition needs by the voucher code of the electronic bill of tax control secure two-dimensional code record, note number and ticket contents information;
2) adopt the first cryptographic algorithm to be encrypted computing to described ticket contents information and obtain ticket contents enciphered message, then adopt the electronic signature algorithm computing preset to generate electronic signature to ticket contents enciphered message, and timestamp is added to this electronic signature;
3) adopt the second cryptographic algorithm to be encrypted computing described ticket contents enciphered message, electronic signature and timestamp, form the bill ciphertext that described electronic bill is corresponding;
4) adopt Quick Response Code encryption algorithm to carry out Quick Response Code coded treatment to the voucher code of described electronic bill, note number and bill ciphertext, generate the tax control secure two-dimensional code that described electronic bill is corresponding.
Can be seen by above-mentioned coded treatment flow process, in this bright tax control secure two-dimensional code code processing method, Quick Response Code encryption algorithm is still directly adopted to encode to the voucher code of electronic bill and note number, allow the Quick Response Code scanning recognition device with corresponding Quick Response Code recognizer processing power directly can read voucher code and the note number of electronic bill, in order to carry out simple electronic bill transmission, circulation running.And for the ticket contents information of electronic bill, first adopt the first cryptographic algorithm to be encrypted computing and form ticket contents enciphered message, make directly to adopt Quick Response Code recognizer only can read ticket contents enciphered message, and directly cannot obtain ticket contents information itself, increase the confidentiality to ticket contents information, also adopt the electronic signature algorithm computing preset to generate electronic signature to ticket contents enciphered message simultaneously, and timestamp is added to this electronic signature, then again by described ticket contents enciphered message, electronic signature and timestamp adopt the second cryptographic algorithm to be encrypted computing and form bill ciphertext, the last Quick Response Code encryption algorithm that just adopts is by the voucher code of this electronic bill, note number is encoding in tax control secure two-dimensional code together with bill ciphertext.Like this, for the tax control secure two-dimensional code adopting the inventive method coding to obtain, the ticket contents information of the electronic bill wherein recorded directly then directly cannot be read by corresponding Quick Response Code recognizer, and the bill ciphertext that can only read through encryption, only knowing the cryptographic calculation mode of the first cryptographic algorithm and the second cryptographic algorithm and corresponding secret key, after just bill decrypt ciphertext may being obtained ticket contents enciphered message, deciphering obtains ticket contents information further.Thus, on the one hand strengthen tax control secure two-dimensional code to the confidentiality of ticket contents information, avoid unauthorized side and obtain the ticket contents information of electronic bill easily and forge false electronic bill content information by the mode such as distorting, on the other hand, for authorized party, can by the mode of the cryptographic calculation mode and corresponding secret key of informing the first cryptographic algorithm and the second cryptographic algorithm, authorized party is allowed to obtain decrypted rights, can decode smoothly and obtain the ticket contents information of the electronic bill recorded in tax control secure two-dimensional code, or provide to authorized party and be integrated with corresponding Quick Response Code recognizer and the first cryptographic algorithm, the special decoding device of the second cryptographic algorithm decrypted program, authorized party is allowed to obtain decryption condition, the ticket contents information obtaining the electronic bill recorded in tax control secure two-dimensional code can be read by special decoding device, thus strengthen the anti-counterfeiting performance of tax control secure two-dimensional code, moreover, except ticket contents information, the electronic signature of ticket contents enciphered message is further comprises in bill ciphertext, if someone has illegally cracked the bill ciphertext in tax control secure two-dimensional code, malice is forged or has distorted the ticket contents enciphered message comprised in bill ciphertext, then forge, the ticket contents enciphered message of distorting then is difficult to corresponding with the electronic signature comprised original in bill ciphertext, thus the electronic signature comprised in default electronic signature algorithm and bill ciphertext can be utilized for whether there is forgery according to checking ticket contents enciphered message, distort risk, further again, electronic signature is also added with timestamp, therefore decoding side is after obtaining the electronic signature and timestamp comprised in the bill ciphertext of tax control secure two-dimensional code, by carrying out timestamp confirmation with the coding staff of tax control secure two-dimensional code, can also examine the true and false of tax control secure two-dimensional code.As can be seen here; tax control secure two-dimensional code code processing method of the present invention; the tax control secure two-dimensional code generated that makes to encode thus has possessed multi-level tax control safeguard protection; improve the anti-tamper security performance of tax control secure two-dimensional code; and the electronic signature information wherein carried can as the instrument carrying out off-line authenticity verification under the condition departing from internet immediately; solve in prior art and receive the problem of network condition and time restriction with true and false examination during Quick Response Code transmission electronic bill information, effectively strengthen the tax control security of tax control secure two-dimensional code.
In the Quick Response Code encryption algorithm applied in tax control secure two-dimensional code code processing method of the present invention, the character code agreement that main flow Quick Response Code in prior art can be adopted to use and Quick Response Code drawing shape, such as just carry out the process of Quick Response Code encryption algorithm according to the character code agreement of the standard two-dimensional codes such as GM code, Chinese letter co, QR code and Quick Response Code drawing shape, the tax control secure two-dimensional code coding obtained also just correspondingly shows as the Quick Response Code graphic form of GM code, Chinese letter co or QR code.But in the application scenario of a lot of electronic bill, there is higher security requirements, and consider from the angle of tax control secure two-dimensional code self, also preferably can embody the monopoly that it is different from ordinary two dimensional code, be directed to this, as a preferred embodiment of the present invention, in the Quick Response Code encryption algorithm applied in tax control secure two-dimensional code code processing method of the present invention, a kind of Quick Response Code drawing shape with specific characteristic of preferred employing, make to adopt the Quick Response Code scanning recognition equipment of existing main flow Quick Response Code recognizer directly can not read the data message of record in tax control secure two-dimensional code coding, the tax control secure two-dimensional code conversion identification equipment needing to have this unique Quick Response Code image recognition ability just can read data message wherein, further enhancing the confidentiality of tax control secure two-dimensional code to a certain extent, also embody the monopoly of tax control secure two-dimensional code from Quick Response Code drawing shape simultaneously.In this preferred version, in the step 5 of tax control secure two-dimensional code code processing method of the present invention, the Quick Response Code drawing shape of the tax control secure two-dimensional code generated by Quick Response Code encryption algorithm has following feature: this Quick Response Code drawing shape entirety is the lattice pixels figure of rectangle; Location code block is provided with at the angle place of described lattice pixels figure, four pixel limits place of the lattice pixels figure of described rectangle is respectively provided with a location boost line, two the location boost lines being wherein close in location code block are solid line location boost line, and two the location boost lines being away from location code block are dotted line location boost line; Described location code block and four regions of locating between boost lines are data message code word district; Described location code block and four location boost lines are used for as the graph area positioning mark of tax control secure two-dimensional code, and location code block and two solid lines locate the direction that position relationship that boost line and two dotted lines locate boost line is used to indicate tax control secure two-dimensional code; Described data message code word district is used for the data message carrying out the carrying of encoded recording needs according to the character code agreement set in described Quick Response Code encryption algorithm.Fig. 2 shows an example of the Quick Response Code drawing shape of the tax control secure two-dimensional code that Quick Response Code encryption algorithm generates in this preferred version.Can see, this Quick Response Code drawing shape use only a location code block 10 in conjunction with four location boost lines 20 as graph area positioning mark, location code block 10 and four regions of locating between boost lines 20 are data message code word district 30, obviously being different from main flow two-dimension code pattern in prior art adopts 3 ~ 4 location code blocks as the mode of graph area positioning mark, embodies the monopoly of tax control secure two-dimensional code, simultaneously, in four location boost lines 20, two the location boost lines being close in location code block 10 are solid line location boost line 21, two the location boost lines being away from location code block are dotted line location boost line 22, make to have possessed obvious direction feature by location code block 10 and four location position identifiers of forming of boost line 20, the scanning recognition device of tax control secure two-dimensional code can identify the correct direction of tax control secure two-dimensional code according to this direction indicative character, therefore ensure that this Quick Response Code drawing shape adopts arbitrarily angled shooting scanning all can be correctly validated.
As on above-mentioned preferred Quick Response Code circular foundation further prioritization scheme, the feature had above-mentioned this Quick Response Code drawing shape also comprises: in the lattice pixels figure of described rectangle, and another angle place outside angle, code block place, location is provided with checking code block; Described checking code block is for recording the unique corresponding anti-duplicating identifying code of this Quick Response Code drawing shape, and the picture element density of the anti-duplicating identifying code recorded in checking code block is at more than 600ppi.Fig. 3 shows an example of the Quick Response Code drawing shape that this is optimized further.Improve in the Quick Response Code drawing shape of one-step optimization, except location code block 10, article four, locate boost line 20(and comprise two solid line location boost lines 21 and two dotted line location boost lines 22), outside data message code word district 30, checking code block 40 is also provided with at another angle place, in checking code block 40, the picture element density of the anti-duplicating identifying code of record is at more than 600ppi, this picture element density requires that current printing technique can reach, but reprography does not reach, that is, if what official or authorized party were printed has verify that the tax control secure two-dimensional code figure of code block is duplicated abuse, because reprography cannot reach the picture element density requirement of more than 600ppi, significant change will be there is in the anti-duplicating identifying code in the checking code block therefore run off because duplicating fuzzy, therefore whether the scanning recognition device of tax control secure two-dimensional code just can there is significant change according to anti-duplicating identifying code and judge that the tax control secure two-dimensional code of Current Scan is original print or is duplicated by the later stage, thus the false proof of tax control secure two-dimensional code and tax control security performance is improved further on Quick Response Code drawing shape.In addition, self-defining additional information under can also adding different application occasion in the data message code word district of this preferred Quick Response Code drawing shape, such as, additional function information code block 31 is designated as adjacent to a pixel column of a dotted line location boost line 21, as shown in Figure 3 in described data message code word district; Described additional function information code block 31 is for carrying out the self-defining additional information of encoded recording according to the character code agreement set in described Quick Response Code encryption algorithm.This self-defining additional information can be determined according to concrete application scenario, it can be such as one section of official's authorization information, also can be the pattern I D code information of the so-called correspondence of this Quick Response Code drawing shape, or some attribute informations etc. that electronic bill content information is relevant, thus checking to Quick Response Code drawing shape self or electronic bill content information, anti-counterfeiting performance can be strengthened further by these self-defining additional informations.
Correspondingly, on the basis of tax control secure two-dimensional code code processing method provided by the invention, present invention also offers a kind of tax control secure two-dimensional code decoding processing method, in order to carry out decoding process to the tax control secure two-dimensional code adopting the inventive method to carry out coding generation, and the tax control security verification that just directly can complete under not by the condition of internet in decode procedure tax control secure two-dimensional code, make to need to obtain electronic bill type business processing immediately by Quick Response Code at some, or cannot under the applicable cases of connecting Internet network immediately at some, the true and false of contained electronic bill content information in tax control secure two-dimensional code just can be authenticated to immediately by decoding, thus promote its tax control security further in the decoding link of tax control secure two-dimensional code.The treatment scheme of tax control secure two-dimensional code decoding processing method of the present invention as shown in Figure 4, comprises the steps:
A) adopt the Quick Response Code recognizer corresponding to described Quick Response Code encryption algorithm to carry out Quick Response Code identifying processing to tax control secure two-dimensional code, obtain the voucher code of the electronic bill wherein recorded, note number and bill ciphertext;
B) adopt the algorithm for inversion of the second cryptographic algorithm to be decrypted computing to described bill ciphertext, obtain the ticket contents enciphered message of electronic bill, electronic signature and timestamp;
C) adopt described default electronic signature algorithm to carry out electronic signature computing to the ticket contents enciphered message that step b deciphering obtains, and the electronic signature of this electronic signature operation result step b being deciphered acquisition is compared; If the two is identical, then continue to perform steps d; If the two is different, then forbids exporting tax control secure two-dimensional code decoded result, and point out this tax control secure two-dimensional code to there is tax control potential safety hazard;
D) algorithm for inversion of the first cryptographic algorithm is adopted to be decrypted computing to described ticket contents enciphered message, obtain the ticket contents information of described electronic bill, the ticket contents information of the timestamp that the voucher code of the electronic bill then step a identification obtained, note number, step b deciphering obtain and this step deciphering acquisition is exported as tax control secure two-dimensional code decoded result.
Can be seen by above-mentioned decoding treatment scheme, in tax control secure two-dimensional code decoding processing method of the present invention, the voucher code of electronic bill is obtained by the Quick Response Code recognizer corresponding to Quick Response Code encryption algorithm, after the bill ciphertext of note number and correspondence, adopt the ticket contents enciphered message in the algorithm for inversion deciphering acquisition bill ciphertext of the second cryptographic algorithm again, electronic signature and timestamp, but also need, after ticket contents enciphered message being adopted described default electronic signature algorithm to carry out electronic signature computing, contrast verification is carried out in the original electronic signature comprised in electronic signature operation result and bill ciphertext, need the algorithm for inversion of the first cryptographic algorithm be unanimously just adopted to be decrypted computing acquisition ticket contents information to described ticket contents enciphered message further by contrast verification, by voucher code, note number, timestamp and ticket contents information are exported as tax control secure two-dimensional code decoded result, if electronic tag contrast verification is inconsistent, show that the information comprised in bill ciphertext may be forge or be tampered, then forbid exporting tax control secure two-dimensional code decoded result, and point out this tax control secure two-dimensional code to there is tax control potential safety hazard, prevent useful information in tax control secure two-dimensional code by illegal leakage, enhance the confidentiality of tax control secure two-dimensional code.This tax control secure two-dimensional code decoding processing method can become decoding processing program to be carried in tax control secure two-dimensional code decoding device by programming technique staffing, in order to carry out decoding process to the tax control secure two-dimensional code adopting tax control secure two-dimensional code code processing method of the present invention to generate, do not relying under the online condition in internet, just can check the true and false of contained electronic bill content information in tax control secure two-dimensional code by off-line immediately, thus promote its tax control security further in the decoding link of tax control secure two-dimensional code.
As a kind of prioritization scheme of tax control secure two-dimensional code decoding processing method of the present invention, in the step a of decoding process, Quick Response Code identifying processing is carried out to tax control secure two-dimensional code and can adopt following treatment scheme:
A1) by fixation and recognition, the graph area of tax control secure two-dimensional code is obtained;
A2) graph area of the tax control secure two-dimensional code of acquisition is divided into N number of block figure, and records the distributing position of each block figure; Wherein, the value of N is be greater than 1 natural square;
A3) concurrently respectively code word identification is carried out to described N number of block figure; Wherein, to the code word identifying of each block figure be, first binary conversion treatment is carried out to block figure, then according to the binaryzation image pattern element value in the character code agreement set in described Quick Response Code encryption algorithm and the corresponding relation of code word, the block figure after binary conversion treatment is identified as corresponding block code word array;
A4) each block figure corresponding block code word array is carried out splicing according to the distributing position of corresponding block figure to recover, thus obtain the complete code array of the graph area of tax control secure two-dimensional code;
A5) according to the corresponding relation of the code word array in the character code agreement set in described Quick Response Code encryption algorithm and data message character, data message identification is carried out to described complete code array, obtain the data message recorded in tax control secure two-dimensional code.
Can be seen by above-mentioned treatment scheme, the usual manner directly whole graph area identified in prior art is not adopted when code word identification being carried out to the graph area of tax control secure two-dimensional code in this prioritization scheme, but the graph area of tax control secure two-dimensional code is divided into N number of block figure, concurrently code word identification is carried out to each block figure, because carrying out code word identification to a graph area is separately serial identification line by line, the code word that the graph area of whole tax control secure two-dimensional code comprises is very many, serial identification is consuming time longer line by line, and the code word amount that comprises significantly reduces in each block figure after dividing, and the code word identification of each block figure is parallel to be carried out, consuming timely significantly to shorten, and then after the splicing of each block figure corresponding block code word battle array is reverted to the complete code array of the graph area of tax control secure two-dimensional code, identify the total data information recorded in tax control secure two-dimensional code, the efficiency of Quick Response Code identifying processing in step a is made to improve like this, minimizing consuming time, integrating step b again, c, the encryption of d, contrast process, make the overall execution efficiency of tax control secure two-dimensional code decoding processing method of the present invention can be suitable with the processing execution efficiency of decoding of general Quick Response Code in prior art, if the division numbers of block figure is more, the execution efficiency of tax control secure two-dimensional code decoding process of the present invention even can be better than the Quick Response Code decoding processing execution efficiency of prior art.Certainly, because tax control secure two-dimensional code decoding processing method of the present invention needs to carry out code word identification respectively to each block figure concurrently, may have higher requirement to the handling property of recognition system, this is also promote the performance cost paid required for decoding processing execution efficiency.
It should be noted that in addition, the first cryptographic algorithm involved in tax control secure two-dimensional code coding of the present invention, decoding processing method, the second cryptographic algorithm and electronic signature algorithm, same cryptographic algorithm can be adopted, but preferably adopt the cryptographic algorithm that three kinds are different, better to ensure the anti-tamper security performance of tax control secure two-dimensional code.The first cryptographic algorithm involved in the inventive method, second cryptographic algorithm can be cryptographic algorithm conventional in prior art, the close SM1 algorithm of such as state, the close SM2 algorithm of state, DES(Data Encryption Standard) cryptographic algorithm, IDEA(International Data Encryption Algorithm) cryptographic algorithm, DSA(Digital Signature Algorithm) Digital Signature Algorithm, the public spoon cryptographic algorithm of RSA, AES(Advanced Encryption Standard) Advanced Encryption Standardalgorithm, SHA1(Secure Hash Algorithm, FIPS PUB 180-1) Secure Hash Algorithm, MD5(Message Digest Algorithm 5) Message Digest 5 etc., and electronic signature algorithm involved in the inventive method, also can be electronic signature algorithm conventional in prior art, the public spoon cryptographic algorithm of the close SM2 algorithm of such as state, DSA Digital Signature Algorithm, RSA, SHA1 Secure Hash Algorithm, MD5 Message Digest 5 etc.
What finally illustrate is, above embodiment is only in order to illustrate technical scheme of the present invention and unrestricted, although with reference to preferred embodiment to invention has been detailed description, those of ordinary skill in the art is to be understood that, can modify to technical scheme of the present invention or equivalent replacement, and not departing from aim and the scope of technical solution of the present invention, it all should be encompassed in the middle of right of the present invention.