Block cipher anti-quantum encryption method and terminal

By performing linear and nonlinear transformation of the packet cipher key and performing key expansion, the problem of packet cipher's security is damaged when facing quantum computing threats is solved, and the anti-quantum improvement of packet cipher is achieved, and the encryption security of data transmission is improved.

CN119652495APending Publication Date: 2025-03-18CHINESE PEOPLES LIBERATION ARMY UNIT 32057
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411747666.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

When the current packet cryptography algorithm faces the threat of quantum computing, its security is affected and it is difficult to effectively resist the attacks of quantum computers.

Method used

By obtaining the quantum resistance level, using the key transformation rules to perform linear and nonlinear transformation on the first key, obtain the second key, and obtain the third key through key expansion, use the third key to encrypt the packet cipher wheel function, and output the encrypted ciphertext.

Benefits of technology

By increasing the key length, the encryption security of packet passwords can be improved, and the attacks of quantum computers can be effectively resisted and the security of data transmission is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119652495A_ABST
    Figure CN119652495A_ABST
Patent Text Reader

Abstract

The invention discloses a block cipher anti-quantum encryption method and a terminal, and the method comprises the steps: carrying out the linear transformation and nonlinear transformation of a first key according to an anti-quantum level through employing a key transformation rule, so as to obtain a second key with an extended length; and performing key expansion on the second key to obtain a third key, encrypting the to-be-transmitted data plaintext by using the third key and a block cipher round function, and outputting an encrypted ciphertext. In this way, anti-quantum improvement is carried out on the block cipher in a key length increasing mode, and the encryption safety of using the block cipher during data transmission can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data encryption, and in particular to a block cipher quantum-resistant encryption method and terminal. Background Art

[0002] At present, the impact of quantum computing on cryptographic algorithms is mainly reflected in the superior attack on public key cryptographic algorithms based on the mathematical problem of large number decomposition, represented by Shor's algorithm. The impact of quantum computing on block cipher algorithms is mainly reflected in quantum search algorithms, represented by Grover's algorithm, which reduces the time complexity of cryptographic algorithm analysis to the square root N of the traditional analysis algorithm by increasing the search speed, where N is the time complexity of the traditional analysis algorithm.

[0003] Therefore, the current quantum computing algorithms and quantum computer engineering implementation capabilities are not sufficient to break mainstream block cipher algorithms represented by AES, SM4, etc. However, with the improvement of quantum computing theory and quantum computer engineering implementation methods, the security of these block cipher algorithms will continue to be threatened, which in turn poses a threat to the security of data transmission. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a block cipher quantum-resistant encryption method and terminal, which can improve the encryption security of block ciphers used in data transmission.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0006] A block cipher quantum-resistant encryption method comprising the steps of:

[0007] Obtaining plaintext data to be transmitted, a first key, a key transformation rule, and a block cipher round function;

[0008] Acquire a quantum resistance level, and perform linear transformation and nonlinear transformation on the first key using the key transformation rule according to the quantum resistance level to obtain a second key;

[0009] The second key is key expanded to obtain a third key, and the third key is used to encrypt the plaintext of the data to be transmitted using the block cipher round function to output an encrypted ciphertext.

[0010] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0011] A block cipher quantum-resistant encryption terminal comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step of the block cipher quantum-resistant encryption method is implemented.

[0012] The beneficial effects of the present invention are: according to the quantum resistance level, a key transformation rule is used to perform linear transformation and nonlinear transformation on the first key to obtain a second key with an extended length; the second key is key-expanded to obtain a third key, and the third key is used to encrypt the plaintext of the data to be transmitted using a block cipher round function to output the encrypted ciphertext. In this way, the block cipher is improved in quantum resistance by increasing the key length, which can effectively improve the encryption security of the block cipher used in data transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 This is a flow chart of a block cipher quantum-resistant encryption method according to an embodiment of the present invention;

[0014] Figure 2 A schematic diagram of a block cipher quantum-resistant encryption terminal according to an embodiment of the present invention;

[0015] Figure 3 A flowchart of the specific steps of a block cipher quantum-resistant encryption method according to an embodiment of the present invention;

