CN113935346A - Commodity anti-counterfeiting code generation method based on trademark picture scrambling encryption - Google Patents
Commodity anti-counterfeiting code generation method based on trademark picture scrambling encryption Download PDFInfo
- Publication number
- CN113935346A CN113935346A CN202111185829.XA CN202111185829A CN113935346A CN 113935346 A CN113935346 A CN 113935346A CN 202111185829 A CN202111185829 A CN 202111185829A CN 113935346 A CN113935346 A CN 113935346A
- Authority
- CN
- China
- Prior art keywords
- matrix
- row
- column
- commodity
- sequence
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/10—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
- G06K7/10009—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves
- G06K7/10257—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves arrangements for protecting the interrogation against piracy attacks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K19/00—Record carriers for use with machines and with at least a part designed to carry digital markings
- G06K19/06—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
- G06K19/06009—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
- G06K19/06037—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
-
- 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
Abstract
The invention discloses a commodity anti-counterfeiting code generation method based on trademark picture scrambling encryption, which comprises the following steps: respectively carrying out binary conversion and splicing on the matrixes R, G and B decomposed by the commodity color trademark picture to obtain a combined three-dimensional binary matrixCarrying out numerical value and binary conversion on the commodity identification code to obtain a binary sequence; the chaotic system iterates to obtain chaotic sequences Y1 and Y2 and parameters of matrix row shift and column shift; according to the sequence scrambling rule of the chaotic sequences Y1 and Y2 and the parameters of matrix row shift and matrix column shift, the matrix is subjected toAnd sequentially carrying out scrambling splicing, line shifting, backfilling reverse scrambling, re-scrambling splicing, column shifting and backfilling reverse scrambling operations to generate a color anti-counterfeiting picture, and combining to generate the commodity anti-counterfeiting two-dimensional code. The commodity anti-counterfeiting code generation method based on the trademark picture scrambling encryption is simple and feasible, has strong safety and is not easy to crack, and the generated commodity anti-counterfeiting two-dimensional code has uniqueness and non-forgeability.
Description
Technical Field
The invention belongs to the technical field of digital anti-counterfeiting, and particularly relates to a commodity anti-counterfeiting code generation method based on trademark picture scrambling encryption.
Background
The anti-counterfeiting technologies commonly used in the market at present mainly include a paper-grain anti-counterfeiting technology, a laser holographic anti-counterfeiting technology, a chemical ink anti-counterfeiting technology, a nuclear track anti-counterfeiting technology, a code anti-counterfeiting technology, a digital anti-counterfeiting technology and the like. The traditional anti-counterfeiting technology is difficult to be widely applied to the authenticity identification of all commodities due to the limitations of complex manufacturing process, inconvenient identification of anti-counterfeiting labels and the like, and is only limited to the authenticity identification of high-end products. Because of various defects of the traditional anti-counterfeiting technology, the digital anti-counterfeiting technology comes with the move, and the development process is divided into the following steps according to different code making modes: the method comprises three stages of a random bar code anti-counterfeiting model, an encrypted sequential serial number anti-counterfeiting model and a comprehensive anti-counterfeiting model. At present, the digital anti-counterfeiting technology has become one of the most widely applied technologies in the anti-counterfeiting industry, and plays a significant role in the anti-counterfeiting field.
The premise of the digital anti-counterfeiting technology is code making, and the common and widely applied code making technology is a two-dimensional code. The two-dimensional code relates to the social life aspect, and from a personal business card in chat software to a transaction medium for mobile payment, the two-dimensional code becomes popular in a code making technology. 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.
Disclosure of Invention
The invention aims to solve the defects in the prior art and provides a commodity anti-counterfeiting code generation method based on trademark picture scrambling encryption.
The invention provides a commodity anti-counterfeiting code generation method based on trademark picture scrambling encryption, which comprises the following steps:
(1) transcoding
The unique identity information of a certain commodity is represented by the combination of a commodity color trademark picture and commodity basic information, firstly, the commodity color trademark picture is divided into three primary colors of red, green and blue, which are respectively represented as matrixes R, G and B, elements in the matrixes R, G and B are respectively converted into 8-bit binary systems one by one, and a three-dimensional binary matrix is obtainedAndand combining the three-dimensional binary matrixAndsequentially splicing the two matrixes up and down to obtain a combined three-dimensional binary matrix
Then the identification code of the commodity, namely the character string A, representing the basic information of a certain commodity1A2,...,AL-1ALConverting the characters into numerical data one by one to obtain a numerical sequenceThen, elements in the numerical sequence P are converted into 8-bit binary one by one to obtain a binary sequence
Wherein the size of the color trademark picture is MxN, the size of the matrix R, G, B is MxN, and the three-dimensional binary matrix The number of rows is M, the number of columns is N, the number of layers is 8, and a three-dimensional binary matrix is combinedThe number of rows is 3M, the number of columns is N, the number of layers is 8, the commodity identification code representing the basic information of the commodity comes from characters of GBK codes, the length of the commodity identification code is L, and the length of the numerical sequence P is LThe length of the binary sequence PB isAnd is
(2) Generating chaotic sequences
Firstly, an initial value x of the chaotic system is respectively calculated by using external encryption keys (alpha, beta) according to the following formulas (1) to (4)1Parameter lambda, extraction start position delta1And delta2Let us order
Then it is possible to obtain,
x1=mod(Key_inner-α,0.999)+0.001, (1)
λ=2+mod(-Key_inner+β,29), (2)
wherein α ∈ (0,1), β ∈ (0,100), [ { PB ∈ (PB) ]8i-7,PB8i-6,...,PB8i-1,PB8i}]0Representing a statistical binary sequence PB8i-7,PB8i-6,...,PB8i-1,PB8iThe number of binary '0's present in the tremble,andrespectively representing statistical three-dimensional binary matricesThe number of binary '1' exists in the ith row, the jth column and the 1 st to 8 th layers,
then, the initial value x is calculated1And a parameter lambda, iterating the Chebyshev chaotic system shown in the following formula (5), wherein k represents iteration times, and xk+1Representing the chaotic signal obtained in the k-th iteration, wherein k is 1,2, …, so as to obtain a chaotic sequence X,
xk+1=cos(λ·arccos(xk)) (5)
then extracting the delta-th from the chaotic sequence X1Elements, the number of rows H _ number of the matrix row shift and the reset extraction start position δ are calculated according to the following formula (6)1,
Extracting the delta-th from the chaotic sequence X1Element according to the following formula(7) Respectively calculating to obtain the direction H _ direction of matrix row shift and the reset extraction starting position delta1And a level parameter H _ CM of the row shift matrix,
from the chaos sequence X by the number delta1Starting to continuously extract 8 +2 elements to obtain a chaos sequence with the length of 8
Finally, the delta is extracted from the chaos sequence X2Each element is calculated by the following equation (8) to obtain the column number L _ number of matrix column shift and the reset extraction start position δ2,
Extracting the delta-th from the chaotic sequence X2The direction L _ direction of matrix column shift and the reset extraction start position delta are calculated according to the following formula (9)2And a level parameter L _ CM of the column shift matrix,
from the chaos sequence X by the number delta2Starting to continuously extract 8 +2 elements to obtain a chaos sequence with the length of 8
(3) Row-shifted scrambling encryption
Firstly, the chaos sequence Y1 is sorted in ascending order, and the combined three-dimensional binary matrix is scrambled according to the position change scrambling rule before and after the sequence Y1The elements are scrambled according to layers to obtain a scrambled combined three-dimensional binary matrixAnd according to the level parameter H _ CM of the row shift matrix, the following splicing operation is carried out,
if H _ CM is 1, the scrambled combined three-dimensional binary matrix is usedSplicing layer by layer to obtain a matrix H to be shiftedRGBIs shown as
If H _ CM is 0, the scrambled combined three-dimensional binary matrix is usedSplicing line by line up and down to obtain a matrix H to be shiftedRGBIs shown as
Wherein the matrix H to be row shiftedRGBIs 24M x N in size,
then, according to the number of rows H _ number and direction H _ direction of the matrix row shift, the following whole row shift operation is performed,
if H _ direction is 0, the row to be shifted is shifted by matrix HRGBCircularly shifting the H _ number row in the whole row to obtain a matrix after row shifting
If H _ direction is 1, the row to be shifted is shifted by matrix HRGBCircularly shifting down H _ number rows in the whole row to obtain a matrix after row shifting
Finally, according to the level parameter H _ CM of the row shift matrix, the following backfill operation is carried out,
if H _ CM is 0, the matrix after row shiftingBackfilling the medium elements layer by layer into a three-dimensional binary matrix with 3M row number, N column number and 8 layer number to obtain a row shift three-dimensional binary matrix BH expressed as
If H _ CM is 1, the matrix after row shiftingBackfilling the medium elements line by line into a three-dimensional binary matrix with 3M row number, N column number and 8 layer number to obtain a line shift three-dimensional binary matrix BH expressed as
Sorting the chaotic sequence Y1 in a descending order, and performing reverse scrambling on the elements of the row-shift three-dimensional binary matrix BH in layers according to the position change scrambling rule before and after sorting the sequence Y1 to obtain a reverse-scrambled row-shift three-dimensional binary matrix
(4) Column shifted scrambling encryption
Firstly, the chaos sequence Y2 is sorted in ascending order, and the three-dimensional binary matrix is shifted for the rows after the reverse scrambling according to the position change scrambling rule before and after the sequence Y2Scrambling the elements according to layers to obtain a scrambled three-dimensional binary matrixAnd according to the level parameter L _ CM of the column shift matrix, the following splicing operation is carried out,
if L _ CM is 1, the three-dimensional binary matrix after scrambling is carried outSplicing layer by layer to obtain a to-be-listed shift matrix LRGBIs shown as
If L _ CM is 0, the three-dimensional binary matrix after scrambling is carried outSplicing the rows one by one to obtain a to-be-row shift matrix LRGBIs shown as
Wherein a matrix L is to be column shiftedRGBIs 3M x 8N in size,
then, according to the column number L _ number and the direction L _ direction of the matrix column shift, the following column shift operation is performed,
if L _ direction is 0, the column is shifted by the matrix LRGBCircularly left-shifting the whole column by L _ number row to obtain a matrix after column shifting
If L _ direction is 1, the column is shifted by the matrix LRGBCircularly right shifting the whole column by L _ number row to obtain a matrix after column shifting
Finally, according to the level parameter L _ CM of the column shift matrix, the following backfill operation is carried out,
if L _ CM is 0, the matrix after column shiftingBackfilling the medium elements layer by layer into a three-dimensional binary matrix with 3M row number, N column number and 8 layer number to obtain a line-column shift three-dimensional binary matrix BHL (binary pattern library), which is expressed as
If L _ CM is 1, the matrix after column shiftingBackfilling the medium elements column by column to a three-dimensional binary matrix with 3M rows, N columns and 8 layers to obtain a column-row shift three-dimensional binary matrix BHL (binary pattern library), which is expressed as
Sequencing the chaotic sequence Y2 in a descending order, and performing reverse scrambling on the elements of the column-row shift three-dimensional binary matrix BHL in layers according to the position change scrambling rule before and after sequencing of the sequence Y2 to obtain a column-row shift three-dimensional binary matrix after reverse scrambling
(5) Generation of commodity anti-counterfeiting two-dimensional code
Shifting three-dimensional binary matrix by inverse scrambled rows and columnsRespectively obtain numerical value matrixesThereby generating a color security image C in which the matrixThe size of the anti-counterfeiting code is M multiplied by N, the size of the color anti-counterfeiting picture C is M multiplied by N, the commodity color trademark picture, the commodity identification code and the generated color anti-counterfeiting picture C are combined, and the combined commodity color trademark picture, the commodity identification code and the color anti-counterfeiting picture C are converted into a two-dimensional code by using a two-dimensional code generator, so that the commodity anti-counterfeiting two-dimensional code is obtained.
Further, in the commodity anti-counterfeiting code generation method based on trademark picture scrambling encryption, the elements in the matrixes R, G and B are respectively converted into 8-bit binary system one by one in the step (1), namely the elements in the matrix R are adopted one by oneOperating to obtain a three-dimensional binary matrixAdopt the elements in the matrix G one by oneOperating to obtain a three-dimensional binary matrixAdopting the elements in the matrix B one by oneOperating to obtain a three-dimensional binary matrix
Further, the commodity identification code, namely the character string A, representing the basic information of a certain commodity in the step (1) of the commodity anti-counterfeiting code generation method based on trademark picture scrambling encryption1A2,...,AL-1ALThe conversion of characters into numerical data one by one means that characters in the commodity identification code are converted into numerical data one by adopting a unicode2native (·) function, namely the conversion of double-byte characters is expressed asFor a single byte character, the conversion is expressed asThereby obtaining a numerical sequence
Further, in the commodity anti-counterfeiting code generation method based on trademark picture scrambling encryption, the step (1) of converting the elements in the numerical sequence P into 8-bit binary system one by one means that the elements in the numerical sequence P adopt PB (8 i) one by one-7:8i)=dec2bin(PiAnd 8) operation to obtainBinary sequence
Further, the commodity anti-counterfeiting code generation method based on trademark picture scrambling encryption is characterized in that the anti-scrambled row-column shifted three-dimensional binary matrix in the step (5)Respectively obtain numerical value matrixesThereby generating a color security image C, representing the steps of:
step one, three-dimensional binary matrixThe 1 st to M th rows, 1 st to N th columns and 1 st to 8 th layers of binary elements are respectively operated by taking the binary elements of the 1 st to 8 th layers of a certain row and a certain column as unitsConverting into some numerical data and filling in matrixWhere i 1,2, M, j 1,2, N, a matrix of values is then obtainedAs shown below, the following description is given,
step two, three-dimensional binary matrixThe M + 1-2M row, 1-N column, 1-8 layer binary elements, and the operations are performed by using the binary elements of 1-8 layers in a certain row and a certain column as the unitConverting into some numerical data and filling in matrixWhere i 1,2, M, j 1,2, N, a matrix of values is then obtainedAs shown below, the following description is given,
step three, three-dimensional binary matrixThe binary elements of the 2M + 1-3M rows, the 1 st-N columns and the 1 st-8 th layers are respectively operated by taking the binary elements of the 1-8 th layers of a certain row and a certain column as unitsConverting into some numerical data and filling in matrixWhere i 1,2, M, j 1,2, N, a matrix of values is then obtainedAs shown below, the following description is given,
step four, the numerical value matrixRespectively representing the three primary colors of red, green and blue of a color picture by usingFunction of matrixAnd converting the color image into a color image to generate a color anti-counterfeiting image C, wherein the size of the color anti-counterfeiting image C is M multiplied by N.
Further, the commodity anti-counterfeiting code generation method based on trademark picture scrambling encryption combines the commodity color trademark picture, the commodity identification code and the generated color anti-counterfeiting picture C in the step (5), and means that the commodity color trademark picture is placed at the top, the commodity identification code is placed in the middle, and the color anti-counterfeiting picture C is placed at the bottom in a vertical connection combination mode.
Has the advantages that: according to the method, the unique identity information of a certain commodity is represented by combining a colorful trademark picture of the commodity and basic information of the commodity, and a combined three-dimensional binary matrix obtained by converting and splicing the colorful trademark picture of the commodity is sequentially subjected to scrambling splicing, line shifting, backfilling reverse scrambling, re-scrambling splicing, column shifting, backfilling and re-scrambling according to a sequencing scrambling rule of a chaotic sequence and parameters of matrix line shifting and column shifting, so that a colorful anti-counterfeiting picture is generated, and then a commodity anti-counterfeiting two-dimensional code is generated by combination.
Drawings
FIG. 1 is a schematic diagram of a commodity anti-counterfeiting code generation flow based on trademark picture scrambling encryption according to the present invention;
FIG. 2 is a red, green and blue three primary color picture of a commercial color trademark picture in embodiment 1 of the present invention;
FIG. 3 is a red, green and blue three-primary-color picture of a color anti-counterfeiting picture C of a commodity obtained in embodiment 1 by the commodity anti-counterfeiting code generation method based on trademark picture scrambling encryption provided by the invention
Fig. 4 shows the anti-counterfeit two-dimensional code of the commodity obtained in embodiment 1 by the method for generating the anti-counterfeit code of the commodity based on the scrambling and encryption of the trademark picture.
Detailed Description
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, an embodiment of the present invention provides a method for generating a commodity anti-counterfeit code based on trademark image scrambling encryption, including the following steps:
(1) transcoding
The unique identity information of a certain commodity is represented by the combination of a commodity color trademark picture and commodity basic information, the commodity color trademark picture is firstly decomposed into three primary colors of red, green and blue, which are respectively represented as matrixes R, G and B, and elements in the matrixes R, G and B are respectively adopted one by oneAndthe operation is converted into 8-bit binary system to obtain a three-dimensional binary system matrixAndand combining the three-dimensional binary matrixAndsequentially splicing the two matrixes up and down to obtain a combined three-dimensional binary matrix
Then the identification code of the commodity, namely the character string A, representing the basic information of a certain commodity1A2,...,AL-1ALConverting characters one by one into numerical data by adopting unicode2native (·) function to obtain numerical sequenceThen, the elements in the numerical value sequence P adopt PB (8 i) one by one-7:8i)=dec2bin(Pi8) converting the operation into an 8-bit binary system to obtain a binary sequence
Wherein the size of the color trademark picture is MxN, the size of the matrix R, G, B is MxN, and the three-dimensional binary matrix The number of rows is M, the number of columns is N, the number of layers is 8, and a three-dimensional binary matrix is combinedThe number of rows is 3M, the number of columns is N, the number of layers is 8, the commodity identification code representing the basic information of the commodity comes from characters of GBK codes, the length of the commodity identification code is L, and the length of the numerical sequence P is LThe length of the binary sequence PB isAnd is
(2) Generating chaotic sequences
Firstly, an initial value x of the chaotic system is respectively calculated by using external encryption keys (alpha, beta) according to the following formula1Parameter lambda, extraction start position delta1And delta2Let us order
Then it is possible to obtain,
x1=mod(Key_inner-α,0.999)+0.001,
λ=2+mod(-Key_inner+β,29),
then, the initial value x is calculated1And a parameter lambda is used for iterating the Chebyshev chaotic system shown in the following formula, wherein k represents iteration times, and x represents the iteration timesk+1Representing the chaotic signal obtained in the k-th iteration, wherein k is 1,2, …, so as to obtain a chaotic sequence X,
xk+1=cos(λ·arccos(xk))
then extracting the delta-th from the chaotic sequence X1The number of rows H _ number of the matrix row shift and the reset extraction start position delta are calculated according to the formula1,
Extracting the delta-th from the chaotic sequence X1The direction H _ direction of matrix row shift is obtained by calculating the elements according to the formulaResetting the extraction start position delta1And a level parameter H _ CM of the row shift matrix,
from the chaos sequence X by the number delta1Starting to continuously extract 8 +2 elements to obtain a chaos sequence with the length of 8
Finally, the delta is extracted from the chaos sequence X2Each element is calculated by the following formula to obtain the column number L _ number of matrix column shift and the reset extraction start position delta2,
Extracting the delta-th from the chaotic sequence X2The direction L _ direction of matrix column shift and the reset extraction starting position delta are respectively calculated according to the following formulas2And a level parameter L _ CM of the column shift matrix,
from the chaos sequence X by the number delta2Starting to continuously extract 8 +2 elements to obtain a chaos sequence with the length of 8
(3) Row-shifted scrambling encryption
First, mix themChaos sequence Y1 is sorted in ascending order, and the combined three-dimensional binary matrix is scrambled according to the position change scrambling rule before and after the sequence Y1The elements are scrambled according to layers to obtain a scrambled combined three-dimensional binary matrixAnd according to the level parameter H _ CM of the row shift matrix, the following splicing operation is carried out,
if H _ CM is 1, the scrambled combined three-dimensional binary matrix is usedSplicing layer by layer to obtain a matrix H to be shiftedRGBIs shown as
If H _ CM is 0, the scrambled combined three-dimensional binary matrix is usedSplicing line by line up and down to obtain a matrix H to be shiftedRGBIs shown as
Wherein the matrix H to be row shiftedRGBIs 24M x N in size,
then, according to the number of rows H _ number and direction H _ direction of the matrix row shift, the following whole row shift operation is performed,
if H _ direction is 0, the row to be shifted is shifted by matrix HRGBCircularly shifting the H _ number row in the whole row to obtain a matrix after row shifting
If H _ direction is 1, it will be waited forRow shift matrix HRGBCircularly shifting down H _ number rows in the whole row to obtain a matrix after row shifting
Finally, according to the level parameter H _ CM of the row shift matrix, the following backfill operation is carried out,
if H _ CM is 0, the matrix after row shiftingBackfilling the medium elements layer by layer into a three-dimensional binary matrix with 3M row number, N column number and 8 layer number to obtain a row shift three-dimensional binary matrix BH expressed as
If H _ CM is 1, the matrix after row shiftingBackfilling the medium elements line by line into a three-dimensional binary matrix with 3M row number, N column number and 8 layer number to obtain a line shift three-dimensional binary matrix BH expressed as
Sorting the chaotic sequence Y1 in descending order, rootAccording to the position change scrambling rule before and after the sequence Y1, the chaotic sequence Y1 is sorted in descending order, according to the position change scrambling rule before and after the sequence Y1, the elements of the line-shift three-dimensional binary matrix BH are subjected to reverse scrambling according to layers, and the line-shift three-dimensional binary matrix BH after reverse scrambling is obtained
(4) Column shifted scrambling encryption
Firstly, the chaos sequence Y2 is sorted in ascending order, and the three-dimensional binary matrix is shifted for the rows after the reverse scrambling according to the position change scrambling rule before and after the sequence Y2Scrambling the elements according to layers to obtain a scrambled three-dimensional binary matrixAnd according to the level parameter L _ CM of the column shift matrix, the following splicing operation is carried out,
if L _ CM is 1, the three-dimensional binary matrix after scrambling is carried outSplicing layer by layer to obtain a to-be-listed shift matrix LRGBIs shown as
If L _ CM is 0, the three-dimensional binary matrix after scrambling is carried outSplicing the rows one by one to obtain a to-be-row shift matrix LRGBIs shown as
Wherein a matrix L is to be column shiftedRGBIs 3M x 8N in size,
then, according to the column number L _ number and the direction L _ direction of the matrix column shift, the following column shift operation is performed,
if L _ direction is 0, the column is shifted by the matrix LRGBCircularly left-shifting the whole column by L _ number row to obtain a matrix after column shifting
If L _ direction is 1, the column is shifted by the matrix LRGBCircularly right shifting the whole column by L _ number row to obtain a matrix after column shifting
Finally, according to the level parameter L _ CM of the column shift matrix, the following backfill operation is carried out,
if L _ CM is 0, the matrix after column shiftingBackfilling the medium elements layer by layer into a three-dimensional binary matrix with 3M row number, N column number and 8 layer number to obtain a line-column shift three-dimensional binary matrix BHL (binary pattern library), which is expressed as
If L _ CM is 1, the matrix after column shiftingBackfilling the medium elements column by column to a three-dimensional binary matrix with 3M rows, N columns and 8 layersIn (1), a row-column shift three-dimensional binary matrix BHL is obtained and expressed as
Sequencing the chaotic sequence Y2 in a descending order, and performing reverse scrambling on the elements of the column-row shift three-dimensional binary matrix BHL in layers according to the position change scrambling rule before and after sequencing of the sequence Y2 to obtain a column-row shift three-dimensional binary matrix after reverse scrambling
(5) Generation of commodity anti-counterfeiting two-dimensional code
Shifting three-dimensional binary matrix by inverse scrambled rows and columnsRespectively obtain numerical value matrixesThereby producing a color security image C, representing the steps of,
step one, three-dimensional binary matrixThe 1 st to M th rows, 1 st to N th columns and 1 st to 8 th layers of binary elements are respectively operated by taking the binary elements of the 1 st to 8 th layers of a certain row and a certain column as unitsConverting into some numerical data and filling in matrixWhere i 1,2, M, j 1,2, N, a numerical moment is then obtainedMatrix ofAs shown below, the following description is given,
step two, three-dimensional binary matrixThe M + 1-2M row, 1-N column, 1-8 layer binary elements, and the operations are performed by using the binary elements of 1-8 layers in a certain row and a certain column as the unitConverting into some numerical data and filling in matrixWhere i 1,2, M, j 1,2, N, a matrix of values is then obtainedAs shown below, the following description is given,
step three, three-dimensional binary matrixThe binary elements of the 2M + 1-3M rows, the 1 st-N columns and the 1 st-8 th layers are respectively operated by taking the binary elements of the 1-8 th layers of a certain row and a certain column as unitsConverting into some numerical data and filling in matrixWherein i is 1N, then a matrix of values is obtainedAs shown below, the following description is given,
step four, the numerical value matrixRespectively representing the three primary colors of red, green and blue of a color picture by usingFunction of matrixConverting into color picture to generate color anti-counterfeiting picture C, wherein the size of the color anti-counterfeiting picture C is MxN,
and finally, placing the color trademark picture of the commodity on the top, placing the commodity identification code in the middle, placing the color anti-counterfeiting picture C on the bottom, connecting and combining the color trademark picture, the commodity identification code and the color anti-counterfeiting picture C up and down, and converting the combined color trademark picture, the commodity identification code and the color anti-counterfeiting picture C into a two-dimensional code by using a two-dimensional code generator, thereby obtaining the anti-counterfeiting two-dimensional code of the commodity.
The invention is further illustrated by the following specific examples:
example 1
The commodity anti-counterfeiting code generation method based on trademark picture scrambling encryption comprises the following steps:
(1) the unique identity information of a certain commodity is represented by the combination of a commodity color trademark picture and commodity basic information, the red, green and blue three primary colors are decomposed from the commodity color trademark picture (the R, G, B three primary color picture is shown in figure 2) and are respectively represented as matrixes R, G and B, elements in the matrixes R, G and B are respectively converted into 8-bit binary matrixes one by one, and a three-dimensional binary matrix is obtainedAndand combining the three-dimensional binary matrixAndsequentially splicing the two matrixes up and down to obtain a combined three-dimensional binary matrix
Then, the commodity identification code representing the basic information of a certain commodity, namely the character string '123 and 123456 and 2021 year 08 month 11 day-12345678', is converted into numerical data character by character to obtain a numerical sequence P ═ 49,50,51,52,53,54,45,50,48,50,49,196,234,48,56,212,194,49, 200,213,45,49,50,51,52,53,54,55,56}, and then the elements in the numerical sequence P are converted into an 8-bit binary system to obtain a binary sequence PB ═ 0,0,1,1,0,0,1,0,1,1,0,1,0, 1,0,0,1,1,0,0,0,1,0,0, 0,1,0,0,1,1,0,0,1,1,0,1,0,0,0,0,1,1,0,1,0,1,0,0,1,1,0,1,1,0,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,0,0,1,1,0,0,0,0,0,0,1,1,0,0,1,0,0,0,1,1,0,0,0,1,1,1,0,0,0,1,0,0,1,1,1,0,1,0,1,0,0,0,1,1,0,0,0,0,0,0,1,1,1,0,0,0,1,1,0,1,0,1,0,0,1,1,0,0,0,0,1,0,0,0,1,1,0,0,0,1,0,0,1,1, 0,0,0,1,1,1,0,0,1,0,0,0,1,1,0,1,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,0,1,0,0,1,1,0,0,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,1,0,0,0,0,1,1,0,1,0,1,0,0,1,1,0,1,1,0,0,0,1,1,0,1,1,1,0,0,1,1,1,0,0,0},
wherein the size of the color trademark picture is 76 × 76, the size of the matrix R, G, B is 76 × 76, and the size of the three-dimensional binary matrix is 76 × 76 With 76 rows, 76 columns and 8 layers, a three-dimensional binary matrix is assembledHas row number 228, column number 76, layer number 8, commodity identification code character string length L-31, and numerical value sequence P length PThe length of the binary sequence PB is 8 × 34 ═ 272;
(2) firstly, using an external encryption key (α -0.12345, β -6.54321), calculating an initial value x of the chaotic system according to the following formula1Parameter lambda, extraction start position delta1And delta2Let us order
Then it is possible to obtain,
x1=mod(0.060894100521666-0.12345,0.999)+0.001=0.937444100521666,
λ=2+mod(-0.060894100521666+6.54321,29)=8.482315899478333,
δ1=mod(5410052166,89)+1=89,
δ2=mod(55410052166,109)+1=49,
then, the initial value x is calculated1And the parameter lambda iterates the Chebyshev chaotic system to obtain a chaotic sequence X,
then, the 89 th element is extracted from the chaotic sequence X, the number of rows H _ number mod (92893772299309,24 × 76) of matrix row shift is calculated as 1509, and the extraction start position δ is reset1=89+mod(1509,123)=122,
Extracting the 122 th element from the chaos sequence X, calculating to obtain the direction H _ direction ═ 1 of matrix row shift, resetting the extraction starting position delta1122+59 181, and the level parameter H _ CM of the row shift matrix 0,
continuously extracting 8 chaotic sequences from the 183 th element in the chaotic sequence X to obtain a chaotic sequence Y1 with the length of 8, namely {0.640718053979319,0.415847546804130, -0.966038615644033,0.763729419664320,0.945741379717408, -0.944554589219226,0.245645345982807,0.221380205639024},
finally, the 49 th element is extracted from the chaotic sequence X, the column number L _ number which obtains the matrix column shift is calculated to be mod (37849618864901,8 × 76) to be 414, and the extraction starting position is reset to be delta2=49+mod(414,123)=94,
Extracting 94 th element from chaos sequence X, calculating to obtain direction L _ direction of matrix column shift as 0, resetting extraction start position delta294+ 53-147, and the level parameter L _ CM of the column shift matrix is 1,
continuously extracting 8 chaotic sequences from 149 th elements in the chaotic sequence X to obtain a chaotic sequence Y2 with the length of 8 { -0.726970140964423,0.191422875691690,0.640096385770775,0.409593790562923, -0.949360784579567,0.366344995675700, -0.753331087148370, -0.139552787306207 };
(3) firstly, the chaos sequence Y1 is sorted in ascending order, and the three-dimensional binary matrix is combined according to the position change scrambling rule {3,6,8,7,2,1,4,5} before and after the sequence Y1The elements are scrambled according to layers to obtain a scrambled combined three-dimensional binary matrixAnd according to the level parameter H _ CM of the row shift matrix, the scrambled combined three-dimensional binary matrix isSplicing line by line up and down to obtain a matrix H to be shiftedRGBIn which the matrix H to be row shiftedRGBIs 1824 x 76 in size,
then, the row to be shifted by matrix HRGBCircularly shifting the whole row down 1509 rows to obtain a matrix after row shifting
Finally, the matrix after row shiftingBackfilling the middle elements layer by layer into a three-dimensional binary matrix with 228 rows, 76 columns and 8 layers to obtain a row-shift three-dimensional binary matrix BH, sequencing the chaotic sequence Y1 in a descending order, performing inverse scrambling on the row-shift three-dimensional binary matrix BH elements in layers according to a position change scrambling rule {5,4,1,2,7,8,6,3} before and after sequencing the sequence Y1 to obtain an inverse-scrambled row-shift three-dimensional binary matrix BH element
(4) Firstly, the chaos sequence Y2 is sorted in ascending order, and the three-dimensional binary matrix is shifted for the rows after the derangement according to the position change scrambling rule {5,7,1,8,2,6,4,3} before and after the sequence Y2Scrambling the elements according to layers to obtain a scrambled three-dimensional binary matrixAnd according to the level parameter L _ CM of the column shift matrix, the scrambled combined three-dimensional binary matrix isSplicing layer by layer to obtain a to-be-listed shift matrix LRGBIn which a column is to be shifted by a matrix LRGBIs 228 x 608, and has a size of,
then, the columns are shifted by matrix LRGBCircularly left-shifting 414 rows in the whole column to obtain a matrix after column shifting
Finally, the matrix after column shiftingFilling the medium elements into a three-dimensional binary matrix with 228 rows, 76 columns and 8 layers one by one to obtain a row-column shift three-dimensional binary matrix BHL, sequencing the chaotic sequence Y2 in a descending order, and performing reverse scrambling on the elements of the row-column shift three-dimensional binary matrix BHL according to a position change scrambling rule {3,4,6,2,8,1,7,5} before and after sequencing of the sequence Y2 to obtain a reverse scrambled row-column shift three-dimensional binary matrix BHL
(5) Shifting three-dimensional binary matrix by inverse scrambled rows and columnsRespectively obtain numerical value matrixesThereby generating a color security image C in which the matrixThe sizes of the commodity color trademark picture, the commodity identification code and the generated color anti-counterfeiting picture C are combined, the two-dimensional code generator is used for converting the combined commodity color trademark picture, the commodity identification code and the color anti-counterfeiting picture C into a two-dimensional code, and therefore the commodity anti-counterfeiting two-dimensional code is obtained, wherein the R, G, B three-primary-color picture of the color anti-counterfeiting picture C is shown in figure 3, and the commodity anti-counterfeiting two-dimensional code is shown in figure 4.
Example 2
According to the above commodity anti-counterfeiting code generation method based on trademark picture scrambling encryption, the color trademark picture of a certain commodity and the commodity anti-counterfeiting code generation steps thereof are similar to those of the specific embodiment 1, and only a certain external encryption key slightly changes: 0.12345000000001; or β 6.54321000000001, the generation of the commercial anti-counterfeiting code is shown in table 1. As can be seen from the following table: once the external encryption key slightly changes, the generated commodity anti-counterfeiting two-dimensional code greatly changes, so that the commodity anti-counterfeiting code generation method based on trademark picture scrambling encryption provided by the patent has key sensitivity.
TABLE 1 Generation result of merchandise anti-counterfeit code when the external encryption key is slightly changed
Example 3
According to the method for generating the commodity anti-counterfeiting code based on the brand picture scrambling encryption, the steps of generating the color brand picture, the external encryption key and the commodity anti-counterfeiting code of a certain commodity are similar to those of the specific embodiment 1, and only the commodity identification code is changed slightly: '124, 123456, 2021, 08, 11, d-12345678'; or '123 + 123459 + 2021, 08.11.11-12345678'; or '123 + 123456 + 2021 year 08 month 11 mesh-12345678'; or 123, 123456, 2021, 08, 11, 12345670', and the generation result of the merchandise anti-counterfeiting two-dimensional code is shown in table 2. As can be seen from the following table: once the commodity identification code slightly changes, the generated commodity anti-counterfeiting two-dimensional code can greatly change, so that the commodity anti-counterfeiting code generation method based on trademark picture scrambling encryption provided by the patent has sensitivity to commodity identity information (namely the commodity identification code).
TABLE 2 Generation result of commodity anti-counterfeit code when commodity identification code is slightly changed
Example 4
According to the commodity anti-counterfeiting code generation method based on trademark picture scrambling encryption, the commodity identification code, the external encryption key and the commodity anti-counterfeiting code generation steps of a certain commodity are similar to those of the specific embodiment 1, and only the color trademark picture is changed slightly: a certain point of red primary color in the commercial color trademark picture is slightly changed, such as R (M, N) mod (R (M, N) +1, 256); or the pixel of a certain point of the green primary color in the commercial color trademark picture is slightly changed, such as G (1,1) ═ mod (G (1,1) +1, 256); or the pixel of a certain point of the blue primary color in the commodity color trademark picture is slightly changed, for example, B (M,1) ═ mod (B (M,1) +1,256), and the generation result of the commodity anti-counterfeiting two-dimensional code is shown in table 3. As can be seen from the following table: once the color trademark picture of the commodity slightly changes, the generated anti-counterfeiting two-dimensional code of the commodity greatly changes, so that the commodity anti-counterfeiting code generation method based on the trademark picture scrambling encryption has sensitivity to the color trademark picture of the commodity.
TABLE 3 Generation result of anti-counterfeit code of commodity when the color trademark picture of commodity is slightly changed
As can be seen from the above specific embodiments 2, 3 and 4, the anti-counterfeit code generated by the method for generating an anti-counterfeit code for a commodity based on scrambling encryption of a trademark picture provided by the present patent is not only closely related to an external encryption key and basic information of the commodity (i.e. a commodity identification code), but also depends on a color trademark picture of the commodity.
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 (6)
1. A commodity anti-counterfeiting code generation method based on trademark picture scrambling encryption is characterized by comprising the following steps:
(1) transcoding
The unique identity information of a certain commodity is represented by the combination of a commodity color trademark picture and commodity basic information, firstly, the commodity color trademark picture is divided into three primary colors of red, green and blue, which are respectively represented as matrixes R, G and B, elements in the matrixes R, G and B are respectively converted into 8-bit binary systems one by one, and a three-dimensional binary matrix is obtainedAndand combining the three-dimensional binary matrixAndsequentially splicing the two matrixes up and down to obtain a combined three-dimensional binary matrix
Then the identification code of the commodity, namely the character string A, representing the basic information of a certain commodity1A2,...,AL-1ALConverting the characters into numerical data one by one to obtain a numerical sequenceThen, elements in the numerical sequence P are converted into 8-bit binary one by one to obtain a binary sequence
Wherein the size of the color trademark picture is MxN, the size of the matrix R, G, B is MxN, and the three-dimensional binary matrix The number of rows is M, the number of columns is N, the number of layers is 8, and a three-dimensional binary matrix is combinedThe number of rows is 3M, the number of columns is N, the number of layers is 8, the commodity identification code representing the basic information of the commodity comes from characters of GBK codes, the length of the commodity identification code is L, and the length of the numerical sequence P is LThe length of the binary sequence PB isAnd is
(2) Generating chaotic sequences
Firstly, an initial value x of the chaotic system is respectively calculated by using external encryption keys (alpha, beta) according to the following formulas (1) to (4)1Parameter lambda, extraction start position delta1And delta2Let us order
Then it is possible to obtain,
x1=mod(Key_inner-α,0.999)+0.001, (1)
λ=2+mod(-Key_inner+β,29), (2)
wherein α ∈ (0,1), β ∈ (0,100), [ { PB ∈ (PB) ]8i-7,PB8i-6,...,PB8i-1,PB8i}]0Representing a statistical binary sequence PB8i-7,PB8i-6,...,PB8i-1,PB8iThe number of binary '0's present in the tremble,andrespectively representing statistical three-dimensional binary matricesThe number of binary '1' exists in the ith row, the jth column and the 1 st to 8 th layers,
then, the initial value x is calculated1And a parameter lambda, iterating the Chebyshev chaotic system shown in the following formula (5), wherein k represents iteration times, and xk+1Representing the chaotic signal obtained in the k-th iteration, wherein k is 1,2, …, so as to obtain a chaotic sequence X,
xk+1=cos(λ·arccos(xk)) (5)
then extracting the delta-th from the chaotic sequence X1Elements, the number of rows H _ number of the matrix row shift and the reset extraction start position δ are calculated according to the following formula (6)1,
Extracting the delta-th from the chaotic sequence X1The direction H _ direction of matrix row shift and the reset extraction start position delta are calculated according to the following formula (7)1And a level parameter H _ CM of the row shift matrix,
from the chaos sequence X by the number delta1Starting to continuously extract 8 +2 elements to obtain a chaos sequence with the length of 8
Finally, the delta is extracted from the chaos sequence X2Each element is calculated by the following equation (8) to obtain the column number L _ number of matrix column shift and the reset extraction start position δ2,
Extracting the delta-th from the chaotic sequence X2The direction L _ direction of matrix column shift and the reset extraction start position delta are calculated according to the following formula (9)2And a level parameter L _ CM of the column shift matrix,
from the chaos sequence X by the number delta2Starting to continuously extract 8 +2 elements to obtain a chaos sequence with the length of 8
(3) Row-shifted scrambling encryption
Firstly, the chaos sequence Y1 is sorted in ascending order, and the combined three-dimensional binary matrix is scrambled according to the position change scrambling rule before and after the sequence Y1The elements are scrambled according to layers to obtain a scrambled combined three-dimensional binary matrixAnd according to the level parameter H _ CM of the row shift matrix, the following splicing operation is carried out,
if H _ CM is 1, the scrambled combined three-dimensional binary matrix is usedSplicing layer by layer to obtain a matrix H to be shiftedRGBIs shown as
If H _ CM is 0, the scrambled combined three-dimensional binary matrix is usedSplicing line by line up and down to obtain a matrix H to be shiftedRGBIs shown as
Wherein the matrix H to be row shiftedRGBIs 24M x N in size,
then, according to the number of rows H _ number and direction H _ direction of the matrix row shift, the following whole row shift operation is performed,
if H _ direction is 0, the row to be shifted is shifted by matrix HRGBCircularly shifting the H _ number row in the whole row to obtain a matrix after row shifting
If H _ direction is 1, the row to be shifted is shifted by matrix HRGBCircularly shifting down H _ number rows in the whole row to obtain a matrix after row shifting
Finally, according to the level parameter H _ CM of the row shift matrix, the following backfill operation is carried out,
if H _ CM is 0, the matrix after row shiftingBackfilling the medium elements layer by layer into a three-dimensional binary matrix with 3M row number, N column number and 8 layer number to obtain a row shift three-dimensional binary matrix BH expressed as
If H _ CM is 1, the matrix after row shiftingBackfilling the medium elements line by line into a three-dimensional binary matrix with 3M row number, N column number and 8 layer number to obtain a line shift three-dimensional binary matrix BH expressed as
Sorting the chaotic sequence Y1 in a descending order, and performing reverse scrambling on the elements of the row-shift three-dimensional binary matrix BH in layers according to the position change scrambling rule before and after sorting the sequence Y1 to obtain a reverse-scrambled row-shift three-dimensional binary matrix
(4) Column shifted scrambling encryption
Firstly, the chaos sequence Y2 is sorted in ascending order, and the three-dimensional binary matrix is shifted for the rows after the reverse scrambling according to the position change scrambling rule before and after the sequence Y2Scrambling the elements according to layers to obtain a scrambled three-dimensional binary matrixAnd according to the level parameter L _ CM of the column shift matrix, the following splicing operation is carried out,
if L _ CM is 1, the three-dimensional binary matrix after scrambling is carried outSplicing layer by layer to obtain a to-be-listed shift matrix LRGBIs shown as
If L _ CM is 0, the three-dimensional binary matrix after scrambling is carried outSplicing the rows one by one to obtain a to-be-row shift matrix LRGBIs shown as
Wherein a matrix L is to be column shiftedRGBIs 3M x 8N in size,
then, according to the column number L _ number and the direction L _ direction of the matrix column shift, the following column shift operation is performed,
if L _ direction is 0, the column is shifted by the matrix LRGBCircularly left-shifting the whole column by L _ number row to obtain a matrix after column shifting
If L _ direction is 1, the column is shifted by the matrix LRGBCircularly right shifting the whole column by L _ number row to obtain a matrix after column shifting
Finally, according to the level parameter L _ CM of the column shift matrix, the following backfill operation is carried out,
if L _ CM is 0, the matrix after column shiftingBackfilling the medium elements layer by layer into a three-dimensional binary matrix with 3M row number, N column number and 8 layer number to obtain a row-column shift three-dimensional binary matrix BHL (Business Link library), a tableShown as
If L _ CM is 1, the matrix after column shiftingBackfilling the medium elements column by column to a three-dimensional binary matrix with 3M rows, N columns and 8 layers to obtain a column-row shift three-dimensional binary matrix BHL (binary pattern library), which is expressed as …
Sequencing the chaotic sequence Y2 in a descending order, and performing reverse scrambling on the elements of the column-row shift three-dimensional binary matrix BHL in layers according to the position change scrambling rule before and after sequencing of the sequence Y2 to obtain a column-row shift three-dimensional binary matrix after reverse scrambling
(5) Generation of commodity anti-counterfeiting two-dimensional code
Shifting three-dimensional binary matrix by inverse scrambled rows and columnsRespectively obtain numerical value matrixesThereby generating a color security image C in which the matrixThe size of the anti-counterfeiting code is M multiplied by N, the size of the color anti-counterfeiting picture C is M multiplied by N, the commodity color trademark picture, the commodity identification code and the generated color anti-counterfeiting picture C are combined, and the combined commodity color trademark picture, the commodity identification code and the color anti-counterfeiting picture C are converted into a two-dimensional code by using a two-dimensional code generator, so that the commodity anti-counterfeiting two-dimensional code is obtained.
2. The method for generating the merchandise anti-counterfeiting code based on the trademark picture scrambling encryption as claimed in claim 1, wherein the step (1) of converting the elements in the matrixes R, G and B into 8-bit binary system one by one respectively means that the elements in the matrix R adopt the 8-bit binary system one by oneOperating to obtain a three-dimensional binary matrixAdopt the elements in the matrix G one by oneOperating to obtain a three-dimensional binary matrixAdopting the elements in the matrix B one by oneOperating to obtain a three-dimensional binary matrix
3. The method for generating the commodity anti-counterfeiting code based on the trademark picture scrambling encryption as claimed in claim 1, wherein the commodity identification code (character string A) representing the basic information of a certain commodity in the step (1)1A2,...,AL-1ALThe conversion of characters into numerical data one by one means that characters in the commodity identification code are converted into numerical data one by adopting a unicode2native (·) function, namely the conversion of double-byte characters is expressed asFor a single byte character, the conversion is expressed asThereby obtaining a numerical sequence
5. The method for generating anti-counterfeit code for commodities scrambled and encrypted based on trademark picture according to claim 1, wherein the three-dimensional binary matrix shifted by the reversed rows and columns in the step (5)Respectively obtain numerical value matrixesThereby generating a color security image C, representing the steps of:
step one, three-dimensional binary matrixThe 1 st to M th rows, 1 st to N th columns and 1 st to 8 th layers of binary elements are respectively operated by taking the binary elements of the 1 st to 8 th layers of a certain row and a certain column as unitsConverting into some numerical data and filling in matrixWhere i 1,2, M, j 1,2, N, a matrix of values is then obtainedAs shown below, the following description is given,
step two, three-dimensional binary matrixThe M + 1-2M row, 1-N column, 1-8 layer binary elements, and the operations are performed by using the binary elements of 1-8 layers in a certain row and a certain column as the unitConverting into some numerical data and filling in matrixWhere i 1,2, M, j 1,2, N, a matrix of values is then obtainedAs shown below, the following description is given,
step three, three-dimensional binary matrixThe binary elements of the 2M + 1-3M rows, the 1 st-N columns and the 1 st-8 th layers are respectively operated by taking the binary elements of the 1-8 th layers of a certain row and a certain column as unitsConverting into some numerical data and filling in matrixWhere i 1,2, M, j 1,2, N, a matrix of values is then obtainedAs shown below, the following description is given,
(ii) a Step four, the numerical value matrixRespectively representing the three primary colors of red, green and blue of a color picture by usingFunction of matrixAnd converting the color image into a color image to generate a color anti-counterfeiting image C, wherein the size of the color anti-counterfeiting image C is M multiplied by N.
6. The method for generating the anti-counterfeiting code of the commodity based on the scrambling and encryption of the trademark picture as claimed in claim 1, wherein the combination of the colored trademark picture of the commodity, the identification code of the commodity and the generated colored anti-counterfeiting picture C in the step (5) is a combination of the colored trademark picture of the commodity placed at the top, the identification code of the commodity placed in the middle and the colored anti-counterfeiting picture C placed at the bottom.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111185829.XA CN113935346B (en) | 2021-10-12 | 2021-10-12 | Commodity anti-counterfeiting code generation method based on trademark picture scrambling encryption |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111185829.XA CN113935346B (en) | 2021-10-12 | 2021-10-12 | Commodity anti-counterfeiting code generation method based on trademark picture scrambling encryption |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113935346A true CN113935346A (en) | 2022-01-14 |
CN113935346B CN113935346B (en) | 2022-06-21 |
Family
ID=79278314
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111185829.XA Active CN113935346B (en) | 2021-10-12 | 2021-10-12 | Commodity anti-counterfeiting code generation method based on trademark picture scrambling encryption |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113935346B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2016077934A1 (en) * | 2014-11-21 | 2016-05-26 | Le Henaff Guy | System and method for detecting the authenticity of products |
US20170109858A1 (en) * | 2015-10-15 | 2017-04-20 | Ningbo University | Zero-watermarking registration and detection method for HEVC video streaming against requantization transcoding |
CN107609621A (en) * | 2017-08-21 | 2018-01-19 | 哈尔滨工业大学深圳研究生院 | A kind of dot matrix security code design method and its application system based on chaos encryption |
CN110417539A (en) * | 2019-08-02 | 2019-11-05 | 齐齐哈尔大学 | A kind of color image encrypting method of dynamic chaos and matrix convolution operation |
CN111800251A (en) * | 2020-05-21 | 2020-10-20 | 北京邮电大学 | Image compressed sensing encryption and decryption method, device and system based on chaotic source |
CN112001467A (en) * | 2020-07-24 | 2020-11-27 | 南通大学 | Commodity anti-counterfeiting code generation and identification method based on picture encryption and decryption |
CN112422268A (en) * | 2020-11-10 | 2021-02-26 | 郑州轻工业大学 | Image encryption method based on block scrambling and state conversion |
-
2021
- 2021-10-12 CN CN202111185829.XA patent/CN113935346B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2016077934A1 (en) * | 2014-11-21 | 2016-05-26 | Le Henaff Guy | System and method for detecting the authenticity of products |
US20170109858A1 (en) * | 2015-10-15 | 2017-04-20 | Ningbo University | Zero-watermarking registration and detection method for HEVC video streaming against requantization transcoding |
CN107609621A (en) * | 2017-08-21 | 2018-01-19 | 哈尔滨工业大学深圳研究生院 | A kind of dot matrix security code design method and its application system based on chaos encryption |
CN110417539A (en) * | 2019-08-02 | 2019-11-05 | 齐齐哈尔大学 | A kind of color image encrypting method of dynamic chaos and matrix convolution operation |
CN111800251A (en) * | 2020-05-21 | 2020-10-20 | 北京邮电大学 | Image compressed sensing encryption and decryption method, device and system based on chaotic source |
CN112001467A (en) * | 2020-07-24 | 2020-11-27 | 南通大学 | Commodity anti-counterfeiting code generation and identification method based on picture encryption and decryption |
CN112422268A (en) * | 2020-11-10 | 2021-02-26 | 郑州轻工业大学 | Image encryption method based on block scrambling and state conversion |
Also Published As
Publication number | Publication date |
---|---|
CN113935346B (en) | 2022-06-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112001467B (en) | Commodity anti-counterfeiting code generation and identification method based on picture encryption and decryption | |
CN109472338B (en) | Batch generation method of commodity anti-counterfeiting two-dimensional codes | |
CN112884104B (en) | Commodity anti-counterfeiting two-dimensional code generation method based on chaotic encryption | |
CN112001468B (en) | Character type commodity anti-counterfeiting code generation and identification method | |
CN112884105B (en) | Commodity anti-counterfeiting two-dimensional code generation method based on shift encryption | |
FR2586122A1 (en) | POSTING MACHINE WITH INFORMATION CODE IN THE INDEX | |
CN111382452A (en) | Encryption method for converting Chinese characters into pictures | |
CN102968654A (en) | Method and system for producing information recognizable by naked eyes in plane of two-dimensional (2D) code and 2D code | |
CN111353166B (en) | Encryption method for converting picture into Chinese character | |
Ali et al. | Image steganography technique by using Braille method of blind people (LSBraille) | |
CN112217627B (en) | Layered encrypted commodity anti-counterfeiting code generation method | |
CN113255860B (en) | Commodity anti-counterfeiting two-dimensional code generation method based on layered encryption | |
CN113935346B (en) | Commodity anti-counterfeiting code generation method based on trademark picture scrambling encryption | |
CN113935345B (en) | Commodity anti-counterfeiting code batch generation method based on character string-to-picture encryption | |
CN111382820B (en) | Four-lattice pure-color commodity anti-counterfeiting code generation method | |
CN113159252A (en) | Commodity anti-counterfeiting two-dimensional code generation method based on different scrambling rules | |
CN113935347B (en) | Commodity anti-counterfeiting code identification method based on anti-counterfeiting picture scrambling and decryption | |
CN105205777B (en) | A kind of coding method of latent image password | |
CN113947096A (en) | Commodity anti-counterfeiting code identification method based on picture-to-character string decryption | |
WO2022131965A1 (en) | Method for encoding and decoding digital information in the form of a multidimensional nano-barcode | |
CN113935343B (en) | Commodity anti-counterfeiting code generation method based on character string-to-picture encryption | |
CN113935344A (en) | Commodity anti-counterfeiting code batch generation method based on trademark picture scrambling encryption | |
Tan et al. | Visual secret sharing scheme for color qr code | |
CN113962839A (en) | Multi-color mode quantum image blind watermarking method based on TMQIR | |
Chavan et al. | Data embedding technique using secret fragment visible mosaic image for covered communication |
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 |