CN104318461A - Anti-counterfeiting code generation and verification method based on cipher machine and USBKey - Google Patents

Anti-counterfeiting code generation and verification method based on cipher machine and USBKey Download PDF

Info

Publication number
CN104318461A
CN104318461A CN201410564708.XA CN201410564708A CN104318461A CN 104318461 A CN104318461 A CN 104318461A CN 201410564708 A CN201410564708 A CN 201410564708A CN 104318461 A CN104318461 A CN 104318461A
Authority
CN
China
Prior art keywords
key
invoice
usbkey
cipher machine
security code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201410564708.XA
Other languages
Chinese (zh)
Other versions
CN104318461B (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.)
Inspur Software Technology Co Ltd
Original Assignee
Inspur Software Group Co Ltd
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 Inspur Software Group Co Ltd filed Critical Inspur Software Group Co Ltd
Priority to CN201410564708.XA priority Critical patent/CN104318461B/en
Publication of CN104318461A publication Critical patent/CN104318461A/en
Application granted granted Critical
Publication of CN104318461B publication Critical patent/CN104318461B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Storage Device Security (AREA)

Abstract

The invention provides an anti-counterfeiting code generation and verification method based on a cipher machine and a USBKey, which is used for generating a specific anti-counterfeiting code according to the calculation of parameters such as tax number, amount, code, invoice number, invoicing date and the like of an invoice and supporting the verification method. The USBKey data verification is synchronously provided, the problem of low timeliness of the USBKey is solved, one ticket and one code are more effectively, more safely and more timely achieved, a cipher machine is used, an algorithm supporting SM1/SM2/SM3/SM4/3DES/SSF33 encryption is provided, anti-counterfeiting codes with national standard rules are generated according to identification numbers of taxpayers of invoicing parties, invoicing amount, invoice codes, invoice numbers and invoice information of invoicing dates, hidden dangers of network safety are guaranteed, and the timeliness problem cannot be solved under the condition that keys infused by the USBKey are different from any group of keys of the encryption machine.

Description

