CN105354717B - A kind of colour commodity counterfeit prevention code generating method - Google Patents

A kind of colour commodity counterfeit prevention code generating method Download PDF

Info

Publication number
CN105354717B
CN105354717B CN201510854277.5A CN201510854277A CN105354717B CN 105354717 B CN105354717 B CN 105354717B CN 201510854277 A CN201510854277 A CN 201510854277A CN 105354717 B CN105354717 B CN 105354717B
Authority
CN
China
Prior art keywords
commodity
code
binary
colored
sequence
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
CN201510854277.5A
Other languages
Chinese (zh)
Other versions
CN105354717A (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.)
Lihe Technology (Shanghai) 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 CN201510854277.5A priority Critical patent/CN105354717B/en
Publication of CN105354717A publication Critical patent/CN105354717A/en
Application granted granted Critical
Publication of CN105354717B publication Critical patent/CN105354717B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Printing Methods (AREA)
  • Credit Cards Or The Like (AREA)

Abstract

The invention discloses a kind of colored commodity counterfeit prevention code generating methods, include the following steps: the commodity sign code for characterizing certain part commodity unique identity information being converted to binary data;The initial value and parameter 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;The bit manipulation as unit of 2bits is carried out to commodity sign code using Chaotic Binary signal, generates the anti-counterfeit number for being superimposed with color background, and then combination producing colour commodity counterfeit prevention code.The present invention proposes colored commodity counterfeit prevention code generating method simple possible, has very strong safety, is not easy to crack, and the colored commodity counterfeit prevention code of generation has " uniqueness and unforgeable ".

Description