[0016] Description of labels:

[0017] 1. A block cipher quantum-resistant encryption terminal; 2. Memory; 3. Processor. DETAILED DESCRIPTION

[0018] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.

[0019] Please refer to Figure 1 The embodiment of the present invention provides a block cipher quantum-resistant encryption method, comprising the steps of:

[0020] Obtaining plaintext data to be transmitted, a first key, a key transformation rule, and a block cipher round function;

[0021] Acquire a quantum resistance level, and perform linear transformation and nonlinear transformation on the first key using the key transformation rule according to the quantum resistance level to obtain a second key;

[0022] The second key is key expanded to obtain a third key, and the third key is used to encrypt the plaintext of the data to be transmitted using the block cipher round function to output an encrypted ciphertext.

[0023] From the above description, it can be seen that the beneficial effects of the present invention are: according to the quantum resistance level, the first key is linearly transformed and nonlinearly transformed using the key transformation rule to obtain the second key with an extended length; the second key is key expanded to obtain the third key, and the third key is used to encrypt the plaintext of the data to be transmitted using the block cipher round function to output the encrypted ciphertext. In this way, the block cipher is quantum-resistant by increasing the key length, which can effectively improve the encryption security of the block cipher used in data transmission.

[0024] Further, performing linear transformation and nonlinear transformation on the first key using the key transformation rule according to the quantum resistance level to obtain a second key includes:

[0025] The first key is transformed:

[0026] K new =K||rk0‖…‖rk level-1 ;

[0027]

[0028]

[0029] In the formula, || represents the cascade operator, K represents the first key, level represents the quantum resistance level, and K new represents the second key, R represents the key transformation rule, T function is a function of composite linear transformation and nonlinear transformation, D j represents the fixed correction parameter of the jth word, K j represents the jth word of the first key, W j represents the key modification parameter of the jth word, and n represents the total number of words in the first key.

[0030] From the above description, it can be seen that each word in the first key is XORed with the corresponding key correction parameter, and the XOR calculation result, linear transformation, nonlinear transformation, and quantum-resistant cascade are combined to obtain the corrected second key, thereby greatly increasing the key length and improving encryption security.

[0031] Furthermore, the T function is a function of composite linear transformation and nonlinear transformation, including:

[0032] The T function is: T(x) = L(r(x));

[0033] Wherein, L function is the left-shift linear transformation function, and r function is the S-box nonlinear transformation function.

[0034] From the above description, it can be seen that the reversible transformation function T is obtained by compounding the nonlinear transformation function r and the linear transformation function L, which further improves the security of key expansion and encryption.

[0035] Further, performing key expansion on the second key to obtain a third key, and using the third key to encrypt the plaintext of the data to be transmitted using the block cipher round function, and outputting the encrypted ciphertext, including:

[0036] Calculate the encrypted ciphertext C: C = R (F (m) (P,E(K new )));

[0037] In the formula, F (m) represents the round function of the mth round, P represents the plaintext data to be transmitted, and E function represents the key expansion function.

[0038] From the above description, it can be seen that using the second key with increased length to calculate the ciphertext can achieve quantum resistance at the lowest cost without changing the basic framework of the original block cipher.

[0039] Furthermore, it also includes:

[0040] If the quantum resistance level is not obtained, K new =K, and calculate the encrypted ciphertext.

[0041] From the above description, it can be seen that without setting the quantum resistance level, the ciphertext calculation can still be performed normally, thereby improving the reliability and flexibility of data encryption.

[0042] Please refer to Figure 2 Another embodiment of the present invention provides a block cipher quantum-resistant encryption terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements each step of the above-mentioned block cipher quantum-resistant encryption method when executing the computer program.

[0043] The above-mentioned block cipher quantum-resistant encryption method and terminal of the present invention are suitable for achieving quantum resistance at a minimum cost without changing the basic framework of the original block cipher, and are described below through specific implementation methods:

[0044] Please refer to Figure 1 and Figure 3 , Embodiment 1 of the present invention is:

[0045] A block cipher quantum-resistant encryption method comprising the steps of:

[0046] S1. Obtain plaintext data to be transmitted, a first key, a key transformation rule and a block cipher round function.

[0047] In this embodiment, the plain text is assumed to be P = (P0, P1, ..., P n-1 ),in n represents the number of plain words, represents a 32-bit binary number; the first key is K = (K0, K1, ..., K n-1 ), The key transformation rule, that is, the transformation algorithm is R; the block cipher round function is F.

[0048] S2. Obtain a quantum resistance level, and perform linear transformation and nonlinear transformation on the first key according to the quantum resistance level using the key transformation rule to obtain a second key.

[0049] Specifically, first determine whether to perform quantum-resistant expansion. If quantum-resistant expansion is not required, let K new =K, and execute step S3.

[0050] If quantum-resistant expansion is required, the quantum-resistant level is obtained, and the first key is transformed:

[0051] K new =K||rk0||…||rk level-1 ;

[0052] Right now

[0053]

[0054] In the formula, || represents the cascade operator, which performs multi-word splicing; represents the XOR operator; K represents the first key; level represents the quantum resistance level; K new represents the second key; R represents the key transformation rule; T function is a function of composite linear transformation and nonlinear transformation; D j represents the fixed correction parameter of the jth word, D=(D0,D1,…,D t ), When level is obtained, t = level - 1; K j represents the jth word of the first key; W j represents the key modification parameter of the jth word, n represents the total number of words in the first key.

[0055] Wherein, the T function is: T(x)=L(r(x));

[0056] Wherein, L function is the left-shift linear transformation function, and r function is the S-box nonlinear transformation function.

[0057] In this embodiment, In the formula, <<< represents an unsigned left shift operation.

[0058] And, let the four S boxes be make:

[0059] r(x)=r(x 1,1 ,x 1,2 ,x 2,1 ,x 2,2 ,x 3,1 ,x 3,2 ,x 4,1 ,x 4,2 )

[0060] =S 1 [x 1,1 ,x 1,2 ]<<24+S 2 [x 2,1 ,x 2,2 ]<<16+S 3 [x 3,1 ,x 3,2 ]<<8+S 4 [x 4,1 ,x 4,2 ]

[0061] In the formula, << represents a left shift operation, which is to split the 32-bit input into eight 4-bit components, with each two components as the number of rows and columns of an S-box, take the value of the S-box, and finally splice them into a 32-bit output.

[0062] S3. Perform key expansion on the second key to obtain a third key, and use the third key and the block cipher round function to encrypt the plaintext of the data to be transmitted, and output the encrypted ciphertext.

[0063] Calculate the encrypted ciphertext:

[0064] C=R(F (m) (P,E(K new ))), C=(C0,C2,…,C n-1 ),

[0065] In the formula, C represents the encrypted ciphertext, F (m) represents the round function of the mth round, P represents the plaintext data to be transmitted, and E function represents the key expansion function.

[0066] Using the encryption method of this embodiment, if the quantum computer has 2 64 If the search capability is insufficient, the block cipher algorithm with a key length of 128 bits will no longer be secure. At this time, you can choose quantum resistance extension, set the quantum resistance level to 1, and increase the key length to 256 bits.

[0067] Please refer to Figure 2 , Embodiment 2 of the present invention is:

[0068] A block cipher quantum-resistant encryption terminal 1 includes a memory 2, a processor 3, and a computer program stored in the memory 2 and executable on the processor 3. When the processor 3 executes the computer program, each step of a block cipher quantum-resistant encryption method of embodiment 1 is implemented.

[0069] In summary, the invention provides a block cipher quantum-resistant encryption method and terminal, which can use the key transformation rule to perform a left-shift linear transformation and an S-box nonlinear transformation on the first key according to the obtained quantum-resistant level to obtain a second key of an extended length; perform key expansion on the second key to obtain a third key, and use the third key to use the block cipher round function to encrypt the plaintext of the data to be transmitted, and then transform the encryption result to output the encrypted ciphertext. In this way, the block cipher is improved in quantum resistance by increasing the key length, which can effectively improve the encryption security of the block cipher used in data transmission.