A kind of security code based on cipher machine and USBKey generates and verification method
Technical field
The present invention relates to Computer Applied Technology field, the security code specifically based on cipher machine and USBKey generates and verification method, provides effective invoice identification and true or false checking for existing network invoice, electronic invoice field.
Background technology
Managing bill system reaches its maturity, and the theory of controlling taxation by bills obtains extensive common recognition.More important to true from false of bills checking thus, be more necessary Strengthens network safety and checking means.
Rely on internet in the use of invoice and electronic invoice, in practical application there is very unstable safety problem in network, once leaking appears in data, consequence is hardly imaginable.
USBKey tries out mainly as identity verification, storage data two kinds of modes at present, when invoice and electronic invoice application, exists ageing not high, there is certain intervals, can not meet the situations such as actual use in time.
Security code based on cipher machine and USBKey generates and verification method, integrates the cipher machine guaranteed network security and the timeliness problem solving USBKey storage data, provide a kind of more effectively, more standard, the management method more used and means.
Summary of the invention
The object of this invention is to provide a kind of security code based on cipher machine and USBKey to generate and verification method.
The object of the invention is to realize in the following manner, in there is ageing not high problem for USBKey offline storage invoice data, utilize and fix under the identical prerequisite of a group key at the filling USBKey key of guarantee with encryption equipment, identical security code generating algorithm Sum fanction, then cipher machine checking is relied on, the ageing not high problem of effective solution, specifically comprises the following steps:
1) 200 keys initially inculcated by cipher machine, each key is one group, order is successively: (1) transmission security key, (2) encryption key, (3) MAC key, (4) TAX key, (5) spare key, (6) spare key, the term of validity of every group key is determined by application system, and after the term of validity, automatically to enable next group key effective for application system;
2) cryptographic algorithm supports that specific implementation algorithm configuration is as follows:
0—3des;1—SM1;2—SM2;3—SSF33;4—SM4;
3) data layout process:
(1) make out an invoice the time online: retain Hour Minute Second, be converted into 14 bit digital forms;
(2) Taxpayer Identification Number: 20 bit digital, as figure place zero padding not above;
(3) invoice codes: 12 bit digital, as figure place zero padding not above;
(4) invoice number: 8 bit digital, as figure place zero padding not above;
(5) invoice amount: invoice amount is got point, removes radix point, then mends " 0 " before the amount of money to 20, then transforms the ASCII character of the amount of money to sexadecimal 10 byte;
(6) code data item process: the ASCII character+0x80 of MAC value front 4 bytes+amount of money sexadecimal 10 byte;
4) by the Taxpayer Identification Number after process in step 3), what Taxpayer Identification Number was converted to 16 systems deposits array, regularly processes, obtain factor array to the Taxpayer Identification Number array of 16 bytes;
5) according to the encryption Summing Factor cryptographic algorithm that step 4) obtains, call cipher machine, generate interim handle and temporary key;
6) according to step 3) data, permanent order splicing data: invoice codes+invoice number+make out an invoice the date, is converted into 16 system ASCII character;
7) ASCII character that the interim handle obtained according to step 5) and temporary key, step 6) obtain and cryptographic algorithm (as SM4) call cipher machine, generate MAC value, nullify temporary key;
8) amount of money is processed, amount of money step 3) obtained and 7) the MAC value process that obtains, obtain code data item: the ASCII character+0x80 of MAC value front 4 bytes+amount of money sexadecimal 10 byte;
9) according to the encryption Summing Factor cryptographic algorithm SM4 that step 4) obtains, call cipher machine, generate interim handle and temporary key;
10) generate 16 bytecodes according to step 7) data item, the interim handle of step 8) and temporary key and cryptographic algorithm SM4, nullify temporary key, close cipher machine;
11) 16 bytecodes step 9) obtained are converted into 20 digital form codes, finally last for 20 digit numeric codes two are replaced to used cipher machine key group group number, finally obtain security code.
This programme security code verification method, specifically comprises the following steps:
1) according to invoice data and security code, the key group group number called security code from cipher machine generates new code, then compares with security code, identical, illustrates and is verified, and different explanation checking is not passed through;
2) USBKey data verification, precondition USBKey inculcates key and encryption equipment, and to fix a certain group key identical, so the security code generated meets the checking in encryption equipment, in like manner 11);
3) security code of cipher machine and USBKey generates with verification method result as follows:
(1) ticket counterfoil is retained from material object and is become the preservation of Electronic Coding information, and data are safer, retention cycle is longer, search efficiency is higher;
(2) network is more added with safety guarantee, USBKey meet an urgent need off-line data obtain more in time verification examination, the true or false of effective guarantee invoice.
Beneficial effect of the present invention is as follows:
1) be applicable to invoice and electronic invoice, print on invoice with 20 bit digital forms;
2) support that online enquiries mode distinguishes its true or false.
3) need to provide the USBKey mobile device storage invoice information that off-line is opened;
4) true or false is verified to need security code to support constantly, there is not ageing not high situation;
5) according to invoice data invoice information: the side's of making out an invoice Taxpayer Identification Number, the amount of money of making out an invoice, invoice codes, invoice number, to make out an invoice the date, the security code with GB rule is generated.
Access to your password machine, the algorithm that the SM1/SM2/SM3/SM4/3DES/SSF33 that provides support encrypts, according to the identifier of the side of making out an invoice taxpayer, the amount of money of making out an invoice, invoice codes, invoice number, the invoice information on date of making out an invoice, generate the security code with GB rule, guarantee network security the hidden danger existed, there is the situation being different from any group key of encryption equipment in the key inculcated for USBKey, then can't resolve ageing problem.
Accompanying drawing explanation
Fig. 1 is working-flow figure;
Fig. 2 is checking process flow diagram;
Fig. 3 is that off-line system is made out an invoice flow process;
Fig. 4 is that flow process opened by net ticket;
Fig. 5 key management flow process.
Embodiment
With reference to Figure of description, method of the present invention is described in detail below.
A kind of security code based on cipher machine and USBKey generates and verification method, access to your password machine, the algorithm that the SM1/SM2/SM3/SM4/3DES/SSF33 that provides support encrypts, according to invoice information: the side's of making out an invoice Taxpayer Identification Number, the amount of money of making out an invoice, invoice codes, invoice number, to make out an invoice the date, generate the security code with GB rule, guarantee network security the hidden danger existed.
Ageing not high problem is there is for USBKey offline storage invoice data, utilize and fix under the identical prerequisite of a group key at the filling USBKey key of guarantee with encryption equipment, identical security code generating algorithm Sum fanction, then relies on cipher machine checking, efficiently solves ageing not high problem.
There is the situation being different from any group key of encryption equipment in the key inculcated for USBKey, then can't resolve ageing problem.
The false proof code generating method of this programme, specifically comprises the following steps: (as shown in Figure 1)
1) 200 keys initially inculcated by cipher machine, existing each key is one group, order is successively: 1, transmission security key 2, encryption key 3, MAC key 4, TAX key 5, spare key 6, spare key, the term of validity of every group key is generally set to 4 years (being determined by application system), and after the term of validity, automatically to enable next group key effective for application system;
2) cryptographic algorithm supports that the concrete configuration of specific implementation algorithm is as follows:
0—3des;1—SM1;2—SM2;3—SSF33;4—SM4;
3) data layout process:
1, make out an invoice the time online: retain Hour Minute Second, be converted into 14 bit digital forms;
2, Taxpayer Identification Number: 20 bit digital, as figure place zero padding not above;
3, invoice codes: 12 bit digital, as figure place zero padding not above;
4, invoice number: 8 bit digital, as figure place zero padding not above;
5, invoice amount: invoice amount is got point, removes radix point, then mends " 0 " before the amount of money to 20, then transforms the amount of money to sexadecimal ASCII character (10 byte);
6, code data item process: front 4 bytes of MAC value+amount of money sexadecimal ASCII character (10 byte)+0x80;
4) by the Taxpayer Identification Number after process in step 3), what Taxpayer Identification Number was converted to 16 systems deposits array, regularly processes, obtain factor array to the Taxpayer Identification Number array of 16 bytes;
5) according to the encryption Summing Factor cryptographic algorithm (as SM4) that step 4) obtains, call cipher machine, generate interim handle and temporary key;
6) according to step 3) data, permanent order splicing data: invoice codes+invoice number+make out an invoice the date, is converted into 16 system ASCII character;
7) ASCII character that the interim handle obtained according to step 5) and temporary key, step 6) obtain and cryptographic algorithm (as SM4) call cipher machine, generate MAC value, nullify temporary key;
8) process the amount of money, the MAC value process that amount of money step 3) obtained and step 7) obtain, obtains code data item: front 4 bytes of MAC value+amount of money sexadecimal ASCII character (10 byte)+0x80;
9) according to the encryption Summing Factor cryptographic algorithm (as SM4) that step 4) obtains, call cipher machine, generate interim handle and temporary key;
10) generate 16 bytecodes according to step 7) data item, the interim handle of step 8) and temporary key and cryptographic algorithm (SM4), nullify temporary key, close cipher machine;
11) 16 bytecodes step 9) obtained are converted into 20 digital form codes, finally last for 20 digit numeric codes two are replaced to used cipher machine key group group number, finally obtain security code;
12) this programme security code verification method, specifically comprises the following steps: (as shown in Figure 2)
(1) according to invoice data and security code, the key group group number called security code from cipher machine generates new code, then compares with security code, identical, illustrates and is verified, and different explanation checking is not passed through;
(2) USBKey data verification, precondition USBKey inculcates key and encryption equipment, and to fix a certain group key identical, so the security code generated meets the checking in encryption equipment, in like manner 11);
13) security code of cipher machine and USBKey generates with verification method result as follows:
1, ticket counterfoil is retained from material object and is become the preservation of Electronic Coding information, and data are safer, retention cycle is longer, search efficiency is higher;
2, network is more added with safety guarantee, USBKey meet an urgent need off-line data obtain more in time verification examination, the true or false of effective guarantee invoice.
Except the technical characteristic described in instructions, be the known technology of those skilled in the art.

