CN112217627A - Layered encrypted commodity anti-counterfeiting code generation method - Google Patents

Layered encrypted commodity anti-counterfeiting code generation method Download PDF

Info

Publication number
CN112217627A
CN112217627A CN202010973576.1A CN202010973576A CN112217627A CN 112217627 A CN112217627 A CN 112217627A CN 202010973576 A CN202010973576 A CN 202010973576A CN 112217627 A CN112217627 A CN 112217627A
Authority
CN
China
Prior art keywords
sequence
binary
commodity
order
counterfeiting
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
CN202010973576.1A
Other languages
Chinese (zh)
Other versions
CN112217627B (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.)
Nantong University Technology Transfer Center 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 CN202010973576.1A priority Critical patent/CN112217627B/en
Publication of CN112217627A publication Critical patent/CN112217627A/en
Application granted granted Critical
Publication of CN112217627B publication Critical patent/CN112217627B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/001Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using chaotic signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords

Abstract

The invention discloses a commodity anti-counterfeiting code generation method based on layered encryption, which comprises the following steps: carrying out numerical data and 8bits binary conversion and high-low order arrangement layering on a commodity identification code A representing unique identity information of a certain commodity to obtain a high-low order binary layering sequence and a binary matrix PB; chaotic iteration is carried out on the chaotic system to obtain chaotic sequences X1 and X2, the binary matrix PB is sequentially subjected to row-column scrambling and row-row scrambling by utilizing the position change rules before and after the descending order of the sequences X1 and X2 to obtain the binary matrix PB after scrambling
Figure DDA0002684958180000011
Layering according to rows, sequentially extracting 1 element from the binary layered sequence in the forward direction in parallel for grouping, recombining the grouped binary sequences to generate a commodity anti-counterfeiting number, and combining to generate a commodity anti-counterfeiting code. The invention providesThe layered encrypted commodity anti-counterfeiting code generation method is simple and feasible, has strong safety and is not easy to crack, and the generated commodity anti-counterfeiting code has uniqueness and non-forgeability.

Description