A kind of colour commodity counterfeit prevention code generating method
Technical field
The present invention relates to digital false-proof technology field, in particular to a kind of colored commodity counterfeit prevention code generating method.
Background technique
Today's society, commodity forge the serious problems that global economy field face is had become with food and drug safety, It not only greatly compromises the vital interests of production firm and the majority of consumers, has upset market order, but also to brand building Extremely bad influence is brought with maintaining social stability.Existing security code generation technique, by its used Encryption Algorithm General lack of the analysis and guarantee of attack tolerant energy, the performance of generated commodity counterfeit prevention code still needs to further increase, in anti-fake effect It is unsatisfactory in terms of fruit.Simultaneously with social development, people want commodity packaging appearance, security code visual effect It asks and increasingly improves.In the case, color background character is introduced, proposes that a kind of simple possible, safety are not easy the colored quotient cracked The anti-fake code generating method of product generates the commodity counterfeit prevention code with " uniqueness and unforgeable ", extremely urgent.
Summary of the invention
Goal of the invention: the purpose of the present invention is to solve deficiencies in the prior art, provide a kind of colored commodity counterfeit prevention Code generating method is carried out the position as unit of 2bits to commodity sign code using chaotic signal and is grasped using customized corresponding relationship Make, generates the anti-counterfeit number for being superimposed with color background, and then combination producing colour commodity counterfeit prevention code, guarantee that mentioned method is simple with this It is feasible, there is very strong safety, be not easy to crack, the colored commodity counterfeit prevention code of generation has " uniqueness and unforgeable ".
Technical solution: a kind of colored commodity counterfeit prevention code generating method of the present invention comprises the following steps:
(1) according to customized commodity sign code character and binary data corresponding relationship, it is unique that certain part commodity will be characterized The commodity sign code A of identity information is converted to binary data, to obtain commodity sign binary sequence P1, wherein commodity mark The length for knowing code A is expressed as L, and commodity sign binary sequence P1 length is 7 × Lbits;
(2) hash value and external key Z of certain part commodity sign code are utilized10、Z20, distinguish according to formula as follows The initial value X of chaos system is calculated1、Y1With system parameter μ,
X1=mod (sum (bin2dec (H))/256 × N ÷ 8+Z10-Z20,1)
Y1=mod (sum (bin2dec (B))/16 × N ÷ 4+Z20-Z10,1)
μ=3.9+mod (sum (bin2dec (H))/256 × N ÷ 8-Z10,0.1)
Wherein, the hash value of certain part commodity sign code be length N be greater than 7 × L binary stream, be expressed as be with 8bits The sequence of unitWith the sequence as unit of 4bitsZ10∈(-1,1)、Z20∈(-1,1);
(3) by initial value X1With system parameter μ and initial value Y1And system parameterChaos shown in following formula is reflected respectively Row iteration is injected,
XK+1=μ * XK*(1-XK)
Chaotic signal sequence X and Y are obtained, therefrom takes chaotic signal sequence X 1 and Y1 of the element with formation length for L respectively, Each element in chaotic signal sequence X 1 and Y1 is carried out integer shown in following formula simultaneously to handle, obtains chaotic signal integer Sequence X 2 and Y2,
Wherein,For the operation for taking the integer smaller than the number,
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 chaotic signal the binary sequence XX and YY of 7 × L;
(4) parity for judging 7 × L of data, if it is odd number, respectively at the end of binary sequence P1, XX and YY Binary digit ' 0 ' or ' 1 ' is filled, comprising even number binary digit ' 0 ' in the binary sequence that makes that treated;
(5) binary sequence P1, XX and YY are grouped as unit of 2bits, every group successively according to following formula Operation is carried out,
(C2*k-1,C2*k)=(P12*k-1,P12*k)⊕(XX2*k-1,XX2*k)-(YY2*k-1,YY2*k)
Wherein, operator ' ⊕ ' is step-by-step xor operation, and operator '-' is two binary subtraction operations,
Obtain anti-pseudorandom binary sequence C;
(6) binary sequence C is grouped according to 7bits for unit, in every group preceding 5bits according to customized two into Data processed and commodity counterfeit prevention sign character corresponding relationship obtain the anti-counterfeit number character string that length is L, in every group last 2bits according to Customized binary data and commodity counterfeit prevention color corresponding relationship obtain the anti-counterfeit number colour sequential that length is L, then Corresponding be superimposed of anti-counterfeit number character string and colour sequential is formed into colored anti-counterfeit number, then combines commodity sign code and colored anti-counterfeit number Generate colored commodity counterfeit prevention code.
Preferably, the commodity sign code of certain part commodity unique identity information is characterized described in step (1), by ASCLL 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 commodity sign code character described in step (1) and binary data corresponding relationship: number Word character ' 0 '~' 9 ', capitalization ' A '~' Z ', lowercase ' a '~' z ' are respectively converted into corresponding by its ASCLL code value 7 bit binary datas;Position is that the punctuation mark character of odd number is converted to by its ASCLL code value corresponding 7 in commodity sign code Bit binary data;Position is the punctuation mark character of even number in commodity sign code, '!' → 0000000, " " → 0000001, ' #' → 0000010, ' $ ' → 0000011, ' %' → 0000100, ' &' → 0000101, ' `' → 0000110, ' (' → 0000111, ') ' → 0001000, ' * ' → 0001001, '+' → 0001010, ', ' → 0001011, '-' → 0001100, ' .' → 0001101, '/' → 0001110, ': ' → 0001111, ';' → 0010000, ' < ' → 0010001, '=' → 0010010, ' > ' → 0010011, '? ' → 0010100, '@' → 0010101, ' [' → 0010110, ' ' → 0010111, '] ' → 0011000, ' ^' → 0011001, ' _ ' → 0011010, ' " → 0011011, ' ' → 0011100, ' | ' → 0011101, ' ' → 0011110, '~' → 0011111, ' ' → 1111111.
Preferably, customized binary data described in step (6) and commodity counterfeit prevention sign character corresponding relationship are as follows: 00000→‘0';00001→‘1';00010→‘2';00011→‘3';00100→‘4';00101→‘5';00110→‘6'; 00111→‘7';01000→‘8';01001→‘9';01010→‘A';01011→‘B';01100→‘C';01101→‘D'; 01110→‘E';01111→‘F';10000→‘G';10001→‘H';10010→‘I';10011→‘J';10100→‘K'; 10101→‘L';10110→‘M';10111→‘N';11000→‘O';11001→‘P';11010→‘Q';11011→‘R'; 11100→‘S';11101→‘T';11110→‘U';11111→‘V'.
Preferably, customized binary data described in step (6) and commodity counterfeit prevention color corresponding relationship are as follows: 00 → white;01 → red;10 → green;11 → blue.
Preferably, described in step (6) that anti-counterfeit number character string and the corresponding superposition formation of colour sequential is colored anti-fake Number, refer to that anti-counterfeit number character adding has a respective background color, background color and corresponding anti-counterfeit number solid colour.
Preferably, the commodity counterfeit prevention of commodity sign code described in step (6) and colored anti-counterfeit number combination producing colour Code refers to the combination being directly linked in sequence using commodity sign code and colored anti-counterfeit number.
The utility model has the advantages that the present invention uses customized corresponding relationship (commodity sign code character and binary data, binary number According to commodity counterfeit prevention sign character and binary data and commodity counterfeit prevention color), using chaotic signal to commodity sign code into Bit manipulation of the row as unit of 2bits generates the anti-counterfeit number for being superimposed with color background, and then combination producing colour commodity counterfeit prevention Code guarantees a kind of colored commodity counterfeit prevention code generating method simple possible that the present invention is proposed, and has very strong safety, not fragile Solution, to guarantee that the colored commodity counterfeit prevention code generated has " uniqueness and unforgeable ".
Detailed description of the invention
Fig. 1 is colored commodity counterfeit prevention code product process schematic diagram of the invention.
Specific embodiment
A kind of colored commodity counterfeit prevention code generating method as shown in Figure 1, comprises the following steps:
(1) according to customized commodity sign code character and binary data corresponding relationship, it is unique that certain part commodity will be characterized The commodity sign code A of identity information is converted to binary data, to obtain commodity sign binary sequence P1, wherein commodity mark Knowing code A includes numerical character ' 0 '~' 9 ', capitalization ' A '~' Z ', lowercase ' a '~' z ' and punctuation mark character etc. The character visible of ASCLL code value ∈ [32,126], the length of commodity sign code A are expressed as L, commodity sign binary sequence P1 long Degree is 7 × Lbits;
Wherein, the corresponding relationship of commodity sign code character and binary data are as follows: numerical character ' 0 '~' 9 ', capitalization ' A '~' Z ', lowercase ' a '~' z ' are respectively converted by corresponding 7 bit binary data of its ASCLL code value;Commodity sign Position is that the punctuation mark character of odd number is converted to by corresponding 7 bit binary data of its ASCLL code value in code;Commodity sign code Middle position is as shown in table 1 for the corresponding relationship that the punctuation mark character of even number is converted to binary data,
1 customized commodity sign code character (punctuation mark character) of table and binary data mapping table
(2) hash value and external key Z of certain part commodity sign code are utilized10、Z20, distinguish according to formula as follows The initial value X of chaos system is calculated1、Y1With system parameter μ,
X1=mod (sum (bin2dec (H))/256 × N ÷ 8+Z10-Z20,1)
Y1=mod (sum (bin2dec (B))/16 × N ÷ 4+Z20-Z10,1)
μ=3.9+mod (sum (bin2dec (H))/256 × N ÷ 8-Z10,0.1)
Wherein, the hash value of certain part commodity sign code be length N be greater than 7 × L binary stream, be expressed as be with 8bits The sequence of unitWith the sequence as unit of 4bitsZ10∈(-1,1)、Z20∈ (- 1,1), it is seen that the initial value X of chaos system1、 Y1With system parameter μ,Not only with external key (Z10, Z20) related, and can be with commercial product identification information change;
(3) by initial value X1With system parameter μ and initial value Y1And system parameterChaos shown in following formula is reflected respectively Row iteration is injected,
XK+1=μ * XK*(1-XK)
Chaotic signal sequence X and Y are obtained, therefrom takes chaotic signal sequence X 1 and Y1 of the element with formation length for L respectively, Each element in chaotic signal sequence X 1 and Y1 is carried out integer shown in following formula simultaneously to handle, obtains chaotic signal integer Sequence X 2 and Y2,
Wherein,For the operation for taking the integer smaller than the number,
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 chaotic signal the binary sequence XX and YY of 7 × L;
(4) parity for judging 7 × L of data, if it is odd number, respectively at the end of binary sequence P1, XX and YY Binary digit ' 0 ' or ' 1 ' is filled, comprising even number binary digit ' 0 ' in the binary sequence that makes that treated;
(5) binary sequence P1, XX and YY are grouped as unit of 2bits, every group successively according to following formula Operation is carried out,
(C2*k-1,C2*k)=(P12*k-1,P12*k)⊕(XX2*k-1,XX2*k)-(YY2*k-1,YY2*k)
Wherein, operator ' ⊕ ' is step-by-step xor operation, and operator '-' is two binary subtraction operations,
Obtain anti-pseudorandom binary sequence C;
(6) binary sequence C is grouped according to 7bits for unit, in every group preceding 5bits according to customized two into Data processed and commodity counterfeit prevention sign character corresponding relationship (being shown in Table 2) obtain length for the anti-counterfeit number character string of L, in every group finally 2bits according to customized binary data and commodity counterfeit prevention color corresponding relationship, i.e., " 00 → white, 01 → red, 10 → Green, 11 → blue " obtains the anti-counterfeit number colour sequential that length is L, then by anti-counterfeit number character adding respective background color, Its background color and corresponding anti-counterfeit number solid colour, to form colored anti-counterfeit number, then it is anti-fake using commodity sign code and colour The commodity counterfeit prevention code of number mode combination producing colour being directly linked in sequence.
The customized binary data of table 2 and commodity counterfeit prevention sign character mapping table
Below with reference to specific embodiment, the invention will be further described:
Embodiment 1
According to above-mentioned colored commodity counterfeit prevention code generating method, steps are as follows:
(1) when the identification code A of certain part commodity be " A123456 2015-09-01 1234B0000001 ", length L=31, According to commodity sign code character customized in table 1 and binary data corresponding relationship, the commodity sign two that length is 217 is obtained System sequence P1 be 1,0,0,0,0,0,1,0,1,1,0,0,0,1,0,1,1,0,0,1,0,0,1,1,0,0,1,1,0,1,1,0, 1,0,0,0,1,1,0,1,0,1,0,1,1,0,1,1,0,1,1,1,1,1,1,1,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,0,1,0,1,0,1,1,0,1,0,1,1,0,0,0,0,0,1,1,1,0,0,1,0,0,0, 1,1,0,0,0,1,1,0,0,0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,0,0,1,1,0,0,0,1,0,1,1,0,0,1, 0,0,1,1,0,0,1,1,0,1,1,0,1,0,0,1,0,0,0,0,1,0,0,1,1,0,0,0,0,0,1,1,0,0,0,0,0,1, 1,0,0,0,0,0,1,1,0,0, 0,0,0,1,1,0,0,0,0,0,1,1,0,0,0,0,0,1,1,0,0,0,1};
(2) taking external key is Z10=0.54321, Z20=0.56789, utilize the hash value of part commodity sign code A Chaos is calculated according to formula in above-mentioned colored commodity counterfeit prevention code generating method step (2) in (taking N=512) and external key The initial value X of system1、Y1With system parameter μ,For
X1=mod (8405/256 × 512 ÷ 8+0.54321-0.56789,1)=0.48832048828125
Y1=mod (1010/16 × 512 ÷ 4+0.56789-0.54321,1)=0.5178440625
μ=3.9+mod (8405/256 × 512 ÷ 8-0.54321,0.1)=3.96979048828125
(3) by initial value X1With system parameter μ and initial value Y1And system parameterAccording to above-mentioned colored commodity counterfeit prevention code Chaotic signal sequence X and Y is calculated in chaotic maps formula shown in generation method step (3), respectively from the 251st element Continuously take 31 elements to form chaotic signal sequence X 1 and Y1, while will be on each element carries out in chaotic signal sequence X 1 and Y1 State integer shown in colored commodity counterfeit prevention code generating method step (3) processing, obtain chaotic signal integer sequence X2=81, 0,124,33,42,74,107,49,116,62,12,39,66,100,16,61,12,126,35,67,22,48,28,78,117, 62,60,86,103,38,50 } and Y2=95,72,100,20,38,108,77,121,54,126,17,118,4,97,30, 85,49,104,36,61,20,25,68,112,10,82,46,92,57,39,17 },
Each element in chaotic signal integer sequence X2 and Y2 is converted into 7 bit binary datas, to obtain length and be 217 chaotic signal binary sequence XX=1,0,1,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,1,0, 0,0,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,0,0,1,1,1,1,0,1,0, 0,0,1,1,1,1,1,0,0,0,0,1,1,0,0,0,1,0,0,1,1,1,1,0,0,0,0,1,0,1,1,0,0,1,0,0,0,0, 1,0,0,0,0,0,1,1,1,1,0,1,0,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,0,0,0,1,1,1,0,0,0,0, 1,1,0,0,1,0,1,1,0,0,1,1,0,0,0,0,0,0,1,1,1,0,0,1,0,0,1,1,1,0,1,1,1,0,1,0,1,0, 1,1,1,1,1,0,0,1,1,1,1,0,0,1,0,1,0,1,1,0,1,1,0,0,1,1,1,0,1,0,0,1,1,0,0,1,1,0, 0,1,0 } and YY=1,0,1,1,1,1,1,1,0,0,1,0,0,0,1,1,0,0,1,0,0,0,0,1,0,1,0,0,0,1,0,0, 1,1,0,1,1,0,1,1,0,0,1,0,0,1,1,0,1,1,1,1,1,0,0,1,0,1,1,0,1,1,0,1,1,1,1,1,1,0, 0,0,1,0,0,0,1,1,1,1,0,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,0,1,0,0,1,1,1,1,0,1,0,1, 0,1,0,1,0,1,1,0,0,0,1,1,1,0,1,0,0,0,0, 1,0,0,1,0,0,0,1,1,1,1,0,1,0,0,1,0,1,0, 0,0,0,1,1,0,0,1,1,0,0,0,1,0,0,1,1,1,0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,1,0,0,1, 0,1,1,1,0,1,0,1,1,1,0,0,0,1,1,1,0,0,1,0,1,0,0,1,1,1,0,0,1,0,0,0,1};
(4) 217 are judged for odd number, then fill binary digit ' 0 ' at the end of binary sequence P1 respectively and (contain in former P1 127 ' 0 '), binary digit ' 1 ' (containing 112 ' 0 ' in former XX) is filled at the end of binary sequence XX, binary sequence YY's Fill binary digit ' 0 ' in end (containing 113 ' 0 ' in former YY);
(5) binary sequence P1, XX and YY are grouped as unit of 2bits, every group successively according to above-mentioned colour Formula shown in commodity counterfeit prevention code generating method step (5) carries out operation, obtains the anti-pseudorandom binary sequence C that length is 218 =1,0,1,1,0,1,0,1,1,1,1,0,0,1,1,1,0,1,0,1,0,0,0,0,1,1,1,0,1,1,1,1,0,0,0,0,0, 1,0,0,1,1,0,0,1,0,0,0,0,0,0,1,0,1,0,1,0,1,1,0,0,0,1,1,0,1,0,0,0,0,0,1,0,1,1, 0,1,1,1,0,1,1,0,0,1,1,0,1,0,1,1,0,1,1,0,1,1,1,0,1,1,0,0,1,0,1,1,0,1,1,0,0,0, 0,0,1,1,0,1,0,1,0,0,1,1,1,1,1,0,0,1,1,1,1,0,0,0,1,0,1,0,1,1,0,0,0,0,0,1,1,1, 0,1,0,1,1,0,1,1,0,1,1,0,1,1,1,0,0,1,0,1,1,0,1,0,1,1,1,1,1,0,0,1,1,0,0,1,1,0, 0,0,1,1,0,1,0,0,1,1,1,1,1,0,0,1,1,0,0,1,1,0,0,1,0,0,1,0,1};
(6) binary sequence C is grouped according to 7bits for unit, preceding 5bits is two according to shown in table 2 in every group Binary data and commodity counterfeit prevention sign character corresponding relationship obtain the anti-counterfeit number character string that length is 31 " MUQ3U445CKBRQDCR39PHCERNMVP6FC4 ", in every group last 2bits according to " 00 → it is white;01 → red;10→ Green;11 → blue " corresponding relationship, acquisition anti-counterfeit number colour sequential it is green, and it is red, it is green, it is green, it is white, it is blue, it is white, it is red, it is red, it is white, it is red, It is white, it is blue, it is blue, it is green, it is white, it is red, it is blue, it is blue, it is red, it is white, it is green, it is red, it is white, it is green, it is white, it is green, it is green, it is green, it is blue, green, superposition forms colored anti-fake Number be " M (green) U (red) Q (green) 3 (green) U (white) 4 (indigo plant) 4 (white) 5 (red) C (red) K (white) B (red) R (white) Q (indigo plant) D (indigo plant) C (green) R (white) 3 (red) 9 (indigo plant) P (indigo plant) H (red) C (white) E (green) R (red) N (white) M (green) V (white) P (green) 6 (green) F (green) C (indigo plant) 4 (green) " is combined, the colored commodity of generation using commodity sign code and colored anti-counterfeit number directly sequential connection mode Security code is " 4 (white) 5 A123456 2015-09-01 1234B0000001M (green) U (red) Q (green) 3 (green) U (white) 4 (indigo plant) (red) C (red) K (white) B (red) R (white) Q (indigo plant) D (indigo plant) C (green) R (white) 3 (red) 9 (indigo plant) P (indigo plant) H (red) C (white) E (green) R (red) N (white) M (green) V (white) P (green) 6 (green) F (green) C (indigo plant) 4 (green) ", wherein " M (green) " indicates the word of green background color Female M, others and so on.
It can be seen that it is mixed and disorderly that this patent, which mentions a kind of colored commodity counterfeit prevention code generating method colored security code generated, Without chapter, not initial data any trace.
Embodiment 2
According to above-mentioned colored commodity counterfeit prevention code generating method, the identification code A of certain part commodity and its colored security code generate step Suddenly similar to specific embodiment 1, only slight change: Z occurs for some external key10=0.543210000000001;Or Z20= 0.567890000000001, the results are shown in Table 3 for the generation of colored commodity counterfeit prevention code.From following table: once external key is Make that slight change occurs, the colored anti-counterfeit number of generation can occur greatly to change, it can be seen that this patent mentions a kind of colored quotient The anti-fake code generating method of product has key sensibility.
When 3 external key of table is slightly variable, the generation result of colored commodity counterfeit prevention code
Embodiment 3
According to above-mentioned colored commodity counterfeit prevention code generating method, external key and its colored security code generation step and specific real Apply commodity sign code A (such as " the A123456 2015-09-01 1234B0000002 ", " A123456 that example 1 is similar, is slightly variable The colored commodity that 2015-09-02 1234B0000001 " and " B123456 2015-09-02 1234B0000001 ") is generated are anti- The results are shown in Table 4 for pseudo-code.From following table: the slight change of commodity sign code can cause colored anti-counterfeit number (including anti-counterfeit number Character string and colour sequential) it changes a lot, it can be seen that this patent mentions a kind of colored commodity counterfeit prevention code generating method There is sensibility to commercial product identification information (i.e. commodity sign code).
When 4 commodity sign code of table is slightly variable, the generation result of colored 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 colored commodity counterfeit prevention code generating method institute It is not only closely related with external key to generate colored commodity counterfeit prevention code, but also depends on commercial product identification information (i.e. commodity sign Code), therefore a kind of colored commodity counterfeit prevention code generating method that this patent is mentioned has very strong safety, can preferably resist Known/chosen -plain attact is not easy to crack, and " uniqueness and can not be forged with guaranteeing that the colored commodity counterfeit prevention code generated has 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 colour commodity counterfeit prevention code generating method, which is characterized in that comprise the following steps:
(1) according to customized commodity sign code character and binary data corresponding relationship, certain part commodity unique identities will be characterized The commodity sign code A of information is converted to binary data, to obtain commodity sign binary sequence P1, wherein commodity sign code The length of A is expressed as L, and commodity sign binary sequence P1 length is 7 × Lbits;
(2) hash value and external key Z of certain part commodity sign code are utilized10、Z20, calculated separately according to formula as follows Obtain the initial value X of chaos system1、Y1With system parameter μ,
X1=mod (sum (bin2dec (H))/256 × N ÷ 8+Z10-Z20,1)
Y1=mod (sum (bin2dec (B))/16 × N ÷ 4+Z20-Z10,1)
μ=3.9+mod (sum (bin2dec (H))/256 × N ÷ 8-Z10,0.1)
Wherein, the hash value of certain part commodity sign code is the binary stream that length N is greater than 7 × L, is expressed as unit of 8bits SequenceWith the sequence as unit of 4bitsZ10∈(-1,1)、Z20∈(-1,1);
(3) by initial value X1With system parameter μ and initial value Y1And system parameterRespectively to chaotic maps shown in following formula into Row iteration,
XK+1=μ * XK*(1-XK)
Chaotic signal sequence X and Y are obtained, therefrom takes chaotic signal sequence X 1 and Y1 of the element with formation length for L respectively, simultaneously Each element in chaotic signal sequence X 1 and Y1 is subjected to the processing of integer shown in following formula, obtains chaotic signal integer sequence X2 and Y2,
Wherein,For the operation for taking the integer smaller than the number,
Each element in chaotic signal integer sequence X2 and Y2 is converted into 7 bit binary datas again, thus obtain length be 7 × Chaotic signal the binary sequence XX and YY of L;
(4) parity for judging 7 × L of data is filled at the end of binary sequence P1, XX and YY respectively if it is odd number Binary digit ' 0 ' or ' 1 ', comprising even number binary digit ' 0 ' in the binary sequence that makes that treated;
(5) binary sequence P1, XX and YY are grouped as unit of 2bits, every group successively carries out according to following formula Operation,
Wherein, operatorFor step-by-step xor operation, operator '-' is two binary subtraction operations,
Obtain anti-pseudorandom binary sequence C;
(6) binary sequence C is grouped according to 7bits for unit, preceding 5bits is according to customized binary number in every group According to commodity counterfeit prevention sign character corresponding relationship, obtain the anti-counterfeit number character string that length is L, last 2bits is according to making by oneself in every group The binary data and commodity counterfeit prevention color corresponding relationship of justice obtain the anti-counterfeit number colour sequential that length is L, then will be anti-fake Sign character string and the corresponding superposition of colour sequential form colored anti-counterfeit number, then commodity sign code and colored anti-counterfeit number combination producing is color The commodity counterfeit prevention code of color.
2. a kind of colored commodity counterfeit prevention code generating method according to claim 1, it is characterised in that: described in step (1) Characterization certain part commodity unique identity information commodity sign code, by ASCLL code value ∈ [32,126] character visible form, packet Include numerical character ' 0 '~' 9 ', capitalization ' A '~' Z ', lowercase ' a '~' z ' and punctuation mark character.
3. a kind of colored commodity counterfeit prevention code generating method according to claim 1, it is characterised in that: described in step (1) Customized commodity sign code character and binary data corresponding relationship: numerical character ' 0 '~' 9 ', capitalization ' A '~ ' Z ', lowercase ' a '~' z ' are respectively converted by corresponding 7 bit binary data of its ASCLL code value;Position in commodity sign code The punctuation mark character for being set to odd number is converted to by corresponding 7 bit binary data of its ASCLL code value;Position in commodity sign code For the punctuation mark character of even number, '!' → 0000000, ' " ' → 0000001, ' #' → 0000010, ' $ ' → 0000011, ' %' → 0000100, ' &' → 0000101, ' `' → 0000110, ' (' → 0000111, ') ' → 0001000, ' * ' → 0001001, ' + ' → 0001010, ', ' → 0001011, '-' → 0001100, ' .' → 0001101, '/' → 0001110, ': ' → 0001111, ';' → 0010000, '<' → 0010001, '=' → 0010010, '>' → 0010011, '? ' → 0010100, '@' → 0010101, ' [' → 0010110, ' ' → 0010111, '] ' → 0011000, ' ^' → 0011001, ' _ ' → 0011010, ' " → 0011011, ' ' → 0011100, ' | ' → 0011101, ' ' → 0011110, '~' → 0011111, ' ' → 1111111.
4. a kind of colored commodity counterfeit prevention code generating method according to claim 1, it is characterised in that: described in step (6) Customized binary data and commodity counterfeit prevention sign character corresponding relationship are as follows: 00000 → ' 0 ';00001→‘1';00010→ ‘2';00011→‘3';00100→‘4';00101→‘5';00110→‘6';00111→‘7';01000→‘8';01001→ ‘9';01010→‘A';01011→‘B';01100→‘C';01101→‘D';01110→‘E';01111→‘F';10000→ ‘G';10001→‘H';10010→‘I';10011→‘J';10100→‘K';10101→‘L';10110→‘M';10111→ ‘N';11000→‘O';11001→‘P';11010→‘Q';11011→‘R';11100→‘S';11101→‘T';11110→ ‘U';11111→‘V'.
5. a kind of colored commodity counterfeit prevention code generating method according to claim 1, it is characterised in that: described in step (6) Customized binary data and commodity counterfeit prevention color corresponding relationship are as follows: 00 → white;01 → red;10 → green;11 → blue.
6. a kind of colored commodity counterfeit prevention code generating method according to claim 1, it is characterised in that: described in step (6) The corresponding superposition of anti-counterfeit number character string and colour sequential is formed into colored anti-counterfeit number, refer to that anti-counterfeit number character adding has respective background Color, background color and corresponding anti-counterfeit number solid colour.
7. a kind of colored commodity counterfeit prevention code generating method according to claim 1, it is characterised in that: described in step (6) Commodity sign code and colored anti-counterfeit number combination producing colour commodity counterfeit prevention code, refer to anti-fake using commodity sign code and colour Number combination being directly linked in sequence.
CN201510854277.5A 2015-11-30 2015-11-30 A kind of colour commodity counterfeit prevention code generating method Active CN105354717B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510854277.5A CN105354717B (en) 2015-11-30 2015-11-30 A kind of colour commodity counterfeit prevention code generating method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510854277.5A CN105354717B (en) 2015-11-30 2015-11-30 A kind of colour commodity counterfeit prevention code generating method

