CN112116048B - Improved Lorenz and Zigzag transformation encryption method for power battery traceability management - Google Patents
Improved Lorenz and Zigzag transformation encryption method for power battery traceability management Download PDFInfo
- Publication number
- CN112116048B CN112116048B CN202010910111.1A CN202010910111A CN112116048B CN 112116048 B CN112116048 B CN 112116048B CN 202010910111 A CN202010910111 A CN 202010910111A CN 112116048 B CN112116048 B CN 112116048B
- Authority
- CN
- China
- Prior art keywords
- matrix
- code
- lorenz
- battery
- image
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 51
- 230000009466 transformation Effects 0.000 title claims abstract description 32
- 230000000739 chaotic effect Effects 0.000 claims abstract description 30
- 230000008569 process Effects 0.000 claims abstract description 21
- 238000004519 manufacturing process Methods 0.000 claims abstract description 15
- 239000011159 matrix material Substances 0.000 claims description 73
- 238000012545 processing Methods 0.000 claims description 6
- 238000005457 optimization Methods 0.000 claims description 3
- 238000000926 separation method Methods 0.000 claims description 3
- 238000011084 recovery Methods 0.000 claims description 2
- 102200148757 rs116840796 Human genes 0.000 claims description 2
- 238000004064 recycling Methods 0.000 abstract description 5
- 238000010586 diagram Methods 0.000 description 7
- 238000006243 chemical reaction Methods 0.000 description 6
- 230000000694 effects Effects 0.000 description 6
- 238000002474 experimental method Methods 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000008520 organization Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000009792 diffusion process Methods 0.000 description 1
- 238000004134 energy conservation Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 238000003912 environmental pollution Methods 0.000 description 1
- 239000002994 raw material Substances 0.000 description 1
- 230000006798 recombination Effects 0.000 description 1
- 238000005215 recombination Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/16—Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
-
- 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/06046—Constructional details
- G06K19/0614—Constructional details the marking being selective to wavelength, e.g. color barcode or barcodes only visible under UV or IR
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N7/00—Computing arrangements based on specific mathematical models
- G06N7/08—Computing arrangements based on specific mathematical models using chaos models or non-linear system models
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Computational Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Algebra (AREA)
- Computing Systems (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- Nonlinear Science (AREA)
- Databases & Information Systems (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Facsimile Transmission Control (AREA)
Abstract
The invention discloses an improved Lorenz and Zigzag transformation encryption method for traceability management of a power battery, which comprises the following steps: establishing a complete traceability management system, and encoding life cycle information of power battery production, sale, scrapping, recycling, disassembly and reuse and the like into a QR code in stages; decomposing the color QR image into gray QR code images of three RGB channels, performing improved Lorenz chaotic encryption and Zigzag transformation to obtain an encrypted gray QR code image, combining the three channels, and finally generating an encrypted color QR code and uploading the encrypted color QR code to form a database; decryption is the reverse process of encryption, an initial QR code image is restored, and a user can inquire the tracing information of the battery through scanning equipment. The invention increases the decryption difficulty, greatly improves the confidentiality and privacy of the QR code information, effectively protects the information of the power battery, constructs a traceability management system for encrypting, decrypting and uploading the information of the power battery at each stage, and provides a precondition guarantee for recycling the battery.
Description
Technical Field
The invention belongs to the technical field of coding, and particularly relates to an improved Lorenz and Zigzag transformation encryption method for traceability management of a power battery.
Background
With the increasingly prominent problems of energy shortage, environmental pollution and the like in the world, electric automobiles are receiving a lot of attention due to the advantages of energy conservation and environmental protection. The power battery is the key of the whole system of the electric automobile, and the problem of echelon utilization of the power battery is widely discussed in society. The echelon utilization of the power battery refers to the disassembly, detection, classification and recombination of waste power batteries on the electric automobile. The battery is utilized in grades according to the using condition of the battery, and is applied to other fields to fully exert the residual value of the battery. Therefore, a traceability system of the power battery is established and perfected, and the full life cycle of battery production, application, scrapping and death is effectively controlled, so that the method has important significance and value.
The QR code is a matrix type two-dimensional code developed by Denso corporation of Japan, has large information capacity, strong reliability and anti-counterfeiting performance, and has great advantages in the aspects of rapid and omnibearing identification and the like. By utilizing the advantages of the QR code, the full life cycle information of the battery is coded in the QR code, and great convenience is provided for the management of the power battery traceability system. However, since the algorithm for encoding and decoding the QR code is itself public, if the carried information is read by an unrelated organization, organization or person at will, unnecessary information leakage and privacy exposure are easily caused. Therefore, a simple, fast and effective encryption means is needed when the QR code is used as a medium for sensitive information transmission. The most common method for images is scrambling-diffusing of pixel values, and there are many encryption methods such as chaotic mapping, Arnold, DES and AES. However, these conventional encryption methods generally have problems in terms of security, complexity, and key space.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides an improved Lorenz and Zigzag transformation encryption method for the traceability management of a power battery. Decomposing a QR code image containing battery information into images of three channels of RGB, diffusing pixel values of the images according to a certain rule by using three chaotic sequences obtained by a Lorenz chaotic system, scrambling the positions of pixels through improved Zigzag conversion, and merging three channels of the encrypted QR code image to obtain an encrypted QR code. Based on the position scrambling of the pixels and the diffusion of the pixel values, the QR code image containing the related battery information is encrypted in the traceability system of the full life cycle of the power battery, and the information safety is improved. The invention aims to effectively ensure the safety of battery information in QR codes in each stage in a full life cycle tracing system of a power battery, and provides a method for obtaining a QR code encrypted image by combining improved Zigzag transformation on the basis of three-dimensional chaotic encryption.
In order to solve the technical problems and achieve the purpose of the invention, the invention is realized by the following technical scheme:
an encryption method for improving Lorenz and Zigzag transformation for traceability management of a power battery comprises the following steps:
s1, encoding the battery data of each life cycle of the plaintext information power battery to generate a color QR code image Q with the size of n multiplied by n0;
S2, converting the image Q0Decomposing the image into grayscale images of three channels of RGB, wherein the matrixes are R (n, n), G (n, n) and B (n, n);
s3, utilizing Matlab2018b software and an expression (2), enabling the Lorenz chaotic system to generate three chaotic sequences:
{x(k),y(k),z(k)|k=1,2...};
the expression (2) is:
wherein k is a positive integer, t is time, x, y and z are respectively state variables of the system, a, b and c are system parameters, a is 10,c is 28, and the system is in a chaotic state; selecting an initial value x0、y0、z0Are respectively 0, 1 and 0 and are stored as Key1Storing for later use;
s4, optimizing the chaotic sequence to obtain processed optimized chaotic sequences X ' (k), Y ' (k) and Z ' (k);
s5, carrying out exclusive OR operation on the optimized chaotic sequences X '(k), Y' (k) and Z '(k) and matrixes R (n, n), G (n, n) and B (n, n) according to the constructed expression (4) to obtain encryption matrixes R' (n, n), G '(n, n) and B' (n, n) containing plaintext characteristics;
wherein, i is 1,2, nxn, R (i), G (i), B (i) and B (i) respectively represent the value of the ith element in the matrix corresponding to the QR code images of the three channels, R ' (i), G ' (i) and B ' (i) respectively represent the value of the ith element in the matrix corresponding to the QR code images of the three channels after encryption, and p (i) represents the value of the ith element in the matrix corresponding to the grayscale image of the original QR code without channel separation;
s6, constructing an improved Zigzag transformation, scrambling the matrixes R ' (n, n), G ' (n, n) and B ' (n, n) respectively by using the improved Zigzag transformation to obtain a Key2 and the scrambled matrixes R "(n, n), G" (n, n) and B "(n, n), and the steps are as follows:
s61, constructing an improved Zigzag transformation;
s611, taking a matrix S with the size of m multiplied by m as an input matrix, equally dividing all matrix elements into four small blocks according to a horizontal axis and a vertical axis, if m is an odd number, carrying out boundary expansion processing on the small blocks to enable the small blocks to be even numbers, then taking each small block as a whole, and exchanging the positions of the matrix elements according to a diagonal line according to an expression (5) to obtain a symmetrical exchange matrix
The expression (5) is:
wherein u is more than or equal to 1,step _ r is m/2, step _ c is m/2, u is the row coordinate, and v is the ordinate. S is an input matrix, and S is an input matrix,is a symmetric switching matrix;
s612, symmetrical switching matrixScrambling is performed, the element position state of which changes as expressed by expression (6), andsequentially ordering the medium elements to obtain a two-dimensional matrix
The expression (6) is:
wherein i is more than or equal to 1, j is more than or equal to m, u is a row coordinate, v is a vertical coordinate,is composed ofThe scrambled matrix;
s62, repeating the scrambling process of the step S61R times, scrambling the matrix R '(n, n) to obtain a final scrambled matrix R' (n, n);
s63, storing the scrambling times r as a Key2 for later use;
s64, repeating the step S61 r times in total, scrambling the matrix G '(n, n) to obtain a scrambled matrix G' (n, n);
s65, repeating the step S61 r times in total, scrambling the matrix B '(n, n) to obtain a scrambled matrix B' (n, n);
s7, respectively generating corresponding gray QR code images by the two-dimensional matrixes R ' (n, n), G ' (n, n) and B ' (n, n) after scrambling, merging three channels to obtain an encrypted color QR code image Q1The ciphertext information of (1);
s8, decryption process;
the decryption process is opposite to the encryption process, and the QR code image Q is obtained after decryption0By scanning the QR code image Q0Plaintext information about the battery is obtained.
Preferably, the battery data of each life cycle of the power battery in step S1 at least includes information of production, sale, scrap, recycle, disassembly and reuse cycles.
Preferably, the sequence elements after the optimization processing in step S4 are all positive numbers and between 0 and 255.
Preferably, the optimization processing in step S4 is performed according to expression (3);
the expression (3) is:
preferably, the decryption process in step S8 includes the following steps:
s81, encrypting QR image Q1Decomposing the image into three channels of RGB to obtain three gray QR code encrypted images, wherein the matrixes of the three QR code encrypted images are R "(n, n), G" (n, n) and B "(n, n);
s82, inputting a key2, and performing improved Zigzag inverse transformation on the R '(n, n), G' (n, n) and B '(n, n) matrixes respectively to obtain matrixes R' (n, n), G '(n, n) and B' (n, n);
s83, inputting a key1, generating and optimizing chaotic sequences X ' (k), Y ' (k) and Z ' (k) by a matrix R ' (n, n), G ' (n, n) and a Lorenz system, bitwise XOR-reducing the matrix R (n, n), G (n, n) and B (n, n) according to the rule of an expression (7), and recovering an original QR code Q after combining three channels0;
S84, scanning QR code image Q0Plaintext information about the battery is obtained.
Compared with the prior art beneficial effect that has:
in the method, the QR code image is decomposed into images of three channels of RGB, and the selection of the QR code image to the chaotic sequence in the Lorenz encryption link is related to the plaintext, so that the safety of the algorithm is improved; in the step of scrambling by Zigzag conversion, in view of the limitation of the traditional Zigzag, the diagonal exchange process of image blocks is added before conversion, so that the pixel position scrambling achieves a better effect; a traceability management system for encrypting, decrypting and uploading power battery information at each stage is established, and the safety of the information transmission process can be well ensured. And the information of each stage of the battery is traced, so that a precondition guarantee is provided for the recycling of the battery.
Drawings
FIG. 1 is a frame diagram of a traceability management system of the present invention for improving the encryption method of Lorenz and Zigzag transformation for traceability management of power batteries;
FIG. 2 is a flow chart of an encryption method of the present invention;
FIG. 3 is a flow chart of a decryption method of the present invention;
FIG. 4 is a diagram of an original QR code for one embodiment of the present invention;
FIG. 5 is a diagram of an encrypted QR code for one embodiment of the present invention;
fig. 6a is a schematic view of a 4 x 4 matrix provided in an embodiment of the invention;
FIG. 6b is a schematic diagram of the matrix 4 x 4 in FIG. 6a after conventional Zigzag transformation to obtain another scrambling matrix;
FIG. 7a is a pair of the embodiments of the present inventionSchematic diagram before Z-shaped conversion;
Detailed Description
The invention will be described in more detail below with reference to the accompanying figures 1-5 and the detailed description of the invention:
an improved Lorenz and Zigzag transformation encryption method for power battery traceability management is disclosed, wherein a traceability management system framework is shown in fig. 1, and the contents are as follows:
the whole life cycle of the power battery mainly comprises the stages of battery production, sale, scrapping, recycling, disassembly and reuse and the like, and the battery information of each stage is different. If people are employed to track the collected information at each stage, the efficiency is not high, and the fund is wasted, so that the establishment of a traceability management system throughout the whole life cycle of the battery is very necessary. Taking the production stage as an example, the coded information of the batteries produced in the same batch is the same, but the serial numbers are different, and the serial numbers are printed on the outer packages of the batteries. The staff encodes the production information of the battery into the QR code, encrypts the QR code (reserves a secret key for use in decryption), and uploads the encrypted QR code to the management system. When the sales stage of the next stage is reached, the staff calls out the encrypted QR code containing the battery production information in a mode of searching the battery number, the encrypted QR code is decrypted and restored by using the key, the sales information provided by the sales company is encoded, and the encrypted QR code is encrypted (the key is reserved) and uploaded, and the processes of other stages are the same as those of the next stage.
And finally, the battery recycling enterprise can inquire the traceability information of the whole life cycle of the battery through the QR code decrypted by scanning, disassemble the battery according to the production and use conditions, realize the secondary utilization of raw materials, and encode the disassembly utilization information into the QR code for encryption and uploading. For ease of understanding, the entire process can be simply expressed by the following equation:
wherein, W1、W2、W3、W4、W5And respectively representing accumulated battery information contained in the encrypted QR code at the production, sale, scrap, recovery, disassembly and reuse stages of the power battery. And P isr、Se、Sc、Re、DiRespectively representing the newly generated battery information of the power battery at each current stage.
The invention takes a battery ex-warehouse link in the production stage of a power battery as a specific embodiment, designs a QR code encryption method based on combination of Lorenz chaotic mapping and improved Zigzag transformation, wherein QR contains information such as production time, specification size, attribute and the like of the battery, and experiments prove that the method has good encryption effect and guarantees the information safety of the battery.
An encryption method for improving Lorenz and Zigzag transformation for traceability management of a power battery is disclosed, an encryption flow chart is shown in FIG. 2, and the content thereof comprises the following steps:
s1, in the embodiment, a color QR code image Q containing information such as battery production time, specification size, attribute and the like is generated by encoding the battery ex-warehouse link in the production stage in the power battery full life cycle traceability system0(256X 256) as shown in FIG. 4Shown in the specification;
s2, pair Q0Decomposing the QR code image into three channels of RGB, wherein the two-dimensional matrix of the QR code image is R, G, B, and the size of the QR code image is 256 multiplied by 256;
s3, according to the expression (2), three chaotic sequences generated by the Lorenz chaotic system are as follows:
{x(k),y(k),z(k)|k=1,2...};
expression (2) is:
wherein k is a positive integer, t is time, x, y and z are respectively state variables of the system, a, b and c are system parameters, a is 10,and c is 28, and the system is in a chaotic state. Selecting an initial value x0、y0、z0Respectively 0, 1 and 0, and is stored as a Key1 for use by a user in decrypting the QR code. Substituting the parameters and the initial values into a written file of the Matlab2018b version, and generating three chaotic sequences by using a program in the file;
s4, selecting the first 256 × 256 entries of each sequence, which are denoted as { x (k), y (k), z (k) | k ═ 1,2., 256 × 256}, and optimizing the sequences according to the expression (3), so as to ensure that the elements of the sequences are all positive numbers and between 0 and 255;
s5, carrying out exclusive OR on the processed chaotic sequences X '(k), Y' (k) and Z '(k) and the matrix R, G, B according to the rule of formula (4), so that the selection of the chaotic sequences depends on the plaintext, the algorithm safety is improved, and the matrixes R', G 'and B' which are equal to the selection are obtained.
Wherein, i ═ 1., 256 × 256, R (i), G (i), and B (i) respectively represent values of the ith element in the matrix corresponding to the QR code images of the three channels, R ' (i), G ' (i), and B ' (i) respectively represent values of the ith element in the matrix corresponding to the QR code images of the three channels after encryption, and p (i) represents a value of the ith element in the matrix corresponding to the grayscale image of the original QR code without channel separation;
s6, after chaotic encryption, the pixel values of the QR code image are changed, but the relation between pixel rows is not changed, and the best encryption effect on the QR code containing the battery information cannot be achieved. Therefore, the improved Zigzag transformation is adopted to scramble the pixel positions of the QR code image subjected to Lorenz chaotic encryption, namely, the matrixes R ', G' and B 'are scrambled respectively, the frequency R is 10, the scrambling frequency is used as a Key Key2, and the Key Key2 is stored for later use to obtain two-dimensional matrixes R', G ', B' with equal size.
S61 construction of improved Zigzag transformation
The schematic diagram of the conventional Zigzag scan scrambling method is shown in fig. 6a and 6b, and a 4 × 4 matrix is set to obtain another scrambling matrix after the conventional Zigzag transform.
It can be seen that the positions of some elements are unchanged after the traditional Zigzag transformation, and in order to achieve a better scrambling effect, the method is improved on the basis that a previous stage of processing is performed before transformation. Taking an m x m matrix S, for example, dividing S equally into four small blocks with all matrix elements on the horizontal and vertical axes. If m is odd number, the boundary expansion processing is carried out to make it be even number, then each small block is taken as a whole, the positions of the matrix elements are exchanged according to the diagonal line to obtain the symmetrical exchange matrix
Then is aligned withPerforming Z-font conversion, scrambling, and changing element position state, that is, pointing from the arrow from the current position state to the next position state can be represented by expression (6), and pointing according to the arrowThe medium elements are sequentially sequenced according to the rows to obtain an equal-size two-dimensional matrix
The schematic diagrams are shown in fig. 7a and 7 b.
The improved Zigzag transform can be described by the following mathematical expression:
Wherein, 1 in 1) is more than or equal to u,2) wherein, u is less than or equal to 1, v is less than or equal to m, step _ r is m/2, step _ c is m/2, the row coordinate is u, and the ordinate is v. The symmetric switching matrix of the input matrix S is The Zigzag transformed matrix is
S62, repeating the scrambling process of the step S61 r times, wherein the scrambling process is set to 10 in the embodiment; scrambling the matrix R 'to obtain a final scrambled two-dimensional matrix R';
s63, storing the scrambling times r as a Key2 for later use;
s64, repeating the step S61 r times in total, and scrambling the matrix G 'to obtain a two-dimensional matrix G' after scrambling;
s65, repeating the step S61 r times in total, and scrambling the matrix B 'to obtain a two-dimensional matrix B' after scrambling;
s7, respectively generating corresponding gray QR code images by the two-dimensional matrixes R ', G ' and B ' after scrambling, carrying out three-channel combination to obtain an encrypted QR code image Q1The ciphertext information of (1);
the QR code image containing the battery information is encrypted according to the steps, the encryption operation ensures the information security of the whole life cycle of the battery, but the user needs to decrypt the tracing information by using the provided secret key, and the flow chart is shown in FIG. 3.
S8, decryption process;
the decryption process is opposite to the encryption process, and the QR code image Q is obtained after decryption0By scanning the QR code image Q0Plaintext information about the battery is obtained.
The decryption process comprises the following steps:
s81, encrypting QR image Q1Decomposing the image into three channels of RGB to obtain three gray QR code encrypted images, wherein two-dimensional matrixes of the three QR code encrypted images are R ', G ' and B ' respectively;
s82, inputting a key2, and performing improved Zigzag inverse transformation on the matrix R ', G' and B 'respectively to obtain matrices R', G 'and B';
s83, inputting a secret key1, performing bitwise exclusive OR on the matrixes R ', G', B 'and chaotic sequences X' (k), Y '(k) and Z' (k) generated by the Lorenz system according to the rule of an expression (7) to restore a matrix R, G, B, and recovering an original QR code Q after three components are fused0。
S84, the user can scan the QR code image Q0And information about the production time, specification size, attributes and the like of the battery is obtained, the source, destination and node of the power battery can be checked, and the tracing system is clear and transparent.
The experiment analyzes the encryption method through the correlation aspect of adjacent pixels: a good image encryption method should reduce the correlation of neighboring pixels to achieve zero correlation as much as possible. Three aspects of the image, horizontal, vertical, and diagonal pixels, are typically analyzed. The correlation coefficient of the adjacent pixel is as shown in expression (8):
wherein N is randomly extracted as adjacent pixels, x, from the gray pixel value matrix of the imageiAnd yiIs the pixel value of a certain pair of neighboring pixels. The experiment randomly abstracts 1000 to analyze the pixel values. The analytical results are shown in Table 1.
TABLE 1 correlation table of adjacent pixels of original QR code and encrypted QR code
Experimental results show that the correlation coefficient of adjacent pixels of the encrypted image is reduced by orders of magnitude, which shows that the encryption method has a good encryption effect.
The invention provides an improved Lorenz and Zigzag transformation encryption method for traceability management of a power battery. Experimental analysis shows that the algorithm has a good encryption effect and can guarantee the safety of the battery information in the QR code at each stage in the full life cycle system of the power battery.
The scope of the invention is defined by the claims. Various modifications and equivalents may be made by those skilled in the art within the spirit and scope of the present invention, and such modifications and equivalents should also be considered as falling within the scope of the present invention.
Claims (5)
1. An improved Lorenz and Zigzag transformation encryption method for power battery traceability management is characterized by comprising the following steps:
s1, encoding the battery data of each life cycle of the plaintext information power battery to generate a color QR code image Q with the size of n multiplied by n0;
S2, converting the image Q0Decomposing the image into grayscale images of three channels of RGB, wherein the matrixes are R (n, n), G (n, n) and B (n, n);
s3, utilizing Matlab2018b software and an expression (2), enabling the Lorenz chaotic system to generate three chaotic sequences:
{x(k),y(k),z(k)|k=1,2...};
the expression (2) is:
wherein k is a positive integer, t is time, and x, y and z are each a seriesThe system state variables, a, b and c are system parameters, let a equal to 10,c is 28, and the system is in a chaotic state; selecting an initial value x0、y0、z0Respectively 0, 1 and 0, and is stored for standby as a Key 1;
s4, optimizing the chaotic sequence to obtain processed optimized chaotic sequences X ' (k), Y ' (k) and Z ' (k);
s5, carrying out exclusive OR operation on the optimized chaotic sequences X '(k), Y' (k) and Z '(k) and matrixes R (n, n), G (n, n) and B (n, n) according to the constructed expression (4) to obtain encryption matrixes R' (n, n), G '(n, n) and B' (n, n) containing plaintext characteristics;
wherein, i is 1,2, nxn, R (i), G (i), B (i) and B (i) respectively represent the value of the ith element in the matrix corresponding to the QR code images of the three channels, R ' (i), G ' (i) and B ' (i) respectively represent the value of the ith element in the matrix corresponding to the QR code images of the three channels after encryption, and p (i) represents the value of the ith element in the matrix corresponding to the grayscale image of the original QR code without channel separation;
s6, constructing an improved Zigzag transformation, scrambling the matrixes R ' (n, n), G ' (n, n) and B ' (n, n) respectively by using the improved Zigzag transformation to obtain a Key2 and the scrambled matrixes R "(n, n), G" (n, n) and B "(n, n), and the steps are as follows:
s61, constructing an improved Zigzag transformation;
s611, taking a matrix S with the size of m multiplied by m as an input matrix, equally dividing all matrix elements into four small blocks according to a horizontal axis and a vertical axis, if m is an odd number, carrying out boundary expansion processing on the small blocks to enable the small blocks to be even numbers, then taking each small block as a whole, and exchanging the positions of the matrix elements according to a diagonal line according to an expression (5) to obtain a symmetrical exchange matrix
The expression (5) is
Wherein,step _ r is m/2, step _ c is m/2, u is a row coordinate, and v is a vertical coordinate; s is an input matrix, and S is an input matrix,is a symmetric switching matrix;
s612, symmetrical switching matrixScrambling is performed, the element position state of which changes as expressed by expression (6), andsequentially ordering the medium elements to obtain a two-dimensional matrix
The expression (6) is:
wherein i is more than or equal to 1, j is more than or equal to m, u is a row coordinate, v is a vertical coordinate,is composed ofThe scrambled matrix;
s62, repeating the scrambling process of the step S61R times, scrambling the matrix R '(n, n) to obtain a final scrambled matrix R' (n, n);
s63, storing the scrambling times r as a Key2 for later use;
s64, repeating the step S61 r times in total, scrambling the matrix G '(n, n) to obtain a scrambled matrix G' (n, n);
s65, repeating the step S61 r times in total, scrambling the matrix B '(n, n) to obtain a scrambled matrix B' (n, n);
s7, respectively generating corresponding gray QR code images by the two-dimensional matrixes R ' (n, n), G ' (n, n) and B ' (n, n) after scrambling, merging three channels to obtain an encrypted color QR code image Q1The ciphertext information of (1);
s8, decryption process;
the decryption process is opposite to the encryption process, and the QR code image Q is obtained after decryption0By scanning the QR code image Q0Plaintext information about the battery is obtained.
2. The encryption method for improving Lorenz and Zigzag transformation for the traceability management of power batteries according to claim 1, wherein the battery data of each life cycle of the power batteries in the step S1 at least includes information of production, sale, abandonment, recovery, disassembly and reuse cycles.
3. The improved Lorenz and Zigzag encryption method for the traceability management of power batteries according to claim 1, wherein the sequence elements optimized in step S4 are all positive numbers and are between 0 and 255.
5. the encryption method for improving Lorenz and Zigzag transformation for the traceability management of power batteries according to claim 1, wherein the decryption process in step S8 comprises the following steps:
s81, encrypting QR image Q1Decomposing the image into three channels of RGB to obtain three gray QR code encrypted images, wherein the matrixes of the three QR code encrypted images are R "(n, n), G" (n, n) and B "(n, n);
s82, inputting a key2, and performing improved Zigzag inverse transformation on the R '(n, n), G' (n, n) and B '(n, n) matrixes respectively to obtain matrixes R' (n, n), G '(n, n) and B' (n, n);
s83, inputting a key1, generating and optimizing chaotic sequences X ' (k), Y ' (k) and Z ' (k) by a matrix R ' (n, n), G ' (n, n) and a Lorenz system, bitwise XOR-reducing the matrix R (n, n), G (n, n) and B (n, n) according to the rule of an expression (7), and recovering an original QR code Q after combining three channels0;
S84, scanning QR code image Q0Plaintext information about the battery is obtained.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010910111.1A CN112116048B (en) | 2020-09-02 | 2020-09-02 | Improved Lorenz and Zigzag transformation encryption method for power battery traceability management |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010910111.1A CN112116048B (en) | 2020-09-02 | 2020-09-02 | Improved Lorenz and Zigzag transformation encryption method for power battery traceability management |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112116048A CN112116048A (en) | 2020-12-22 |
CN112116048B true CN112116048B (en) | 2021-08-31 |
Family
ID=73805491
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010910111.1A Active CN112116048B (en) | 2020-09-02 | 2020-09-02 | Improved Lorenz and Zigzag transformation encryption method for power battery traceability management |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112116048B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101417679B1 (en) * | 2013-10-23 | 2014-07-09 | 주식회사 지엠에스 | VSDT device for detecting lane Violation and Communication fee Payment method using the same |
CN104635204A (en) * | 2015-01-22 | 2015-05-20 | 燕山大学 | Signal source positioning method of Duffing-Lorenz-based chaotic system |
CN107610034A (en) * | 2017-09-06 | 2018-01-19 | 贵州航天计量测试技术研究所 | Image encryption method based on chaos system and the reversible cellular automaton of two dimension |
CN109472338A (en) * | 2018-11-19 | 2019-03-15 | 南通大学 | A kind of Mass production method of commodity anti-counterfeit two-dimensional bar code |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030138742A1 (en) * | 2000-04-11 | 2003-07-24 | Nikon Corporation | Exposure method and exposure apparatus |
-
2020
- 2020-09-02 CN CN202010910111.1A patent/CN112116048B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101417679B1 (en) * | 2013-10-23 | 2014-07-09 | 주식회사 지엠에스 | VSDT device for detecting lane Violation and Communication fee Payment method using the same |
CN104635204A (en) * | 2015-01-22 | 2015-05-20 | 燕山大学 | Signal source positioning method of Duffing-Lorenz-based chaotic system |
CN107610034A (en) * | 2017-09-06 | 2018-01-19 | 贵州航天计量测试技术研究所 | Image encryption method based on chaos system and the reversible cellular automaton of two dimension |
CN109472338A (en) * | 2018-11-19 | 2019-03-15 | 南通大学 | A kind of Mass production method of commodity anti-counterfeit two-dimensional bar code |
Non-Patent Citations (1)
Title |
---|
色散媒质中的理想匹配层吸收边界及其误差分析;陈明阳等;《光学学报》;20020417;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN112116048A (en) | 2020-12-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Gao et al. | EFR-CSTP: Encryption for face recognition based on the chaos and semi-tensor product theory | |
Sheela et al. | Image encryption based on modified Henon map using hybrid chaotic shift transform | |
Kumar et al. | A 2D logistic map and Lorenz-Rossler chaotic system based RGB image encryption approach | |
Li et al. | Fractional-order 4D hyperchaotic memristive system and application in color image encryption | |
Gong et al. | Quantum image encryption algorithm based on quantum image XOR operations | |
CN106023051B (en) | DNA image encryption method and system based on cloud model and hyperchaotic system | |
CN101706947B (en) | Image fusion encryption method based on DNA sequences and multiple chaotic mappings | |
Yousif et al. | A new image encryption based on bit replacing, chaos and DNA coding techniques | |
Zhang et al. | On the security of symmetric ciphers based on DNA coding | |
Wang et al. | Chaotic image encryption algorithm based on block theory and reversible mixed cellular automata | |
Amani et al. | A new approach in adaptive encryption algorithm for color images based on DNA sequence operation and hyper-chaotic system | |
CN106713274A (en) | Method and device for generating two-dimensional code based on text compression and method and device for reading two-dimensional code based on text compression | |
CN111262684A (en) | Power battery traceability management coding encryption method based on improved AES algorithm | |
CN105046634A (en) | Image encryption method based on information entropy and a spatiotemporal chaotic system | |
Abusukhon et al. | New direction of cryptography: A review on text-to-image encryption algorithms based on RGB color value | |
Wang et al. | I mage encryption scheme based on Chaos and DNA plane operations | |
CN113691362B (en) | Bit plane image compression encryption method based on hyperchaotic system and DNA coding | |
Asl et al. | Scale invariant digital color image encryption using a 3D modular chaotic map | |
Wang et al. | An efficient batch images encryption method based on DNA encoding and PWLCM | |
Movafegh Ghadirli et al. | Color image DNA encryption using mRNA properties and non-adjacent coupled map lattices | |
Shi et al. | A novel memristor-based chaotic image encryption algorithm with Hash process and S-box | |
Zhou | A quantum image encryption method based on DNACNot | |
Song et al. | Multi-image reorganization encryption based on SLF cascade chaos and bit scrambling | |
Salman et al. | Color image encryption depend on DNA operation and chaotic system | |
Chong et al. | Block color image encryption algorithm based on elementary cellular automata and DNA sequence operations |
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 |