Layered encrypted commodity anti-counterfeiting code generation method
Technical Field
The invention relates to the technical field of digital anti-counterfeiting, in particular to a commodity anti-counterfeiting code generation method based on hierarchical encryption.
Background
Counterfeit products are often not fresh, and it is necessary to take action to maintain the rights of the manufacturer and the consumer. Counterfeit products pose a serious threat to various industries, particularly luxuries such as pharmaceuticals, agricultural products, automotive parts, computer software, and expensive perfumes, cosmetics, jewelry, watches, and famous costumes. The geneva international business estimates that worldwide annual sales of counterfeit products amount to $ 6,500 billion. Counterfeit drugs and wine products are particularly problematic, not only are they counterfeits, but the actions made by counterfeiters seriously jeopardize the rights and interests of consumers: the counterfeit of the medicine delays or even aggravates the illness; the things of fake wine harm to people are more frequent, the reputation of merchants and the confidence of consumers are stricken heavily, and the good establishment of economic and social orders is greatly damaged. Therefore, numerous anti-counterfeiting means are created, such as: special packaging, designing complex icons, providing a thumbnail, etc. However, these measures often result in insufficient anti-counterfeiting performance due to lack of technology, and are easy for counterfeiters to drill blanks. With the progress of the times, the anti-counterfeiting technology has great breakthrough. Such as chip technology, biotechnology, etc., but the practical operability for many fields is not great due to the characteristics of high cost, rather limited inquiry terminal, etc. Since the digital anti-counterfeiting technology is brought to the market in the middle of the 90 th century, the digital anti-counterfeiting technology is unprecedented.
The digital anti-counterfeiting combines the characteristics of anti-counterfeiting printing and digital encryption technology, one-time use authority, randomness of generated passwords, invisibility and the like, so that the anti-counterfeiting of commodities is unprecedentedly guaranteed, meanwhile, the authenticity of products can be inquired in multiple ways, and the rampant of counterfeit and shoddy products can be effectively inhibited. Meanwhile, the chaotic signal is used as a natural password and is introduced into the generation process of the commodity anti-counterfeiting code, so that the safety is higher. Under the condition, by utilizing the chaotic cipher technology, a layered encrypted commodity anti-counterfeiting code generation method is provided to generate a commodity anti-counterfeiting code with uniqueness and non-forgeability, so that the method has good practical application and popularization values.
Disclosure of Invention
The purpose of the invention is as follows: the invention aims to solve the defects in the prior art and provides a layered encrypted commodity anti-counterfeiting code generation method, which utilizes chaotic mapping to generate a chaotic signal sequence, sequentially carries out row-column scrambling and row-column scrambling on a binary matrix formed by converting commodity identification codes and combining high-low order arrangement layers, and carries out layering, grouping and recombination operations on elements in the scrambled binary matrix so as to generate a commodity anti-counterfeiting number, and then combines and generates a commodity anti-counterfeiting code, so that the layered encrypted commodity anti-counterfeiting code generation method is simple and feasible, has strong safety and is not easy to crack, and the generated commodity anti-counterfeiting code has uniqueness and non-counterfeiting property.
The technical scheme is as follows: a layered encrypted commodity anti-counterfeiting code generation method is characterized by comprising the following steps:
(1) transcoding
Firstly, a commodity identification code A representing unique identity information of a certain commodity is converted into numerical data [ P ] symbol by symboli1,Pi2]To obtain a high-order numerical sequence P1 ═ { P ═ P11,P21,...,Pi1,....,PL1And a low order value sequence P2 ═ P12,P22,...,Pi2,....,PL2},
Then, the high-order numerical sequence P1 is element by element Pi1Conversion into a binary sequence of 8bits PB1i1,PB1i2,PB1i3,PB1i4,PB1i5,PB1i6,PB1i7,PB1i8And dividing the binary data into 8 layers according to the high-low order arrangement of the binary data to obtain corresponding 8 high-order binary layered sequences, which are expressed as { PB 1}11,PB121,...,PB1i1,...,PB1(L-1)1,PB1L1}、{PB112,PB122,...,PB1i2,...,PB1(L-1)2,PB1L2}、{PB113,PB123,...,PB1i3,...,PB1(L-1)3,PB1L3}、{PB114,PB124,...,PB1i4,...,PB1(L-1)4,PB1L4}、{PB115,PB125,...,PB1i5,...,PB1(L-1)5,PB1L5}、{PB116,PB126,...,PB1i6,...,PB1(L-1)6,PB1L6}、{PB117,PB127,...,PB1i7,...,PB1(L-1)7,PB1L7}、{PB118,PB128,...,PB1i8,...,PB1(L-1)8,PB1L8},
At the same time, the low-order bit value sequence P2 is element by element Pi2Conversion into a binary sequence of 8bits PB2i1,PB2i2,PB2i3,PB2i4,PB2i5,PB2i6,PB2i7,PB2i8And dividing the binary data into 8 layers according to the high-low order arrangement of the binary data to obtain corresponding 8 low order binary layered sequences, which are expressed as { PB 2}11,PB221,...,PB2i1,...,PB2(L-1)1,PB2L1}、{PB212,PB222,...,PB2i2,...,PB2(L-1)2,PB2L2}、{PB213,PB223,...,PB2i3,...,PB2(L-1)3,PB2L3}、{PB214,PB224,...,PB2i4,...,PB2(L-1)4,PB2L4}、{PB215,PB225,...,PB2i5,...,PB2(L-1)5,PB2L5}、{PB216,PB226,...,PB2i6,...,PB2(L-1)6,PB2L6}、{PB217,PB227,...,PB2i7,...,PB2(L-1)7,PB2L7}、{PB218,PB228,...,PB1i8,...,PB2(L-1)8,PB2L8},
Finally, the 6 th to 8 th high order binary hierarchical sequences and the 4 th to 8 th low order binary hierarchical sequences are taken to be combined to form a binary matrix PB, which is expressed as follows,
Figure BDA0002684958160000021
the commodity identification code A comprises Chinese punctuation marks in a GB2312 character set and double-byte coded Chinese characters in the GB2312 character set, the length of the commodity identification code A is represented as L, the lengths of numerical value sequences P1 and P2 are both L, the lengths of 8 high-order binary hierarchical sequences and 8 low-order binary hierarchical sequences are both L, and the size of a binary matrix PB is 8 xL;
(2) scrambling of binary matrix PB
First, a binary sequence { PB1 obtained by converting a high-order numerical sequence P1, a low-order numerical sequence P2 and element-by-element thereofi1,PB1i2,...,PB1i8}、{PB2i1,PB2i2,…,PB2i8And respectively calculating an initial value x of the Logistic chaotic mapping according to the following formulas (1) to (5) to obtain the external keys alpha and beta1A sum parameter mu, an extraction start position m, and an extraction interval number n1、n2
Order to
Figure BDA0002684958160000022
Figure BDA0002684958160000023
Then
x1=0.000001+mod(α-kp1,0.999999), (1)
μ=β+mod(kp1,4-β), (2)
Figure BDA0002684958160000024
Figure BDA0002684958160000031
Figure BDA0002684958160000032
Wherein the content of the first and second substances,<PB1i1,...,PB1i5>=bin2dec([PB1i1,...,PB1i5]),<PB1i6,PB1i7,PB1i8>=bin2dec([PB1i6,PB1i7,PB1i8]),<PB2i1,PB2i2,PB2i3>=bin2dec([PB2i1,PB2i2,PB2i3]),<PB2i4,...,PB2i8>=bin2dec([PB2i4,...,PB2i8]) The external key satisfies α ∈ (0,1), β ∈ (3.57,4),
then, the initial value x mapped by chaos1And an external key mu, iterating the Logistic chaotic mapping shown in the following formula (6), wherein k represents iteration times (k is 1, 2), xk+1Represents the chaotic signal obtained by the k-th iteration,
xk+1=μ×xk×(1-xk) (6)
obtaining a chaotic signal sequence X ═ X1,x2,., spaced by n from the m-th element in the sequence X1Taking 1 element as an element to form a chaotic signal sequence with the length of L X1 ═ X11,X12,...,X1LN at intervals of m from the m-th element in the sequence X2Taking 1 element as an element to form a chaotic signal sequence with the length of 8, namely X2 ═ X21,X22,...,X28},
Finally, the chaotic signal sequence X1 is sorted in a descending order, and the binary matrix PB is scrambled according to the position change scrambling rule before and after the chaotic signal sequence X1 is sorted, so that a binary matrix after column scrambling is obtained
Figure BDA0002684958160000033
Then the chaotic signal sequence X2 is sorted according to the descending order, the binary matrix after the column scrambling is carried out according to the position change scrambling rule before and after the chaotic signal sequence X2 is sorted
Figure BDA0002684958160000034
Scrambling according to rows to obtain a scrambled binary matrix
Figure BDA0002684958160000035
As shown below, the following description is given,
Figure BDA0002684958160000036
(3) binary matrix after scrambling
Figure BDA0002684958160000037
Layering, grouping, reassembling of
First, the binary matrix after scrambling is aligned
Figure BDA0002684958160000038
Layering by rows to obtain corresponding 8 binary layered sequences, represented as
Figure BDA0002684958160000039
Figure BDA0002684958160000041
Then, 1 element is sequentially extracted from the 8 binary hierarchical sequences in parallel in the forward direction for grouping to obtain grouped binary hierarchical sequences, which are represented as BF1{1}, BF1{2},. 9, BF1{ i },. BF1{ L }, and BF2{1}, BF2{2},. 9, BF2{ i },. BF2{ L }, wherein,
Figure BDA0002684958160000042
next, each of the grouped binary hierarchical sequences BF1{ i } and BF2{ i }, where i is 1,2, 3.
Let tmp1{ i } -, dec2bin (bin2dec ([ PB 1) ]i1,PB1i2,PB1i3,PB1i4,PB1i5]) +2, 5), the most significant of the binary hierarchical sequence BF1{ i } after groupingThe preamble is preceded by a binary sequence tmp1{ i }, denoted as
Figure BDA0002684958160000043
Wherein the bin2dec (-) function represents the conversion of the binary sequence into the numerical data, and the dec2bin (-) function represents the conversion of the numerical data into the binary sequence,
meanwhile, tmp2{ i } - { PB 2} is giveni1,PB2i2,PB2i3The forefront of the grouped binary hierarchical sequence BF2{ i } is added with a binary sequence tmp2{ i } which is represented as
Figure BDA0002684958160000044
Thereby obtaining a binary recombination sequence represented by
Figure BDA0002684958160000045
And
Figure BDA0002684958160000046
Figure BDA0002684958160000047
finally, each binary recombination sequence is sequenced using the bin2dec (-) function
Figure BDA0002684958160000048
Conversion into numerical data
Figure BDA0002684958160000049
Simultaneously sequentially recombining each binary recombination sequence
Figure BDA00026849581600000410
Conversion into numerical data
Figure BDA00026849581600000411
Wherein i is 1,2, 3.., L, resulting in a sequence of values
Figure BDA00026849581600000412
And
Figure BDA00026849581600000413
(4) transcoding
Sequence of values
Figure BDA00026849581600000414
And
Figure BDA00026849581600000415
and combining the corresponding elements in sequence, converting numerical values and Chinese characters to obtain a Chinese character sequence C, namely the commodity anti-counterfeiting number, wherein the length of the Chinese character sequence C is L, and combining the commodity identification code A and the commodity anti-counterfeiting number to generate the commodity anti-counterfeiting code.
Further, in the layered encryption commodity anti-counterfeiting code generation method, the commodity identification code A representing the unique identity information of a certain commodity in the step (1) is converted into numerical data [ P ] symbol by symboli1,Pi2]It is to convert symbols in the commodity identification code A into numerical data by adopting unicode2native () function, namely [ P ]i1,Pi2]=unicode2native(Ai) So as to obtain a high-order numerical value sequence P1 ═ { P ═ P11,P21,...,Pi1,....,PL1And a low order value sequence P2 ═ P12,P22,...,Pi2,....,PL2}。
Furthermore, in the layered encryption commodity anti-counterfeiting code generation method, the numerical value sequence in the step (4)
Figure BDA00026849581600000416
And
Figure BDA00026849581600000417
corresponding elements are combined in sequence and the conversion between numerical values and Chinese characters is carried out, which means that numerical value sequences are combined
Figure BDA0002684958160000051
And
Figure BDA0002684958160000052
each corresponding element in (a) is combined, i.e.
Figure BDA0002684958160000053
And the following operations are sequentially carried out, and a Chinese character sequence C ═ 2 is set],
If it is not
Figure BDA0002684958160000054
Adding 1 Chinese space symbol to the Chinese character sequence C, i.e. C ═ C, native2unidoce ([161, 161)])]Wherein the Chinese space symbol can be native2unidoce ([161, 161)]) Show, at the same time order
Figure BDA0002684958160000055
If it is not
Figure BDA0002684958160000056
Adding 1 Chinese symbol' to the Chinese character sequence C, i.e. C ═ C, native2 unidococce ([161,164])]Wherein the Chinese symbol 'cna' can use native2unicode ([161,164)]) Show, at the same time order
Figure BDA0002684958160000057
If it is not
Figure BDA0002684958160000058
Then add 1 Chinese symbol' to the Kanji sequence C, i.e. C ═ C, native2unicode ([163,172 ]])]Wherein the Chinese symbol' available native2 unidocene ([163,172)]) Show, at the same time order
Figure BDA0002684958160000059
If it is not
Figure BDA00026849581600000510
And is
Figure BDA00026849581600000511
Adding 1 Chinese symbol to the Chinese character sequence C', i.e. C ═ C, native2unicode ([161, 162)])]Wherein the Chinese symbols 'and' available native2unidoce ([161, 162)]) Show, at the same time order
Figure BDA00026849581600000512
Then using native2unicode (·) function to convert numerical data
Figure BDA00026849581600000513
Converted into Chinese characters and added to the Chinese character sequence C, i.e.
Figure BDA00026849581600000514
The steps are cycled until the numerical value sequence
Figure BDA00026849581600000515
And
Figure BDA00026849581600000516
the last 1 corresponding element in (i.e. 1)
Figure BDA00026849581600000517
Thereby obtaining the Chinese character sequence C, namely the commodity anti-counterfeiting number.
Further, in the method for generating the layered encrypted anti-counterfeiting code for the commodity, the commodity identification code A and the anti-counterfeiting number are combined to generate the anti-counterfeiting code in the step (4), which means that the commodity identification code A and the anti-counterfeiting number are directly connected in sequence, or directly connected in reverse order, or connected in spaced insertion order.
Has the advantages that: the chaos signal sequence is generated by utilizing chaos mapping, the binary matrix formed by converting the commodity identification code and arranging and combining the high and low order is sequentially subjected to line and row scrambling, elements in the scrambled binary matrix are subjected to layering, grouping and recombination operations, so that the commodity anti-counterfeiting number is generated, and then the commodity anti-counterfeiting code is generated by combination, so that the method for generating the commodity anti-counterfeiting code by the layered encryption is simple and feasible, has strong safety and is not easy to crack, and the generated commodity anti-counterfeiting code has uniqueness and non-counterfeiting property.
Drawings
Fig. 1 is a schematic diagram of a process for generating a layered encrypted merchandise anti-counterfeit code according to the present invention.
Detailed Description
As shown in fig. 1, a method for generating a layered encrypted merchandise anti-counterfeit code includes the following steps:
(1) transcoding
Firstly, a commodity identification code A representing the unique identity information of a certain commodity is converted into numerical data, namely [ P ] by adopting a unicode2native () function one by one symboli1,Pi2]=unicode2native(Ai) To obtain a high-order numerical sequence P1 ═ { P ═ P11,P21,...,Pi1,....,PL1And a low order value sequence P2 ═ P12,P22,...,Pi2,....,PL2},
Then, the high-order numerical sequence P1 is element by element Pi1Conversion into a binary sequence of 8bits PB1i1,PB1i2,PB1i3,PB1i4,PB1i5,PB1i6,PB1i7,PB1i8And dividing the binary data into 8 layers according to the high-low order arrangement of the binary data to obtain corresponding 8 high-order binary layered sequences, which are expressed as { PB 1}11,PB121,...,PB1i1,...,PB1(L-1)1,PB1L1}、{PB112,PB122,...,PB1i2,...,PB1(L-1)2,PB1L2}、{PB113,PB123,...,PB1i3,...,PB1(L-1)3,PB1L3}、{PB114,PB124,...,PB1i4,...,PB1(L-1)4,PB1L4}、{PB115,PB125,...,PB1i5,...,PB1(L-1)5,PB1L5}、{PB116,PB126,...,PB1i6,...,PB1(L-1)6,PB1L6}、{PB117,PB127,...,PB1i7,...,PB1(L-1)7,PB1L7}、{PB118,PB128,...,PB1i8,...,PB1(L-1)8,PB1L8},
At the same time, the low-order bit value sequence P2 is element by element Pi2Conversion into a binary sequence of 8bits PB2i1,PB2i2,PB2i3,PB2i4,PB2i5,PB2i6,PB2i7,PB2i8And dividing the binary data into 8 layers according to the high-low order arrangement of the binary data to obtain corresponding 8 low order binary layered sequences, which are expressed as { PB 2}11,PB221,...,PB2i1,...,PB2(L-1)1,PB2L1}、{PB212,PB222,...,PB2i2,...,PB2(L-1)2,PB2L2}、{PB213,PB223,...,PB2i3,...,PB2(L-1)3,PB2L3}、{PB214,PB224,...,PB2i4,...,PB2(L-1)4,PB2L4}、{PB215,PB225,...,PB2i5,...,PB2(L-1)5,PB2L5}、{PB216,PB226,...,PB2i6,...,PB2(L-1)6,PB2L6}、{PB217,PB227,...,PB2i7,...,PB2(L-1)7,PB2L7}、{PB218,PB228,...,PB1i8,...,PB2(L-1)8,PB2L8},
Finally, the 6 th to 8 th high order binary hierarchical sequences and the 4 th to 8 th low order binary hierarchical sequences are taken to be combined to form a binary matrix PB, which is expressed as follows,
Figure BDA0002684958160000061
the commodity identification code A comprises Chinese punctuation marks in a GB2312 character set and double-byte coded Chinese characters in the GB2312 character set, the length of the commodity identification code A is represented as L, the lengths of numerical value sequences P1 and P2 are both L, the lengths of 8 high-order binary hierarchical sequences and 8 low-order binary hierarchical sequences are both L, and the size of a binary matrix PB is 8 xL;
(2) scrambling of binary matrix PB
First, a binary sequence { PB1 obtained by converting a high-order numerical sequence P1, a low-order numerical sequence P2 and element-by-element thereofi1,PB1i2,...,PB1i8}、{PB2i1,PB2i2,…,PB2i8And respectively calculating an initial value x of the Logistic chaotic mapping according to the following formula1A sum parameter mu, an extraction start position m, and an extraction interval number n1、n2
Order to
Figure BDA0002684958160000071
Figure BDA0002684958160000072
Then
x1=0.000001+mod(α-kp1,0.999999),
μ=β+mod(kp1,4-β),
Figure BDA0002684958160000073
Figure BDA0002684958160000074
Figure BDA0002684958160000075
Wherein the content of the first and second substances,<PB1i1,...,PB1i5>=bin2dec([PB1i1,...,PB1i5]),<PB1i6,PB1i7,PB1i8>=bin2dec([PB1i6,PB1i7,PB1i8]),<PB2i1,PB2i2,PB2i3>=bin2dec([PB2i1,PB2i2,PB2i3]),<PB2i4,...,PB2i8>=bin2dec([PB2i4,...,PB2i8]) The external key satisfies α ∈ (0,1), β ∈ (3.57,4),
then, the initial value x mapped by chaos1And an external key mu, and iterating the Logistic chaotic mapping shown in the following formula, wherein k represents iteration times (k is 1,2, and.) and xk+1Represents the chaotic signal obtained by the k-th iteration,
xk+1=μ×xk×(1-xk)
obtaining a chaotic signal sequence X ═ X1,x2,., spaced by n from the m-th element in the sequence X1Taking 1 element as an element to form a chaotic signal sequence with the length of L X1 ═ X11,X12,...,X1LN at intervals of m from the m-th element in the sequence X2Taking 1 element as an element to form a chaotic signal sequence with the length of 8, namely X2 ═ X21,X22,...,X28},
Finally, the chaotic signal sequence X1 is sorted in a descending order, and the binary matrix PB is scrambled according to the position change scrambling rule before and after the chaotic signal sequence X1 is sorted, so that a binary matrix after column scrambling is obtained
Figure BDA0002684958160000076
Then the chaotic signal sequence X2 is sorted according to the descending order, the binary matrix after the column scrambling is carried out according to the position change scrambling rule before and after the chaotic signal sequence X2 is sorted
Figure BDA0002684958160000081
Scrambling according to rows to obtain a scrambled binary matrix
Figure BDA0002684958160000082
As shown below, the following description is given,
Figure BDA0002684958160000083
(3) binary matrix after scrambling
Figure BDA0002684958160000084
Layering, grouping, reassembling of
First, the binary matrix after scrambling is aligned
Figure BDA0002684958160000085
Layering by rows to obtain corresponding 8 binary layered sequences, represented as
Figure BDA0002684958160000086
Then, 1 element is sequentially extracted from the 8 binary hierarchical sequences in parallel in the forward direction for grouping to obtain grouped binary hierarchical sequences, which are represented as BF1{1}, BF1{2},..,. BF1{ i },. BF1{ L }, and BF2{1}, BF2{2},..,. BF2{ i },. BF2{ L }, wherein the grouped binary hierarchical sequences are expressed as BF1{1}, BF1{2},..,
Figure BDA0002684958160000087
next, each of the grouped binary hierarchical sequences BF1{ i } and BF2{ i }, where i is 1,2, 3.
Let tmp1{ i } -, dec2bin (bin2dec ([ PB 1) ]i1,PB1i2,PB1i3,PB1i4,PB1i5]) +2, 5), the forefront of the grouped binary hierarchical sequence BF1{ i } is added with the binary sequence tmp1{ i }, denoted as
Figure BDA0002684958160000088
Wherein the bin2dec (-) function represents the conversion of the binary sequence into the numerical data, and the dec2bin (-) function represents the conversion of the numerical data into the binary sequence,
meanwhile, tmp2{ i } - { PB 2} is giveni1,PB2i2,PB2i3The forefront of the grouped binary hierarchical sequence BF2{ i } is added with a binary sequence tmp2{ i } which is represented as
Figure BDA0002684958160000089
Thereby obtaining a binary recombination sequence represented by
Figure BDA00026849581600000810
And
Figure BDA00026849581600000811
Figure BDA0002684958160000091
finally, each binary recombination sequence is sequenced using the bin2dec (-) function
Figure BDA0002684958160000092
Conversion into numerical data
Figure BDA0002684958160000093
Simultaneously sequentially recombining each binary recombination sequence
Figure BDA0002684958160000094
Conversion into numerical data
Figure BDA0002684958160000095
Wherein i is 1,2, 3.., L, resulting in a sequence of values
Figure BDA0002684958160000096
And
Figure BDA0002684958160000097
(4) transcoding
Sequence of values
Figure BDA0002684958160000098
And
Figure BDA0002684958160000099
corresponding elements are combined in sequence and the conversion between numerical values and Chinese characters is carried out, namely numerical value sequence
Figure BDA00026849581600000910
And
Figure BDA00026849581600000911
each corresponding element in (1) is combined to representIs composed of
Figure BDA00026849581600000912
Figure BDA00026849581600000913
And the following operations are sequentially carried out, and a Chinese character sequence C ═ 2 is set],
If it is not
Figure BDA00026849581600000914
Adding 1 Chinese space symbol to the Chinese character sequence C, i.e. C ═ C, native2unidoce ([161, 161)])]Wherein the Chinese space symbol can be native2unidoce ([161, 161)]) Show, at the same time order
Figure BDA00026849581600000915
If it is not
Figure BDA00026849581600000916
Adding 1 Chinese symbol' to the Chinese character sequence C, i.e. C ═ C, native2 unidococce ([161,164])]Wherein the Chinese symbol 'cna' can use native2unicode ([161,164)]) Show, at the same time order
Figure BDA00026849581600000917
If it is not
Figure BDA00026849581600000918
Then add 1 Chinese symbol' to the Kanji sequence C, i.e. C ═ C, native2unicode ([163,172 ]])]Wherein the Chinese symbol' available native2 unidocene ([163,172)]) Show, at the same time order
Figure BDA00026849581600000919
If it is not
Figure BDA00026849581600000920
And is
Figure BDA00026849581600000921
Then add 1 Chinese symbol 'and', i.e. C ═ C, native2unicode ([161, 162)])]Wherein the Chinese symbols 'and' available native2unidoce ([161, 162)]) Show, at the same time order
Figure BDA00026849581600000922
Then using native2unicode (·) function to convert numerical data
Figure BDA00026849581600000923
Converted into Chinese characters and added to the Chinese character sequence C, i.e.
Figure BDA00026849581600000924
The steps are cycled until the numerical value sequence
Figure BDA00026849581600000925
And
Figure BDA00026849581600000926
the last 1 corresponding element in (i.e. 1)
Figure BDA00026849581600000927
And then combining the commodity identification code A and the commodity anti-counterfeiting number in a combination mode of direct sequential connection, direct reverse sequential connection or interval insertion sequential connection, thereby generating the commodity anti-counterfeiting code.
The invention is further illustrated by the following specific examples:
example 1
The method for generating the commodity anti-counterfeiting code by hierarchical encryption comprises the following steps:
(1) firstly, a product identification code A which represents the unique identity information of a certain product is converted into numerical data one by one according to a product production date 2020-02-01 production line 12 serial number 123456 to obtain a high-order value sequence P1 ═ 189,203,202,163,163,188,205,161,161,215,185,203,161,163,163,201,198,161,201,178,200,198,163,163,163,163,163,163,163,163,163,163,161,201,178,207,163,163,208,193,186,163,163,163,163,163,163 and a low-order value sequence P2 ═ 173,213,161,163,163,175,197,193,193,211,171,190,161,192,192,204,183,161,250,250,213,218,178,176,178,176,173,176,178,173,176,177,161,250,250,223,177,178,242,208,197,177,178,179,180,181,182.
Then, the high-order bit value sequence P1 is converted into binary sequences of 8bits one by one, and is divided into 8 layers according to the high-order and low-order bit arrangement of binary data, so as to obtain 8 high-order binary hierarchical sequences, which are {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1}, {0,1,1,0,0,0,1,0, 1,0,1,0,0,0,0,0,0,0,0,0,0,0, 1,0,0,1,1,1,0,1,1, 1,1,1,1,1,1,1,1,1,0,1,0,1,1, 1,1,0,0,1,1,1,1,1,1,1}, {1,0,0,0,0, 0,0,1,1,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,1,0,0,0,0,0,0,0,0, 1,0,0,0,0,0,0,0,0,0,0,0,0,1,0, 0,0,0,0,0}, {1,0,0,0,0, 0,1,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0, 0}, {0,1,1,1,1,0,0,0,0, 0,1,0,1,1,1,1,1,1,1,1,1,1,1,0, 1,0,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,1},
meanwhile, the low-order bit value sequence P2 is converted into a binary sequence of 8bits element by element, and is divided into 8 layers according to the high-order and low-order bit arrangement of binary data, so as to obtain 8 low-order binary hierarchical sequences, which are {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1}, {0,1,0,0,0,0,0,0, 1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1, 0,0,0,0,0,0,0,0,1,0,1, 1,1,0,0,0,1,1,1,1,1,1,1,1,1, 0,1,1,1,1,1,1,1, 1}, {0,1,0,0,0,0,0,0,0,1, 1,0,0,1,0,1,1,1,1,1,1, 0,1,1,0,1,0,1,1,1, 1,1,1,1,0,0,0,0,1,0, 0,1,0,0,0,0,0,1, 1,1,0,0,0,0,0,0,0,0,0, 0}, {1,1,0,0,0,1, 0,0,0,0,0,1,0,0,1,0,0, 1,1,0,0,0,1,0,0,0,0,0, 0,0,0,0,0,0,1,0,0, 1,1,1}, {0,0,1,1, 0,0,0,0,1,0,1,1,0, 0,0,1,0,1,0,0,1, 0,1,1,1,1,0,0,0,1,1,1, 1,0,1,1,0,1,0,1,0,0,0,0,0,1,0,0,1,0,1,1,0,0,1,1,0,0,0,1,1,0,1,0,1,0},
finally, the 6 th to 8 th high order binary hierarchical sequences and the 4 th to 8 th low order binary hierarchical sequences are taken to be combined to form a binary matrix PB, which is expressed as follows,
Figure BDA0002684958160000101
the length of the Chinese character commodity identification code A is L-47, the length of each of the numerical value sequences P1 and P2 is L-47, the length of each of the 8 high-order binary hierarchical sequences and the 8 low-order binary hierarchical sequences is L-47, and the size of the binary matrix PB is 8 multiplied by L-8 multiplied by 47;
(2) scrambling of binary matrix PB
First, a binary sequence { PB1 obtained by converting a high-order numerical sequence P1, a low-order numerical sequence P2 and element-by-element thereofi1,PB1i2,...,PB1i8}、{PB2i1,PB2i2,…,PB2i80.12345 and 3.75 external keys alpha and beta, respectively calculating to obtain initial values x of the Logistic chaotic map according to the following formulas1A sum parameter mu, an extraction start position m, and an extraction interval number n1、n2
Order to
Figure BDA0002684958160000111
Then
x1=0.000001+mod(0.12345-0.007699460349288,0.999999)=0.115751539650712,
μ=3.75+mod(0.007699460349288,4-3.75)=3.757699460349288,
Figure BDA0002684958160000112
Figure BDA0002684958160000113
Figure BDA0002684958160000114
Then, the initial value x mapped by chaos10.115751539650712 and 3.757699460349288 of an external key mu, iterating the Logistic chaotic mapping to obtain a chaotic signal sequence X { X ═ X }1,x2,., taking 1 element from the 557th element in the sequence X at intervals of 28 elements in turn to form a chaotic signal sequence X1 with the length of 47 ═ X11,X12,...,X147And simultaneously, 1 element is taken out at 31 elements in sequence from the 557 th element in the sequence X to form a chaotic signal sequence X2 with the length of 8 ═ X21,X22,...,X28},
Finally, the chaotic signal sequence X1 is sorted in a descending order, and the binary matrix PB is scrambled according to the position change scrambling rule before and after the chaotic signal sequence X1 is sorted, so that a binary matrix after column scrambling is obtained
Figure BDA0002684958160000115
Then the chaotic signal sequence X2 is sorted according to the descending order, the binary matrix after the column scrambling is carried out according to the position change scrambling rule before and after the chaotic signal sequence X2 is sorted
Figure BDA0002684958160000116
Scrambling according to rows to obtain a scrambled binary matrix
Figure BDA0002684958160000117
As shown below, the following description is given,
Figure BDA0002684958160000118
(3) binary moments after scrambling
Figure BDA0002684958160000119
Layering, grouping, reassembling of
First, the binary matrix after scrambling is aligned
Figure BDA00026849581600001110
Layering by rows to obtain corresponding 8 binary layered sequences, represented as
Figure BDA00026849581600001111
Figure BDA0002684958160000121
Then, 1 element is sequentially extracted in parallel from the 8 binary hierarchical sequences in the forward direction, and the binary hierarchical sequences are grouped, and expressed as BF1{1} {1,1,0}, BF1{2} {0, 0}, …, BF1{23} {0,1,0}, …, BF1{46} {1,0,0}, BF1{47} {1,0,1}, BF2{1} {1,0,1,0,0}, BF2{2}, 0,0,1,1,1}, …, BF2{23} {0,0,1,0,0}, …, BF2{46} {0,0,1,0,0}, BF 56 {47}, 1,0,0,0,1,1, 0}, and BF2{47}, 1,0,0,0,1, 1}, 0}, and 1}, which are grouped in parallel to obtain a grouped binary hierarchical sequence.
Next, each of the grouped binary hierarchical sequences BF1{ i } and BF2{ i }, where i is 1,2, 3.
Let tmp1{ i } -, dec2bin (bin2dec ([ PB 1) ]i1,PB1i2,PB1i3,PB1i4,PB1i5]) +2, 5), the forefront of the grouped binary hierarchical sequence BF1{ i } is added with the binary sequence tmp1{ i }, denoted as
Figure BDA0002684958160000122
Meanwhile, tmp2{ i } - { PB 2} is giveni1,PB2i2,PB2i3The forefront of the grouped binary hierarchical sequence BF2{ i } is added with a binary sequence tmp2{ i } which is represented as
Figure BDA0002684958160000123
Thereby obtaining a binary recombination sequence represented by
Figure BDA0002684958160000124
Figure BDA0002684958160000125
And
Figure BDA0002684958160000126
Figure BDA0002684958160000127
finally, each binary recombination sequence is sequenced using the bin2dec (-) function
Figure BDA0002684958160000128
Conversion into numerical data
Figure BDA0002684958160000129
Simultaneously sequentially recombining each binary recombination sequence
Figure BDA0002684958160000131
Conversion into numerical data
Figure BDA0002684958160000132
Thereby obtaining a numerical sequence
Figure BDA0002684958160000133
Figure BDA0002684958160000134
Figure BDA0002684958160000135
And
Figure BDA0002684958160000136
(4)sequence of values
Figure BDA0002684958160000137
And
Figure BDA0002684958160000138
the corresponding elements are combined in sequence and the numerical values and the Chinese characters are converted to obtain a commodity anti-counterfeiting code, namely' green top primary green bottom green boy material to milling meditation bordoides success and oblique morbid graulis baumi disease stir-frying the green top green house young boy flower bud hillock paint and the specific green top green house young boy flower bud revolve and the specific green house young Dong flower bud horse paint and the specific green house young boy flower bud tomato pig bud hillock paint, the commodity identification code A and the commodity anti-counterfeiting code are combined in a combination mode of direct sequence connection, direct reverse sequence connection or interval insertion sequence connection, the generated commodity anti-counterfeiting codes are respectively as follows,
direct sequential connection: "Jiangsu # # group x sub company @ commercial production date 2020-02-01 production line 12 serial No. 123456 not terminal nor,
direct reverse order connection: "when the vegetal Dong Yang Geng horse ding Zhongyou paint hillock sparging Tung house tasted the vegetal Dong Tung and the diseased money and the grazing Du slope of the vegetal Tung Di Huang milling to the Tung Di Yun not Yao 654321 line produces the 10-20-0202-day product, the vegetal Shang Yang X collection # # Sujiang province),
interval insertion connection: "Yun Chi Yun Cheng Yun Zhi # primary collection not Do Jia XmaZi to milling Dai Yao @ Tibi @ Di @ success maker product oblique Du gracilaria production wedge period confronted 2 pineapple 0 money 2 disease 0 stir-frying-Dong 0 tip 2 taste-0 house 1 Dong Fang and hillock paint production line Zhi 1 bank and 2 Ling 2 Tung 4 Tung 6 as 2 Ding sequence horse list revolve 1 Dong 4 Tung 6.
Example 2
According to the method for generating the layered encrypted commodity anti-counterfeiting code, the commodity identification code character string A of a certain commodity and the commodity anti-counterfeiting code generation steps are similar to those of the specific embodiment 1, and only a certain external secret key slightly changes: 0.12345000000001; or β 3.74999999999999, the generation of the commercial anti-counterfeiting code is shown in table 1. As can be seen from the following table: even if the external key slightly changes, the generated commodity anti-counterfeiting number and the commodity anti-counterfeiting code greatly change, so that the method for generating the commodity anti-counterfeiting code by hierarchical encryption has key sensitivity.
TABLE 1 Generation result of merchandise anti-counterfeit code when external secret key is slightly changed
Figure BDA0002684958160000139
Figure BDA0002684958160000141
Example 3
According to the above-mentioned commodity anti-counterfeit code generation method of layered encryption, the steps of generating the external secret key and the commodity anti-counterfeit code thereof are similar to those of the specific embodiment 1, only the commodity identification code character string A of a certain commodity has slight change 'Gang Suzhou # # group x a subsidiary company @ commodity production date 2020-02-01 production line 12 serial number 123456'; or "Jiangsu province # # group x son company @ brand product production date 2020-12-01 production line 12 serial No. 123456"; or "Jiangsu province # # group x son company @ commercial production date 2020-02-01 production line 12 serial number 123459", the production results of the commercial anti-counterfeiting code are shown in Table 2. As can be seen from the following table: once the commodity identification code character string representing the unique identification information of a certain commodity slightly changes, the generated commodity anti-counterfeiting number and the commodity anti-counterfeiting code can greatly change, so that the layered encrypted commodity anti-counterfeiting code generation method provided by the patent has sensitivity to the commodity identification information (namely the commodity identification code character string).
TABLE 2 Generation result of commodity anti-counterfeit code when commodity identification code is slightly changed
Figure BDA0002684958160000151
Figure BDA0002684958160000161
It can be seen from the above specific embodiments 2 and 3 that the anti-counterfeit code generated by the method for generating a layered encrypted anti-counterfeit code for a commodity provided by the present patent is not only closely related to an external secret key, but also depends on a commodity identification code character string representing unique identity information of a certain commodity, so that the method for generating a layered encrypted anti-counterfeit code for a commodity provided by the present patent has strong security, can better resist known/selected plaintext attacks, is not easy to crack, and ensures that the generated anti-counterfeit code for a commodity has "uniqueness" and "non-forgeability".
Although the present invention has been described with reference to a preferred embodiment, it should be understood that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (4)

