A general fast key expansion method

By performing XOR, shift, and S-box transformation operations on the 256-bit encryption key, a 128-bit round key is generated, which solves the problems of slow key expansion speed and insufficient balance in the existing technology and achieves higher key expansion speed and randomness.

CN114640437BActive Publication Date: 2025-09-30WUXI ALEADER INTELLIGENT TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210126823.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-11
Publication Date
2025-09-30
Estimated Expiration
2042-02-11

AI Technical Summary

Technical Problem

In the prior art, 256-bit encryption keys have low balance and randomness, high correlation between keys, and slow key expansion speed.

Method used

The 256-bit encryption key is subjected to XOR, shift and S-box transformation operations in an iterative manner to generate a 128-bit round key, and the extended key is generated by bit-by-bit XOR, shift and concatenation operations.

Benefits of technology

Improves the balance and randomness of the expanded key, reduces the correlation between keys, and speeds up key expansion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114640437B_ABST
    Figure CN114640437B_ABST
Patent Text Reader

Abstract

The present invention provides a universal fast key expansion method. The method is a universal key expansion method for an encryption key length of 256 bits and a round key length of 128 bits. The input encryption key is expanded through a predetermined number of rounds to generate an output key, namely a round key. The input encryption key of the first round is divided into two consecutive left and right key fragments, each of which is 128 bits in length. The two key fragments are subjected to a bit-by-bit exclusive OR and then a first transformation. The output 128-bit data is then subjected to a second transformation to obtain the output round key of the first round. Starting from the second round, the output round key of the previous round is fed back into NK, and then the output round key of the current round is obtained after the first and second transformations. Through the present invention, the overall balance and randomness of the expanded key are improved, the correlation between keys is reduced, and the speed of generating the expanded key is faster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cryptography, and in particular to a universal fast key expansion method. Background Art

[0002] Block ciphers are the mainstream encryption algorithms for long data, and key expansion algorithms are a crucial component of these algorithms. Given the rapid growth of computer computing power, 256 bits will remain the preferred encryption key length for most block ciphers for a long time to come. Summary of the Invention

[0003] The present invention provides a universal fast key expansion method to solve the problems in the prior art of low balance and randomness for a 256-bit encryption key, high correlation between keys and slow speed of generating an expanded key.

[0004] To solve the above technical problems, the present invention provides a universal key expansion fast method, which is a universal key expansion method with an encryption key length of 256 bits and a round key length of 128 bits. The input encryption key is expanded for a predetermined number of rounds to generate an output key, i.e., a round key; the input encryption key of the first round is divided into two consecutive left and right key fragments, each of which is 128 bits in length. The two key fragments are subjected to a bit-by-bit XOR and then a first transformation is performed. The output 128-bit data is then subjected to a second transformation to obtain the output round key of the first round. Starting from the second round, the output round key of the previous round is fed back to NK, and then the output round key of the current round is obtained after the first and second transformations.

[0005] The input encryption key of the first round is 256 bits.

[0006] The first transformation includes performing a bit-by-bit XOR operation on NK by sequentially connecting the first 16 bytes of data in the AES standard S-box table to obtain the data.

[0007] The data obtained by sequentially connecting the first 16 bytes of data in the AES standard S-box table is 128 bits.

[0008] The second transformation includes dividing the data obtained after the first transformation into two data segments, a left segment and a right segment, each of which is 64 bits in length, and then performing bit-by-bit XOR, shift and concatenation operations on the two data segments in sequence.

[0009] The second transformation includes an Rcon[n] operation, where n is the number of bits of the offset.

[0010] The beneficial effects brought by the present invention are as follows: the universal fast key expansion method of the present invention obtains the extended key by performing XOR, shift and S-box operations on the 128-bit key in each round, so that the overall balance and randomness of the extended key are higher, and the correlation between the keys is lower, and the speed of generating the extended key is faster. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 1 is a block diagram of iterative generation of round keys of a general fast key expansion method according to an embodiment of the present invention;

