Information encryption method based on two-dimensional code and fractional order Logistic chaotic system
By combining the information encryption method of QR code and fractional-order Logistic chaotic system, the problems of high computing resources and slow encryption speed in the prior art are solved, and an efficient and secure information encryption and decryption process is realized.
Patent Information
- Application Number
- CN202410807395.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-11-01
AI Technical Summary
The existing information encryption technology has high computing resources, slow encryption speed and cannot guarantee the security of information.
Using the information encryption method based on QR code and fractional-order Logistic chaotic system, the key sequence is constructed by reading information, generating key hash values, and using QR code technology and one-dimensional fractional-order Logistic chaotic system to confuse images and XOR operation implement encryption.
It realizes efficient encryption and decryption of information, saves computing resources, improves encryption speed and security, and has anti-attack capabilities.
Smart Images

Figure CN118890137A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of information security and information steganography, in particular to an information encryption method based on a two-dimensional code and a fractional-order Logistic chaotic system. Background Art
[0002] The importance of information encryption in modern society cannot be underestimated. It not only protects personal privacy, but also commercial secrets and national security. As the digitalization process advances, information encryption technology will continue to develop to cope with ever-changing security threats. This technology is widely used in the fields of digital copyright protection, data integrity verification, secure communication and privacy protection. Existing technologies require high computing resources, slow encryption speed, and cannot guarantee the security of information. Summary of the invention
[0003] In view of this, the purpose of the present invention is to provide an information encryption method based on a two-dimensional code and a fractional-order Logistic chaotic system. Neither the two-dimensional code conversion of the information nor the encryption process of the information requires modification of the basic hardware module, and the information encryption and decryption efficiency is high, the speed is fast, and the security is good.
[0004] To achieve the above object, the present invention adopts the following technical solution: an information encryption method based on a two-dimensional code and a fractional-order logistic chaotic system, comprising the following steps:
[0005] Step 1: Read the information T to be encrypted, import Python's hashlib library, and call the HASH function in it; act on the information T to obtain the key hash value H of the information T;
[0006] Step 2: Import the qrcode library in Python and create a QRCode object;
[0007] Step 3: Add information T to the QRCode object to generate a QR code image P M×N , where M×N is the size of the QR code image;
[0008] Step 4: Call the HASH function on the QR code image P M×N On the top, obtain the two-dimensional code image P M×N The length of the key bit stream B=k is 128 0 k 1 k 2 ....k 126 k 127 ,k i =0 or 1, i=0,1,2,…,127;
[0009] Step 5: Define lists L01 = [0, 1, 2, ..., M], L02 = [0, 1, 2, ..., N], then use the hash value H of information T as the random seed, and use the scrambling function shuffle in the random library to scramble lists L01 and L02 respectively, so as to obtain random sequences L1 and L2;
[0010] Step 6: One-dimensional fractional-order Logistic chaotic system key construction;
[0011] Step 7: Chaotic sequence S is generated;
[0012] Step 8: Scramble the rows and columns of the QR code; use the random sequences L1 and L2 from step 5 to scramble the QR code image P M×N Perform the following row and column scrambling and generate the scrambled image C1:
[0013] C1[i,:]=P[L1[i],:] (Note: replace the pixels in the i-th row of P with the elements in the L1[i]-th row of P, i=1,2,…,M),
[0014] C1[:,j]=P[,:L2[j]] (Explanation: replace the j-th row pixel of P with the L2[j]-th row element of P, i=1,2,…,N);
[0015] Step 9: Image encryption: Perform an XOR operation on the scrambled image C1 and the chaotic sequence S, and finally obtain the encrypted ciphertext image C.
[0016] In a preferred embodiment, in step 6, a fractional-order logistic chaotic system is set:
[0017] The initial parameter value is μ 01 ,α 01 ,r 01 ,x 01 ; where x n , x n+1 Represent the values of the nth and n+1th iterations respectively, μ is the system parameter, which determines the dynamic behavior of the fractional-order Logistic chaotic system, α∈(n,n+1) represents the fractional order of the fractional-order chaotic system, Γ(α+1) represents the factorial of the fraction α+1, r∈(0,1); at the same time, 4 groups of continuous bit streams of length 8 are randomly selected from B And convert it into a decimal integer, and then combine it with the initial parameter value of the system to construct the initial key μ of the encryption system 02 ,α 02 ,r 02 ,x 02 , its construction method is as follows:
[0018]
[0019] Here 1 ,t 2 ,t 3 ,t 4 are all positive integers and t 1 ,t 2 ,t 3 ,t 4 ∈[0,120].
[0020] In a preferred embodiment, in step 7, the initial parameter μ 02 ,α 02 ,r 02 ,x 02 Substitute into the one-dimensional fractional-order Logistic chaotic system:
[0021]
[0022] A chaotic sequence S0 is generated by iterating 500+M*N times, the first 500 data of the chaotic sequence are deleted to eliminate the initial state response, and then the first 10 valid digits of each value are taken out, and a chaotic sequence S with a length of M×N composed of integers between 0 and 255 is obtained through modulo 256 operation.
[0023] Compared with the prior art, the present invention has the following beneficial effects:
[0024] 1. The present invention can realize three functions of two-dimensional code conversion, two-dimensional code encryption and decryption of text information.
[0025] 2. The present invention applies the HASH function to the plaintext information T to be encrypted and its two-dimensional code image, and uses the HASH value of the plaintext information T and the HASH value of its two-dimensional code to construct the random sequence and the key parameter of the encryption system S. Therefore, the information encryption scheme proposed by the present invention has a strong sensitivity to the original information, and the HASH values corresponding to different information and two-dimensional codes are completely different, which can effectively resist attacks from known sensitive information or plaintext two-dimensional codes.
[0026] 3. The present invention uses two-dimensional code technology to encrypt and decrypt text information.
[0027] 4. The chaotic system used in the present invention is a one-dimensional fractional-order Logistic chaotic system, which has low dimension, fast operation speed, high encryption operation efficiency, saves computing resources, and is a lightweight encryption system.
[0028] 5. The chaotic system used in the present invention is a one-dimensional fractional-order logistic chaotic system. Compared with the traditional one-dimensional logistic chaotic mapping, the chaotic system used in the present invention not only retains the characteristics of the low-dimensional chaotic system, low dimension, and fast calculation speed, but also has more key parameters, a large key space, higher system security, and strong anti-attack ability. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a flow chart of plain text information two-dimensional code conversion and encryption according to a preferred embodiment of the present invention.
[0030] Figure 2 It is a decryption and information extraction flow chart of a preferred embodiment of the present invention.
[0031] Figure 3 It is the plain text information, two-dimensional code and cipher text image of the preferred embodiment of the present invention, wherein (a) is the plain text information; (b) is the cipher text image. DETAILED DESCRIPTION
[0032] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0033] It should be noted that the following detailed descriptions are illustrative and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.
[0034] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application; as used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or their combinations.
[0035] Information encryption algorithm based on QR code and fractional-order Logistic chaotic system, reference Figure 1-3 , including the following steps:
[0036] Step 1: Read the information T to be encrypted, import Python's hashlib library, and call the HASH function in it to act on the information T to obtain the key hash value H of the information T.
[0037] Step 2: Import the qrcode library in Python and create a QRCode object.
[0038] Step 3: Add information T to the QRCode object to generate a QR code image P M×N, where M×N is the size of the QR code image.
[0039] Step 4: Call the HASH function on the QR code image P M×N On the top, obtain the two-dimensional code image P M×N The length of the key bit stream B=k is 128 0 k 1 k 2 ....k 126 k 127 ,k i =0 or 1 (i=0,1,2,…,127).
[0040] Step 5: Define lists L01 = [0, 1, 2, …, M], L02 = [0, 1, 2, …, N], then use the hash value H of information T as the random seed, and use the scrambling function shuffle in the random library to scramble lists L01 and L02 respectively, so as to obtain random sequences L1 and L2.
[0041] Step 6: One-dimensional fractional-order Logistic chaotic system key construction. Set up the fractional-order Logistic chaotic system:
[0042]
[0043] The initial parameter value is μ 01 ,α 01 ,r 01 ,x 01 Among them, x n , x n+1 Represent the values of the nth and n+1th iterations respectively, μ is the system parameter, which determines the dynamic behavior of the fractional-order Logistic chaotic system, α∈(n,n+1) represents the fractional order of the fractional-order chaotic system, Γ(α+1) represents the factorial of the fraction α+1, r∈(0,1); at the same time, 4 groups of continuous bit streams of length 8 are randomly selected from B And convert it into a decimal integer, and then combine it with the initial parameter value of the system to construct the initial key μ of the encryption system 02 ,α 02 ,r 02 ,x 02 , its construction method is as follows:
[0044]
[0045] Here 1 ,t 2 ,t 3 ,t 4 are all positive integers and t 1 ,t 2 ,t3 ,t 4 ∈[0,120].
[0046] Step 7: Generate the chaotic sequence S. Set the initial parameter μ 02 ,α 02 ,r 02 ,x 02 Substitute into the one-dimensional fractional-order Logistic chaotic system:
[0047]
[0048] A chaotic sequence S0 is generated by iterating 500+M*N times, the first 500 data of the chaotic sequence are deleted to eliminate the initial state response, and then the first 10 valid digits of each value are taken out. Through modulo 256 operation, a chaotic sequence S with a length of M×N composed of integers between 0-255 is obtained.
[0049] Step 8: Scramble the rows and columns of the QR code. Use the random sequences L1 and L2 from step 5 to scramble the QR code image P M×N Perform the following row and column scrambling and generate the scrambled image C1:
[0050] C1[i,:]=P[L1[i],:] (Note: replace the pixels in the i-th row of P with the elements in the L1[i]-th row of P, i=1,2,…,M),
[0051] C1[:,j]=P[,:L2[j]] (Note: replace the pixels in the jth row of P with the elements in the L2[j]th row of P, i=1,2,…,N).
[0052] Step 9: Image encryption. The scrambled image C1 is XORed with the chaotic sequence S, and finally the encrypted ciphertext image C is obtained. At this point, the information encryption algorithm based on the two-dimensional code and the fractional-order Logistic chaotic system proposed by the present invention is completed.
[0053] From the above steps, it can be seen that the present invention uses the two-dimensional code technology to convert information into a two-dimensional code. In the encryption link, the fractional-order Logistic chaotic system is used to achieve encryption. The chaotic system has more key parameters, a large range of key parameter values, strong anti-attack ability, and high encryption security. With the use of two-dimensional code technology, whether it is text information or audio and video information, it can be converted into a two-dimensional code first to achieve efficient and secure encryption. Therefore, the information encryption algorithm proposed in the present invention is not only highly secure but also has a wide range of applications.
Claims
1. An information encryption method based on a two-dimensional code and a fractional-order logistic chaotic system, characterized in that: The following steps are involved: Step 1: Read the information T to be encrypted, import Python's hashlib library, and call the HASH function in it; act on the information T to obtain the key hash value H of the information T; Step 2: Import the qrcode library in Python and create a QRCode object; Step 3: Add information T to the QRCode object to generate a QR code image P M×N , where M×N is the size of the QR code image; Step 4: Call the HASH function on the QR code image P M×N On the top, obtain the two-dimensional code image P M×N The length of the key bit stream is 128 B = k0 k1 k2....k 126 k 127 ,k i =0 or 1, i=0,1,2,…,127; Step 5: Define lists L01 = [0, 1, 2, ..., M], L02 = [0, 1, 2, ..., N], then use the hash value H of information T as the random seed, and use the scrambling function shuffle in the random library to scramble lists L01 and L02 respectively, so as to obtain random sequences L1 and L2; Step 6: One-dimensional fractional-order Logistic chaotic system key construction; Step 7: Chaotic sequence S is generated; Step 8: Scramble the rows and columns of the QR code; use the random sequences L1 and L2 from step 5 to scramble the QR code image P M×N Perform the following row and column scrambling and generate the scrambled image C1: C1[i,:]=P[L1[i],:] (Note: replace the pixels in the i-th row of P with the elements in the L1[i]-th row of P, i=1,2,…,M), C1[:,j]=P[:,L2[j]] (Note: replace the j-th row pixel of P with the L2[j]-th row element of P, i=1,2,…,N); Step 9: Image encryption: Perform an XOR operation on the scrambled image C1 and the chaotic sequence S, and finally obtain the encrypted ciphertext image C.
2. The information encryption method based on two-dimensional code and fractional-order logistic chaotic system according to claim 1 is characterized in that: In step 6, set up the fractional-order Logistic chaotic system: The initial parameter value is μ 01 ,α 01 ,r 01 ,x 01 ; where x n , x n+1 Represent the values of the nth and n+1th iterations respectively, μ is the system parameter, which determines the dynamic behavior of the fractional-order Logistic chaotic system, α∈(n,n+1) represents the fractional order of the fractional-order chaotic system, Γ(α+1) represents the factorial of the fraction α+1, r∈(0,1); at the same time, 4 groups of continuous bit streams of length 8 are randomly selected from B And convert it into a decimal integer, and then combine it with the initial parameter value of the system to construct the initial key μ of the encryption system 02 ,α 02 ,r 02 ,x 02 , its construction method is as follows: Here t1, t2, t3, t4 are all positive integers and t1, t2, t3, t4∈[0,120].
3. The information encryption method based on two-dimensional code and fractional-order logistic chaotic system according to claim 2 is characterized in that: In step 7, the initial parameter μ 02 ,α 02 ,r 02 ,x 02 Substitute into the one-dimensional fractional-order Logistic chaotic system: A chaotic sequence S0 is generated by iterating 500+M*N times, the first 500 data of the chaotic sequence are deleted to eliminate the initial state response, and then the first 10 valid digits of each value are taken out, and a chaotic sequence S with a length of M×N composed of integers between 0 and 255 is obtained through modulo 256 operation.