1. A layered encrypted commodity anti-counterfeiting code generation method is characterized by comprising the following steps:
(1) transcoding:
firstly, a commodity identification code A representing unique identity information of a certain commodity is converted into numerical data [ P ] symbol by symboli1,Pi2]To obtain a high-order numerical sequence P1 ═ { P ═ P11,P21,...,Pi1,....,PL1And a low order value sequence P2 ═ P12,P22,...,Pi2,....,PL2},
Then, the high-order numerical sequence P1 is element by element Pi1Conversion into a binary sequence of 8bits PB1i1,PB1i2,PB1i3,PB1i4,PB1i5,PB1i6,PB1i7,PB1i8And dividing the binary data into 8 layers according to the high-low order arrangement of the binary data to obtain corresponding 8 high-order binary layered sequences, which are expressed as { PB 1}11,PB121,...,PB1i1,...,PB1(L-1)1,PB1L1}、{PB112,PB122,...,PB1i2,...,PB1(L-1)2,PB1L2}、{PB113,PB123,...,PB1i3,...,PB1(L-1)3,PB1L3}、{PB114,PB124,...,PB1i4,...,PB1(L-1)4,PB1L4}、{PB115,PB125,...,PB1i5,...,PB1(L-1)5,PB1L5}、{PB116,PB126,...,PB1i6,...,PB1(L-1)6,PB1L6}、{PB117,PB127,...,PB1i7,...,PB1(L-1)7,PB1L7}、{PB118,PB128,...,PB1i8,...,PB1(L-1)8,PB1L8},
At the same time, the low-order bit value sequence P2 is element by element Pi2Conversion into a binary sequence of 8bits PB2i1,PB2i2,PB2i3,PB2i4,PB2i5,PB2i6,PB2i7,PB2i8And dividing the binary data into 8 layers according to the high-low order arrangement of the binary data to obtain corresponding 8 low order binary layered sequences, which are expressed as { PB 2}11,PB221,...,PB2i1,...,PB2(L-1)1,PB2L1}、{PB212,PB222,...,PB2i2,...,PB2(L-1)2,PB2L2}、{PB213,PB223,...,PB2i3,...,PB2(L-1)3,PB2L3}、{PB214,PB224,...,PB2i4,...,PB2(L-1)4,PB2L4}、{PB215,PB225,...,PB2i5,...,PB2(L-1)5,PB2L5}、{PB216,PB226,...,PB2i6,...,PB2(L-1)6,PB2L6}、{PB217,PB227,...,PB2i7,...,PB2(L-1)7,PB2L7}、{PB218,PB228,...,PB1i8,...,PB2(L-1)8,PB2L8},
Finally, the 6 th to 8 th high order binary hierarchical sequences and the 4 th to 8 th low order binary hierarchical sequences are taken to be combined to form a binary matrix PB, which is expressed as follows,
Figure FDA0002684958150000011
the commodity identification code A comprises Chinese punctuation marks in a GB2312 character set and double-byte coded Chinese characters in the GB2312 character set, the length of the commodity identification code A is represented as L, the lengths of numerical value sequences P1 and P2 are both L, the lengths of 8 high-order binary hierarchical sequences and 8 low-order binary hierarchical sequences are both L, and the size of a binary matrix PB is 8 xL;
(2) scrambling of the binary matrix PB:
first, a binary sequence { PB1 obtained by converting a high-order numerical sequence P1, a low-order numerical sequence P2 and element-by-element thereofi1,PB1i2,...,PB1i8}、{PB2i1,PB2i2,…,PB2i8And respectively calculating an initial value x of the Logistic chaotic mapping according to the following formulas (1) to (5) to obtain the external keys alpha and beta1A sum parameter mu, an extraction start position m, and an extraction interval number n1、n2
Order to
Figure FDA0002684958150000021
Figure FDA0002684958150000022
Then
x1=0.000001+mod(α-kp1,0.999999), (1)
μ=β+mod(kp1,4-β), (2)
Figure FDA0002684958150000023
Figure FDA0002684958150000024
Figure FDA0002684958150000025
Wherein the content of the first and second substances,<PB1i1,...,PB1i5>=bin2dec([PB1i1,...,PB1i5]),<PB1i6,PB1i7,PB1i8>=bin2dec([PB1i6,PB1i7,PB1i8]),<PB2i1,PB2i2,PB2i3>=bin2dec([PB2i1,PB2i2,PB2i3]),<PB2i4,...,PB2i8>=bin2dec([PB2i4,...,PB2i8]) The external key satisfies α ∈ (0,1), β ∈ (3.57,4),
then, the initial value x mapped by chaos1And an external key mu, iterating the Logistic chaotic mapping shown in the following formula (6), wherein k represents iteration times (k is 1, 2), xk+1Represents the chaotic signal obtained by the k-th iteration,
xk+1=μ×xk×(1-xk) (6)
obtaining a chaotic signal sequence X ═ X1,x2,., spaced by n from the m-th element in the sequence X1Taking 1 element as an element to form a chaotic signal sequence with the length of L X1 ═ X11,X12,...,X1LN at intervals of m from the m-th element in the sequence X2Taking 1 element as an element to form a chaotic signal sequence with the length of 8, namely X2 ═ X21,X22,...,X28},
Finally, the chaotic signal sequence X1 is sorted in a descending order, and the binary matrix PB is sorted according to the position change scrambling rule before and after the chaotic signal sequence X1 is sorted in columnsScrambling to obtain the binary matrix after column scrambling
Figure FDA0002684958150000026
Then the chaotic signal sequence X2 is sorted in descending order, the binary matrix PB after the column scrambling is scrambled according to the position change scrambling rule before and after the chaotic signal sequence X2 is sorted, and the scrambled binary matrix PB is obtained
Figure FDA0002684958150000027
As shown below, the following description is given,
Figure FDA0002684958150000031
(3) binary matrix after scrambling
Figure FDA0002684958150000032
Layering, grouping and recombining:
first, the binary matrix after scrambling is aligned
Figure FDA0002684958150000033
Layering by rows to obtain corresponding 8 binary layered sequences, represented as
Figure FDA0002684958150000034
Figure FDA0002684958150000035
Figure FDA0002684958150000036
Then, 1 element is sequentially extracted from the 8 binary hierarchical sequences in parallel in the forward direction for grouping to obtain grouped binary hierarchical sequences, which are represented as BF1{1}, BF1{2},. 9, BF1{ i },. BF1{ L }, and BF2{1}, BF2{2},. 9, BF2{ i },. BF2{ L }, wherein,
Figure FDA0002684958150000037
next, each of the grouped binary hierarchical sequences BF1{ i } and BF2{ i }, where i is 1,2, 3.
Let tmp1{ i } -, dec2bin (bin2dec ([ PB 1) ]i1,PB1i2,PB1i3,PB1i4,PB1i5]) +2, 5), the forefront of the grouped binary hierarchical sequence BF1{ i } is added with the binary sequence tmp1{ i }, denoted as
Figure FDA0002684958150000038
Wherein the bin2dec (-) function represents the conversion of the binary sequence into the numerical data, and the dec2bin (-) function represents the conversion of the numerical data into the binary sequence,
meanwhile, tmp2{ i } - { PB 2} is giveni1,PB2i2,PB2i3The forefront of the grouped binary hierarchical sequence BF2{ i } is added with a binary sequence tmp2{ i } which is represented as
Figure FDA0002684958150000039
Thereby obtaining a binary recombination sequence represented by
Figure FDA00026849581500000310
And
Figure FDA00026849581500000311
Figure FDA00026849581500000312
finally, each binary recombination sequence is sequenced using the bin2dec (-) function
Figure FDA00026849581500000313
Conversion into numerical data
Figure FDA00026849581500000314
Simultaneously sequentially recombining each binary recombination sequence
Figure FDA00026849581500000315
Conversion into numerical data
Figure FDA00026849581500000316
Wherein i is 1,2, 3.., L, resulting in a sequence of values
Figure FDA00026849581500000317
And
Figure FDA00026849581500000318
(4) transcoding:
sequence of values
Figure FDA0002684958150000041
And
Figure FDA0002684958150000042
and combining the corresponding elements in sequence, converting numerical values and Chinese characters to obtain a Chinese character sequence C, namely the commodity anti-counterfeiting number, wherein the length of the Chinese character sequence C is L, and combining the commodity identification code A and the commodity anti-counterfeiting number to generate the commodity anti-counterfeiting code.
2. The method for generating the layered encryption commodity anti-counterfeiting code according to claim 1, wherein: converting the commodity identification code A representing the unique identity information of a certain commodity into numerical data [ P ] one by one in the step (1)i1,Pi2]It is to convert symbols in the commodity identification code A into numerical data by adopting unicode2native () function, namely [ P ]i1,Pi2]=unicode2native(Ai) So as to obtain a high-order numerical value sequence P1 ═ { P ═ P11,P21,...,Pi1,....,PL1And a low order value sequence P2 ═ P12,P22,...,Pi2,....,PL2}。
3. The method for generating the layered encryption commodity anti-counterfeiting code according to claim 1, wherein: the numerical sequence in step (4)
Figure FDA0002684958150000043
And
Figure FDA0002684958150000044
corresponding elements are combined in sequence and the conversion between numerical values and Chinese characters is carried out, which means that numerical value sequences are combined
Figure FDA0002684958150000045
And
Figure FDA0002684958150000046
each corresponding element in (a) is combined, i.e.
Figure FDA0002684958150000047
Figure FDA0002684958150000048
And the following operations are sequentially carried out, and a Chinese character sequence C ═ 2 is set],
If it is not
Figure FDA0002684958150000049
Adding 1 Chinese space symbol to the Chinese character sequence C, i.e. C ═ C, native2unidoce ([161, 161)])]Wherein the Chinese space symbol can be native2unidoce ([161, 161)]) Show, at the same time order
Figure FDA00026849581500000410
If it is not
Figure FDA00026849581500000411
Adding 1 Chinese symbol' to the Chinese character sequence C, i.e. C ═ C, native2 unidococce ([161,164])]Wherein Chinese symbol'Useful native2 unidocene ([161,164)]) Show, at the same time order
Figure FDA00026849581500000412
If it is not
Figure FDA00026849581500000413
Then add 1 Chinese symbol' to the Kanji sequence C, i.e. C ═ C, native2unicode ([163,172 ]])]Wherein the Chinese symbol' available native2 unidocene ([163,172)]) Show, at the same time order
Figure FDA00026849581500000414
If it is not
Figure FDA00026849581500000415
And is
Figure FDA00026849581500000416
Then add 1 Chinese symbol 'and', i.e. C ═ C, native2unicode ([161, 162)])]Wherein the Chinese symbols 'and' available native2unidoce ([161, 162)]) Show, at the same time order
Figure FDA00026849581500000417
Then using native2unicode (·) function to convert numerical data
Figure FDA00026849581500000418
Converted into Chinese characters and added to the Chinese character sequence C, i.e.
Figure FDA00026849581500000419
The steps are cycled until the numerical value sequence
Figure FDA00026849581500000420
And
Figure FDA00026849581500000421
the last 1 corresponding element in (i.e. 1)
Figure FDA00026849581500000422
Thereby obtaining the Chinese character sequence C, namely the commodity anti-counterfeiting number.
4. The method for generating the layered encryption commodity anti-counterfeiting code according to claim 1, wherein: the step (4) of combining the commodity identification code A and the commodity anti-counterfeiting number to generate the commodity anti-counterfeiting code means a combination mode of directly connecting the commodity identification code A and the commodity anti-counterfeiting number in sequence, or directly connecting the commodity identification code A and the commodity anti-counterfeiting number in reverse sequence, or connecting the commodity identification code A and the commodity anti-counterfeiting number in insertion sequence at intervals.
CN202010973576.1A 2020-09-16 2020-09-16 Layered encrypted commodity anti-counterfeiting code generation method Active CN112217627B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010973576.1A CN112217627B (en) 2020-09-16 2020-09-16 Layered encrypted commodity anti-counterfeiting code generation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010973576.1A CN112217627B (en) 2020-09-16 2020-09-16 Layered encrypted commodity anti-counterfeiting code generation method