Publications (2)

Publication Number Publication Date
CN105354717A CN105354717A (en) 2016-02-24
CN105354717B true CN105354717B (en) 2019-02-22

Family

ID=55330684

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510854277.5A Active CN105354717B (en) 2015-11-30 2015-11-30 A kind of colour commodity counterfeit prevention code generating method

Country Status (1)

Country Link
CN (1) CN105354717B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107425956B (en) * 2017-07-27 2019-07-16 南通大学 A kind of character type commodity counterfeit prevention code generating method
CN109345269A (en) * 2018-09-27 2019-02-15 成都量安区块链科技有限公司 A method of it is carried out using anti-counterfeit package fingerprint anti-fake
CN111382820B (en) * 2020-02-25 2021-10-12 南通大学 Four-lattice pure-color commodity anti-counterfeiting code generation method
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 (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103310255A (en) * 2013-05-31 2013-09-18 曾芝渝 Color character encoding method and decoding method
CN104657871A (en) * 2015-03-24 2015-05-27 南通大学 Generation method of commodity anti-counterfeiting code

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103310255A (en) * 2013-05-31 2013-09-18 曾芝渝 Color character encoding method and decoding method
CN104657871A (en) * 2015-03-24 2015-05-27 南通大学 Generation method of commodity anti-counterfeiting code

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
混沌数码防伪技术研究与应用;盛苏英;《微电子学与计算机》;20130831;第169-174页

Also Published As

Publication number Publication date
CN105354717A (en) 2016-02-24

Similar Documents

Publication Publication Date Title
CN105354717B (en) A kind of colour commodity counterfeit prevention code generating method
CN109472338B (en) Batch generation method of commodity anti-counterfeiting two-dimensional codes
CN109284803B (en) Commodity anti-counterfeiting two-dimensional code generation method
CN104680220B (en) A kind of commodity counterfeit prevention code Mass production method
CN103761702B (en) Image hiding and authentication method based on secret sharing
CN104657871B (en) A kind of commodity counterfeit prevention code generating method
CN103310255B (en) A kind of coding method of color character and its coding/decoding method
CN104486073B (en) A kind of encryption and decryption method of character type data
CN112884104B (en) Commodity anti-counterfeiting two-dimensional code generation method based on chaotic encryption
CN112001467B (en) Commodity anti-counterfeiting code generation and identification method based on picture encryption and decryption
CN112163230B (en) Commodity anti-counterfeiting code generation method based on Chinese character encryption
CN112001468B (en) Character type commodity anti-counterfeiting code generation and identification method
CN107425956B (en) A kind of character type commodity counterfeit prevention code generating method
CN112149773B (en) Commodity anti-counterfeiting code generation method based on Chinese character encryption
CN111985591B (en) Commodity anti-counterfeiting code generation method based on character string encryption
CN112149774B (en) Chinese character commodity anti-counterfeiting code generation method
CN102663668B (en) Digital watermarking system based on continuous vector graphics and implementation method of digital watermarking system based on continuous vector graphics
Mokhtar et al. Colored image encryption algorithm using DNA code and chaos theory
CN106375083A (en) Encryption-decryption method based on Base64 and device thereof
CN111382820B (en) Four-lattice pure-color commodity anti-counterfeiting code generation method
Alsaffar et al. An encryption based on DNA and AES algorithms for hiding a compressed text in colored Image
CN113255860A (en) Commodity anti-counterfeiting two-dimensional code generation method based on layered encryption
CN103824197A (en) Anti-counterfeit code generating device
CN105205777A (en) Encoding method of invisible image ciphers
CN108830366A (en) A kind of generation method and system of anti-fake spiral coloured silk code

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

Effective date of registration: 20200612

Address after: Room a1023, 1st floor, No.535, Hongqi East Road, Shanyang Town, Jinshan District, Shanghai, 201508

Patentee after: Lihe Technology (Shanghai) Co., Ltd

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

Patentee before: NANTONG University

TR01 Transfer of patent right