CN107425956B - A kind of character type commodity counterfeit prevention code generating method - Google Patents

A kind of character type commodity counterfeit prevention code generating method Download PDF

Info

Publication number
CN107425956B
CN107425956B CN201710623439.3A CN201710623439A CN107425956B CN 107425956 B CN107425956 B CN 107425956B CN 201710623439 A CN201710623439 A CN 201710623439A CN 107425956 B CN107425956 B CN 107425956B
Authority
CN
China
Prior art keywords
rule
bit arithmetic
commodity
character type
operate1
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
CN201710623439.3A
Other languages
Chinese (zh)
Other versions
CN107425956A (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.)
Shanghai Chengyang Information Technology Co., Ltd
Original Assignee
Nantong 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 Nantong University filed Critical Nantong University
Priority to CN201710623439.3A priority Critical patent/CN107425956B/en
Publication of CN107425956A publication Critical patent/CN107425956A/en
Application granted granted Critical
Publication of CN107425956B publication Critical patent/CN107425956B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/001Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using chaotic signals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/018Certifying business or products
    • G06Q30/0185Product, service or business identity fraud
    • 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/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Strategic Management (AREA)
  • Finance (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Power Engineering (AREA)
  • Development Economics (AREA)
  • Accounting & Taxation (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Lock And Its Accessories (AREA)
  • Complex Calculations (AREA)

Abstract

The invention discloses a kind of character type commodity counterfeit prevention code generating method, include the following steps: the character type commodity sign code for characterizing certain part commodity unique identity information being converted to binary sequence;Initial value, parameter and the extraction interval of chaos system are calculated using commercial product identification information and external key, two groups of chaotic signal binary sequences are generated after being iterated to chaotic maps;Binary sequence is subjected to 7bits grouping, preceding 3bits generates commodity encrypted value, simultaneously according to customized 2bits coding rule corresponding relationship and customized bit arithmetic rule corresponding relationship, 4bits carries out 2bits correspondence mappings coding and twice bit arithmetic afterwards, further according to the corresponding relationship of customized commodity encrypted value and character type commodity encryption numbers, obtain character type commodity counterfeit prevention number, and then combination producing character type commodity counterfeit prevention code.The mentioned character type commodity counterfeit prevention code generating method simple possible of the present invention has very strong safety, is not easy to crack, and the character type commodity counterfeit prevention code of generation has " uniqueness and unforgeable ".

Description

A kind of character type commodity counterfeit prevention code generating method
Technical field
The present invention relates to digital false-proof technology field, in particular to a kind of character type commodity counterfeit prevention code generating method.
Background technique
Since reform and opening-up, the Chinese rate of economic development, development level are maked rapid progress, and are greatly enriched people group Many living standards.While economic development brings benefit for us, detrimental effect is also produced.In economic interests Driving under, all kinds of fake and inferior commodities emerge one after another, this not only compromises consumer's interests, while also to being forged brand band Carry out reputational damage, caused economic loss, severely impacts corporate image.In order to protect the interests of producer and consumer, Anti- pseudo problem comes into being and receives more and more attention.
It fakes such as dream dimple along with the development of human civilization, as long as fake producer is lucrative, any commodity nearly all can There is so-called " Counterfeit Item ".For this purpose, the anti-fake project for becoming people and constantly studying.Anti-counterfeiting technology is kept updating, existing It is having developed into for a special subject.It is anti-fake to be related to different field, such as bank password, food safety, medical medicine Product, textile garment, tobacco and wine etc..Anti-counterfeiting technology can be roughly divided into two class of physical security and digital code anti-false, and development also occurs by now Chemical anti-fake, " intension is anti-fake ", biology are anti-fake etc..Physical security needs the printer using custom-made, while in order to reach It is required to printing, it is necessary to select special material (such as paper, ink), in conjunction with special technique, this is undoubtedly anti-to enterprise Puppet takes excessive cost, is unfavorable for company interest.For this purpose, people begin look for a kind of economical and effective method for anti-counterfeit, and The appearance of digital code anti-false just solves the anti-fake matter of great urgency of enterprise.Existing security code generation technique, since it is used Encryption Algorithm general lack of attack tolerant can analysis and guarantee, the performance of generated commodity counterfeit prevention code still needs to further increase. In the case, propose that a kind of simple possible, safety are not easy the character type commodity counterfeit prevention code generating method cracked, generation has The commodity counterfeit prevention code of " uniqueness and unforgeable " feature, it is extremely urgent.
Summary of the invention
Goal of the invention: the purpose of the present invention is to solve deficiencies in the prior art, and it is anti-to provide a kind of character type commodity Pseudo- code generating method generates chaotic signal binary sequence using chaotic maps, using customized corresponding relationship, carries out 2bits Correspondence mappings coding and twice bit arithmetic generate anti-counterfeit number, and then combination producing character type commodity counterfeit prevention code, guarantee to be mentioned with this Method simple possible has very strong safety, is not easy to crack, and the character type commodity counterfeit prevention code of generation has " uniqueness and not Forgeability ".
Technical solution: a kind of character type commodity counterfeit prevention code generating method of the present invention comprises the following steps:
(1) the character type commodity sign code A for characterizing certain part commodity unique identity information is subjected to ASCII character conversion, obtained Sequence of values A1, then numerical value each in sequence A1 is subjected to 7 Binary Conversions, to obtain binary sequence AB, wherein quotient The length of product identification code A is expressed as L, and commodity sign binary sequence AB contains 7 × Lbits;
(2) the 16 character type MD5 values and external key K of certain part commodity sign code A are utilized10、K20And K30, according to such as Formula (1)-(6) shown in lower calculate separately to obtain the initial value x of inclination tent chaotic maps1、y1With parameter p1、p2, and between extraction Every several n1、n2:
x1=mod (sum (double (M))/128 × 16+K10,1) (1)
y1=mod (sum (double (M))/128 × 16-K10,1) (2)
p1=0.4+mod (sum (double (M))/128 × 16+K20,0.2) (3)
p2=0.6-mod (sum (double (M))/128 × 16-K20,0.2) (4)
n1=10+mod (sum (double (A))+K30,29) (5)
n2=10+mod (sum (double (A))-K30,29) (6)
Wherein, the MD5 value of certain part commodity sign code is expressed as the character string M of length 16, and external key meets K10∈(-1, 1)、K20∈ (- 1,1), K30It is greater than 1 positive integer;
(3) by chaotic maps initial value x1With parameter p1And chaotic maps initial value y1With parameter p2, respectively to following formula (7) inclination tent chaotic maps shown in is iterated, and parameter p is taken as p respectively in formula1(0.4≤p1< 0.6) and p2(0.4<p2≤ 0.6), k indicates the number of iterations (k=1,2 ...), zk+1It indicates the chaotic signal that kth time iteration obtains, is taken as x respectivelyk+1With yk+1,
Obtain chaotic signal sequence X={ x1,x2... } and Y={ y1,y2... }, n is successively spaced from sequence X1Take member Element is the chaotic signal sequence X 1 of L with formation length, is successively spaced n from sequence Y2Take chaos of the element with formation length for L Signal sequence Y1, while each element in chaotic signal sequence X 1 and Y1 is subjected to integer shown in following formula (8) and is handled, it obtains To chaotic signal integer sequence X2 and Y2,
Each element in chaotic signal integer sequence X2 and Y2 is converted into 7 bit binary datas again, thus obtain containing 7 × Chaotic signal the binary sequence XX and YY of Lbits;
(4) binary sequence AB, XX and YY are grouped as unit of 7bits, corresponding every group of binary sequence {AB(7k-6),AB(7k-5),...,AB(7k)}、{XX(7k-6),XX(7k-5),...,XX(7k)}、{YY(7k-6),YY (7k-5) ..., YY (7k) }, k=1,2 ..., L successively carry out following operation:
Firstly, calculating according to formula as follows (9), every group of binary sequence is respectively obtained before bit arithmetic, first time Coding rule number used by bit arithmetic and second of bit arithmetic,
Wherein, function bin2dec () is that string of binary characters is converted into decimal number;
Then, the preceding 3bits of every group of binary sequence is proceeded as follows, obtains commodity encrypted value C1,
Wherein, operatorFor step-by-step xor operation;
Every group of binary sequence is calculated according to formula as follows (10) again, is closed according to customized bit arithmetic rule is corresponding The rear 4bits that system obtains every group of binary sequence carries out the rule of operation as unit of 2bits,
Then, according to customized 2bits coding rule corresponding relationship, by the rear 4bits of every group of binary sequence with 2bits Correspondence mappings coding is carried out respectively for unit, carries out first time position fortune according to the operation rule in bit arithmetic rule corresponding relationship It calculates, obtains the commodity encrypted code C2 of 4bits;
And then, also according to customized 2bits coding rule corresponding relationship, by commodity encrypted code C2, binary sequence XX (7k-3), XX (7k-2) ..., XX (7k) }, YY (7k-3), YY (7k-2) ..., and YY (7k) } divided as unit of 2bits Not carry out correspondence mappings coding, according in bit arithmetic rule corresponding relationship operation rule carry out second of bit arithmetic, obtain The commodity encrypted code C3 of 4bits;
Finally, calculating according to formula as follows (11), commodity encrypted value CC is obtained,
CC=C1 × 16+bin2dec (C3) (11)
According to the corresponding relationship of customized commodity encrypted value and character type commodity encryption numbers, commodity encrypted value CC is turned Character type commodity encryption numbers are changed into, to obtain corresponding kth group binary sequence { AB (7k-6), AB (7k-5) ..., AB (7k) }, { XX (7k-6), XX (7k-5) ..., XX (7k) }, after { YY (7k-6), YY (7k-5) ..., YY (7k) } cryptographic calculation Character type commodity encryption numbers C (k),
L group binary sequence is successively subjected to operation as described above respectively, obtain character type commodity counterfeit prevention C=C (1), C(2),...,C(L)};
(5) character type commodity sign code A and character type commodity counterfeit prevention C are combined, generate commodity counterfeit prevention code.
Preferably, the commodity sign code of certain part commodity unique identity information is characterized described in step (1), by ASCII The character visible of code value ∈ [32,126] forms, including numerical character ' 0 '~' 9 ', capitalization ' A '~' Z ', lowercase ' a '~' z ' and punctuation mark character.
Preferably, customized bit arithmetic rule corresponding relationship described in step (4) are as follows: work as operation_1=0 When, first time bit arithmetic isIf operation_2=0, second of bit arithmetic It isIf operation_2=1, second of bit arithmetic is C_operate1+YY, if Operation_2=2, then second of bit arithmetic is C_operate1-YY;As operation_1=1, first time bit arithmetic It is C_operate1=AB+XX, if operation_2=0, second of bit arithmetic isSuch as Fruit operation_2=1, then second of bit arithmetic is C_operate1+YY, if operation_2=2, second Operation is C_operate1-YY;As operation_1=2, first time bit arithmetic is C_operate1=AB-XX, if Operation_2=0, then second of bit arithmetic beIf operation_2=1, second Bit arithmetic is C_operate1+YY, if operation_2=2, second of bit arithmetic is C_operate1-YY;When When operation_1=3, first time bit arithmetic isIf operation_2=0, the Secondary bit arithmetic isIf operation_2=1, second of bit arithmetic is C_operate1+ XX, if operation_2=2, second of bit arithmetic is C_operate1-XX;As operation_1=4, for the first time Bit arithmetic is C_operate1=AB+YY, if operation_2=0, second of bit arithmetic isIf operation_2=1, second of bit arithmetic is C_operate1+XX, if Operation_2=2, then second of bit arithmetic is C_operate1-XX;As operation_1=5, first time bit arithmetic It is C_operate1=AB-YY, if operation_2=0, second of bit arithmetic isIf Operation_2=1, then second of bit arithmetic is C_operate1+XX, if operation_2=2, second fortune It is C_operate1-XX.Wherein 2bits is the binary addition of unit, the expression of subtraction bit arithmetic are as follows: 00+00=00,00+ 01=01,00+10=10,00+11=11,01+01=10,01+10=11,01+11=00,10+10=00,10+11=01, 11+11=10;00-00=00,00-01=11,00-10=10,00-11=01,01-00=01,01-01=00,01-10= 11,01-11=10,10-00=10,10-01=01,10-10=00,10-11=11,11-00=11,11-01=10,11- 10=01,11-11=00.
Preferably, according to 2bits coding rule corresponding relationship described in step (4), by every group of binary sequence 4bits carries out correspondence mappings coding respectively as unit of 2bits afterwards, wherein 2bits coding rule corresponding relationship are as follows: Rule=0 When ' 00 ', Rule=1 when ' 00 ', Rule=2 when ' 01 ', Rule=3 when ' 01 ', Rule=4 when ' 10 ', Rule When=5 ' 10 ', Rule=6 when ' 11 ' and Rule=7 when ' 11 ' between correspond to each other;When Rule=0 ' 01 ', Rule When=1 ' 10 ', Rule=2 when ' 00 ', Rule=3 when ' 11 ', Rule=4 when ' 00 ', Rule=5 when ' 11 ', When ' 01 ' and Rule=7 when Rule=6 ' 10 ' between correspond to each other;When Rule=0 ' 10 ', Rule=1 when ' 01 ', When Rule=2 ' 11 ', Rule=3 when ' 00 ', Rule=4 when ' 11 ', Rule=5 when ' 00 ', Rule=6 when When ' 10 ' and Rule=7 ' 01 ' between correspond to each other;When Rule=0 ' 11 ', Rule=1 when ' 11 ', Rule=2 when ' 10 ', when Rule=3 ' 10 ', Rule=4 when ' 01 ', Rule=5 when ' 01 ', Rule=6 when ' 00 ' and Rule=7 When ' 00 ' between correspond to each other.4bits after every group of binary sequence is wherein subjected to correspondence mappings respectively as unit of 2bits Coding refers to using every group of binary sequence before bit arithmetic, coding rule number used by first time bit arithmetic, by bit arithmetic Certain 2bits under preceding coding rule number is replaced with the 2bits under corresponding first time bit arithmetic coding rule number, for example, position is transported Before calculation, coding rule used by first time bit arithmetic be respectively 0 and 2, used for ' 00 ' generation then ' 00 ' is replaced with ' 01 ', ' 01 ' It replaces, ' 10 ' are replaced with ' 11 ', and ' 11 ' are replaced with ' 10 '.
Preferably, according to customized 2bits coding rule corresponding relationship described in step (4), by commodity encrypted code C2, binary sequence { XX (7k-3), XX (7k-2) ..., XX (7k) }, { YY (7k-3), YY (7k-2) ..., YY (7k) } with 2bits is that unit carries out correspondence mappings coding respectively, is referred to using every group of binary sequence before bit arithmetic, second of bit arithmetic Certain 2bits under coding rule number before bit arithmetic is encoded with corresponding second of bit arithmetic and is advised by used coding rule number 2bits under then number is replaced.
It is closed preferably, customized commodity encrypted value described in step (4) is corresponding with character type commodity encryption numbers System, refers to as CC < 10, C (k)=char (CC+48);As 10≤CC < 48, C (k)=char (CC+53);As 48≤CC When, C (k)=char (CC+59).
Preferably, character type commodity sign code A and character type commodity counterfeit prevention C are carried out group described in step (5) It closes, generates commodity counterfeit prevention code, refer to the group being directly linked in sequence using character type commodity sign code and character type commodity counterfeit prevention number Conjunction mode.
The utility model has the advantages that the present invention uses customized corresponding relationship (bit arithmetic rule corresponding relationship, 2bits coding rule pair Should be related to and the corresponding relationship of commodity encrypted value and character type commodity encryption numbers), utilize chaotic maps generate chaotic signal Binary sequence carries out 2bits correspondence mappings coding and twice bit arithmetic, generates anti-counterfeit number, and then combination producing character type quotient Product security code guarantees a kind of character type commodity counterfeit prevention code generating method simple possible that the present invention is proposed, and has very strong safety Property, be not easy to crack, character type commodity counterfeit prevention code generated have " uniqueness and unforgeable ".
Detailed description of the invention
Fig. 1 is character type commodity counterfeit prevention code product process schematic diagram of the invention.
Specific embodiment
A kind of character type commodity counterfeit prevention code generating method as shown in Figure 1, comprises the following steps:
(1) the character type commodity sign code A for characterizing certain part commodity unique identity information is subjected to ASCII character conversion, obtained Sequence of values A1, then numerical value each in sequence A1 is subjected to 7 Binary Conversions, to obtain binary sequence AB, wherein quotient Product identification code A includes numerical character ' 0 '~' 9 ', capitalization ' A '~' Z ', lowercase ' a '~' z ' and punctuation word The character visible of the ASCII characters value ∈ [32,126] such as symbol, the length of commodity sign code A are expressed as L, commodity sign binary sequence AB contains 7 × Lbits;
(2) the 16 character type MD5 values and external key K of certain part commodity sign code A are utilized10、K20And K30, according to such as Formula shown in lower calculates separately to obtain the initial value x of inclination tent chaotic maps1、y1With parameter p1、p2, and extract space-number n1、 n2:
x1=mod (sum (double (M))/128 × 16+K10,1)
y1=mod (sum (double (M))/128 × 16-K10,1)
p1=0.4+mod (sum (double (M))/128 × 16+K20,0.2)
p2=0.6-mod (sum (double (M))/128 × 16-K20,0.2)
n1=10+mod (sum (double (A))+K30,29)
n2=10+mod (sum (double (A))-K30,29)
Wherein, the MD5 value of certain part commodity sign code is expressed as the character string M of length 16, and external key meets K10∈(-1, 1)、K20∈ (- 1,1), K30It is greater than 1 positive integer;
(3) by chaotic maps initial value x1With parameter p1And chaotic maps initial value y1With parameter p2, respectively to following formula Shown inclination tent chaotic maps are iterated, and parameter p is taken as p respectively in formula1(0.4≤p1< 0.6) and p2(0.4<p2≤ 0.6), k indicates the number of iterations (k=1,2 ...), zk+1It indicates the chaotic signal that kth time iteration obtains, is taken as x respectivelyk+1With yk+1,
Obtain chaotic signal sequence X={ x1,x2... } and Y={ y1,y2... }, n is successively spaced from sequence X1Take member Element is the chaotic signal sequence X 1 of L with formation length, is successively spaced n from sequence Y2Take chaos of the element with formation length for L Signal sequence Y1, while each element in chaotic signal sequence X 1 and Y1 is subjected to integer shown in following formula and is handled, it obtains Chaotic signal integer sequence X2 and Y2,
Each element in chaotic signal integer sequence X2 and Y2 is converted into 7 bit binary datas again, thus obtain containing 7 × Chaotic signal the binary sequence XX and YY of Lbits;
(4) binary sequence AB, XX and YY are grouped as unit of 7bits, corresponding every group of binary sequence {AB(7k-6),AB(7k-5),...,AB(7k)}、{XX(7k-6),XX(7k-5),...,XX(7k)}、{YY(7k-6),YY (7k-5) ..., YY (7k) }, k=1,2 ..., L are successively calculated as follows:
Firstly, calculating according to formula as follows, every group of binary sequence is respectively obtained before bit arithmetic, the fortune of first time position Coding rule number used by calculation and second of bit arithmetic,
AB_rule_orig=bin2dec (AB (7k-6), AB (7k-5), AB (7k-4))
XX_rule_orig=bin2dec (XX (7k-6), XX (7k-5), XX (7k-4))
YY_rule_orig=bin2dec (YY (7k-6), YY (7k-5), YY (7k-4))
AB_rule_1=mod (bin2dec (AB (7k-6), AB (7k-5) ..., AB (7k-2)), 8)
XX_rule_1=mod (bin2dec (XX (7k-6), XX (7k-5) ..., XX (7k-2)), 8)
YY_rule_1=mod (bin2dec (YY (7k-6), YY (7k-5) ..., YY (7k-2)), 8)
AB_rule_2=mod (bin2dec (AB (7k-6), AB (7k-5) ..., AB (7k)), 8)
XX_rule_2=mod (bin2dec (XX (7k-6), XX (7k-5) ..., XX (7k)), 8)
YY_rule_2=mod (bin2dec (YY (7k-6), YY (7k-5) ..., YY (7k)), 8)
Wherein, function bin2dec () is that string of binary characters is converted into decimal number;
Then, the preceding 3bits of every group of binary sequence is proceeded as follows, obtains commodity encrypted value C1,
Wherein, operatorFor step-by-step xor operation;
Every group of binary sequence is calculated according to formula as follows again, is obtained according to customized bit arithmetic rule corresponding relationship The rule of bit arithmetic is carried out as unit of 2bits to the rear 4bits of every group of binary sequence,
Operation_1=mod (bin2dec (AB (7k-6:7k))-bin2dec (XX (7k-6:7k)), 6)
Operation_2=mod (bin2dec (AB (7k-6:7k))-bin2dec (YY (7k-6:7k)), 3)
Wherein customized bit arithmetic rule corresponding relationship is as shown in table 1,
The customized bit arithmetic rule mapping table of table 1
I.e. as operation_1=0 and operation_2=0, first time bit arithmetic isSecond of bit arithmetic beAs operation_1=1 and When operation_2=0, first time bit arithmetic is C_operate1=AB+XX, and second of bit arithmetic isAs operation_1=2 and operation_2=0, first time bit arithmetic is C_ Operatel=AB-XX, second of bit arithmetic areEtc..Wherein 2bits is the binary system of unit Addition, subtraction bit arithmetic are as shown in table 2,
2 2bits of table is the binary addition of unit, subtraction bit arithmetic table
Then, according to customized 2bits coding rule corresponding relationship, by the rear 4bits of every group of binary sequence with 2bits Correspondence mappings coding is carried out respectively for unit, carries out first time position fortune according to the operation rule in bit arithmetic rule corresponding relationship It calculates, obtains the commodity encrypted code C2 of 4bits, wherein 2bits coding rule corresponding relationship is as shown in table 3,
3 2bits coding rule mapping table of table
Rule=0 Rule=1 Rule=2 Rule=3 Rule=4 Rule=5 Rule=6 Rule=7
00 00 01 01 10 10 11 11
01 10 00 11 00 11 01 10
10 01 11 00 11 00 10 01
11 11 10 10 01 01 00 00
Wherein 4bits after every group of binary sequence is subjected to correspondence mappings coding respectively as unit of 2bits, refers to utilization Every group of binary sequence is before bit arithmetic, coding rule number used by first time bit arithmetic, by coding rule number before bit arithmetic Under certain 2bits replaced with the 2bits under corresponding first time bit arithmetic coding rule number, for example, before bit arithmetic, first time position Coding rule number used by operation is respectively 0 and 2, then ' 00 ' is replaced with ' 01 ', ' 01 ' is replaced with ' 00 ', and ' 10 ' use ' 11 ' Instead of ' 11 ' are replaced with ' 10 '.
And then, also according to customized 2bits coding rule corresponding relationship, by commodity encrypted code C2, binary sequence XX (7k-3), XX (7k-2) ..., XX (7k) }, YY (7k-3), YY (7k-2) ..., and YY (7k) } divided as unit of 2bits Not carry out correspondence mappings coding, i.e., using every group of binary sequence before bit arithmetic, used by second of bit arithmetic encode rule Then number, by certain 2bits under coding rule number before bit arithmetic with the 2bits generation under corresponding second of bit arithmetic coding rule number It replaces, carries out second of bit arithmetic according to the bit arithmetic rule in bit arithmetic rule corresponding relationship, obtain the commodity encrypted code of 4bits C3;
Finally, calculating according to formula as follows, commodity encrypted value CC is obtained,
CC=C1 × 16+bin2dec (C3)
According to the corresponding relationship of customized commodity encrypted value and character type commodity encryption numbers, commodity encrypted value CC is turned Character type commodity encryption numbers are changed into, to obtain corresponding kth group binary sequence { AB (7k-6), AB (7k-5) ..., AB (7k) }, { XX (7k-6), XX (7k-5) ..., XX (7k) }, after { YY (7k-6), YY (7k-5) ..., YY (7k) } cryptographic calculation Character type commodity encryption numbers C (k), wherein the corresponding relationship of customized commodity encrypted value and character type commodity encryption numbers, is Refer to the C (k)=char (CC+48) as CC < 10;As 10≤CC < 48, C (k)=char (CC+53);As 48≤CC, C (k) =char (CC+59),
L group binary sequence is successively subjected to operation as described above respectively, obtain character type commodity counterfeit prevention C=C (1), C(2),...,C(L)};
(5) character type commodity sign code A and character type commodity counterfeit prevention C are combined, that is, use character type commodity mark Know the combination that code and character type commodity counterfeit prevention number are directly linked in sequence, generates commodity counterfeit prevention code.
Below with reference to specific embodiment, the invention will be further described:
Embodiment 1
According to above-mentioned character type commodity counterfeit prevention code generating method, steps are as follows:
(1) when the identification code A of certain part commodity is " B654321 2017-07-10 abcd:111111 ", length L=30 is obtained To sequence of values A1=66,54,53,52,51,50,49,32,50,48,49,55,45,48,55,45,49,48,32,97, 98,99,100,58,49,49,49,49,49,49 } 7 Binary Conversions, then by numerical value each in sequence A1 are carried out, thus To containing 7 × Lbits binary sequence AB=1,0,0,0,0,1,0,0,1,1,0,1,1,0,0,1,1,0,1,0,1,0,1, 1,0,1,0,0,0,1,1,0,0,1,1,0,1,1,0,0,1,0,0,1,1,0,0,0,1,0,1,0,0,0,0,0,0,1,1,0,0, 1,0,0,1,1,0,0,0,0,0,1,1,0,0,0,1,0,1,1,0,1,1,1,0,1,0,1,1,0,1,0,1,1,0,0,0,0,0, 1,1,0,1,1,1,0,1,0,1,1,0,1,0,1,1,0,0,0,1,0,1,1,0,0,0,0,0,1,0,0,0,0,0,1,1,0,0, 0,0,1,1,1,0,0,0,1,0,1,1,0,0,0,1,1,1,1,0,0,1,0,0,0,1,1,1,0,1,0,0,1,1,0,0,0,1, 0,1,1,0,0,0,1,0,1,1,0,0,0,1,0,1,1,0,0,0,1,0,1,1,0,0,0,1,0,1,1,0,0,0,1};
(2) external key K is taken10=0.54321, K20=0.56789 and K30=13, utilize the 16 of part commodity sign code A The initial value x of inclination tent chaotic maps is calculated in position character type MD5 value (7bca0cebdd357899) and external key1、y1 With parameter p1、p2, and extract space-number n1、n2Respectively
x1=mod (1224/128 × 16+0.54321,1)=0.14086625
y1=mod (1224/128 × 16-0.56789,1)=0.05444625
p1=0.4+mod (1224/128 × 16+0.56789,0.2)=0.56554625
p2=0.6-mod (1224/128 × 16-0.56789,0.2)=0.57023375
n1=10+mod (1677+13,29)=18
n2=10+mod (1677-13,29)=21
(3) by chaotic maps initial value x1With parameter p1And chaotic maps initial value y1With parameter p2, respectively to following formula Shown inclination tent chaotic maps are iterated, and parameter p is taken as p respectively in formula1(0.4≤p1< 0.6) and p2(0.4<p2≤ 0.6), k indicates the number of iterations (k=1,2 ...), zk+1It indicates the chaotic signal that kth time iteration obtains, is taken as x respectivelyk+1With yk+1,
Obtain chaotic signal sequence X={ x1,x2... } and Y={ y1,y2... }, n is successively spaced from sequence X1Take member Element with formation length for L chaotic signal sequence X 1=0.050507827984553,0.749172891758299, 0.676958085804782,0.335283863445713,0.483606360698634,0.713107601298483, 0.857972636361692,0.984266526238039,0.092768007941601,0.547368732101527, 0.313564605282072,0.733154722514277,0.601605874063301,0.773358379686513, 0.831605667701184,0.437463358153133,0.281138495135736,0.205689171941684, 0.115634288897517,0.406790066182662,0.131834681952958,0.767949945634140, 0.402306472132247,0.422555474138404,0.618572523398750,0.312172207325796, 0.957805614986651,0.745486691631882,0.808547028554029,0.656050860597709 }, from sequence N is successively spaced in column Y2Take element with formation length for L chaotic signal sequence Y1=0.389632753182343, 0.591573716376097,0.477092075862466,0.244286310986199,0.383870509250934, 0.308301444972257,0.962367677107388,0.697887731378546,0.143089199271197, 0.510467207658816,0.555804022462118,0.662104981407716,0.789871784934876, 0.292821567141980,0.871323998184164,0.236455468138537,0.216288816833434, 0.041004325789299,0.492130881526222,0.703969452783255,0.790738420268146, 0.255287125629488,0.419271199049455,0.153714126969999,0.442051914155652, 0.475712866694365,0.138773291942039,0.002455576040069,0.064404931267882, 0.813607007534420 } integer processing, while by each element in chaotic signal sequence X 1 and Y1 is carried out, obtains chaos letter Number integer sequence X2=118,16,44,6,95,68,14,105,64,23,30,91,58,79,24,105,120,59,118, 60,74,11,24,18,125,58,72,18,94,124 } and Y2=7,89,104,111,113,6,124,61,107,32, 24,121,93,87,23,10,72,59,92,78,56,39,71,117,39,8,84,107,81,6 },
Each element in chaotic signal integer sequence X2 and Y2 is converted into 7 bit binary datas again, so that it is equal to obtain length For 7 × Lbits chaotic signal binary sequence XX=1,1,1,0,1,1,0,0,0,1,0,0,0,0,0,1,0,1,1,0,0, 0,0,0,0,1,1,0,1,0,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,1,1,1,0,1,1,0,1,0,0,1,1,0,0, 0,0,0,0,0,0,1,0,1,1,1,0,0,1,1,1,1,0,1,0,1,1,0,1,1,0,1,1,1,0,1,0,1,0,0,1,1,1, 1,0,0,1,1,0,0,0,1,1,0,1,0,0,1,1,1,1,1,0,0,0,0,1,1,1,0,1,1,1,1,1,0,1,1,0,0,1, 1,1,1,0,0,1,0,0,1,0,1,0,0,0,0,1,0,1,1,0,0,1,1,0,0,0,0,0,1,0,0,1,0,1,1,1,1,1, 0,1,0,1,1,1,0,1,0,1,0,0,1,0,0,0,0,0,1,0,0,1,0,1,0,1,1,1,1,0,1,1,1,1,1,0,0 } and YY=0,0,0,0,1,1,1,1,0,1,1,0,0,1,1,1,0,1,0,0,0,1,1,0,1,1,1,1,1,1,1,0,0,0,1,0, 0,0,0,1,1,0,1,1,1,1,1,0,0,0,1,1,1,1,0,1,1,1,0,1,0,1,1,0,1,0,0,0,0,0,0,0,1,1, 0,0,0,1,1,1,1,0,0,1,1,0,1,1,1,0,1,1,0,1,0,1,1,1,0,0,1,0,1,1,1,0,0,0,1,0,1,0, 1,0,0,1,0,0,0,0,1,1,1,0,1,1,1,0,1,1,1,0,0,1,0,0,1,1,1,0,0,1,1,1,0,0,0,0,1,0, 0,1,1,1,1,0,0,0,1,1,1,1,1,1,0,1,0,1,0,1,0,0,1,1,1,0,0,0,1,0,0,0,1,0,1,0,1,0, 0,1,1,0,1,0,1,1,1,0,1,0,0,0,1,0,0,0,0,1,1,0};
(4) binary sequence AB, XX and YY are grouped as unit of 7bits, corresponding every group of binary sequence {AB(7k-6),AB(7k-5),...,AB(7k)}、{XX(7k-6),XX(7k-5),...,XX(7k)}、{YY(7k-6),YY (7k-5) ..., YY (7k) }, k=1,2 ..., 30 is successively calculated as follows, is illustrated by taking k=1 as an example below,
Firstly, it is respectively AB_rule_ that the 1st group of binary sequence used coding rule before bit arithmetic, which is calculated, Orig=bin2dec (' 100')=4, XX_rule_orig=bin2dec (' 111')=7 and YY_rule_orig= Bin2dec (' 000')=0, coding rule used by first time bit arithmetic be respectively AB_rule_1=mod (bin2dec (' 10000'), 8)=0, XX_rule_1=mod (bin2dec (' 11101'), 8)=5 and YY_rule_1=mod (bin2dec (' 00001'), 8)=1 and coding rule used by second of bit arithmetic be respectively AB_rule_2=mod (bin2dec (' 1000010'), 8)=2, XX_rule_2=mod (bin2dec (' 1110110'), 8)=6 and YY_rule_2=mod (bin2dec (' 0000111'), 8)=7;
Then, commodity encrypted value C1, which is calculated, is
It is calculated again operation_1=mod (bin2dec (' 1000010')-bin2dec (' 1110110'), 6)= 2, operation_2=mod (bin2dec (' 1000010')-bin2dec (' 0000111'), 3)=2, according to making adopted position fortune by oneself Regular mapping table is calculated to obtain the rear 4bits of every group of binary sequence to carry out the rule of bit arithmetic as unit of 2bits be the Bit arithmetic is C_operate1=AB-XX, and second of bit arithmetic is C_operate1-YY;
Then, according to 2bits coding rule relation table, as unit of 2bits, after the 1st group of binary sequence AB 4bits ' 00 ' and ' 10 ' is replaced with ' 01 ' and ' 00 ' respectively, the rear 4bits ' 01 ' and ' 10 ' of the 1st group of binary sequence XX distinguishes It is replaced with ' 00 ' and ' 11 ', carries out first time bit arithmetic ' 01 '-' 00 '=' 01 ', ' 00 '-' 11 '=' 01 ', obtain 4bits Commodity encrypted code C2=' 0101 ',
And then, also according to 2bits coding rule relation table, as unit of 2bits, by ' the 01 ' of commodity encrypted code C2 ' 01 ' respectively with ' 10 ' and ' 10 ' replaces, the rear 4bits ' 01 ' and ' 11 ' of the 1st group of binary sequence YY use respectively ' 10 ' with ' 00 ' replaces, and carries out second of bit arithmetic ' 10 '-' 10 '=' 00 ', ' 10 '-' 00 '=' 10 ', and the commodity for obtaining 4bits add Password C3=' 0010 ',
Finally, commodity encrypted value CC=C1 × 16+bin2dec (C3)=2 is calculated, encrypted according to customized commodity Commodity encrypted value CC is converted into character type commodity encryption numbers, C (k) by the corresponding relationship of numerical value and character type commodity encryption numbers =char (2+48)=' 2',
Successively L group binary sequence is subjected to operation as described above respectively, obtains character type commodity counterfeit prevention C= ‘2MIYNOJRT@BJQf4L4B2EHJBX1AeG9P';
(5) character type commodity sign code A and character type commodity counterfeit prevention C are combined, that is, use character type commodity mark Know the combination that code and character type commodity counterfeit prevention number are directly linked in sequence, generation character type commodity counterfeit prevention code is ' B654321 2017-07-10 abcd:1111112MIYNOJRT@BJQf4L4B2EHJBX1AeG9P’。
It can be seen that this patent mentions a kind of character type commodity counterfeit prevention code generating method character type commodity counterfeit prevention generated It number is rambling, not initial data any trace.
Embodiment 2
According to above-mentioned character type commodity counterfeit prevention code generating method, the identification code A and its character type commodity counterfeit prevention of certain part commodity Code generation step is similar to specific embodiment 1, and only slight change: K occurs for some external key10=0.543210000000001; Or K20=0.567890000000001;Or K30=12, the results are shown in Table 4 for the generation of character type commodity counterfeit prevention code.By following table It can be seen that: once even if slight change occurs for external key, the character type commodity counterfeit prevention number of generation can occur greatly to change, thus It can be seen that this patent, which mentions a kind of character type commodity counterfeit prevention code generating method, has key sensibility.
When 4 external key of table is slightly variable, the generation result of character type commodity counterfeit prevention code
Embodiment 3
According to above-mentioned character type commodity counterfeit prevention code generating method, external key and its character type security code generation step and tool Body embodiment 1 is similar, commodity sign code A (such as ' the b654321 2017-07-10 abcd:111111 ', ' B654321 being slightly variable 2017-07-11 abcd:111111 ' and ' B654321 2017-07-10 abcd:111112 ') the character type commodity that generate are anti- The results are shown in Table 5 for pseudo-code.From following table: the slight change of commodity sign code can cause character type commodity counterfeit prevention number to occur very Big variation, it can be seen that this patent mentions a kind of character type commodity counterfeit prevention code generating method to commercial product identification information (i.e. commodity Identification code) there is sensibility.
When 5 commodity sign code of table is slightly variable, the generation result of character type commodity counterfeit prevention code
By above-mentioned specific embodiment 2 and the analysis of example 3 it is found that this patent mentions a kind of character type commodity counterfeit prevention code generating method Generated character type commodity counterfeit prevention code is not only closely related with external key, but also depends on commercial product identification information (i.e. commodity mark Know code), therefore a kind of character type commodity counterfeit prevention code generating method that this patent is mentioned has very strong safety, it can be preferably Known/chosen -plain attact is resisted, is not easy to crack, to guarantee that the character type commodity counterfeit prevention code generated has " uniqueness and can not Forgery property ".
The above described is only a preferred embodiment of the present invention, be not intended to limit the present invention in any form, though So the present invention has been disclosed as a preferred embodiment, and however, it is not intended to limit the invention, any technology people for being familiar with this profession Member, without departing from the scope of the present invention, when the technology contents using the disclosure above make a little change or modification For the equivalent embodiment of equivalent variations, but anything that does not depart from the technical scheme of the invention content, according to the technical essence of the invention Any simple modification, equivalent change and modification to the above embodiments, all of which are still within the scope of the technical scheme of the invention.