Publications (2)

Publication Number Publication Date
CN112217627A true CN112217627A (en) 2021-01-12
CN112217627B CN112217627B (en) 2021-10-12

Family

ID=74048966

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010973576.1A Active CN112217627B (en) 2020-09-16 2020-09-16 Layered encrypted commodity anti-counterfeiting code generation method

Country Status (1)

Country Link
CN (1) CN112217627B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113255860A (en) * 2021-03-26 2021-08-13 南通大学 Commodity anti-counterfeiting two-dimensional code generation method based on layered encryption
CN113947096A (en) * 2021-10-12 2022-01-18 南通大学 Commodity anti-counterfeiting code identification method based on picture-to-character string decryption

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140341374A1 (en) * 2011-12-01 2014-11-20 Integrita Computing Systems India Private Limited Method of generating secure tokens and transmission based on (trng) generated tokens and split into shares and the system thereof
CN104657871A (en) * 2015-03-24 2015-05-27 南通大学 Generation method of commodity anti-counterfeiting code
CN109040041A (en) * 2018-07-23 2018-12-18 深圳职业技术学院 Data hierarchy encryption device and related electronic device, storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140341374A1 (en) * 2011-12-01 2014-11-20 Integrita Computing Systems India Private Limited Method of generating secure tokens and transmission based on (trng) generated tokens and split into shares and the system thereof
CN104657871A (en) * 2015-03-24 2015-05-27 南通大学 Generation method of commodity anti-counterfeiting code
CN109040041A (en) * 2018-07-23 2018-12-18 深圳职业技术学院 Data hierarchy encryption device and related electronic device, storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
贾王晶,郭丽峰,马添军: "改进的基于身份的分层加密方案", 《山西大学学报自然科学版》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113255860A (en) * 2021-03-26 2021-08-13 南通大学 Commodity anti-counterfeiting two-dimensional code generation method based on layered encryption
CN113255860B (en) * 2021-03-26 2022-08-02 南通大学 Commodity anti-counterfeiting two-dimensional code generation method based on layered encryption
CN113947096A (en) * 2021-10-12 2022-01-18 南通大学 Commodity anti-counterfeiting code identification method based on picture-to-character string decryption