[0070] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A block cipher quantum-resistant encryption method, characterized in that: Includes steps: Obtaining plaintext data to be transmitted, a first key, a key transformation rule, and a block cipher round function; Acquire a quantum resistance level, and perform linear transformation and nonlinear transformation on the first key using the key transformation rule according to the quantum resistance level to obtain a second key; The second key is key expanded to obtain a third key, and the third key is used to encrypt the plaintext of the data to be transmitted using the block cipher round function to output an encrypted ciphertext.

2. A block cipher quantum-resistant encryption method according to claim 1, characterized in that: According to the quantum resistance level, the first key is linearly transformed and nonlinearly transformed using the key transformation rule to obtain a second key, including: The first key is transformed: K new =K||rk0||…||rk level-1 ; In the formula, || represents the cascade operator, K represents the first key, level represents the quantum resistance level, and K new represents the second key, R represents the key transformation rule, T function is a function of composite linear transformation and nonlinear transformation, D j represents the fixed correction parameter of the jth word, K j represents the jth word of the first key, W j represents the key modification parameter of the jth word, and n represents the total number of words in the first key.

3. A block cipher quantum-resistant encryption method according to claim 2, characterized in that: The T function is a function of composite linear transformation and nonlinear transformation, including: The T function is: T(x) = L(r(x)); Wherein, L function is the left-shift linear transformation function, and r function is the S-box nonlinear transformation function.

4. A block cipher quantum-resistant encryption method according to claim 2, characterized in that: The second key is key expanded to obtain a third key, and the third key is used to encrypt the plaintext of the data to be transmitted using the block cipher round function to output the encrypted ciphertext, including: Calculate the encrypted ciphertext C: C = R (F (m) (P,E(K new ))); In the formula, F (m) represents the round function of the mth round, P represents the plaintext data to be transmitted, and E function represents the key expansion function.

5. A block cipher quantum-resistant encryption method according to claim 4, characterized in that: Also includes: If the quantum resistance level is not obtained, K new =K, and calculate the encrypted ciphertext.

6. A block cipher quantum-resistant encryption terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the following steps are implemented: Obtaining plaintext data to be transmitted, a first key, a key transformation rule, and a block cipher round function; Acquire a quantum resistance level, and perform linear transformation and nonlinear transformation on the first key using the key transformation rule according to the quantum resistance level to obtain a second key; The second key is key expanded to obtain a third key, and the third key is used to encrypt the plaintext of the data to be transmitted using the block cipher round function to output an encrypted ciphertext.

7. A block cipher quantum-resistant encryption terminal according to claim 6, characterized in that: According to the quantum resistance level, the first key is linearly transformed and nonlinearly transformed using the key transformation rule to obtain a second key, including: The first key is transformed: K new =K||rk0||…||rk level-1 ; In the formula, || represents the cascade operator, K represents the first key, level represents the quantum resistance level, and K new represents the second key, R represents the key transformation rule, T function is a function of composite linear transformation and nonlinear transformation, D j represents the fixed correction parameter of the jth word, K j represents the jth word of the first key, W j represents the key modification parameter of the jth word, and n represents the total number of words in the first key.

8. A block cipher quantum-resistant encryption terminal according to claim 7, characterized in that: The T function is a function of composite linear transformation and nonlinear transformation, including: The T function is: T(x) = L(r(x)); Wherein, L function is the left-shift linear transformation function, and r function is the S-box nonlinear transformation function.

9. A block cipher quantum-resistant encryption terminal according to claim 7, characterized in that: The second key is key expanded to obtain a third key, and the third key is used to encrypt the plaintext of the data to be transmitted using the block cipher round function to output the encrypted ciphertext, including: Calculate the encrypted ciphertext C: C = R (F (m) (P,E(K new ))); In the formula, F (m) represents the round function of the mth round, P represents the plaintext data to be transmitted, and E function represents the key expansion function.

10. A block cipher quantum-resistant encryption terminal according to claim 9, characterized in that: Also includes: If the quantum resistance level is not obtained, K new =K, and calculate the encrypted ciphertext.