Claims (7)

1. a kind of character type commodity counterfeit prevention code generating method, which is characterized in that comprise the following steps:
(1) the character type commodity sign code A for characterizing certain part commodity unique identity information is subjected to ASCII character conversion, obtains numerical value Sequence A1, then numerical value each in sequence A1 is subjected to 7 Binary Conversions, to obtain binary sequence AB, wherein commodity mark The length for knowing code A is expressed as L, and commodity sign binary sequence AB contains 7 × Lbits;
(2) the 16 character type MD5 values and external key K of certain part commodity sign code A are utilized10、K20And K30, according to following institute Show that formula calculates separately to obtain the initial value x of inclination tent chaotic maps1、y1With parameter p1、p2, and extract space-number n1、n2:
x1=mod (sum (double (M))/128 × 16+K10,1)
y1=mod (sum (double (M))/128 × 16-K10,1)
p1=0.4+mod (sum (double (M))/128 × 16+K20,0.2)
p2=0.6-mod (sum (double (M))/128 × 16-K20,0.2)
n1=10+mod (sum (double (A))+K30,29)
n2=10+mod (sum (double (A))-K30,29)
Wherein, the MD5 value of certain part commodity sign code is expressed as the character string M of length 16, and external key meets K10∈(-1,1)、K20 ∈ (- 1,1), K30It is greater than 1 positive integer;
(3) by chaotic maps initial value x1With parameter p1And chaotic maps initial value y1With parameter p2, incline respectively to shown in following formula Oblique tent chaotic maps are iterated, and parameter p is taken as p respectively in formula1(0.4≤p1< 0.6) and p2(0.4<p2≤ 0.6), k is indicated The number of iterations (k=1,2 ...), zk+1It indicates the chaotic signal that kth time iteration obtains, is taken as x respectivelyk+1And yk+1,
Obtain chaotic signal sequence X={ x1,x2... } and Y={ y1,y2... }, n is successively spaced from sequence X1Take element with Formation length is the chaotic signal sequence X 1 of L, is successively spaced n from sequence Y2Take chaotic signal of the element with formation length for L Sequence Y1, while each element in chaotic signal sequence X 1 and Y1 is subjected to integer shown in following formula and is handled, obtain chaos Signal integer sequence X2 and Y2,
Each element in chaotic signal integer sequence X2 and Y2 is converted into 7 bit binary datas again, thus obtain containing 7 × Chaotic signal the binary sequence XX and YY of Lbits;
(4) binary sequence AB, XX and YY are grouped as unit of 7bits, corresponding every group of binary sequence { AB (7k-6),AB(7k-5),...,AB(7k)}、{XX(7k-6),XX(7k-5),...,XX(7k)}、{YY(7k-6),YY(7k- 5) ..., YY (7k), k=1,2 ..., L successively carry out following operation:
Firstly, according to formula as follows calculate, respectively obtain every group of binary sequence before bit arithmetic, first time bit arithmetic with And coding rule number used by second of bit arithmetic,
AB_rule_orig=bin2dec (AB (7k-6), AB (7k-5), AB (7k-4))
XX_rule_orig=bin2dec (XX (7k-6), XX (7k-5), XX (7k-4))
YY_rule_orig=bin2dec (YY (7k-6), YY (7k-5), YY (7k-4))
AB_rule_1=mod (bin2dec (AB (7k-6), AB (7k-5) ..., AB (7k-2)), 8)
XX_rule_1=mod (bin2dec (XX (7k-6), XX (7k-5) ..., XX (7k-2)), 8)
YY_rule_1=mod (bin2dec (YY (7k-6), YY (7k-5) ..., YY (7k-2)), 8)
AB_rule_2=mod (bin2dec (AB (7k-6), AB (7k-5) ..., AB (7k)), 8)
XX_rule_2=mod (bin2dec (XX (7k-6), XX (7k-5) ..., XX (7k)), 8)
YY_rule_2=mod (bin2dec (YY (7k-6), YY (7k-5) ..., YY (7k)), 8)
Wherein, function bin2dec () is that string of binary characters is converted into decimal number;
Then, the preceding 3bits of every group of binary sequence is proceeded as follows, obtains commodity encrypted value C1,
C1=mod (bin2dec (AB (7k-6:7k-4) ⊕ XX (7k-6:7k-4) ⊕ YY (7k-6:7k-4)), 3)
Wherein, operator ' ⊕ ' is step-by-step xor operation;
Every group of binary sequence is calculated according to formula as follows again, is obtained often according to customized bit arithmetic rule corresponding relationship The rear 4bits of group binary sequence carries out the rule of bit arithmetic as unit of 2bits,
Operation_1=mod (bin2dec (AB (7k-6:7k))-bin2dec (XX (7k-6:7k)), 6)
Operation_2=mod (bin2dec (AB (7k-6:7k))-bin2dec (YY (7k-6:7k)), 3)
Then, according to customized 2bits coding rule corresponding relationship, by the rear 4bits of every group of binary sequence with 2bits for singly Position carries out correspondence mappings coding respectively, carries out first time bit arithmetic according to the operation rule in bit arithmetic rule corresponding relationship, obtains To the commodity encrypted code C2 of 4bits;
And then, also according to customized 2bits coding rule corresponding relationship, by commodity encrypted code C2, binary sequence { XX (7k-3), XX (7k-2) ..., XX (7k) }, { YY (7k-3), YY (7k-2) ..., YY (7k) } as unit of 2bits respectively into Row correspondence mappings coding carries out second of bit arithmetic according to the operation rule in bit arithmetic rule corresponding relationship, obtains 4bits's Commodity encrypted code C3;
Finally, calculating according to formula as follows, commodity encrypted value CC is obtained,
CC=C1 × 16+bin2dec (C3)
According to the corresponding relationship of customized commodity encrypted value and character type commodity encryption numbers, commodity encrypted value CC is converted into Character type commodity encryption numbers, thus obtain corresponding kth group binary sequence { AB (7k-6), AB (7k-5) ..., AB (7k) }, Character after { XX (7k-6), XX (7k-5) ..., XX (7k) }, { YY (7k-6), YY (7k-5) ..., YY (7k) } cryptographic calculation Type commodity encryption numbers C (k),
Successively L group binary sequence is subjected to operation as described above respectively, obtains character type commodity counterfeit prevention C={ C (1), C (2),...,C(L)};
(5) character type commodity sign code A and character type commodity counterfeit prevention C are combined, generate commodity counterfeit prevention code.
2. a kind of character type commodity counterfeit prevention code generating method according to claim 1, it is characterised in that: institute in step (1) That states characterizes the commodity sign code of certain part commodity unique identity information, is made of the character visible of ASCII character value ∈ [32,126], Including numerical character ' 0 '~' 9 ', capitalization ' A '~' Z ', lowercase ' a '~' z ' and punctuation mark character.
3. a kind of character type commodity counterfeit prevention code generating method according to claim 1, it is characterised in that: institute in step (4) The customized bit arithmetic rule corresponding relationship stated are as follows: as operation_1=0, first time bit arithmetic is C_operate1= AB ⊕ XX, if operation_2=0, second of bit arithmetic is C_operate1 ⊕ YY, if operation_2=1, Then second of bit arithmetic is C_operate1+YY, if operation_2=2, second of bit arithmetic is C_operate1- YY;As operation_1=1, first time bit arithmetic is C_operate1=AB+XX, if operation_2=0, the Secondary bit arithmetic is C_operate1 ⊕ YY, if operation_2=1, second of bit arithmetic is C_operate1+YY, If operation_2=2, second of bit arithmetic is C_operate1-YY;As operation_1=2, first time position Operation is C_operate1=AB-XX, if operation_2=0, second of bit arithmetic is C_operate1 ⊕ YY, such as Fruit operation_2=1, then second of bit arithmetic is C_operate1+YY, if operation_2=2, second Operation is C_operate1-YY;As operation_1=3, first time bit arithmetic is C_operate1=AB ⊕ YY, if Operation_2=0, then second of bit arithmetic is C_operate1 ⊕ XX, if operation_2=1, second fortune It is C_operate1+XX, if operation_2=2, second of bit arithmetic is C_operate1-XX;When When operation_1=4, first time bit arithmetic is C_operate1=AB+YY, if operation_2=0, second Bit arithmetic is C_operate1 ⊕ XX, if operation_2=1, second of bit arithmetic is C_operate1+XX, if Operation_2=2, then second of bit arithmetic is C_operate1-XX;As operation_1=5, first time bit arithmetic It is C_operate1=AB-YY, if operation_2=0, second of bit arithmetic is C_operate1 ⊕ XX, if Operation_2=1, then second of bit arithmetic is C_operate1+XX, if operation_2=2, second fortune It is C_operate1-XX;
Wherein 2bits is the binary addition of unit, the expression of subtraction bit arithmetic are as follows: 00+00=00,00+01=01,00+10= 10,00+11=11,01+01=10,01+10=11,01+11=00,10+10=00,10+11=01,11+11=10;00- 00=00,00-01=11,00-10=10,00-11=01,01-00=01,01-01=00,01-10=11,01-11=10, 10-00=10,10-01=01,10-10=00,10-11=11,11-00=11,11-01=10,11-10=01,11-11= 00。
4. a kind of character type commodity counterfeit prevention code generating method according to claim 1, it is characterised in that: institute in step (4) State according to 2bits coding rule corresponding relationship, the rear 4bits of every group of binary sequence is carried out respectively as unit of 2bits Correspondence mappings coding, wherein 2bits coding rule corresponding relationship are as follows: when Rule=0 ' 00 ', Rule=1 when ' 00 ', Rule When=2 ' 01 ', Rule=3 when ' 01 ', Rule=4 when ' 10 ', Rule=5 when ' 10 ', Rule=6 when ' 11 ' and When Rule=7 ' 11 ' between correspond to each other;When Rule=0 ' 01 ', Rule=1 when ' 10 ', Rule=2 when ' 00 ', When Rule=3 ' 11 ', Rule=4 when ' 00 ', Rule=5 when ' 11 ', Rule=6 when ' 01 ' and when Rule=7 It is corresponded to each other between ' 10 ';When Rule=0 ' 10 ', Rule=1 when ' 01 ', Rule=2 when ' 11 ', Rule=3 when ' 00 ', when Rule=4 ' 11 ', Rule=5 when ' 00 ', Rule=6 when ' 10 ' and Rule=7 when ' 01 ' between mutually It is corresponding;When Rule=0 ' 11 ', Rule=1 when ' 11 ', Rule=2 when ' 10 ', Rule=3 when ' 10 ', Rule=4 When ' 01 ', Rule=5 when ' 01 ', Rule=6 when ' 00 ' and Rule=7 when ' 00 ' between correspond to each other;
Wherein 4bits after every group of binary sequence is subjected to correspondence mappings coding respectively as unit of 2bits, refers to and utilize every group Binary sequence, will be under coding rule number before bit arithmetic before bit arithmetic, coding rule number used by first time bit arithmetic Certain 2bits is replaced with the 2bits under corresponding first time bit arithmetic coding rule number, for example, before bit arithmetic, first time bit arithmetic Used coding rule number is respectively 0 and 2, then ' 00 ' is replaced with ' 01 ', ' 01 ' is replaced with ' 00 ', and ' 10 ' used for ' 11 ' generations It replaces, ' 11 ' are replaced with ' 10 '.
5. a kind of character type commodity counterfeit prevention code generating method according to claim 1, it is characterised in that: institute in step (4) State according to customized 2bits coding rule corresponding relationship, by commodity encrypted code C2, binary sequence { XX (7k-3), XX (7k- ..., 2) XX (7k) }, YY (7k-3), YY (7k-2) ..., and YY (7k) } carry out correspondence mappings volume respectively as unit of 2bits Code refers to using every group of binary sequence before bit arithmetic, coding rule number used by second of bit arithmetic, before bit arithmetic Certain 2bits under coding rule number is replaced with the 2bits under corresponding second of bit arithmetic coding rule number.
6. a kind of character type commodity counterfeit prevention code generating method according to claim 1, it is characterised in that: institute in step (4) The corresponding relationship of the customized commodity encrypted value and character type commodity encryption numbers stated, refers to as CC < 10, C (k)=char (CC+48);As 10≤CC < 48, C (k)=char (CC+53);As 48≤CC, C (k)=char (CC+59).
7. a kind of character type commodity counterfeit prevention code generating method according to claim 1, it is characterised in that: institute in step (5) That states is combined character type commodity sign code A and character type commodity counterfeit prevention C, generates commodity counterfeit prevention code, refers to using word The combination that symbol type commodity sign code and character type commodity counterfeit prevention number are directly linked in sequence.
CN201710623439.3A 2017-07-27 2017-07-27 A kind of character type commodity counterfeit prevention code generating method Active CN107425956B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710623439.3A CN107425956B (en) 2017-07-27 2017-07-27 A kind of character type commodity counterfeit prevention code generating method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710623439.3A CN107425956B (en) 2017-07-27 2017-07-27 A kind of character type commodity counterfeit prevention code generating method