Claims (1)

1. one kind generates and verification method based on the security code of cipher machine and USBKey, it is characterized in that there is ageing not high problem for USBKey offline storage invoice data, utilize and fix under the identical prerequisite of a group key at the filling USBKey key of guarantee with encryption equipment, identical security code generating algorithm Sum fanction, then cipher machine checking is relied on, the ageing not high problem of effective solution, specifically comprises the following steps:
1) 200 keys initially inculcated by cipher machine, each key is one group, order is successively: (1) transmission security key, (2) encryption key, (3) MAC key, (4) TAX key, (5) spare key, (6) spare key, the term of validity of every group key is determined by application system, and after the term of validity, automatically to enable next group key effective for application system;
2) cryptographic algorithm supports that specific implementation algorithm configuration is as follows:
0—3des;1—SM1;2—SM2;3—SSF33;4—SM4;
3) data layout process:
(1) make out an invoice the time online: retain Hour Minute Second, be converted into 14 bit digital forms;
(2) Taxpayer Identification Number: 20 bit digital, as figure place zero padding not above;
(3) invoice codes: 12 bit digital, as figure place zero padding not above;
(4) invoice number: 8 bit digital, as figure place zero padding not above;
(5) invoice amount: invoice amount is got point, removes radix point, then mends " 0 " before the amount of money to 20, then transforms the ASCII character of the amount of money to sexadecimal 10 byte;
(6) code data item process: the ASCII character+0x80 of MAC value front 4 bytes+amount of money sexadecimal 10 byte;
4) by the Taxpayer Identification Number after process in step 3), what Taxpayer Identification Number was converted to 16 systems deposits array, regularly processes, obtain factor array to the Taxpayer Identification Number array of 16 bytes;
5) according to the encryption Summing Factor cryptographic algorithm that step 4) obtains, call cipher machine, generate interim handle and temporary key;
6) according to step 3) data, permanent order splicing data: invoice codes+invoice number+make out an invoice the date, is converted into 16 system ASCII character;
7) ASCII character that the interim handle obtained according to step 5) and temporary key, step 6) obtain and cryptographic algorithm (as SM4) call cipher machine, generate MAC value, nullify temporary key;
8) amount of money is processed, amount of money step 3) obtained and 7) the MAC value process that obtains, obtain code data item: the ASCII character+0x80 of MAC value front 4 bytes+amount of money sexadecimal 10 byte;
9) according to the encryption Summing Factor cryptographic algorithm SM4 that step 4) obtains, call cipher machine, generate interim handle and temporary key;
10) generate 16 bytecodes according to step 7) data item, the interim handle of step 8) and temporary key and cryptographic algorithm SM4, nullify temporary key, close cipher machine;
11) 16 bytecodes step 9) obtained are converted into 20 digital form codes, finally last for 20 digit numeric codes two are replaced to used cipher machine key group group number, finally obtain security code;
Security code checking comprises the following steps:
1) according to invoice data and security code, the key group group number called security code from cipher machine generates new code, then compares with security code, identical, illustrates and is verified, and different explanation checking is not passed through;
2) USBKey data verification, precondition USBKey inculcates key and encryption equipment, and to fix a certain group key identical, so the security code generated meets the checking in encryption equipment, identical with step 11;
3) security code of cipher machine and USBKey generates with verification method result as follows:
(1) ticket counterfoil is retained from material object and is become the preservation of Electronic Coding information, and data are safer, retention cycle is longer, search efficiency is higher;
(2) network is more added with safety guarantee, USBKey meet an urgent need off-line data obtain more in time verification examination, the true or false of effective guarantee invoice.
CN201410564708.XA 2014-10-22 2014-10-22 Anti-counterfeiting code generation and verification method based on cipher machine and USBKey Active CN104318461B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410564708.XA CN104318461B (en) 2014-10-22 2014-10-22 Anti-counterfeiting code generation and verification method based on cipher machine and USBKey

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410564708.XA CN104318461B (en) 2014-10-22 2014-10-22 Anti-counterfeiting code generation and verification method based on cipher machine and USBKey