Also Published As

Publication number Publication date
CN112217627B (en) 2021-10-12

Similar Documents

Publication Publication Date Title
CN109472338B (en) Batch generation method of commodity anti-counterfeiting two-dimensional codes
CN112163230B (en) Commodity anti-counterfeiting code generation method based on Chinese character encryption
CN112149773B (en) Commodity anti-counterfeiting code generation method based on Chinese character encryption
CN102800243B (en) Anti-counterfeiting annular code and encoding method thereof
CN109284803B (en) Commodity anti-counterfeiting two-dimensional code generation method
CN112884104B (en) Commodity anti-counterfeiting two-dimensional code generation method based on chaotic encryption
CN112217627B (en) Layered encrypted commodity anti-counterfeiting code generation method
CN104486073B (en) A kind of encryption and decryption method of character type data
CN101847225B (en) A kind of method based on CN39 code managing commodity circulation
CN112149774B (en) Chinese character commodity anti-counterfeiting code generation method
CN112001467B (en) Commodity anti-counterfeiting code generation and identification method based on picture encryption and decryption
CN103886469A (en) Product two-dimension code generation and query system
CN105354717B (en) A kind of colour commodity counterfeit prevention code generating method
CN111382820B (en) Four-lattice pure-color commodity anti-counterfeiting code generation method
CN104657871A (en) Generation method of commodity anti-counterfeiting code
CN111382452A (en) Encryption method for converting Chinese characters into pictures
CN101286203A (en) Chip-free quasi RFID multiple verification low cost encrypted EPC composite label and system
CN113052286A (en) Commodity anti-counterfeiting two-dimensional code generation method based on scrambling encryption
CN113255860B (en) Commodity anti-counterfeiting two-dimensional code generation method based on layered encryption
CN113159252A (en) Commodity anti-counterfeiting two-dimensional code generation method based on different scrambling rules
CN103824197A (en) Anti-counterfeit code generating device
CN113935345B (en) Commodity anti-counterfeiting code batch generation method based on character string-to-picture encryption
CN104899521A (en) Methods for bleaching and reverse bleaching of 18-bits identity card number
CN113935343B (en) Commodity anti-counterfeiting code generation method based on character string-to-picture encryption
CN113947096A (en) Commodity anti-counterfeiting code identification method based on picture-to-character string decryption

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20210112

Assignee: Yizhong (Nantong) Network Technology Co.,Ltd.

Assignor: NANTONG University

Contract record no.: X2023320000049

Denomination of invention: A Method of Generating Product Anti-counterfeit Code with Hierarchical Encryption

Granted publication date: 20211012

License type: Common License

Record date: 20230112

EE01 Entry into force of recordation of patent licensing contract
TR01 Transfer of patent right

Effective date of registration: 20230818

Address after: 226000 Jiangsu city of Nantong province sik Road No. 9

Patentee after: Nantong University Technology Transfer Center Co.,Ltd.

Address before: 226019 Jiangsu city of Nantong province sik Road No. 9

Patentee before: NANTONG University

TR01 Transfer of patent right