Publications (2)

Publication Number Publication Date
CN107425956A CN107425956A (en) 2017-12-01
CN107425956B true CN107425956B (en) 2019-07-16

Family

ID=60430254

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710623439.3A Active CN107425956B (en) 2017-07-27 2017-07-27 A kind of character type commodity counterfeit prevention code generating method

Country Status (1)

Country Link
CN (1) CN107425956B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111382820B (en) * 2020-02-25 2021-10-12 南通大学 Four-lattice pure-color commodity anti-counterfeiting code generation method
CN111985591B (en) * 2020-07-24 2022-06-21 南通大学 Commodity anti-counterfeiting code generation method based on character string encryption
CN112001467B (en) * 2020-07-24 2021-11-19 南通大学 Commodity anti-counterfeiting code generation and identification method based on picture encryption and decryption
CN112001468B (en) * 2020-07-24 2021-12-10 南通大学 Character type commodity anti-counterfeiting code generation and identification method
CN112149774B (en) * 2020-09-16 2021-11-30 南通大学 Chinese character commodity anti-counterfeiting code generation method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104680220A (en) * 2015-03-24 2015-06-03 南通大学 Commodity anti-counterfeiting code batch generation method
KR20150121427A (en) * 2014-04-21 2015-10-29 (주) 아이엔아이테크 System for providing Electronic Magnetic security barcode, and method for providing security Electronic Magnetic security barcode
CN105354717A (en) * 2015-11-30 2016-02-24 南通大学 Colorful commodity anti-counterfeiting code generating method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20150121427A (en) * 2014-04-21 2015-10-29 (주) 아이엔아이테크 System for providing Electronic Magnetic security barcode, and method for providing security Electronic Magnetic security barcode
CN104680220A (en) * 2015-03-24 2015-06-03 南通大学 Commodity anti-counterfeiting code batch generation method
CN105354717A (en) * 2015-11-30 2016-02-24 南通大学 Colorful commodity anti-counterfeiting code generating method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"混沌数码防伪技术研究与应用";盛苏英,陈轶;《微电子学与计算机》;20120831;第29卷(第8期);169-174