[0012] Figure 2 NK initialization block diagram of a general key expansion fast method according to an embodiment of the present invention; DETAILED DESCRIPTION

[0013] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0014] This fast key expansion method takes as input a 256-bit encryption key from a cryptographic algorithm and uses an iterative approach to output a 128-bit round key with a predetermined number of rounds, L. Therefore, the total length of the round key is 128 × L.

[0015] like Figure 1-2 As shown in the figure, a general fast key expansion method is implemented as follows:

[0016] Step 1: NK initialization: Figure 2 , output key CK = 0, divide the 256-bit encryption key into two parts, left and right, each with a length of 128 bits, which can be expressed as LK and RK. Perform bit-by-bit XOR operation on LK and RK, and the result is expressed as NK, then

[0017]

[0018] Step 2: If Figure 1 , the data (128 bits) obtained by sequentially connecting the first 16 bytes of data in the AES standard S-box table is subjected to bit-by-bit XOR operation with NK. The result of the operation is expressed as SK, then

[0019]

[0020] Step 3: Divide SK into two consecutive 64-bit left and right parts, denoted as LSK and RSK, and perform the following operations:

[0021]

[0022] RSK>>>Rcon

[32] ;

[0023]

[0024] Step 4: Connect the left and right parts of the data after completing the calculation in step 3 to obtain the 128-bit current round output key CK i , i≥0, i represents the round number;

[0025] Step 5: Set NK = CK i , that is, update NK to the output round key CK of the previous round i , i increases by 1. Repeat steps 2 to 4 until the value of i equals the preset number of rounds and then exits the loop.

[0026] Step 1 is NK initialization, such as Figure 2 As shown; Steps 2 to 5 are the steps for iteratively generating round keys in this method, as shown Figure 1 As shown in the figure, the operator symbol is the exclusive OR operation, and the operator symbol ‖ is the connection operation.

[0027] The present invention implements encryption key expansion for 256-bit encryption keys using only operations such as XOR, shift, and S-box transformation. In addition to exhibiting excellent randomness, such as excellent balance, this key expansion method also reduces correlation between round keys, resulting in faster key expansion. Depending on the requirements of the encryption algorithm, this key expansion method can generate round keys of arbitrary length. Therefore, this method is a universal key expansion method applicable to encryption keys with a length of 256 bits and round keys with a length of 128 bits.

[0028] In summary, the universal fast key expansion method of the present invention obtains the extended key by performing XOR, shift and S-box operations on the 128-bit key in each round, so that the overall balance and randomness of the extended key are higher, the correlation between the keys is lower, and the speed of generating the extended key is faster.

[0029] The foregoing description is merely an embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of the claims.

Claims

1. A general fast key expansion method, characterized by: The fast key expansion method is a universal key expansion method with an encryption key length of 256 bits and a round key length of 128 bits. The input encryption key is expanded through a predetermined number of rounds to generate an output key, namely a round key. The input encryption key of the first round is divided into two consecutive left and right key fragments, each of which is 128 bits in length. The two key fragments are subjected to a bit-by-bit XOR to obtain NK. NK is subjected to a first transformation, and the output 128-bit data is then subjected to a second transformation to obtain the output round key of the first round. Starting from the second round, the output round key of the previous round is fed back into NK, and then the output round key of the current round is obtained after the first and second transformations. The first transformation includes performing a bit-by-bit XOR operation on NK by sequentially concatenating the first 16 bytes of data in the AES standard S-box table; The second transformation includes dividing the data obtained after the first transformation into two data segments, a left segment and a right segment, each of which is 64 bits in length, and then performing bit-by-bit XOR, shift and concatenation operations on the two data segments in sequence.

2. The universal fast key expansion method according to claim 1, wherein: The input encryption key of the first round is 256 bits.

3. The universal fast key expansion method according to claim 1, wherein: The data obtained by sequentially connecting the first 16 bytes of data in the AES standard S-box table is 128 bits.

4. The universal fast key expansion method according to claim 1, wherein: The second transformation includes an Rcon[n] operation, where n is the number of bits of the offset.