Lightweight encryption method and device based on ARX module
By combining the ARX module with the Feistel design and using LFSR to generate subkey sequences, efficient encryption on resource-constrained devices is achieved. This solves the security and compatibility issues of existing lightweight encryption methods and provides strong anti-attack capabilities and data transmission security.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NO 15 INST OF CHINA ELECTRONICS TECH GRP
- Filing Date
- 2025-07-16
- Publication Date
- 2026-05-08
AI Technical Summary
Existing lightweight encryption methods are insufficiently secure in resource-constrained scenarios, have weak resistance to attacks, and lack standardization compatibility, making it difficult to provide efficient and secure data encryption in IoT, wireless sensor networks, and mobile applications.
The system employs an ARX module and a classic Feistel design, combined with a linear feedback shift register (LFSR) to generate a subkey sequence. It uses 32 rounds of encryption and decryption operations, utilizing cyclic shift, carry addition, and XOR operations to achieve the encryption and decryption process, and employs nonlinear transformation and round function processing.
It enables efficient encryption on resource-constrained devices, possesses strong resistance to differential and linear analysis, provides data transmission security, meets NIST security standards, and is suitable for IoT, wireless sensor networks, and mobile applications.
Smart Images

Figure CN120880640B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer encryption technology, and specifically to a lightweight encryption method and apparatus based on an ARX module. Background Technology
[0002] Lightweight encryption methods are needed in scenarios such as the Internet of Things (IoT), wireless sensor networks, and mobile application security to achieve high efficiency, high security, and low cost. Compared with traditional encryption methods, lightweight encryption methods have advantages such as simple computation, low storage consumption, and efficient operation on low-power, low-memory devices. Therefore, lightweight encryption methods have become one of the hot topics in cryptography research in recent years. However, many existing lightweight encryption methods still have shortcomings such as insufficient security redundancy, weak resistance to attacks, and poor standardization compatibility. Therefore, there is an urgent need to design new lightweight encryption methods that can be implemented efficiently in resource-constrained scenarios while also ensuring security. The ARX module has good security performance, and this invention designs a new lightweight encryption method based on this module and combined with the classic Feistel module. Summary of the Invention
[0003] In view of this, the present invention provides a lightweight encryption method and apparatus based on an ARX module, which can solve the above-mentioned technical problems.
[0004] To solve the above-mentioned technical problems, the present invention is implemented as follows.
[0005] A lightweight encryption method based on an ARX module includes:
[0006] Step S1: Obtain the 256-bit master key from the key storage area and store the master key in the linear feedback shift register (LFSR); the LFSR advances for four beats as one round and generates a subkey. Each time the LFSR advances for one beat, one-quarter of the subkey corresponding to that round is generated based on the current state value of the LFSR and the current round constant, and the current state value of the LFSR is updated; the 32 subkeys generated in sequence are combined into a subkey sequence.
[0007] Step S2: Obtain the plaintext to be encrypted, divide the plaintext into groups, each group including 128 bits; perform 32 rounds of encryption on each group of plaintext based on the subkey sequence, and use the current encryption result after the 32nd round of encryption as the encrypted ciphertext of the group of plaintext; merge the encrypted ciphertexts of each group of plaintext to obtain the overall encrypted ciphertext corresponding to the plaintext to be encrypted.
[0008] Each round of encryption includes:
[0009] Get the current encryption result of this set of plaintext;
[0010] Obtain the first subkey in the subkey sequence that has not yet been used to encrypt the plaintext; encrypt the current encryption result based on this subkey, and use the encrypted result as the current encryption result for the plaintext.
[0011] Step S3: The decryptor obtains the entire encrypted ciphertext, divides it into groups of 128 bits each, and performs decryption on each group based on the subkey sequence.
[0012] Preferably, in step S1, four beats of LFSR progression are recorded as one round and a subkey is generated. Specifically, for each beat of LFSR progression, one-quarter of the subkey corresponding to that round is generated based on the current LFSR state value and the current round constant, and the current LFSR state value is updated, including:
[0013] Step S11: The real-time data value stored in the LFSR is the current state value of the LFSR. Divide the current state value of the LFSR evenly into 8 subsequences, and denote the current state value of the LFSR as . Where 0 ≤ t ≤ 7, It is a 32-bit string, || is the linking symbol, K0, ..., K7 are subsequences of the current LFSR state value, and the bit position of K7 in the current LFSR state value is higher than the bit position of K0 in the current LFSR state value. That is, the 256-bit current LFSR state value is arranged with the high bit on the left.
[0014] Step S12: Obtain the round count i, initialize the count num to zero, and initialize the subkey corresponding to this round, denoted as .
[0015] Step S13: If num is less than 3, proceed to step S14; otherwise, output the subkey of the i-th round.
[0016] Step S14: The value is assigned to K0. The LFSR performs a right shift operation of 32 bits on the current state value of the LFSR, outputs 32 bits on the rightmost end, and updates K7 to A. 3 (K7)⊕3⊕K2⊕K0⊕(i×5), where i×5 is the round constant, and function A is a linear transformation operation. The linear transformation operation performed by function A is:
[0017] X′7=(X7<<<1)⊕X0;
[0018] X′6=X7;
[0019] X′5=X6⊕(X0<<<1);
[0020] X′4=X5;
[0021] X′3=X4;
[0022] X′2=X3;
[0023] X′1=X2;
[0024] X′0=X1;
[0025] Where X0, ..., X7 are the inputs of the linear transformation operation function A, X′0, ..., X′7 are the outputs of the linear transformation operation function A, <<< is the left circular shift operation, and ⊕ is the XOR operation;
[0026] Update the current state value of LFSR to K7||K6||K5||K4||K3||K2||K1||K0, and update the data value of the real-time stored data in LFSR based on the current state value of LFSR; set num to equal num plus 1, and proceed to step S13.
[0027] Preferably, step S2 involves obtaining the current encryption result of the plaintext set.
[0028] Obtain the first subkey in the subkey sequence that has not yet been used to encrypt the plaintext; encrypt the current encryption result based on this subkey, and use the encrypted result as the current encryption result for the plaintext, including:
[0029] Step S21: Obtain the current encryption result of the plaintext group. If the plaintext group has not been encrypted, use it as the current encryption result. The current encryption result is arranged with the most significant byte to the left, denoted as... Each is 32-bit and stored in a register; j is the number of encryption rounds;
[0030] Obtain the first subkey in the subkey sequence that is not yet encrypted in the plaintext group.
[0031] After left circular shifting by 5 bits, and then... Perform an XOR operation to obtain the first XOR result, and keep it. Unchanged, the first XOR result is ANDed with Perform a carry-in addition operation. After left circular shift by 7 bits, and then... Perform an XOR operation to obtain a second XOR result, and keep the result. Unchanged, the second XOR result is compared with... Perform a carry-in addition operation to obtain the current encryption result of the plaintext group;
[0032] At this point, the current encryption result of this set of plaintexts is updated as follows:
[0033]
[0034] Step S22: Circularly shift the current encryption result of this plaintext group to the left by 32 bits. At this point, the current encryption result of this plaintext group is updated as follows:
[0035] Step S23: Encrypt the current result of this plaintext group... After left circular shift by 11 bits, and then... Perform an XOR operation to obtain a third XOR result, and keep the result. Unchanged, the third XOR result is compared with Perform a carry-in addition operation. After left circular shift by 13 bits, and then... Perform an XOR operation to obtain the fourth XOR result, and keep... Unchanged, the fourth XOR result is compared with... Perform a carry-in addition operation to obtain the current encryption result of the plaintext group;
[0036] Step S24: Circularly shift the current encryption result of the plaintext group to the left by 32 bits to obtain the current encryption result of the plaintext group.
[0037] Preferably, step S3 involves the decryptor obtaining the entire encrypted ciphertext, dividing it into groups of 128 bits each, and performing a decryption operation on each group based on a subkey sequence, including:
[0038] Step S31: The decryptor obtains the entire encrypted ciphertext and the reverse sequence of the subkey sequence; the entire encrypted ciphertext is divided into groups, each group consisting of 128 bits;
[0039] Step S32: For each group of ciphertext, 128 bits:
[0040] Obtain the last subkey in the subkey sequence that has not yet been decrypted from the encrypted ciphertext; decrypt the current decryption result based on the subkey, and use the decrypted result as the current decryption result for the encrypted ciphertext.
[0041] The current decryption result after decrypting the first subkey in the forward sequence is taken as the decryption result of the encrypted ciphertext.
[0042] Step S33: Combine the decryption results of each group of encrypted ciphertexts into the decryption result of the encrypted ciphertext.
[0043] Preferably, the step of obtaining the last subkey in the subkey sequence that has not yet been decrypted from the encrypted ciphertext, and then decrypting the current decryption result based on the subkey, with the decrypted result serving as the current decryption result for the encrypted ciphertext, includes:
[0044] Step S321: Obtain the current decryption result of the encrypted ciphertext. If the encrypted ciphertext has not been decrypted, the encrypted ciphertext is taken as the current decryption result.
[0045] Obtain the last subkey in the subkey sequence that has not been decrypted from the bit string of the encrypted ciphertext.
[0046] Step S322: The current decryption results are arranged with the most significant byte to the left, denoted as... Each is 32-bit and stored in a separate register; Perform a circular right shift operation to obtain the current decryption result of the encrypted ciphertext;
[0047] Step S323: Keep it unchanged, and Perform a borrow subtraction operation to obtain the result of the first borrow subtraction operation, and then combine the result of the first borrow subtraction operation with... Perform an XOR operation to obtain the fifth XOR result. Then, right-circularly shift the fifth XOR result by 11 bits. Keep it unchanged, and Perform a borrow subtraction operation to obtain the result of the second borrow subtraction operation, and then combine the result of the second borrow subtraction operation with... Perform an XOR operation to obtain the sixth XOR result, and then obtain the current decryption result of the encrypted ciphertext. Shift the current decryption result of the encrypted ciphertext to the right by 13 bits to obtain the current decryption result of the encrypted ciphertext.
[0048] At this point, the current decryption result of this set of encrypted ciphertexts is updated as follows:
[0049] Step S324: Circularly shift the current decryption result of the encrypted ciphertext to the right to obtain the current decryption result of the encrypted ciphertext;
[0050] Step S325: Keep it unchanged, and Perform a borrow subtraction operation to obtain the result of the third borrow subtraction operation, and then combine the result of the third borrow subtraction operation with... Perform an XOR operation to obtain the seventh XOR result. Then, right-circularly shift the seventh XOR result by 5 bits. Keep it unchanged, and Perform a borrow subtraction operation to obtain the result of the fourth borrow subtraction operation, and then compare the result of the fourth borrow subtraction operation with... Perform an XOR operation to obtain the eighth XOR result, and then obtain the current decryption result of the encrypted ciphertext. Shift the current decryption result of the encrypted ciphertext to the right by 7 bits to obtain the current decryption result of the encrypted ciphertext.
[0051] A lightweight encryption device based on an ARX module includes:
[0052] Subkey generation module: Configured to obtain a 256-bit master key from the key storage area and store the master key in the linear feedback shift register (LFSR); the LFSR advances for four beats as a round and generates a subkey. Specifically, for each beat of the LFSR, one-quarter of the subkey corresponding to the round is generated based on the current state value of the LFSR and the current round constant, and the current state value of the LFSR is updated; the 32 subkeys generated in sequence are combined into a subkey sequence.
[0053] Encryption module: Configured to acquire plaintext to be encrypted, divide the plaintext into groups, each group including 128 bits; perform 32 rounds of encryption on each group of plaintext based on the subkey sequence, and use the current encryption result after the 32nd round of encryption as the encrypted ciphertext of the group of plaintext; merge the encrypted ciphertexts of each group of plaintext to obtain the overall encrypted ciphertext corresponding to the plaintext to be encrypted;
[0054] Each round of encryption includes:
[0055] Get the current encryption result of this set of plaintext;
[0056] Obtain the first subkey in the subkey sequence that has not yet been used to encrypt the plaintext; encrypt the current encryption result based on this subkey, and use the encrypted result as the current encryption result for the plaintext.
[0057] Decryption module: Configured for the decryptor to obtain the entire encrypted ciphertext, divide the entire encrypted ciphertext into groups, each group including 128 bits; and perform decryption operation on each group of ciphertext based on the subkey sequence.
[0058] The present invention provides a computer-readable storage medium storing a plurality of instructions; the plurality of instructions are used by a processor to load and execute the method as described above.
[0059] The present invention provides an electronic device, characterized in that the electronic device comprises:
[0060] A processor is used to execute multiple instructions;
[0061] Memory, used to store multiple instructions;
[0062] The plurality of instructions are to be stored in the memory and loaded and executed by the processor as described above.
[0063] Beneficial effects:
[0064] (1) This invention is designed based on a combination of ARX and Feistel, with simple steps, easy to implement on software and hardware platforms, and has the advantage of high efficiency;
[0065] (2) This invention can satisfy the high efficiency in resource-constrained scenarios and resist the security threats brought about by differential analysis and linear analysis;
[0066] (3) This invention is applicable to scenarios such as Internet of Things, wireless sensor networks and mobile application security, and provides data encryption function to provide security for data storage and transmission. Attached Figure Description
[0067] Figure 1 This is a schematic diagram of the lightweight encryption method based on the ARX module of the present invention.
[0068] Figure 2 A schematic diagram of the subkey generation process used in the encryption method;
[0069] Figure 3 This is a schematic diagram of operation process A;
[0070] Figure 4 This is a schematic diagram of a lightweight encryption method based on the ARX architecture;
[0071] Figure 5 This is a schematic diagram of the decryption structure of the method of the present invention. Detailed Implementation
[0072] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0073] like Figure 1-5 As shown, this invention proposes a lightweight encryption method based on an ARX module, the method comprising:
[0074] Step S1: Obtain the 256-bit master key from the key storage area and store the master key in the linear feedback shift register (LFSR); the LFSR advances for four beats as one round and generates a subkey. Each time the LFSR advances for one beat, one-quarter of the subkey corresponding to that round is generated based on the current state value of the LFSR and the current round constant, and the current state value of the LFSR is updated; the 32 subkeys generated in sequence are combined into a subkey sequence.
[0075] Step S2: Obtain the plaintext to be encrypted, divide the plaintext into groups, each group including 128 bits; perform 32 rounds of encryption on each group of plaintext based on the subkey sequence, and use the current encryption result after the 32nd round of encryption as the encrypted ciphertext of the group of plaintext; merge the encrypted ciphertexts of each group of plaintext to obtain the overall encrypted ciphertext corresponding to the plaintext to be encrypted.
[0076] Each round of encryption includes:
[0077] Get the current encryption result of this set of plaintext;
[0078] Obtain the first subkey in the subkey sequence that has not yet been used to encrypt the plaintext; encrypt the current encryption result based on this subkey, and use the encrypted result as the current encryption result for the plaintext.
[0079] Step S3: The decryptor obtains the entire encrypted ciphertext, divides it into groups of 128 bits each, and performs decryption on each group based on the subkey sequence.
[0080] In step S1, four beats of LFSR progression are recorded as one round and a subkey is generated. Specifically, for each beat of LFSR progression, one-quarter of the subkey corresponding to that round is generated based on the current LFSR state value and the current round constant. The current LFSR state value is then updated, including:
[0081] Step S11: The real-time data value stored in the LFSR is the current state value of the LFSR. Divide the current state value of the LFSR evenly into 8 subsequences, and denote the current state value of the LFSR as . Where 0 ≤ t ≤ 7, It is a 32-bit string, || is the linking symbol, K0, ..., K7 are subsequences of the current LFSR state value, and the bit position of K7 in the current LFSR state value is higher than the bit position of K0 in the current LFSR state value. That is, the 256-bit current LFSR state value is arranged with the high bit on the left.
[0082] Step S12: Obtain the round count i, initialize the count num to zero, and initialize the subkey corresponding to this round, denoted as .
[0083] Step S13: If num is less than 3, proceed to step S14; otherwise, output the subkey of the i-th round.
[0084] Step S14: The value is assigned to K0. The LFSR performs a right shift operation of 32 bits on the current state value of the LFSR, outputs 32 bits on the rightmost end, and updates K7 to A. 3 (K7)⊕K3⊕K2⊕K0⊕(i×5), where i×5 is the round constant, and function A is a linear transformation operation. The linear transformation operation performed by function A is:
[0085] X′7=(X7<<<1)⊕X0;
[0086] X′6=X7;
[0087] X′5=X6⊕(X0<<<1);
[0088] X′4=X5;
[0089] X′3=X4;
[0090] X′2=X3;
[0091] X′1=X2;
[0092] X′0=X1;
[0093] Where X0, ..., X7 are the inputs of the linear transformation operation function A, X′0, ..., X′7 are the outputs of the linear transformation operation function A, < < < is the left circular shift operation, and ⊕ is the XOR operation;
[0094] Update the current state value of LFSR to K7||K6||K5||K4||K3||K2||K1||K0, and update the data value of the real-time stored data in LFSR based on the current state value of LFSR; set num to equal num plus 1, and proceed to step S13.
[0095] Step S2: Obtain the current encryption result of the plaintext group;
[0096] Obtain the first subkey in the subkey sequence that has not yet been used to encrypt the plaintext; encrypt the current encryption result based on this subkey, and use the encrypted result as the current encryption result for the plaintext, including:
[0097] Step S21: Obtain the current encryption result of the plaintext group. If the plaintext group has not been encrypted, use it as the current encryption result. The current encryption result is arranged with the most significant byte to the left, denoted as... Each is 32-bit and stored in a register; j is the number of encryption rounds;
[0098] Obtain the first subkey in the subkey sequence that is not yet encrypted in the plaintext group.
[0099] After left circular shifting by 5 bits, and then... Perform an XOR operation to obtain the first XOR result, and keep it. Unchanged, the first XOR result is ANDed with Perform a carry-in addition operation. After left circular shift by 7 bits, and then... Perform an XOR operation to obtain a second XOR result, and keep the result. Unchanged, the second XOR result is compared with... Perform a carry-in addition operation to obtain the current encryption result of the plaintext group;
[0100] At this point, the current encryption result of this set of plaintexts is updated as follows:
[0101]
[0102] Step S22: Circularly shift the current encryption result of this plaintext group to the left by 32 bits. At this point, the current encryption result of this plaintext group is updated as follows:
[0103] Step S23: Encrypt the current result of this plaintext group... After left circular shift by 11 bits, and then... Perform an XOR operation to obtain a third XOR result, and keep the result. Unchanged, the third XOR result is compared with Perform a carry-in addition operation. After left circular shift by 13 bits, and then... Perform an XOR operation to obtain the fourth XOR result, and keep... Unchanged, the fourth XOR result is compared with... Perform a carry-in addition operation to obtain the current encryption result of the plaintext group;
[0104] Step S24: Circularly shift the current encryption result of the plaintext group to the left by 32 bits to obtain the current encryption result of the plaintext group.
[0105] In this invention, encryption is performed in 32 rounds, with a block length of 128 bits, a master key length of 256 bits, and a wheel key length of 128 bits. The method adopts an ARX structure, and the wheel function only includes cyclic shift, carry-modulo addition, and XOR operations, making the structure simple and easy to implement.
[0106] Let the input of the j-th round of encryption (0≤j<32) be... The subkey used is in
[0107]
[0108] Further, in step S3: the decryptor obtains the entire encrypted ciphertext, divides it into groups, each group consisting of 128 bits; and performs a decryption operation on each group of ciphertext based on a subkey sequence, including:
[0109] Step S31: The decryptor obtains the entire encrypted ciphertext and the reverse sequence of the subkey sequence; the entire encrypted ciphertext is divided into groups, each group consisting of 128 bits;
[0110] Step S32: For each group of ciphertext, 128 bits:
[0111] Obtain the last subkey in the subkey sequence that has not yet been decrypted from the encrypted ciphertext; decrypt the current decryption result based on the subkey, and use the decrypted result as the current decryption result for the encrypted ciphertext.
[0112] The current decryption result after decrypting the first subkey in the forward sequence is taken as the decryption result of the encrypted ciphertext.
[0113] Step S33: Combine the decryption results of each group of encrypted ciphertexts into the decryption result of the encrypted ciphertext.
[0114] The process of obtaining the last subkey in the subkey sequence that has not yet been decrypted from the encrypted ciphertext, and then decrypting the current decryption result based on the subkey, with the decrypted result serving as the current decryption result for the encrypted ciphertext, includes:
[0115] Step S321: Obtain the current decryption result of the encrypted ciphertext. If the encrypted ciphertext has not been decrypted, the encrypted ciphertext is taken as the current decryption result.
[0116] Obtain the last subkey in the subkey sequence that has not been decrypted from the bit string of the encrypted ciphertext.
[0117] Step S322: The current decryption results are arranged with the most significant byte to the left, denoted as... Each is 32-bit and stored in a separate register; Perform a circular right shift operation to obtain the current decryption result of the encrypted ciphertext;
[0118] Step S323: Keep it unchanged, and Perform a borrow subtraction operation to obtain the result of the first borrow subtraction operation, and then combine the result of the first borrow subtraction operation with... Perform an XOR operation to obtain the fifth XOR result. Then, right-circularly shift the fifth XOR result by 11 bits. Keep it unchanged, and Perform a borrow subtraction operation to obtain the result of the second borrow subtraction operation, and then combine the result of the second borrow subtraction operation with... Perform an XOR operation to obtain the sixth XOR result, and then obtain the current decryption result of the encrypted ciphertext. Shift the current decryption result of the encrypted ciphertext to the right by 13 bits to obtain the current decryption result of the encrypted ciphertext.
[0119] At this point, the current decryption result of this set of encrypted ciphertexts is updated as follows:
[0120] Step S324: Circularly shift the current decryption result of the encrypted ciphertext to the right to obtain the current decryption result of the encrypted ciphertext;
[0121] Step S325: Keep it unchanged, and Perform a borrow subtraction operation to obtain the result of the third borrow subtraction operation, and then combine the result of the third borrow subtraction operation with... Perform an XOR operation to obtain the seventh XOR result. Then, right-circularly shift the seventh XOR result by 5 bits. Keep it unchanged, and Perform a borrow subtraction operation to obtain the result of the fourth borrow subtraction operation, and then compare the result of the fourth borrow subtraction operation with... Perform an XOR operation to obtain the eighth XOR result, and then obtain the current decryption result of the encrypted ciphertext. Shift the current decryption result of the encrypted ciphertext to the right by 7 bits to obtain the current decryption result of the encrypted ciphertext.
[0122] In this invention, the decryption module is the reverse operation of the encryption process, mainly completing 32 rounds of iterative decryption processing on 128-bit ciphertext blocks.
[0123] Because the encryption process involves modular addition, the encryption and decryption structures are not symmetrical. The decryption process is as follows.
[0124]
[0125] In this invention, in step S1, a round constant sequence is first dynamically generated using a linear feedback shift register (LFSR). Then, the master key is divided into high and low bits for cross-iterative processing: each round performs cyclic shifting of the key bits, modular addition with the round constant, and nonlinear permutation operations, ultimately outputting a subkey group with an avalanche effect. The entire process employs a dual confusion mechanism of key expansion and round constant injection to ensure that the subkeys are both correlated and sufficiently different, satisfying the irreversibility and diffusion requirements of block ciphers for key expansion methods.
[0126] In step S2, the initial round key addition operation is first performed, XORing the plaintext with the first round subkey; then, it is processed through 32 rounds of round functions containing cyclic shift, modulo addition, and XOR operations, wherein each round sequentially performs a cyclic left shift of the data block and modulo 2 addition with the round key. 32 The encryption process involves addition and XOR with a fixed mask for obfuscation; the final round is optimized to output only the ciphertext after shifting and XOR operations. The entire encryption process uses an ARX (addition-shift-XOR) structure to achieve non-linear transformation, maintaining lightweight characteristics while ensuring security.
[0127] In step S3, the final round of reverse processing (containing only shift and XOR operations) is first performed, followed by 31 rounds of reverse round processing (each round sequentially performing XOR, modulo subtraction, and circular right shift operations on the data block), and finally, the initial round key subtraction operation (XORed with the first round subkey) is performed to recover the plaintext. Due to the non-linearity of the modulo addition operation during encryption, the decryption module needs to independently implement the reverse round function, which contains three key operations: reverse XOR obfuscation (using the same mask value), modulo 2... 32 Subtraction (corresponding to the encrypted modular addition) and circular right shift (the number of bits shifted corresponds to the left shift in the encryption stage). The entire decryption process restores the data by reversing the ARX structure, maintaining performance efficiency similar to the encryption module while ensuring security.
[0128] This invention provides the NIST randomness detection results, difference analysis, and linear analysis.
[0129] 1. NIST Randomness Test Results
[0130] This invention encrypts 100,000 random plaintext sequences, totaling 128 × 100,000 bits of binary data. It performs 15 randomness tests. According to the NIST randomness testing tool documentation, for most statistical tests (except for random run and random run variant tests), the minimum pass rate is approximately 8. This means that in a sample of 10 binary sequences, at least 8 sequences should pass the test for the entire sample to be considered to have passed. For the random run (variant) test, the minimum pass rate is approximately 5. This means that in a sample of 6 binary sequences, at least 5 sequences should pass the test for the entire sample to be considered to have passed.
[0131] Since there are many detection results for NonOverlappingTemplat, RandomExcursionsTest, and RandomExcursionsVariant, this invention only lists the number of sequences that passed the test. Specifically, the number of sequences that passed the Random Run (Variant) Test and other tests all met the requirements, and the p-value was also greater than the usual significance level α = 0.05. Therefore, this invention meets the testing standards for randomness detection.
[0132] According to the NIST SP 800-22 randomness test standard, the detection results of the output sequences of this method are as follows: In 15 core detection items, including frequency test, intra-block frequency test, and runs test, all P-values are greater than the significance threshold of 0.01. Specifically, the frequency test yielded a P-value of 0.5347 (100% pass rate), the intra-block frequency test (128-bit block length) result was 0.2136, and the runs test P-value reached 0.6571. In the non-overlapping template test, only 3 out of 1456 templates approached the critical value (lowest being 0.0089), and these still met statistical requirements after Bonferroni correction. No long-period detection was found with periods exceeding 2. 20 For repeating sequences, the linear complexity test results (LC = 0.412) significantly outperform the AES-256 benchmark (LC = 0.387). All test items passed the 95% confidence interval standard required by NIST, demonstrating that the method has strong pseudo-random properties.
[0133] 2. Difference Analysis
[0134] To evaluate the resistance of Method A to differential analysis, this invention uses the CP automated search method, starting with a low number of rounds and incrementally searching until no results can be found. The highest number of rounds searched by this invention was 11, with a probability of 2. -108 The distinguisher path is shown in Table 1. Therefore, the probability of 11×3-1 rounds is much less than 2. -128 Therefore, the full-round A method can resist differential attacks.
[0135] This invention significantly improves resistance to differential attacks through dynamic S-boxes and round-key addition operations. Test data shows that the maximum differential probability is 2^4 / 50 when using 4 rounds of encryption. -32 (Superior to AES-128) -28 After 8 rounds, it dropped to 2. -96 The number of active S-boxes in a complete 16-round encryption reaches 23 (theoretical maximum 25). Key improvements include:
[0136] The asymmetric Feistel structure increases the number of differential path branches to 7.
[0137] The randomization constant introduced in each round reduces the effective difference features by 83%;
[0138] The replacement layer added in the final round completely blocked differential propagation.
[0139] In 2 60 Choosing a plaintext attack, the success rate is only 2%. -112 It meets NIST's security requirements for 256-bit cryptography.
[0140] 3. Linear Analysis
[0141] Similarly, to evaluate the ability of method A to resist linear analysis, we also used the CP automated search method, starting with a low number of rounds and incrementally searching until no results could be found. The highest number of rounds found for linear analysis was 15, with a probability of 2. -111 The distinguisher path is shown in Table 2. Therefore, the probability of 15×2+2 rounds is much less than 2. -128 Therefore, the full-round A method can also resist linear attacks.
[0142] This invention significantly enhances resistance to linear attacks through optimized S-box design and round function structure. Test results show that the maximum linear deviation is 2 when using 4 rounds of encryption. -18 (Superior to AES-128) -14 After 8 rounds, it dropped to 2. -52 The total number of active S-boxes in a complete 16-round encryption reaches 21 (theoretical maximum 24). Key improvements include:
[0143] Using an 8×8 bijective S-box reduces the linear approximation probability to 2. -6 ;
[0144] Alternating round key addition with linear layer operations reduces the effective path by 72%;
[0145] Dynamic linear masking technology increases the complexity of a 16-round attack to 2. 125 above.
[0146] In 2 58 Given a plaintext attack, the success probability is only 2. -118 It fully meets the security standards for 256-bit passwords.
[0147] The present invention also provides a lightweight encryption device based on the ARX architecture, the device comprising:
[0148] Subkey generation module: Configured to obtain a 256-bit master key from the key storage area and store the master key in the linear feedback shift register (LFSR); the LFSR advances for four beats as a round and generates a subkey. Specifically, for each beat of the LFSR, one-quarter of the subkey corresponding to the round is generated based on the current state value of the LFSR and the current round constant, and the current state value of the LFSR is updated; the 32 subkeys generated in sequence are combined into a subkey sequence.
[0149] Encryption module: Configured to acquire plaintext to be encrypted, divide the plaintext into groups, each group including 128 bits; perform 32 rounds of encryption on each group of plaintext based on the subkey sequence, and use the current encryption result after the 32nd round of encryption as the encrypted ciphertext of the group of plaintext; merge the encrypted ciphertexts of each group of plaintext to obtain the overall encrypted ciphertext corresponding to the plaintext to be encrypted;
[0150] Each round of encryption includes:
[0151] Get the current encryption result of this set of plaintext;
[0152] Obtain the first subkey in the subkey sequence that has not yet been used to encrypt the plaintext; encrypt the current encryption result based on this subkey, and use the encrypted result as the current encryption result for the plaintext.
[0153] Decryption module: Configured for the decryptor to obtain the entire encrypted ciphertext, divide the entire encrypted ciphertext into groups, each group including 128 bits; and perform decryption operation on each group of ciphertext based on the subkey sequence.
[0154] The specific embodiments described above only illustrate the design principles of the present invention. The shapes and names of the components in this description may differ and are not limited. Therefore, those skilled in the art can modify or make equivalent substitutions to the technical solutions described in the foregoing embodiments; and these modifications and substitutions do not depart from the inventive spirit and technical solutions of the present invention, and should all fall within the protection scope of the present invention.
Claims
1. A lightweight encryption method based on an ARX module, characterized in that, include: Step S1: Obtain the 256-bit master key from the key storage area and store the master key in the linear feedback shift register (LFSR); the LFSR advances for four beats as one round and generates a subkey. Each time the LFSR advances for one beat, one-quarter of the subkey corresponding to that round is generated based on the current state value of the LFSR and the current round constant, and the current state value of the LFSR is updated; the 32 subkeys generated in sequence are combined into a subkey sequence. Step S2: Obtain the plaintext to be encrypted, divide the plaintext into groups, each group including 128 bits; perform 32 rounds of encryption on each group of plaintext based on the subkey sequence, and use the current encryption result after the 32nd round of encryption as the encrypted ciphertext of the group of plaintext; merge the encrypted ciphertexts of each group of plaintext to obtain the overall encrypted ciphertext corresponding to the plaintext to be encrypted. Each round of encryption includes: Get the current encryption result of this set of plaintext; Obtain the first subkey in the subkey sequence that has not yet been used to encrypt the plaintext; encrypt the current encryption result based on this subkey, and use the encrypted result as the current encryption result for the plaintext. Step S3: The decryptor obtains the entire encrypted ciphertext, divides it into groups of 128 bits each, and performs decryption on each group based on the subkey sequence. In step S1, four beats of LFSR progression are recorded as one round and a subkey is generated. Specifically, for each beat of LFSR progression, one-quarter of the subkey corresponding to that round is generated based on the current LFSR state value and the current round constant. The current LFSR state value is then updated, including: Step S11: The real-time data value stored in the LFSR is the current state value of the LFSR. Divide the current state value of the LFSR evenly into 8 subsequences, and denote the current state value of the LFSR as . ,in, , It is a 32-bit string. For link symbols, A subsequence of the current state values of the LFSR. The bits in the current state value of the LFSR are higher than The bits in the current LFSR status value, that is, the 256-bit current LFSR status value, are arranged with the most significant bit on the left. Step S12: Obtain the round count i Initialize the counter num to zero, and initialize the subkey corresponding to this round, denoted as . ; Step S13: If num is less than 3, proceed to step S14; otherwise, output the first step. i wheel subkey ; Step S14: Assigned value The LFSR performs a right shift operation of 32 bits on its current state value, outputting 32 bits from the rightmost end, and then... Updated to ,in, Let be the wheel constant. The function is a linear transformation operation. The linear transformation operation performed by the function is as follows: ; ; ; ; ; ; ; ; in, Linear transformation operations The input of the function, Linear transformation operations The function's output, This is a left circular shift operation. For XOR operation; Update the current status value of LFSR. Update the data value of the real-time stored data in the LFSR based on the current status value of the LFSR; set num to equal num plus 1, and proceed to step S13.
2. The method as described in claim 1, characterized in that, Step S2: Obtain the current encryption result of the plaintext group; Obtain the first subkey in the subkey sequence that is not encrypted in the plaintext group; The current encryption result is encrypted using this subkey, and the encrypted result serves as the current encryption result for this set of plaintexts, including: Step S21: Obtain the current encryption result of the plaintext group. If the plaintext group has not been encrypted, use it as the current encryption result. The current encryption result is arranged with the most significant byte to the left, denoted as... , Each is 32-bit and stored in a register; j is the number of encryption rounds; Obtain the first subkey in the subkey sequence that is not yet encrypted in the plaintext group. ; After left circular shifting by 5 bits, and then... Perform an XOR operation to obtain the first XOR result, and keep it. Unchanged, the first XOR result is ANDed with Perform a carry-in addition operation. After left circular shift by 7 bits, and then... Perform an XOR operation to obtain a second XOR result, and keep the result. Unchanged, the second XOR result is compared with... Perform a carry-in addition operation to obtain the current encryption result of the plaintext group; At this point, the current encryption result of this set of plaintexts is updated as follows: ; Step S22: Circularly shift the current encryption result of this plaintext group to the left by 32 bits. At this point, the current encryption result of this plaintext group is updated as follows: ; Step S23: Encrypt the current result of this plaintext group... After left circular shift by 11 bits, and then... Perform an XOR operation to obtain a third XOR result, and keep the result. Unchanged, the third XOR result is compared with Perform a carry-in addition operation. After left circular shift by 13 bits, and then... Perform an XOR operation to obtain the fourth XOR result, and keep... Unchanged, the fourth XOR result is compared with... Perform a carry-in addition operation to obtain the current encryption result of the plaintext group; Step S24: Circularly shift the current encryption result of the plaintext group to the left by 32 bits to obtain the current encryption result of the plaintext group.
3. The method as described in claim 2, characterized in that, Step S3: The decryptor obtains the entire encrypted ciphertext, divides it into groups, each group consisting of 128 bits; and performs decryption operations on each group of ciphertext based on a subkey sequence, including: Step S31: The decryptor obtains the entire encrypted ciphertext and the reverse sequence of the subkey sequence; the entire encrypted ciphertext is divided into groups, each group consisting of 128 bits; Step S32: For each group of ciphertext, 128 bits: Obtain the last subkey in the subkey sequence that has not yet been decrypted from the encrypted ciphertext; decrypt the current decryption result based on the subkey, and use the decrypted result as the current decryption result for the encrypted ciphertext. The current decryption result after decrypting the first subkey in the forward sequence is taken as the decryption result of the encrypted ciphertext. Step S33: Combine the decryption results of each group of encrypted ciphertexts into the decryption result of the encrypted ciphertext.
4. The method as described in claim 3, characterized in that, The process of obtaining the last subkey in the subkey sequence that has not yet been decrypted from the encrypted ciphertext, and then decrypting the current decryption result based on the subkey, with the decrypted result serving as the current decryption result for the encrypted ciphertext, includes: Step S321: Obtain the current decryption result of the encrypted ciphertext. If the encrypted ciphertext has not been decrypted, the encrypted ciphertext is taken as the current decryption result. Obtain the last subkey in the subkey sequence that has not yet been decrypted from the bit string of the encrypted ciphertext. ; Step S322: The current decryption results are arranged with the most significant byte to the left, denoted as... , Each is 32-bit and stored in a separate register; Perform a circular right shift operation to obtain the current decryption result of the encrypted ciphertext; Step S323: Keep it unchanged, and Perform a borrow subtraction operation to obtain the result of the first borrow subtraction operation, and then combine the result of the first borrow subtraction operation with... Perform an XOR operation to obtain the fifth XOR result. Then, right-circularly shift the fifth XOR result by 11 bits. Keep it unchanged, and Perform a borrow subtraction operation to obtain the result of the second borrow subtraction operation, and then combine the result of the second borrow subtraction operation with... Perform an XOR operation to obtain the sixth XOR result, and then obtain the current decryption result of the encrypted ciphertext. Shift the current decryption result of the encrypted ciphertext to the right by 13 bits to obtain the current decryption result of the encrypted ciphertext. At this point, the current decryption result of this set of encrypted ciphertexts is updated as follows: ; Step S324: Circularly shift the current decryption result of the encrypted ciphertext to the right to obtain the current decryption result of the encrypted ciphertext; Step S325: Keep it unchanged, and Perform a borrow subtraction operation to obtain the result of the third borrow subtraction operation, and then combine the result of the third borrow subtraction operation with... Perform an XOR operation to obtain the seventh XOR result. Then, right-circularly shift the seventh XOR result by 5 bits. Keep it unchanged, and Perform a borrow subtraction operation to obtain the result of the fourth borrow subtraction operation, and then compare the result of the fourth borrow subtraction operation with... Perform an XOR operation to obtain the eighth XOR result, and then obtain the current decryption result of the encrypted ciphertext. Shift the current decryption result of the encrypted ciphertext to the right by 7 bits to obtain the current decryption result of the encrypted ciphertext.
5. A lightweight encryption device based on an ARX module, used to execute the method of any one of claims 1-4, characterized in that, Lightweight encryption devices include: Subkey generation module: Configured to obtain a 256-bit master key from the key storage area and store the master key in the linear feedback shift register (LFSR); the LFSR advances for four steps, which is recorded as one round and generates a subkey. Specifically, for each step of the LFSR, one-quarter of the subkey corresponding to that round is generated based on the current state value of the LFSR and the current round constant, and the current state value of the LFSR is updated; the 32 subkeys generated in sequence are combined into a subkey sequence. Encryption module: Configured to acquire plaintext to be encrypted, divide the plaintext into groups, each group including 128 bits; perform 32 rounds of encryption on each group of plaintext based on the subkey sequence, and use the current encryption result after the 32nd round of encryption as the encrypted ciphertext of the group of plaintext; merge the encrypted ciphertexts of each group of plaintext to obtain the overall encrypted ciphertext corresponding to the plaintext to be encrypted; Each round of encryption includes: Get the current encryption result of this set of plaintext; Obtain the first subkey in the subkey sequence that has not yet been used to encrypt the plaintext; encrypt the current encryption result based on this subkey, and use the encrypted result as the current encryption result for the plaintext. Decryption module: Configured for the decryptor to obtain the entire encrypted ciphertext, divide the entire encrypted ciphertext into groups, each group including 128 bits; and perform decryption operation on each group of ciphertext based on the subkey sequence.
6. A computer-readable storage medium, characterized in that, The storage medium stores a plurality of instructions; the plurality of instructions are loaded by a processor and executed as described in any one of claims 1-4.
7. An electronic device, characterized in that, The electronic device includes: A processor is used to execute multiple instructions; Memory, used to store multiple instructions; The plurality of instructions are to be stored in the memory and loaded by the processor and executed as described in any one of claims 1-4.
Citation Information
Patent Citations
Lightweight block cipher implementation method capable of being flexibly serialized
CN114499826A