Publications (2)

Publication Number Publication Date
CN104318461A true CN104318461A (en) 2015-01-28
CN104318461B CN104318461B (en) 2017-06-27

Family

ID=52373688

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410564708.XA Active CN104318461B (en) 2014-10-22 2014-10-22 Anti-counterfeiting code generation and verification method based on cipher machine and USBKey

Country Status (1)

Country Link
CN (1) CN104318461B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104851206A (en) * 2015-05-25 2015-08-19 华北电力大学 USBKEY (universal serial bus key)-based online electric charge payment system
CN107977870A (en) * 2017-11-21 2018-05-01 桂林爱家购股份有限公司 A kind of electronic invoice generates system and method
CN109525389A (en) * 2018-10-16 2019-03-26 航天信息股份有限公司 A kind of production method and system of tax controlling equipment code key

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1588843A (en) * 2004-09-15 2005-03-02 华南理工大学 Forming and verifying system and method for bill anti-fake code
US20070180266A1 (en) * 1998-09-24 2007-08-02 En-Seung Kang Digital content cryptograph and process
CN101038634A (en) * 2007-04-23 2007-09-19 中国振华(集团)科技股份有限公司 Production RFID false proof method with logic control unit
CN101132276A (en) * 2007-09-27 2008-02-27 中兴通讯股份有限公司 Method and system for symmetrical encryption of terminal data by SAM card
WO2009089997A1 (en) * 2008-01-11 2009-07-23 Proton World International N.V. Hierarchization of cryptographic keys in an electronic circuit
CN102739397A (en) * 2011-03-31 2012-10-17 汉王科技股份有限公司 Method and device for encrypting and checking electronic worksheet
CN202815938U (en) * 2012-06-14 2013-03-20 深圳市金溢科技有限公司 Electronic toll collection system (ETC), free flow system and monitor center, and DSRC device
CN103544439A (en) * 2012-07-11 2014-01-29 北京旋极信息技术股份有限公司 Embedded software for tax-control disk and tax-declaration disk

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070180266A1 (en) * 1998-09-24 2007-08-02 En-Seung Kang Digital content cryptograph and process
CN1588843A (en) * 2004-09-15 2005-03-02 华南理工大学 Forming and verifying system and method for bill anti-fake code
CN101038634A (en) * 2007-04-23 2007-09-19 中国振华(集团)科技股份有限公司 Production RFID false proof method with logic control unit
CN101132276A (en) * 2007-09-27 2008-02-27 中兴通讯股份有限公司 Method and system for symmetrical encryption of terminal data by SAM card
WO2009089997A1 (en) * 2008-01-11 2009-07-23 Proton World International N.V. Hierarchization of cryptographic keys in an electronic circuit
CN102739397A (en) * 2011-03-31 2012-10-17 汉王科技股份有限公司 Method and device for encrypting and checking electronic worksheet
CN202815938U (en) * 2012-06-14 2013-03-20 深圳市金溢科技有限公司 Electronic toll collection system (ETC), free flow system and monitor center, and DSRC device
CN103544439A (en) * 2012-07-11 2014-01-29 北京旋极信息技术股份有限公司 Embedded software for tax-control disk and tax-declaration disk

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104851206A (en) * 2015-05-25 2015-08-19 华北电力大学 USBKEY (universal serial bus key)-based online electric charge payment system
CN107977870A (en) * 2017-11-21 2018-05-01 桂林爱家购股份有限公司 A kind of electronic invoice generates system and method
CN109525389A (en) * 2018-10-16 2019-03-26 航天信息股份有限公司 A kind of production method and system of tax controlling equipment code key

