CN107425956A - 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 PDFInfo
- Publication number
- CN107425956A CN107425956A CN201710623439.3A CN201710623439A CN107425956A CN 107425956 A CN107425956 A CN 107425956A CN 201710623439 A CN201710623439 A CN 201710623439A CN 107425956 A CN107425956 A CN 107425956A
- Authority
- CN
- China
- Prior art keywords
- rule
- bit arithmetic
- commodity
- operate1
- character type
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/001—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using chaotic signals
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Commerce
- G06Q30/018—Certifying business or products
- G06Q30/0185—Product, service or business identity fraud
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic 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/0643—Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Development Economics (AREA)
- Strategic Management (AREA)
- Accounting & Taxation (AREA)
- Power Engineering (AREA)
- Economics (AREA)
- Finance (AREA)
- Marketing (AREA)
- Entrepreneurship & Innovation (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Complex Calculations (AREA)
- Lock And Its Accessories (AREA)
Abstract
The invention discloses a kind of character type commodity counterfeit prevention code generating method, comprise the following steps:The character type commodity sign code for characterizing certain part commodity unique identity information is changed into 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 packets, preceding 3bits generates commodity encrypted value, simultaneously according to self-defined 2bits coding rules corresponding relation and self-defined bit arithmetic rule corresponding relation, 4bits carries out 2bits correspondence mappings coding and twice bit arithmetic afterwards, further according to self-defined commodity encrypted value and the corresponding relation of commodity encryption numbers, obtain character type commodity counterfeit prevention number, and then combination producing character type commodity counterfeit prevention code.The present invention puies forward character type commodity counterfeit prevention code generating method simple possible, has very strong security, is not easy to crack, the character type commodity counterfeit prevention code of generation has " uniqueness and unforgeable ".
Description
Technical field
The present invention relates to digital false-proof technology field, more particularly to a kind of character type commodity counterfeit prevention code generating method.
Background technology
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 generated.In economic interests
Driving under, all kinds of fake and inferior commodities emerge in an endless stream, and this not only compromises consumer's interests, while also to being forged brand band
Carry out reputational damage, caused economic loss, severely impact corporate image.In order to protect the interests of producer and consumer,
Anti- pseudo problem arises at the historic moment and received more and more attention.
Fake such as dream dimple along with the development of human civilization, as long as fake producer is lucrative, any commodity nearly all can
Occur so-called " Counterfeit Item ".Therefore, the false proof problem for becoming people and constantly studying.Anti-counterfeiting technology, which is constantly updated, regenerates, existing
Having developed into for a special subject.It is false proof to be related to different field, such as bank cipher, food security, medical medicine
Product, textile garment, tobacco and wine etc..Anti-counterfeiting technology can be roughly divided into physical security and the class of digital code anti-false two, and development also occurs by now
Chemical false proof, " intension is false proof ", biology are false proof etc..Physical security needs the printer using custom-made, at the same in order to up to
Required to printing, it is necessary to select special material (such as paper, ink), with reference to special technique, this undoubtedly prevents to enterprise
Puppet takes excessive cost, is unfavorable for company interest.Therefore, 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 false proof matter of great urgency of enterprise.Existing security code generation technique, by it is used
AES general lack of attack tolerant can analysis and guarantee, the performance for generating commodity counterfeit prevention code still needs to further improve.
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.
The content of the invention
Goal of the invention:The invention aims to solve deficiency of the prior art, there is provided a kind of character type commodity are prevented
Pseudo- code generating method, chaotic signal binary sequence is produced using chaotic maps, using self-defined corresponding relation, carry out 2bits
Correspondence mappings coding and twice bit arithmetic, anti-counterfeit number, and then combination producing character type commodity counterfeit prevention code are produced, ensures to be carried with this
Method simple possible, there is very strong security, be not easy to crack, the character type commodity counterfeit prevention code of generation has " uniqueness and not
Forgeability ".
Technical scheme:A kind of character type commodity counterfeit prevention code generating method of the present invention, including 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 each numerical value in sequence A1 is subjected to 7 Binary Conversions, so as to obtain binary sequence AB, wherein business
Product identification code A length is expressed as L, and commodity sign binary sequence AB contains 7 × L bits;
(2) certain part commodity sign code A 16 character type MD5 values, and external key K are utilized10、K20And K30, according to such as
The initial value x for tilting tent chaotic maps is calculated in formula (1)-(6) shown in lower respectively1、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 values of certain part commodity sign code are 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 p1, and chaotic maps initial value y1With parameter p2, respectively to equation below
(7) tilt tent chaotic maps shown in be iterated, parameter p is taken as p respectively in formula1(0.4≤p1<And p 0.6)2(0.4<p2≤
0.6), k represents iterations (k=1,2 ...), zk+1The chaotic signal that kth time iteration obtains is represented, is taken as x respectivelyk+1With
yk+1,
Obtain chaotic signal sequence X={ x1,x2... } and Y={ y1,y2... }, it is spaced n successively from sequence X1Take member
Element is spaced n successively to form chaotic signal sequence X 1 of the length as L from sequence Y2Element is taken to form chaos of the length as L
Signal sequence Y1, while each element in chaotic signal sequence X 1 and Y1 is subjected to the integer processing shown in equation below (8), obtain
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, so as to obtain containing 7 ×
Lbits chaotic signal binary sequence XX and YY;
(4) binary sequence AB, XX and YY are grouped in units 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, following computing is carried out successively:
First, calculated according to formula as follows (9), respectively obtain every group of binary sequence 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,
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 (10) again, closed according to self-defined bit arithmetic rule is corresponding
The rear 4bits that system obtains every group of binary sequence carries out the rule of computing in units of 2bits,
Then, according to self-defined 2bits coding rules corresponding relation, by the rear 4bits of every group of binary sequence with 2bits
Correspondence mappings coding is carried out respectively for unit, and first time position fortune is carried out according to the operation rule in bit arithmetic rule corresponding relation
Calculate, obtain 4bits commodity encrypted code C2;
And then, also according to self-defined 2bits coding rules corresponding relation, 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 in units of 2bits
Not carry out correspondence mappings coding, according in bit arithmetic rule corresponding relation operation rule carry out second of bit arithmetic, obtain
4bits commodity encrypted code C3;
Finally, calculated according to formula as follows (11), obtain commodity encrypted value CC,
CC=C1 × 16+bin2dec (C3) (11)
According to self-defined commodity encrypted value and the corresponding relation of commodity encryption numbers, numeric type commodity encryption numbers CC is changed
Into character type commodity encryption numbers, so as 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 groups binary sequence is subjected to computing as described above respectively successively, 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 for characterizing certain part commodity unique identity information described in step (1), by ASCLL
Code value ∈ [32,126] character visible composition, including numerical character ' 0 '~' 9 ', capitalization ' A '~' Z ', lowercase
' a '~' z ' and punctuation mark character.
Preferably, the self-defined bit arithmetic rule corresponding relation described in step (4) is:Work as operation_1=0
When, 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, 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 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=2, 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=3, first time position
Computing is C_operate1=AB ⊕ YY, if operation_2=0, second of bit arithmetic is C_operate1 ⊕ XX, such as
Fruit operation_2=1, then second of bit arithmetic is C_operate1+XX, if operation_2=2, second
Computing is C_operate1-XX;As operation_1=4, 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
During operation_1=5, 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.Wherein 2bits is the binary addition of unit, subtraction
Bit arithmetic is expressed as: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, described in step (4) according to 2bits coding rule corresponding relations, by every group of binary sequence
4bits carries out correspondence mappings coding respectively in units of 2bits afterwards, and wherein 2bits coding rules corresponding relation is: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 it is mutually corresponding;During Rule=0 ' 01 ', Rule
When=1 ' 10 ', Rule=2 when ' 00 ', Rule=3 when ' 11 ', Rule=4 when ' 00 ', Rule=5 when ' 11 ',
During ' 01 ' and Rule=7 during Rule=6 ' 10 ' between it is mutually corresponding;During Rule=0 ' 10 ', Rule=1 when ' 01 ',
During Rule=2 ' 11 ', Rule=3 when ' 00 ', Rule=4 when ' 11 ', Rule=5 when ' 00 ', Rule=6 when
During ' 10 ' and Rule=7 ' 01 ' between it is mutually corresponding;During Rule=0 ' 11 ', Rule=1 when ' 11 ', Rule=2 when
' 10 ', during Rule=3 ' 10 ', Rule=4 when ' 01 ', Rule=5 when ' 01 ', Rule=6 when ' 00 ' and Rule=7
When ' 00 ' between it is mutually corresponding.4bits after every group of binary sequence is wherein subjected to correspondence mappings respectively in units of 2bits
Coding, refer to using every group of binary sequence before bit arithmetic, coding rule number used by first time bit arithmetic, by bit arithmetic
The 2bits under certain 2bits first time bit arithmetic coding rules number corresponding under preceding coding rule number is replaced, for example, position is transported
Coding rule is respectively 0 and 2 before calculation, used by first time bit arithmetic, then ' 00 ' is replaced with ' 01 ', and ' 01 ' used for ' 00 ' generation
Replace, ' 10 ' are replaced with ' 11 ', and ' 11 ' are replaced with ' 10 '.
Preferably, described in step (4) according to self-defined 2bits coding rules corresponding relation, 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
Used coding rule number, by second of bit arithmetic coding rule corresponding to certain 2bits use under coding rule number before bit arithmetic
2bits under then number is replaced.
Preferably, self-defined commodity encrypted value and the corresponding relation of commodity encryption numbers described in step (4), refer to
Work as CC<When 10, C (k)=char (CC+48);As 10≤CC<When 48, C (k)=char (CC+53);As 48≤CC, C (k)=
char(CC+59)。
Preferably, character type commodity sign code A and character type commodity counterfeit prevention C are subjected to group described in step (5)
Close, generate 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.
Beneficial effect:The present invention uses self-defined corresponding relation (bit arithmetic rule corresponding relation, 2bits coding rules pair
It should be related to, and commodity encrypted value and the corresponding relation of commodity encryption numbers), produce chaotic signal binary system using chaotic maps
Sequence, 2bits correspondence mappings coding and twice bit arithmetic are carried out, produces anti-counterfeit number, and then combination producing character type commodity counterfeit prevention
Code, ensure a kind of character type commodity counterfeit prevention code generating method simple possible that the present invention is put forward, there is very strong security, be not easy
Crack, the character type commodity counterfeit prevention code generated has " uniqueness and unforgeable ".
Brief description of the drawings
Fig. 1 is the character type commodity counterfeit prevention code product process schematic diagram of the present invention.
Embodiment
A kind of character type commodity counterfeit prevention code generating method as shown in Figure 1, including 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 each numerical value in sequence A1 is subjected to 7 Binary Conversions, so as to obtain binary sequence AB, wherein business
Product identification code A includes numerical character ' 0 '~' 9 ', capitalization ' A '~' Z ', lowercase ' a '~' z ' and punctuation word
The ASCLL code values ∈ [32,126] such as symbol character visible, commodity sign code A length are expressed as L, commodity sign binary sequence
AB contains 7 × L bits;
(2) certain part commodity sign code A 16 character type MD5 values, and external key K are utilized10、K20And K30, according to such as
The initial value x for tilting tent chaotic maps is calculated in formula shown in lower respectively1、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 values of certain part commodity sign code are 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 p1, and chaotic maps initial value y1With parameter p2, respectively to equation below
Shown inclination tent chaotic maps are iterated, and parameter p is taken as p respectively in formula1(0.4≤p1<And p 0.6)2(0.4<p2≤
0.6), k represents iterations (k=1,2 ...), zk+1The chaotic signal that kth time iteration obtains is represented, is taken as x respectivelyk+1With
yk+1,
Obtain chaotic signal sequence X={ x1,x2... } and Y={ y1,y2... }, it is spaced n successively from sequence X1Take member
Element is spaced n successively to form chaotic signal sequence X 1 of the length as L from sequence Y2Element is taken to form chaos of the length as L
Signal sequence Y1, while each element in chaotic signal sequence X 1 and Y1 is subjected to the integer processing shown in equation below, obtain
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, so as to obtain containing 7 ×
Lbits chaotic signal binary sequence XX and YY;
(4) binary sequence AB, XX and YY are grouped in units 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, it is calculated as below successively:
First, calculated according to formula as follows, respectively obtain every group of binary sequence before bit arithmetic, first time position fortune
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,
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, obtained according to self-defined bit arithmetic rule corresponding relation
Rear 4bits to every group of binary sequence carries out the rule of bit arithmetic in units 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)
Wherein self-defined bit arithmetic rule corresponding relation is as shown in table 1,
The self-defined bit arithmetic rule mapping table of table 1
I.e. as operation_1=0 and operation_2=0, first time bit arithmetic is C_operate1=AB ⊕
XX, second of bit arithmetic are C_operate1 ⊕ YY;As operation_1=1 and operation_2=0, first time position fortune
It is C_operate1=AB+XX, second of bit arithmetic is C_operate1 ⊕ YY;As operation_1=2 and
During operation_2=0, first time bit arithmetic is C_operate1=AB-XX, and second of bit arithmetic is C_operate1 ⊕
YY;Etc..Wherein 2bits is that the binary addition of unit, subtraction bit arithmetic are as shown in table 2,
The 2bits of table 2 is the binary addition of unit, subtraction bit arithmetic table
Then, according to self-defined 2bits coding rules corresponding relation, by the rear 4bits of every group of binary sequence with 2bits
Correspondence mappings coding is carried out respectively for unit, and first time position fortune is carried out according to the operation rule in bit arithmetic rule corresponding relation
To calculate, obtain 4bits commodity encrypted code C2, wherein 2bits coding rules corresponding relation is as shown in table 3,
The 2bits coding rule mapping tables of table 3
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 |
4bits after every group of binary sequence is wherein subjected to correspondence mappings coding respectively in units of 2bits, refers to utilize
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 first time bit arithmetic coding rules number corresponding under 2bits replace, for example, before bit arithmetic, first time position
Coding rule number is respectively 0 and 2 used by computing, then ' 00 ' is replaced with ' 01 ', and ' 01 ' is replaced with ' 00 ', and ' 10 ' use ' 11 '
Instead of ' 11 ' are replaced with ' 10 '.
And then, also according to self-defined 2bits coding rules corresponding relation, 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 in units 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 use corresponding to 2bits generations under second of bit arithmetic coding rule number
Replace, carry out second of bit arithmetic according to the bit arithmetic rule in bit arithmetic rule corresponding relation, obtain 4bits commodity encrypted code
C3;
Finally, calculated according to formula as follows, obtain commodity encrypted value CC,
CC=C1 × 16+bin2dec (C3)
According to self-defined commodity encrypted value and the corresponding relation of commodity encryption numbers, numeric type commodity encryption numbers CC is changed
Into character type commodity encryption numbers, so as 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 relation of self-defined commodity encrypted value and commodity encryption numbers, refers to work as CC<
When 10, C (k)=char (CC+48);As 10≤CC<When 48, C (k)=char (CC+53);As 48≤CC, C (k)=char
(CC+59),
L groups binary sequence is subjected to computing as described above respectively successively, 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, i.e., using character type commodity mark
Know the combination that code and character type commodity counterfeit prevention number are directly linked in sequence, generate commodity counterfeit prevention code.
With reference to specific embodiment, the invention will be further described:
Embodiment 1
It is as follows according to above-mentioned character type commodity counterfeit prevention code generating method, step:
(1) when the identification code A of certain part commodity is " B654321 2017-07-10abcd:111111 ", length L=30, obtain
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 each numerical value in sequence A1 are carried out, so as to
To containing 7 × L bits 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
Position character type MD5 values (7bca0cebdd357899) and external key, the initial value x for tilting tent chaotic maps is calculated1、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 p1, and chaotic maps initial value y1With parameter p2, respectively to equation below
Shown inclination tent chaotic maps are iterated, and parameter p is taken as p respectively in formula1(0.4≤p1<And p 0.6)2(0.4<p2≤
0.6), k represents iterations (k=1,2 ...), zk+1The chaotic signal that kth time iteration obtains is represented, is taken as x respectivelyk+1With
yk+1,
Obtain chaotic signal sequence X={ x1,x2... } and Y={ y1,y2... }, it is spaced n successively from sequence X1Take member
Element using formed length as 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 spaced successively in row Y2Take element using formed length as 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, it is equal so as 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 in units 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, it is calculated as below, is illustrated below by taking k=1 as an example successively,
First, 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, used by first time bit arithmetic coding rule 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 used by second of bit arithmetic coding rule 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, it is C1=mod (bin2dec (⊕ 000 of 100 ⊕ 111), 3)=0 that commodity encrypted value C1, which is calculated,;
It is calculated operation_1=mod (bin2dec (' 1000010')-bin2dec (' 1110110') again, 6)=
2nd, operation_2=mod (bin2dec (' 1000010')-bin2dec (' 0000111'), 3)=2, according to making adopted position fortune by oneself
Calculate regular mapping table and obtain the rear 4bits of every group of binary sequence and the rule of bit arithmetic is carried out in units of 2bits as the
Bit arithmetic is C_operate1=AB-XX, and second of bit arithmetic is C_operate1-YY;
Then, according to 2bits coding rule relation tables, in units of 2bits, after the 1st group of binary sequence AB
4bits ' 00 ' and ' 10 ' is replaced with ' 01 ' and ' 00 ' respectively, the 1st group of binary sequence XX rear 4bits ' 01 ' and ' 10 ' distinguishes
Replaced with ' 00 ' and ' 11 ', carry 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 tables, in units of 2bits, by ' the 01 ' of commodity encrypted code C2
' 01 ' respectively with ' 10 ' and ' 10 ' replaces, the 1st group of binary sequence YY rear 4bits ' 01 ' and ' 11 ' respectively with ' 10 ' with
' 00 ' replaces, and carries out second of bit arithmetic ' 10 '-' 10 '=' 00 ', ' 10 '-' 00 '=' 10 ', the commodity for obtaining 4bits add
Password C3=' 0010 ',
Finally, commodity encrypted value CC=C1 × 16+bin2dec (C3)=2 is calculated, is encrypted according to self-defined commodity
The corresponding relation of numerical value and commodity encryption numbers, numeric type commodity encryption numbers CC is converted into character type commodity encryption numbers, C (k)=
Char (2+48)=' 2',
L groups binary sequence is subjected to computing as described above respectively successively, 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, i.e., using 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
‘B6543212017-07-10abcd:1111112MIYNOJRT@BJQf4L4B2EHJBX1AeG9P’。
As can be seen here, this patent carries the character type commodity counterfeit prevention that a kind of character type commodity counterfeit prevention code generating method is generated
Number it is any vestige rambling, without initial data.
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 occurs for some external key:K10=0.543210000000001;
Or K20=0.567890000000001;Or K30=12, the generation result of character type commodity counterfeit prevention code is as shown in table 4.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 carries a kind of character type commodity counterfeit prevention code generating method, has key sensitiveness.
When micro- change occurs for the external key of table 4, 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-10abcd of micro- change:111111’、‘B654321
2017-07-11abcd:111111 ' and ' B654321 2017-07-10abcd:111112 ') the character type commodity counterfeit prevention of generation
Code result is as shown in table 5.From following table:It is very big that the slight change of commodity sign code can cause character type commodity counterfeit prevention number to occur
Change, it can be seen that this patent carries a kind of character type commodity counterfeit prevention code generating method to commercial product identification information (i.e. commodity mark
Know code) there is sensitiveness.
When micro- change occurs for the commodity sign code of table 5, the generation result of character type commodity counterfeit prevention code
Analyzed from above-mentioned specific embodiment 2 and example 3, this patent carries 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, and 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 carried has very strong security, can be preferably
Resistance is known/chosen -plain attact, it is not easy to crack, to ensure that the character type commodity counterfeit prevention code of generation has " uniqueness and can not
Forgery property ".
The above described is only a preferred embodiment of the present invention, any formal limitation not is made to the present invention, though
So the present invention is disclosed above with preferred embodiment, but is not limited to the present invention, any to be familiar with this professional technology people
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, as long as being the content without departing from technical solution of the present invention, the technical spirit according to the present invention
Any simple modification, equivalent change and modification made to above example, in the range of still falling within technical solution of the present invention.
Claims (7)
1. a kind of character type commodity counterfeit prevention code generating method, it is characterised in that including 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 each numerical value in sequence A1 is subjected to 7 Binary Conversions, so as 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) certain part commodity sign code A 16 character type MD5 values, and external key K are utilized10、K20And K30, according to following institute
Show that the initial value x for tilting tent chaotic maps is calculated in formula respectively1、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 values of certain part commodity sign code are 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 p1, and chaotic maps initial value y1With parameter p2, respectively to inclining shown in equation below
Oblique tent chaotic maps are iterated, and parameter p is taken as p respectively in formula1(0.4≤p1<And p 0.6)2(0.4<p2≤ 0.6), k is represented
Iterations (k=1,2 ...), zk+1The chaotic signal that kth time iteration obtains is represented, is taken as x respectivelyk+1And yk+1,
<mrow>
<msub>
<mi>z</mi>
<mrow>
<mi>k</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>=</mo>
<mfenced open = "{" close = "">
<mtable>
<mtr>
<mtd>
<mrow>
<msub>
<mi>z</mi>
<mi>k</mi>
</msub>
<mo>/</mo>
<mi>p</mi>
</mrow>
</mtd>
<mtd>
<mrow>
<mi>i</mi>
<mi>f</mi>
<mn>0</mn>
<mo>&le;</mo>
<msub>
<mi>z</mi>
<mi>k</mi>
</msub>
<mo>&le;</mo>
<mi>p</mi>
</mrow>
</mtd>
</mtr>
<mtr>
<mtd>
<mrow>
<mn>1</mn>
<mo>-</mo>
<msub>
<mi>z</mi>
<mi>k</mi>
</msub>
<mo>/</mo>
<mn>1</mn>
<mo>-</mo>
<mi>p</mi>
</mrow>
</mtd>
<mtd>
<mrow>
<mi>i</mi>
<mi>f</mi>
<mi> </mi>
<mi>p</mi>
<mo><</mo>
<msub>
<mi>z</mi>
<mi>k</mi>
</msub>
<mo>&le;</mo>
<mn>1</mn>
</mrow>
</mtd>
</mtr>
</mtable>
</mfenced>
</mrow>
Obtain chaotic signal sequence X={ x1,x2... } and Y={ y1,y2... }, it is spaced n successively from sequence X1Take element with
The chaotic signal sequence X 1 that length is L is formed, n is spaced successively from sequence Y2Element is taken to form chaotic signal of the length as L
Sequence Y1, while each element in chaotic signal sequence X 1 and Y1 is subjected to the integer processing shown in equation below, 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, so as to obtain containing 7 ×
Lbits chaotic signal binary sequence XX and YY;
(4) binary sequence AB, XX and YY are grouped in units 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, carry out following computing successively:
First, 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, obtained often according to self-defined bit arithmetic rule corresponding relation
The rear 4bits of group binary sequence carries out the rule of bit arithmetic in units 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 self-defined 2bits coding rules corresponding relation, by the rear 4bits of every group of binary sequence using 2bits to be single
Position carries out correspondence mappings coding respectively, carries out first time bit arithmetic according to the operation rule in bit arithmetic rule corresponding relation, obtains
To 4bits commodity encrypted code C2;
And then, also according to self-defined 2bits coding rules corresponding relation, by commodity encrypted code C2, binary sequence { XX
(7k-3), XX (7k-2) ..., XX (7k) }, YY (7k-3), YY (7k-2) ..., and YY (7k) } entered respectively in units of 2bits
Row correspondence mappings encode, and carry out second of bit arithmetic according to the operation rule in bit arithmetic rule corresponding relation, obtain 4bits's
Commodity encrypted code C3;
Finally, calculated according to formula as follows, obtain commodity encrypted value CC,
CC=C1 × 16+bin2dec (C3)
According to self-defined commodity encrypted value and the corresponding relation of commodity encryption numbers, numeric type commodity encryption numbers CC is converted into word
Symbol type commodity encryption numbers, so as to kth group binary sequence { AB (7k-6), AB (7k-5) ..., AB (7k) } corresponding to obtaining,
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),
L groups binary sequence is subjected to computing as described above respectively successively, 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.
A kind of 2. 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 up of ASCLL code values ∈ [32,126] character visible,
Including numerical character ' 0 '~' 9 ', capitalization ' A '~' Z ', lowercase ' a '~' z ' and punctuation mark character.
A kind of 3. character type commodity counterfeit prevention code generating method according to claim 1, it is characterised in that:Institute in step (4)
The self-defined bit arithmetic rule corresponding relation stated is: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
Computing 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
Computing 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
During 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 that the binary addition of unit, subtraction bit arithmetic are expressed as: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。
A kind of 4. 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 relations, the rear 4bits of every group of binary sequence is carried out respectively in units of 2bits
Correspondence mappings encode, and wherein 2bits coding rules corresponding relation is:During 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
During Rule=7 ' 11 ' between it is mutually corresponding;During Rule=0 ' 01 ', Rule=1 when ' 10 ', Rule=2 when ' 00 ',
During Rule=3 ' 11 ', Rule=4 when ' 00 ', Rule=5 when ' 11 ', Rule=6 when ' 01 ' and during Rule=7
It is mutually corresponding between ' 10 ';During Rule=0 ' 10 ', Rule=1 when ' 01 ', Rule=2 when ' 11 ', Rule=3 when
' 00 ', during Rule=4 ' 11 ', Rule=5 when ' 00 ', Rule=6 when ' 10 ' and Rule=7 when ' 01 ' between mutually
It is corresponding;During 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 it is mutually corresponding;
4bits after every group of binary sequence is wherein subjected to correspondence mappings coding respectively in units of 2bits, refers to utilize every group
Binary sequence is before bit arithmetic, coding rule number used by first time bit arithmetic, by under coding rule number before bit arithmetic
2bits under certain 2bits first time bit arithmetic coding rules number corresponding to is replaced, for example, before bit arithmetic, first time bit arithmetic
Used coding rule number is respectively 0 and 2, then ' 00 ' is replaced with ' 01 ', and ' 01 ' is replaced with ' 00 ', and ' 10 ' used for ' 11 ' generations
Replace, ' 11 ' are replaced with ' 10 '.
A kind of 5. character type commodity counterfeit prevention code generating method according to claim 1, it is characterised in that:Institute in step (4)
State according to self-defined 2bits coding rules corresponding relation, 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 in units of 2bits
Code, refer to using every group of binary sequence before bit arithmetic, coding rule number used by second of bit arithmetic, before bit arithmetic
The 2bits under certain 2bits second of bit arithmetic coding rule number corresponding under coding rule number is replaced.
A kind of 6. character type commodity counterfeit prevention code generating method according to claim 1, it is characterised in that:Institute in step (4)
The self-defined commodity encrypted value stated and the corresponding relation of commodity encryption numbers, refer to work as CC<When 10, C (k)=char (CC+48);
As 10≤CC<When 48, C (k)=char (CC+53);As 48≤CC, C (k)=char (CC+59).
A kind of 7. 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 use word
The combination that symbol type commodity sign code and character type commodity counterfeit prevention number are directly linked in sequence.
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 true CN107425956A (en) | 2017-12-01 |
CN107425956B 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) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111382820A (en) * | 2020-02-25 | 2020-07-07 | 南通大学 | Four-lattice pure-color commodity anti-counterfeiting code generation method |
CN111985591A (en) * | 2020-07-24 | 2020-11-24 | 南通大学 | Commodity anti-counterfeiting code generation method based on character string encryption |
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 (3)
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 |
-
2017
- 2017-07-27 CN CN201710623439.3A patent/CN107425956B/en active Active
Patent Citations (3)
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)
Title |
---|
盛苏英,陈轶: ""混沌数码防伪技术研究与应用"", 《微电子学与计算机》 * |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
CN111985591A (en) * | 2020-07-24 | 2020-11-24 | 南通大学 | Commodity anti-counterfeiting code generation method based on character string encryption |
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 |
CN111985591B (en) * | 2020-07-24 | 2022-06-21 | 南通大学 | Commodity anti-counterfeiting code generation method based on character string encryption |
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 |
---|---|
CN107425956B (en) | 2019-07-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107425956B (en) | A kind of character type commodity counterfeit prevention code generating method | |
CN104486073B (en) | A kind of encryption and decryption method of character type data | |
CN109472338B (en) | Batch generation method of commodity anti-counterfeiting two-dimensional codes | |
CN112001468B (en) | Character type commodity anti-counterfeiting code generation and identification method | |
CN104657871B (en) | A kind of commodity counterfeit prevention code generating method | |
CN112001467B (en) | Commodity anti-counterfeiting code generation and identification method based on picture encryption and decryption | |
CN105303075B (en) | Adaptive Text Watermarking method based on PDF format | |
CN105354717B (en) | A kind of colour commodity counterfeit prevention code generating method | |
Naharuddin et al. | A high capacity and imperceptible text steganography using binary digit mapping on ASCII characters | |
CN112163230B (en) | Commodity anti-counterfeiting code generation method based on Chinese character encryption | |
CN108418683A (en) | A kind of carrier-free text steganography method based on feature of Chinese characters structure | |
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 | |
Singh | A new approach to enhance avalanche effect in aes to improve computer security | |
KR101584127B1 (en) | System and method for deniable encryption | |
RU2656734C2 (en) | Method of digital information in the form of ultra-compressed nano bar code encoding and decoding (options) | |
Din et al. | The Design Review of Feature-based Method in Embedding the Hidden Message in Text as the Implementation of Steganography | |
Moussa et al. | A Data Hiding Algorithm Based on DNA and Elliptic Curve Cryptosystems. | |
CN104573781A (en) | Encoding and decoding method of two-dimensional code | |
Carlson et al. | Evaluating True Cryptographic Key Space Size | |
CN108875395A (en) | The generation and the method for inspection of commodity counterfeit prevention code | |
Sathiaraj et al. | Secure Transfer of Image-Acquired Text Using a Combination of Cryptography and Steganography | |
Cusack et al. | Using graphic methods to challenge cryptographic performance | |
Azeem et al. | A cryptographic data hiding algorithm with high cover text capacity | |
Azzam et al. | The use of binary digit mapping on ASCII characters to create a high-capacity, undetectable text steganography |
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 |