CN105354717A - Colorful commodity anti-counterfeiting code generating method - Google Patents

Colorful commodity anti-counterfeiting code generating method Download PDF

Info

Publication number
CN105354717A
CN105354717A CN201510854277.5A CN201510854277A CN105354717A CN 105354717 A CN105354717 A CN 105354717A CN 201510854277 A CN201510854277 A CN 201510854277A CN 105354717 A CN105354717 A CN 105354717A
Authority
CN
China
Prior art keywords
commodity
code
counterfeit
binary
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.)
Granted
Application number
CN201510854277.5A
Other languages
Chinese (zh)
Other versions
CN105354717B (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

Abstract

The invention discloses a colorful commodity anti-counterfeiting code generating method. The colorful commodity anti-counterfeiting code generating method comprises the following steps: converting a commodity identification code for representing the unique identity information of a certain commodity into a binary data; obtaining an initial value and parameters of a chaotic system based on the commodity identity information and an external secret key through calculation, and performing iteration on a chaotic mapping to generate two groups of chaotic signal binary sequences; performing bit manipulation taking 2bits as a unit on the commodity identification code by the chaotic binary signals to generate an anti-counterfeiting number overlapped with a colorful background, and further combining the anti-counterfeiting number into the colorful commodity anti-counterfeiting code. The colorful commodity anti-counterfeiting code generating method provided by the invention is simple, feasible, high in safety, and difficult to be cracked; and in addition, the generated colorful commodity anti-counterfeiting code is has the uniqueness and unforgeability.

Description

A kind of colored commodity counterfeit prevention code generating method
Technical field
The present invention relates to digital false-proof technology field, particularly the colored commodity counterfeit prevention code generating method of one.
Background technology
Society, commodity forgery and food and drug safety become the serious problems of global economy field face day by day, its not only greatly compromise production firm and consumers in general vital interests, upset market order, and to brand building with maintain social stability and bring extremely ill effect.Existing security code generation technique, due to its adopt cryptographic algorithm generally to lack analysis and the guarantee of attack resistance performance, generate commodity counterfeit prevention code performance still need further raising, unsatisfactory in antifalse effect.Simultaneously along with social development, the requirement of people to commodity packaging appearance, security code visual effect improves day by day.In the case, introduce color background character, the colored commodity counterfeit prevention code generating method propose a kind of simple possible, not easily cracking safely, generate the commodity counterfeit prevention code with " uniqueness and unforgeable " feature, extremely urgent.
Summary of the invention
Goal of the invention: the object of the invention is to solve deficiency of the prior art, a kind of colored commodity counterfeit prevention code generating method is provided, adopt self-defined corresponding relation, chaotic signal is utilized to carry out the bit manipulation in units of 2bits to commodity sign code, produce the anti-counterfeit number being superimposed with color background, and then the colored commodity counterfeit prevention code of combination producing, institute's extracting method simple possible is ensured with this, have very strong security, not easily crack, the colored commodity counterfeit prevention code of generation has " uniqueness and unforgeable ".
Technical scheme: the colored commodity counterfeit prevention code generating method of one of the present invention, comprises following several step:
(1) according to self-defining commodity sign code character and binary data corresponding relation, the commodity sign code A characterizing certain part commodity unique identity information is changed into binary data, thus obtain commodity sign binary sequence P1, wherein the length of commodity sign code A is expressed as L, and commodity sign binary sequence P1 length is 7 × Lbits;
(2) hash value of certain part commodity sign code is utilized, and external key Z 10, Z 20, the initial value X of chaos system is calculated respectively according to formula as follows 1, Y 1with systematic parameter μ,
X 1=mod(sum(bin2dec(H))/256×N÷8+Z 10-Z 20,1)
Y 1=mod(sum(bin2dec(B))/16×N÷4+Z 20-Z 10,1)
μ=3.9+mod(sum(bin2dec(H))/256×N÷8-Z 10,0.1)
μ ~ = 3.9 + mod ( s u m ( b i n 2 d e c ( B ) ) / 16 × N ÷ 4 - Z 20 , 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 the sequence in units of 8bits with the sequence in units of 4bits z 10∈ (-1,1), Z 20∈ (-1,1);
(3) by initial value X 1with systematic parameter μ, and initial value Y 1and systematic parameter respectively iteration is carried out to chaotic maps shown in following formula,
X K+1=μ*X K*(1-X K)
Obtain chaotic signal sequence X and Y, therefrom get element respectively to form the chaotic signal sequence X 1 and Y1 that length is L, element each in chaotic signal sequence X 1 and Y1 is carried out the integer process shown in following formula simultaneously, obtain chaotic signal integer sequence X2 and Y2,
Wherein, for getting the operation of the integer less than this number,
Convert each element in chaotic signal integer sequence X2 and Y2 to 7 bit binary data again, thus obtain chaotic signal binary sequence XX and YY that length is 7 × L;
(4) judge the parity of data 7 × L, if be odd number, then fill binary digit ' 0 ' or ' 1 ' respectively at the end of binary sequence P1, XX and YY, make to comprise even number binary digit ' 0 ' in the binary sequence after process;
(5) binary sequence P1, XX and YY are all divided into groups in units of 2bits, often organize and carry out computing according to following formula successively,
(C 2*k-1,C 2*k)=(P1 2*k-1,P1 2*k)⊕(XX 2*k-1,XX 2*k)-(YY 2*k-1,YY 2*k)
Wherein, operational symbol ' ⊕ ' is step-by-step xor operation, and operational symbol '-' is two binary subtraction operations,
Obtain anti-pseudorandom binary sequence C;
(6) be that unit divides into groups by binary sequence C according to 7bits, before often in group, 5bits is according to self-defining binary data and commodity counterfeit prevention sign character corresponding relation, obtain the anti-counterfeit number character string that length is L, often in group last 2bits according to self-defining binary data and commodity counterfeit prevention color corresponding relation, obtain the anti-counterfeit number colour sequential that length is L, then anti-counterfeit number character string and the superposition of colour sequential correspondence are formed colored anti-counterfeit number, then by the commodity counterfeit prevention code of commodity sign code and colored anti-counterfeit number combination producing colour.
As preferably, the commodity sign code of the sign part commodity unique identity information described in step (1), by ASCLL code value ∈ [32,126] character visible composition, comprises numerical character ' 0 ' ~ ' 9 ', capitalization ' A ' ~ ' Z ', lowercase ' a ' ~ ' z ' and punctuation mark character.
As preferably, the self-defining commodity sign code character described in step (1) and binary data corresponding relation: numerical character ' 0 ' ~ ' 9 ', capitalization ' A ' ~ ' Z ', lowercase ' a ' ~ ' z ' are converted to by 7 bit binary data corresponding to its ASCLL code value respectively; The punctuation mark character that commodity sign code meta is set to odd number is converted to by 7 bit binary data corresponding to its ASCLL code value; Commodity sign code meta is set to 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.
As preferably, the self-defining binary data described in step (6) and commodity counterfeit prevention sign character corresponding relation are: 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 '.
As preferably, the self-defining binary data described in step (6) and commodity counterfeit prevention color corresponding relation are: 00 → white; 01 → red; 10 → green; 11 → blue.
As preferably, described in step (6), anti-counterfeit number character string and the superposition of colour sequential correspondence are formed colored anti-counterfeit number, refer to that anti-counterfeit number character adding has respective background color, its background color and corresponding anti-counterfeit number solid colour.
As preferably, the commodity counterfeit prevention code of the commodity sign code described in step (6) and colored anti-counterfeit number combination producing colour, refers to the array mode adopting commodity sign code and colored anti-counterfeit number to be directly linked in sequence.
Beneficial effect: the present invention adopts self-defined corresponding relation (commodity sign code character and binary data, binary data and commodity counterfeit prevention sign character, and binary data and commodity counterfeit prevention color), chaotic signal is utilized to carry out the bit manipulation in units of 2bits to commodity sign code, produce the anti-counterfeit number being superimposed with color background, and then the colored commodity counterfeit prevention code of combination producing, ensure the one colored commodity counterfeit prevention code generating method simple possible that the present invention puies forward, there is very strong security, not easily crack, to ensure that the colored commodity counterfeit prevention code generated has " uniqueness and unforgeable ".
Accompanying drawing explanation
Fig. 1 is colored commodity counterfeit prevention code product process schematic diagram of the present invention.
Embodiment
The colored commodity counterfeit prevention code generating method of one as shown in Figure 1, comprises following several step:
(1) according to self-defining commodity sign code character and binary data corresponding relation, the commodity sign code A characterizing certain part commodity unique identity information is changed into binary data, thus obtain commodity sign binary sequence P1, wherein commodity sign code A comprises numerical character ' 0 ' ~ ' 9 ', capitalization ' A ' ~ ' Z ', lowercase ' a ' ~ ASCLL code value ∈ [32 such as ' z ' and punctuation mark character, 126] character visible, the length of commodity sign code A is expressed as L, and commodity sign binary sequence P1 length is 7 × Lbits;
Wherein, commodity sign code character with the corresponding relation of binary data is: numerical character ' 0 ' ~ ' 9 ', capitalization ' A ' ~ ' Z ', lowercase ' a ' ~ ' z ' are converted to by 7 bit binary data corresponding to its ASCLL code value respectively; The punctuation mark character that commodity sign code meta is set to odd number is converted to by 7 bit binary data corresponding to its ASCLL code value; The corresponding relation that the punctuation mark character that commodity sign code meta is set to even number changes into binary data is as shown in table 1,
The self-defined commodity sign code character of table 1 (punctuation mark character) and binary data mapping table
(2) hash value of certain part commodity sign code is utilized, and external key Z 10, Z 20, the initial value X of chaos system is calculated respectively according to formula as follows 1, Y 1with systematic parameter μ,
X 1=mod(sum(bin2dec(H))/256×N÷8+Z 10-Z 20,1)
Y 1=mod(sum(bin2dec(B))/16×N÷4+Z 20-Z 10,1)
μ=3.9+mod(sum(bin2dec(H))/256×N÷8-Z 10,0.1)
&mu; ~ = 3.9 + mod ( s u m ( b i n 2 d e c ( B ) ) 16 &times; N &divide; 4 - Z 20 , 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 the sequence in units of 8bits with the sequence in units of 4bits z 10∈ (-1,1), Z 20∈ (-1,1), the initial value X of visible chaos system 1, Y 1with systematic parameter μ, not only with external key (Z 10, Z 20) relevant, and can along with commercial product identification information change;
(3) by initial value X 1with systematic parameter μ, and initial value Y 1and systematic parameter respectively iteration is carried out to chaotic maps shown in following formula,
X K+1=μ*X K*(1-X K)
Obtain chaotic signal sequence X and Y, therefrom get element respectively to form the chaotic signal sequence X 1 and Y1 that length is L, element each in chaotic signal sequence X 1 and Y1 is carried out the integer process shown in following formula simultaneously, obtain chaotic signal integer sequence X2 and Y2,
Wherein, for getting the operation of the integer less than this number,
Convert each element in chaotic signal integer sequence X2 and Y2 to 7 bit binary data again, thus obtain chaotic signal binary sequence XX and YY that length is 7 × L;
(4) judge the parity of data 7 × L, if be odd number, then fill binary digit ' 0 ' or ' 1 ' respectively at the end of binary sequence P1, XX and YY, make to comprise even number binary digit ' 0 ' in the binary sequence after process;
(5) binary sequence P1, XX and YY are all divided into groups in units of 2bits, often organize and carry out computing according to following formula successively,
(C 2*k-1,C 2*k)=(P1 2*k-1,P1 2*k)⊕(XX 2*k-1,XX 2*k)-(YY 2*k-1,YY 2*k)
Wherein, operational symbol ' ⊕ ' is step-by-step xor operation, and operational symbol '-' is two binary subtraction operations,
Obtain anti-pseudorandom binary sequence C;
(6) be that unit divides into groups by binary sequence C according to 7bits, before often in group, 5bits is according to self-defining binary data and commodity counterfeit prevention sign character corresponding relation (see table 2), obtain the anti-counterfeit number character string that length is L, often in group last 2bits according to self-defining binary data and commodity counterfeit prevention color corresponding relation, i.e. " 00 → white, 01 → red, 10 → green, 11 → blue ", obtain 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, the commodity counterfeit prevention code of the mode combination producing colour adopting commodity sign code and colored anti-counterfeit number to be directly linked in sequence again.
The self-defining binary data of table 2 and commodity counterfeit prevention sign character mapping table
Below in conjunction with specific embodiment, the invention will be further described:
Embodiment 1
According to above-mentioned colored commodity counterfeit prevention code generating method, step is as follows:
(1) when the identification code A of certain part commodity is " A1234562015-09-011234B0000001 ", length L=31, according to commodity sign code character self-defining in table 1 and binary data corresponding relation, obtain length be 217 commodity sign binary 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) getting external key is Z 10=0.54321, Z 20=0.56789, utilize hash value (getting N=512) and the external key of this part commodity sign code A, obtain the initial value X of chaos system according to formulae discovery in above-mentioned colored commodity counterfeit prevention code generating method step (2) 1, Y 1with systematic parameter μ, for
X 1=mod(8405/256×512÷8+0.54321-0.56789,1)=0.48832048828125
Y 1=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
&mu; ~ = 3.9 + mod ( 1010 / 16 &times; 512 &divide; 4 - 0.56789 , 0.1 ) = 3.9252740625
(3) by initial value X 1with systematic parameter μ, and initial value Y 1and systematic parameter chaotic signal sequence X and Y is obtained according to chaotic maps formulae discovery shown in above-mentioned colored commodity counterfeit prevention code generating method step (3), 31 elements are got continuously to form chaotic signal sequence X 1 and Y1 respectively from the 251st element, element each in chaotic signal sequence X 1 and Y1 is carried out integer process shown in above-mentioned colored commodity counterfeit prevention code generating method step (3) simultaneously, 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},
Convert each element in chaotic signal integer sequence X2 and Y2 to 7 bit binary data, thus obtain the chaotic signal binary sequence XX={1 that length is 217, 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) judge that 217 as odd number, binary digit ' 0 ' (containing 127 ' 0 ' in former P1) is then filled respectively at the end of binary sequence P1, binary digit ' 1 ' (containing 112 ' 0 ' in former XX) is filled at the end of binary sequence XX, and binary digit ' 0 ' (containing 113 ' 0 ' in former YY) is filled at the end of binary sequence YY;
(5) by binary sequence P1, XX and YY all divides into groups in units of 2bits, often organize and carry out computing according to formula shown in above-mentioned colored commodity counterfeit prevention code generating method step (5) successively, obtain the anti-pseudorandom binary sequence C={1 that length is 218, 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) be that unit divides into groups by binary sequence C according to 7bits, before often in group, 5bits is according to the binary data shown in table 2 and commodity counterfeit prevention sign character corresponding relation, obtain the anti-counterfeit number character string " MUQ3U445CKBRQDCR39PHCERNMVP6FC4 " that length is 31, often in group last 2bits according to " 00 → white, 01 → red, 10 → green, 11 → blue " corresponding relation, obtain anti-counterfeit number colour sequential { green, red, green, green, in vain, blue, in vain, red, red, in vain, red, in vain, blue, blue, green, in vain, red, blue, blue, red, in vain, green, red, in vain, green, in vain, green, green, green, blue, green }, it is " M (green) U (red) Q (green) 3 (green) U (in vain) 4 (indigo plant) 4 (in vain) 5 (red) C (red) K (in vain) B (red) R (in vain) Q (indigo plant) D (indigo plant) C (green) R (in vain) 3 (red) 9 (indigo plant) P (indigo plant) H (red) C (in vain) E (green) R (red) N (in vain) M (green) V (in vain) P (green) 6 (green) F (green) C (indigo plant) 4 (green) " that superposition forms colored anti-counterfeit number, employing commodity sign code and colored the anti-counterfeit number directly mode of being linked in sequence combine, the colored commodity counterfeit prevention code generated is " A1234562015-09-011234B0000001M (green) U (red) Q (green) 3 (green) U (in vain) 4 (indigo plant) 4 (in vain) 5 (red) C (red) K (in vain) B (red) R (in vain) Q (indigo plant) D (indigo plant) C (green) R (in vain) 3 (red) 9 (indigo plant) P (indigo plant) H (red) C (in vain) E (green) R (red) N (in vain) M (green) V (in vain) P (green) 6 (green) F (green) C (indigo plant) 4 (green) ", wherein " M (green) " represents the alphabetical M of green background color, other by that analogy.
As can be seen here, this patent to carry the colored security code that a kind of colored commodity counterfeit prevention code generating method generates be any vestige that is rambling, that do not have raw data.
Embodiment 2
According to above-mentioned colored commodity counterfeit prevention code generating method, identification code A and the colored security code generation step thereof of certain part commodity are similar to specific embodiment 1, only certain external key generation slight change: Z 10=0.543210000000001; Or Z 20=0.567890000000001, the generation result of colored commodity counterfeit prevention code is as shown in table 3.From following table: even if once slight change occurs external key, great change can occur the colored anti-counterfeit number of generation, and this patent is carried a kind of colored commodity counterfeit prevention code generating method and had key susceptibility as can be seen here.
When there is micro-change in table 3 external key, 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 colored security code generation step similar to specific embodiment 1, the colored commodity counterfeit prevention code result that the commodity sign code A (as " A1234562015-09-011234B0000002 ", " A1234562015-09-021234B0000001 " and " B1234562015-09-021234B0000001 ") of micro-change generates is as shown in table 4.From following table: the slight change of commodity sign code can cause colored anti-counterfeit number (comprising anti-counterfeit number character string and colour sequential) to change a lot, this patent is carried a kind of colored commodity counterfeit prevention code generating method and is had susceptibility to commercial product identification information (i.e. commodity sign code) as can be seen here.
When there is micro-change in table 4 commodity sign code, the generation result of colored commodity counterfeit prevention code
Analyzed from above-mentioned specific embodiment 2 and example 3, this patent carry a kind of colored commodity counterfeit prevention code generating method to generate colored commodity counterfeit prevention code not only closely related with external key, and depend 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 carried has very strong security, known/chosen-plain attact can be resisted preferably, not easily crack, to ensure that the colored commodity counterfeit prevention code generated has " uniqueness and unforgeable ".
The above, it is only preferred embodiment of the present invention, not any pro forma restriction is done to the present invention, although the present invention discloses as above with preferred embodiment, but and be not used to limit the present invention, any those skilled in the art, do not departing within the scope of technical solution of the present invention, make a little change when the technology contents of above-mentioned announcement can be utilized or be modified to the Equivalent embodiments of equivalent variations, in every case be the content not departing from technical solution of the present invention, according to any simple modification that technical spirit of the present invention is done above embodiment, equivalent variations and modification, all still belong in the scope of technical solution of the present invention.

Claims (7)

1. a commodity counterfeit prevention code generating method, is characterized in that, comprises following several step:
(1) according to self-defining commodity sign code character and binary data corresponding relation, the commodity sign code A characterizing certain part commodity unique identity information is changed into binary data, thus obtain commodity sign binary sequence P1, wherein the length of commodity sign code A is expressed as L, and commodity sign binary sequence P1 length is 7 × Lbits;
(2) hash value of certain part commodity sign code is utilized, and external key Z 10, Z 20, the initial value X of chaos system is calculated respectively according to formula as follows 1, Y 1with systematic parameter μ,
X 1=mod(sum(bin2dec(H))/256×N÷8+Z 10-Z 20,1)
Y 1=mod(sum(bin2dec(B))/16×N÷4+Z 20-Z 10,1)
μ=3.9+mod(sum(bin2dec(H))/256×N÷8-Z 10,0.1)
&mu; ~ = 3.9 + mod ( s u m ( b i n 2 d e c ( B ) ) / 16 &times; N &divide; 4 - Z 20 , 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 the sequence { H in units of 8bits 1, H 2, H 3, H 4..., H n/8-2, H n/8-1, H n/8and sequence { B in units of 4bits 1, B 2, B 3, B 4..., B n/4-2, B n/4-1, B n/4, Z 10∈ (-1,1), Z 20∈ (-1,1);
(3) by initial value X 1with systematic parameter μ, and initial value Y 1and systematic parameter respectively iteration is carried out to chaotic maps shown in following formula,
X K+1=μ*X K*(1-X K)
Obtain chaotic signal sequence X and Y, therefrom get element respectively to form the chaotic signal sequence X 1 and Y1 that length is L, element each in chaotic signal sequence X 1 and Y1 is carried out the integer process shown in following formula simultaneously, obtain chaotic signal integer sequence X2 and Y2,
Wherein, for getting the operation of the integer less than this number,
Convert each element in chaotic signal integer sequence X2 and Y2 to 7 bit binary data again, thus obtain chaotic signal binary sequence XX and YY that length is 7 × L;
(4) judge the parity of data 7 × L, if be odd number, then fill binary digit ' 0 ' or ' 1 ' respectively at the end of binary sequence P1, XX and YY, make to comprise even number binary digit ' 0 ' in the binary sequence after process;
(5) binary sequence P1, XX and YY are all divided into groups in units of 2bits, often organize and carry out computing according to following formula successively,
(C 2*k-1,C 2*k)=(P1 2*k-1,P1 2*k)⊕(XX 2*k-1,XX 2*k)-(YY 2*k-1,YY 2*k)
Wherein, operational symbol ' ⊕ ' is step-by-step xor operation, and operational symbol '-' is two binary subtraction operations,
Obtain anti-pseudorandom binary sequence C;
(6) be that unit divides into groups by binary sequence C according to 7bits, before often in group, 5bits is according to self-defining binary data and commodity counterfeit prevention sign character corresponding relation, obtain the anti-counterfeit number character string that length is L, often in group last 2bits according to self-defining binary data and commodity counterfeit prevention color corresponding relation, obtain the anti-counterfeit number colour sequential that length is L, then anti-counterfeit number character string and the superposition of colour sequential correspondence are formed colored anti-counterfeit number, then by the commodity counterfeit prevention code of commodity sign code and colored anti-counterfeit number combination producing colour.
2. the colored commodity counterfeit prevention code generating method of one according to claim 1, it is characterized in that: the commodity sign code of the sign part commodity unique identity information described in step (1), by ASCLL code value ∈ [32,126] character visible composition, comprises numerical character ' 0 ' ~ ' 9 ', capitalization ' A ' ~ ' Z ', lowercase ' a ' ~ ' z ' and punctuation mark character.
3. the colored commodity counterfeit prevention code generating method of one according to claim 1, is characterized in that: the self-defining commodity sign code character described in step (1) and binary data corresponding relation: numerical character ' 0 ' ~ ' 9 ', capitalization ' A ' ~ ' Z ', lowercase ' a ' ~ ' z ' are converted to by 7 bit binary data corresponding to its ASCLL code value respectively; The punctuation mark character that commodity sign code meta is set to odd number is converted to by 7 bit binary data corresponding to its ASCLL code value; Commodity sign code meta is set to 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. the colored commodity counterfeit prevention code generating method of one according to claim 1, is characterized in that: the self-defining binary data described in step (6) and commodity counterfeit prevention sign character corresponding relation are: 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. the colored commodity counterfeit prevention code generating method of one according to claim 1, is characterized in that: the self-defining binary data described in step (6) and commodity counterfeit prevention color corresponding relation are: 00 → white; 01 → red; 10 → green; 11 → blue.
6. the colored commodity counterfeit prevention code generating method of one according to claim 1, it is characterized in that: anti-counterfeit number character string and colour sequential correspondence being superposed described in step (6) forms colored anti-counterfeit number, refer to that anti-counterfeit number character adding has respective background color, its background color and corresponding anti-counterfeit number solid colour.
7. the colored commodity counterfeit prevention code generating method of one according to claim 1, it is characterized in that: the commodity counterfeit prevention code of the commodity sign code described in step (6) and colored anti-counterfeit number combination producing colour, refer to the array mode adopting commodity sign code and colored anti-counterfeit number to be 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 true CN105354717A (en) 2016-02-24
CN105354717B 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)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107425956A (en) * 2017-07-27 2017-12-01 南通大学 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
CN111382820A (en) * 2020-02-25 2020-07-07 南通大学 Four-lattice pure-color commodity anti-counterfeiting code generation method
CN112001467A (en) * 2020-07-24 2020-11-27 南通大学 Commodity anti-counterfeiting code generation and identification method based on picture encryption and decryption
CN112001468A (en) * 2020-07-24 2020-11-27 南通大学 Character type commodity anti-counterfeiting code generation and identification method
CN112149774A (en) * 2020-09-16 2020-12-29 南通大学 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
盛苏英: "混沌数码防伪技术研究与应用", 《微电子学与计算机》 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107425956A (en) * 2017-07-27 2017-12-01 南通大学 A kind of character type commodity counterfeit prevention code generating method
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
CN111382820A (en) * 2020-02-25 2020-07-07 南通大学 Four-lattice pure-color commodity anti-counterfeiting code generation method
CN111382820B (en) * 2020-02-25 2021-10-12 南通大学 Four-lattice pure-color commodity anti-counterfeiting code generation method
CN112001467A (en) * 2020-07-24 2020-11-27 南通大学 Commodity anti-counterfeiting code generation and identification method based on picture encryption and decryption
CN112001468A (en) * 2020-07-24 2020-11-27 南通大学 Character type commodity anti-counterfeiting code generation and identification method
CN112001467B (en) * 2020-07-24 2021-11-19 南通大学 Commodity anti-counterfeiting code generation and identification method based on picture encryption and decryption
CN112149774A (en) * 2020-09-16 2020-12-29 南通大学 Chinese character commodity anti-counterfeiting code generation method
CN112149774B (en) * 2020-09-16 2021-11-30 南通大学 Chinese character commodity anti-counterfeiting code generation method

Also Published As

Publication number Publication date
CN105354717B (en) 2019-02-22

Similar Documents

Publication Publication Date Title
CN105354717A (en) Colorful commodity anti-counterfeiting 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
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
CN103761702B (en) Image hiding and authentication method based on secret sharing
CN112001467B (en) Commodity anti-counterfeiting code generation and identification method based on picture encryption and decryption
CN104657871A (en) Generation method of commodity anti-counterfeiting code
CN111985591B (en) Commodity anti-counterfeiting code generation method based on character string encryption
CN102800243B (en) Anti-counterfeiting annular code and encoding method thereof
CN112884104B (en) Commodity anti-counterfeiting two-dimensional code generation method based on chaotic encryption
CN102184243B (en) Text-type attribute-based relational database watermark embedding method
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
CN112149773B (en) Commodity anti-counterfeiting code generation method based on Chinese character encryption
CN104794619B (en) Anti-channel conflict digital information mapping code method for commodity packaging
CN112149774B (en) Chinese character commodity anti-counterfeiting code generation method
CN105007160A (en) Message integrity protection method in quantum digital signature
Mokhtar et al. Colored image encryption algorithm using DNA code and chaos theory
CN108418683A (en) A kind of carrier-free text steganography method based on feature of Chinese characters structure
CN102663668A (en) Digital watermarking system based on continuous vector graphics and implementation method of digital watermarking system based on continuous vector graphics
CN106375083A (en) Encryption-decryption method based on Base64 and device thereof
CN112217627B (en) Layered encrypted commodity anti-counterfeiting code generation method
CN103824197A (en) Anti-counterfeit code generating device

Legal Events

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

Effective date of registration: 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