Also Published As

Publication number Publication date
CN104318461B (en) 2017-06-27

Similar Documents

Publication Publication Date Title
CN106548353B (en) Commodity anti-counterfeiting code generation and verification method
CN103856640A (en) Method and system for processing user resource information
CN105468990A (en) Sensitive information management control method and apparatus
CN104935429A (en) Data processing method and system employing multi-encryption technology
CN104637185A (en) Offline box opening method of intelligent storage cabinet
CN104281794A (en) Password storing and verifying method and password storing and verifying device
CN105827582B (en) A kind of communication encrypting method, device and system
CN104966026A (en) Arithmetical operation system
CN102571357A (en) Signature realization method and signature realization device
CN107257349A (en) Cipher encrypting method and system based on unidirectional and public key encryption algorithm
CN104660551A (en) Webservice-based database access device and method
CN103957106A (en) User-defined two-way dynamic safety certification system
CN103905400A (en) Service authentication method, apparatus and system
CN104318461A (en) Anti-counterfeiting code generation and verification method based on cipher machine and USBKey
CN104112223A (en) offline billing method based on security key
CN106161710A (en) A kind of user account safety management system based on smart mobile phone
CN102542645B (en) A kind of entrance guard authentication method and Verification System
CN114741704A (en) Privacy protection method, device, equipment and medium based on marriage and love dating
CN107733936B (en) Encryption method for mobile data
CN108038979A (en) Continuously operating method based on STS payment systems
CN102868521A (en) Method for enhancing secret key transmission of symmetrical secret key system
Thakare et al. Comparative study of CIA and revised-CIA algorithm
CN107919917B (en) Method for preventing illegal ONU registration from getting online
CN103684784B (en) Two-factor identity authentication method based on Chinese character format information
CN102970145B (en) Signature method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200616

Address after: 250100 Inspur Science Park, No. 1036, Inspur Road, high tech Zone, Jinan City, Shandong Province

Patentee after: Inspur Software Technology Co.,Ltd.

Address before: 250100 Ji'nan science and Technology Development Zone, Shandong Branch Road No. 2877

Patentee before: INSPUR GROUP Co.,Ltd.