Also Published As

Publication number Publication date
CN107425956A (en) 2017-12-01

Similar Documents

Publication Publication Date Title
CN107425956B (en) A kind of character type commodity counterfeit prevention code generating method
CN109472338B (en) Batch generation method of commodity anti-counterfeiting two-dimensional codes
CN104486073B (en) A kind of encryption and decryption method of character type data
CN103646264B (en) A kind of dimension code anti-counterfeit method of multiple information encryption
CN109284803B (en) Commodity anti-counterfeiting two-dimensional code generation method
CN112001468B (en) Character type commodity anti-counterfeiting code generation and identification method
CN104657871B (en) A kind of commodity counterfeit prevention code generating method
CN105303075B (en) Adaptive Text Watermarking method based on PDF format
Yadav et al. A novel approach of bulk data hiding using text steganography
CN105354717B (en) A kind of colour commodity counterfeit prevention code generating method
CN105205674A (en) Product anti-counterfeiting method based on two-dimensional code
CN112001467B (en) Commodity anti-counterfeiting code generation and identification method based on picture encryption and decryption
Naharuddin et al. A high capacity and imperceptible text steganography using binary digit mapping on ASCII characters
Thabit et al. CSNTSteg: Color spacing normalization text steganography model to improve capacity and invisibility of hidden data
CN105095699A (en) Watermark information embedding method and device, and watermark information decoding method
Al-Wesabi Proposing high-smart approach for content authentication and tampering detection of arabic text transmitted via internet
CN102194081A (en) Method for hiding natural language information
Baawi et al. A comparative study on the advancement of text steganography techniques in digital media
Al-Wesabi Entropy-Based Watermarking Approach for Sensitive Tamper Detection of Arabic Text.
CN107437186A (en) A kind of generation of commodity counterfeit prevention code and the method for inspection
CN112149773A (en) Commodity anti-counterfeiting code generation method based on Chinese character encryption
CN104376236B (en) Scheme self-adaptive digital watermark embedding grammar and extracting method based on camouflage science
Abbasi et al. Urdu text steganography: Utilizing isolated letters
CN112217627A (en) Layered encrypted commodity anti-counterfeiting code generation method
CN108875395A (en) The generation and the method for inspection of commodity counterfeit prevention code

Legal Events

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

Address after: Room 2307, No. 335, Guoding Road, Yangpu District, Shanghai

Patentee after: Shanghai Chengyang Information Technology Co., Ltd

Address before: 226000 Jiangsu Province, Nantong City Chongchuan District sik Road No. 9

Patentee before: NANTONG University