ARX lightweight block encryption method and system based on pseudo-random dynamic round number

Through the ARX lightweight block encryption method with pseudo-random dynamic rounds, combined with a simplified Feistel structure and ARX operations, the round number is dynamically generated, which solves the performance bottleneck and security problems of lightweight block cipher algorithms in resource-constrained environments and realizes an efficient and secure encryption scheme.

CN120602075AActive Publication Date: 2025-09-05BEIJING ELECTRONICS SCI & TECH INST
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510792516.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2025-09-05
Estimated Expiration
2045-06-13

AI Technical Summary

Technical Problem

Existing lightweight block cipher algorithms have increased computational complexity and storage requirements in resource-constrained environments, leading to performance bottlenecks. In addition, they lack security and are unable to effectively resist side-channel attacks and cryptanalysis.

Method used

This paper adopts the ARX lightweight block encryption method based on pseudo-random dynamic rounds. By combining the simplified Feistel structure with ARX operations, the round number is dynamically generated, the round function algorithm is used to update the key, and XOR and cyclic shift operations are introduced in the encryption process to generate a key with strong pseudo-randomness, thereby enhancing security and simplicity.

Benefits of technology

Significantly reduce resource overhead, improve encryption speed, enhance resistance to differential analysis and linear analysis, reduce power consumption, improve security against side-channel attacks, and adapt to resource-constrained devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120602075A_ABST
    Figure CN120602075A_ABST
Patent Text Reader

Abstract

The invention discloses an ARX lightweight block encryption method and system based on a pseudo-random dynamic round number, and relates to the technical field of cryptography and information security, and the method comprises the steps: 1, equally dividing to-be-encrypted data into n to-be-encrypted data blocks; step 2, obtaining a basic round number and a master key, and calculating r and rd; 3, generating an initial round key based on the master key, introducing a temporary variable, and generating a round key by using a round function algorithm; step 4, inputting the n to-be-encrypted data blocks into n branches of the encryption round function to generate an initial to-be-encrypted data block, and performing XOR operation on the initial to-be-encrypted data block and the round key; performing XOR on the initial to-be-encrypted data block and the corresponding to-be-encrypted data block to obtain an intermediate variable; performing modular addition on the intermediate variable subjected to cyclic displacement and an XOR result; 5, carrying out iterative calculation; and 4, outputting a ciphertext. According to the invention, lightweight design is realized, high-efficiency encryption / decryption speed is maintained, and the method can flexibly adapt to various application scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cryptography and information security technology, and more particularly to an ARX lightweight block encryption method and system based on pseudo-random dynamic round numbers. Background Art

[0002] With the advent of the ubiquitous computing era, the widespread use of a large number of IoT devices has created an urgent need for low-latency and low-power block cipher algorithms. This has led to the development of lightweight block cipher algorithms such as RECTANGLE, ITUbee, and SIMON, designed to adapt to resource-constrained environments such as wireless sensor networks and electronic tags. Simultaneously, in the face of increasingly advanced cryptanalysis techniques, researchers are continuously improving the security of lightweight algorithms against side-channel attacks, differential analysis, and linear analysis through methods such as masking techniques (e.g., those used in PICARO, Zorro, and Robin) and wide-orbit strategies (e.g., those used in PRINCE and PRIDE). Furthermore, lightweight block cipher algorithms have become core components of numerous information security protocols and authenticated encryption algorithms, and their application has also expanded to resource-rich devices such as smartphones that interact with resource-constrained devices. However, to further optimize performance or enhance security, some innovative solutions attempt to jointly design cryptographic algorithms with technologies such as error-correcting coding. For example, LDPC coding is directly integrated into the encryption process (such as the method described in patent CN11622967A, which uses an ARX-type lightweight block algorithm for R rounds of iterations and performs LDPC coding and key encryption in the R+1 round). This deep integration may theoretically bring advantages, but in practical resource-constrained lightweight application scenarios, the additional computational complexity (such as LDPC coding operations), potential increased latency, and the need for limited storage resources (such as storing the LDPC check matrix) it introduces may partially offset the efficiency advantages of the lightweight cryptographic algorithm itself, or even become a new performance bottleneck. Therefore, how to truly achieve efficient and secure coding is an urgent problem that those skilled in the art need to solve. Summary of the Invention

[0003] In view of this, the present invention provides an ARX lightweight block encryption method and system based on pseudo-random dynamic rounds, which overcomes the above-mentioned defects.

[0004] In order to achieve the above object, the present invention adopts the following technical solutions:

[0005] An ARX lightweight block encryption method based on pseudo-random dynamic rounds, the specific steps are as follows:

[0006] Step 1: Divide the data to be encrypted into n blocks of data to be encrypted and set the master key;

[0007] Step 2: Obtain a basic round number and the 8-bit knt of the master key, calculate an outer encryption round number r based on the knt and the basic round number; and determine an inner encryption round number rd based on the outer encryption round number r according to a preset rule;

[0008] Step 3: Split the master key into multiple subkeys, split any of the subkeys to generate an initial round key, introduce a temporary variable, and use a round function algorithm to update the initial round key based on the external encryption round number r and the subkey to generate a round key;

[0009] Step 4: Input the n data blocks to be encrypted into the n branches of the encryption round function in sequence, perform an initial transformation on n / 2 of the data blocks to be encrypted to generate an initial data block to be encrypted, perform an XOR operation on the initial data block to be encrypted and the round key to generate an XOR result; perform an XOR operation on the initial data block to be encrypted and the corresponding data block to be encrypted to obtain n / 2 intermediate variables; perform a modular addition of the XOR result with the cyclically shifted intermediate variables;

[0010] Step 5: Determine whether the current encryption round number is less than the external encryption round number r. If so, perform linear permutation on the modular addition result and the cyclic shift result, and jump to step 4; if not, output the ciphertext.

[0011] Optionally, the number of external encryption rounds r is calculated as follows:

[0012] The 8-bit knt of the master key is divided modulo 7 and added to the basic round number to obtain the external encryption round number r.

[0013] Optionally, the steps for generating the round key are:

[0014] Step 311: Divide the master key into the first subkey and the second subkey , and for the first subkey and the second subkey Assign a value;

[0015] Step 312: The first subkey Divide into two parts, as the initial round key of the current round number i;

[0016] Step 313: The second subkey Assign to a temporary variable ;

[0017] Step 314: The second subkey Cyclic shift result, the first subkey Perform an XOR operation on the current round number i and update the second subkey based on the XOR result ;

[0018] Step 315: Set the temporary variable The value of the first subkey is assigned to ;

[0019] Step 316: Determine whether the current round number i is equal to the external encryption round number r. If not, execute steps 312 to 316; if so, output the round key.

[0020] Optionally, the steps for generating the round key are:

[0021] Step 321: Divide the master key into the first subkey , the second subkey , the third subkey and the fourth subkey , and for the first subkey , the second subkey , the third subkey and the fourth subkey Assign a value;

[0022] Step 322: The first subkey Divide into two parts, as the initial round key of the current round number i;

[0023] Step 323: The second subkey Assign to the first temporary variable , the fourth subkey Assign to the second temporary variable ;

[0024] Step 324: The second subkey The cyclic shift result and the first subkey Perform an XOR operation and update the second subkey based on the XOR result ; The fourth subkey The cyclic shift result and the third subkey Perform an XOR operation and update the fourth subkey based on the XOR result ;

[0025] Step 325: Set the first temporary variable k t1 The value of the first subkey is assigned to ; The second temporary variable The value of the third subkey is assigned to ;

[0026] Step 326: The second subkey , the fourth subkey Perform an XOR operation with the current round number i, and update the second subkey based on the XOR result ;

[0027] Step 327: Determine whether the current round number i is equal to the external encryption round number r. If not, execute steps 322 to 327; if so, output the round key.

[0028] Optionally, the steps for generating the initial data block to be encrypted are:

[0029] When the number of external encryption rounds r=1, the data block to be encrypted is cyclically shifted left to generate the initial data block to be encrypted;

[0030] When the number of external encryption rounds r>1, an XOR operation is performed on the data block to be encrypted and the data block to be encrypted after cyclic left shift to generate the initial data block to be encrypted.

[0031] Optionally, if n is 4, step 4 is specifically as follows:

[0032] Inputting the four data blocks to be encrypted into the four branches of the encryption round function in sequence;

[0033] Performing initial transformation on the data block to be encrypted of the second branch and the data block to be encrypted of the fourth branch, respectively, to generate a first initial data block to be encrypted and a second initial data block to be encrypted;

[0034] Perform an XOR operation on the first initial data block to be encrypted and the data block to be encrypted in the third branch to generate a first intermediate variable P2;

[0035] Perform an XOR operation on the second initial data block to be encrypted and the data block to be encrypted of the first branch to generate a second intermediate variable P0;

[0036] Performing cyclic shift on the first intermediate variable P2 and the second intermediate variable P0 respectively to generate a first shift result and a second shift result;

[0037] Performing an XOR operation on the first shift result and the first part of the round key to obtain a first XOR result; performing an XOR operation on the second shift result and the second part of the round key to obtain a second XOR result;

[0038] Modulo-add the first XOR result and the first shift result to obtain the output value of the third branch; modulo-add the second XOR result and the second shift result to obtain the output value of the first branch; and use the first shift result as the output value of the fourth branch; and use the second shift result as the output value of the second branch.

[0039] Optionally, when decrypting the ciphertext, the decryption process is completely symmetrical with the encryption process, and the inverse round key is used to perform the inverse operation steps of the round function.

[0040] An ARX lightweight block encryption system based on pseudo-random dynamic round numbers, comprising:

[0041] The pre-processing module is used to evenly divide the data to be encrypted into n data blocks to be encrypted and set the master key;

[0042] A dynamic round number generation module is configured to obtain a basic round number and the 8-bit knt of the master key, calculate an external encryption round number r based on the knt and the basic round number, and determine an internal encryption round number rd based on the external encryption round number r according to a preset rule;

[0043] a key generation module, configured to split the master key into multiple subkeys, split any of the subkeys to generate an initial round key, introduce a temporary variable, and use a round function algorithm to update the initial round key based on the external encryption round number r and the subkey to generate a round key;

[0044] a round function encryption module, configured to sequentially input n data blocks to be encrypted into n branches of an encryption round function, perform an initial transformation on n / 2 of the data blocks to be encrypted to generate an initial data block to be encrypted, perform an XOR operation on the initial data block to be encrypted and the round key to generate an XOR result; perform an XOR operation on the initial data block to be encrypted and the corresponding data block to be encrypted to obtain n / 2 intermediate variables; and perform a modular addition of the XOR result with the cyclically shifted intermediate variables;

[0045] The ciphertext generation module is used to determine whether the current encryption round number is less than the external encryption round number r. If so, it performs linear permutation on the modular addition result and the cyclic shift result, and transmits the generated output to the round function encryption module; if not, it outputs the ciphertext.

[0046] Through the above technical solutions, it can be seen that the present invention discloses an ARX lightweight block encryption method and system based on pseudo-random dynamic rounds, which has the following beneficial effects compared with the existing technology:

[0047] 1. The simplified Feistel structure combined with optimized ARX operations significantly reduces the algorithm's resource overhead, achieving a lightweight design while maintaining efficient encryption / decryption speed, enabling it to flexibly adapt to application scenarios with highly constrained resources, such as IoT devices and edge computing nodes.

[0048] 2. The pseudo-random dynamic round number mechanism effectively disrupts the attack pattern and greatly improves the algorithm's ability to resist classic cryptanalysis attacks such as differential analysis and linear analysis.

[0049] 3. Through a carefully designed ARX structure and the removal of traditional S-boxes (which are often vulnerable to side-channel attacks), physical leakage information such as power consumption is significantly reduced, improving the algorithm's inherent security against side-channel attacks (such as power analysis and electromagnetic analysis). BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0051] Figure 1 The present invention provides a flow chart of the method.

[0052] Figure 2 This is a diagram of the key generation encryption round function provided by the present invention;

[0053] Figure 3 It is a structural diagram of the encryption round function provided by the present invention;

[0054] Figure 4 It is a structural diagram of the decryption round function of the present invention. DETAILED DESCRIPTION

[0055] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0056] On the one hand, the embodiment of the present invention discloses an ARX lightweight block encryption method based on pseudo-random dynamic rounds. The round function adopts a simplified Feistel structure and ARX structure, and uses the addition, rotation and XOR operations of the ARX structure to enhance the security and simplicity of the algorithm. The plaintext data is preprocessed into a 4-branch operation, which reduces the size and complexity of each component. At the same time, the key lies in the dynamic mechanism design of the round function, combined with the negative feedback mechanism, to achieve pseudo-randomness, effectively ensuring the security of the block cipher and resisting various attacks, such as Figure 1 As shown, the specific steps are:

[0057] Step 1: Divide the data to be encrypted into n blocks of data to be encrypted and set the master key;

[0058] Step 2: Obtain the basic round number and the 8-bit knt of the master key, calculate the outer encryption round number r based on knt and the basic round number; and determine the inner encryption round number rd based on the outer encryption round number r according to the preset rules;

[0059] Step 3: Split the master key into multiple subkeys, split any subkey to generate an initial round key, introduce a temporary variable, and use the round function algorithm to update the initial round key based on the external encryption round number r and the subkey to generate a round key;

[0060] Step 4: Input n data blocks to be encrypted into n branches of the encryption round function in sequence, perform initial transformation on n / 2 data blocks to be encrypted to generate an initial data block to be encrypted, perform XOR operation on the initial data block to be encrypted and the round key to generate an XOR result; perform XOR operation on the initial data block to be encrypted and the corresponding data block to be encrypted to obtain n / 2 intermediate variables; perform modular addition of the XOR result with the cyclically shifted intermediate variables;

[0061] Step 5: Determine whether the current encryption round number is less than the external encryption round number r. If so, perform linear permutation on the modular addition result and the cyclic shift result, and jump to step 4; if not, output the ciphertext.

[0062] In one embodiment, step 1 is to pre-process the plaintext data, specifically:

[0063] This embodiment discloses two algorithm versions. The first version uses 64-bit plaintext as the first round of encrypted data, and divides it into 4 blocks from low to high, with each block length of 16 bits. The second version uses 128-bit plaintext as the first round of encrypted data, and divides it into 4 blocks from low to high, with each block length of 32 bits. The 4 blocks are respectively recorded as , where i=1,2,…,r-1; the master key is set to 128 bits, expressed as , the round key of the algorithm , where the master key The high 8 bits of the round number seed knt will be used as the basis for dynamic round number generation.

[0064] In one embodiment, the number of external encryption rounds r is calculated as follows:

[0065] The 8-bit knt of the master key is divided modulo 7 and added to the basic round number to obtain the outer encryption round number r.

[0066] Furthermore, step 2 is a step of generating dynamic round numbers, specifically:

[0067] The outer encryption round number r for the current session is generated based on the high-order 8 bits of the master key, knt. When processing 64-bit packets, the outer encryption round number r is calculated by adding knt modulo 7 to the base round number 34. When processing 128-bit packets, the outer encryption round number r is calculated by adding knt modulo 7 to the base round number 40. This round number generation mechanism constitutes the algorithm's dynamic feedback structure, providing adaptive support for security.

[0068] Furthermore, the function and function The negative feedback mechanism of the algorithm is formed; the number of external encryption rounds r of the algorithm is determined by the master key; and and There is an rd round iterative operation. The rd round is determined by the number of external encryption rounds r according to the preset rules. The preset rules are as follows:

[0069] For the first version (64-bit blocks), rd is equal to 1 when the number of outer encryption rounds r is in the range of 38 to 40 (inclusive); rd is equal to 2 when the number of outer encryption rounds r is in the range of 36 (inclusive) to 38 (excluding 38); and rd is equal to 3 when the number of outer encryption rounds r is in the range of 34 (inclusive) to 36 (excluding 36).

[0070] For the second version (128-bit blocks), rd is equal to 1 when the number of outer encryption rounds r is in the range of 44 to 46 (inclusive); rd is equal to 2 when the number of outer encryption rounds r is in the range of 42 (inclusive) to 44 (excluding 44); and rd is equal to 3 when the number of outer encryption rounds r is in the range of 40 (inclusive) to 42 (excluding 42).

[0071] In one embodiment, the steps for generating the round key are:

[0072] Step 311: Divide the master key into the first subkey and the second subkey , and for the first subkey and the second subkey Assign a value;

[0073] Step 312: The first subkey Divide into two parts, as the initial round key of the current round number i;

[0074] Step 313: The second subkey Assign to a temporary variable ;

[0075] Step 314: The second subkey Cyclic shift result, first subkey Perform an XOR operation with the current round number i, and update the second subkey based on the XOR result ;

[0076] Step 315: Set the temporary variable The value of is assigned to the first subkey ;

[0077] Step 316: Determine whether the current round number i is equal to the external encryption round number r. If not, execute steps 312 to 316; if so, output the round key.

[0078] In one embodiment, the steps for generating the round key are:

[0079] Step 321: Divide the master key into the first subkey , the second subkey , the third subkey and the fourth subkey , and for the first subkey , the second subkey , the third subkey and the fourth subkey Assign a value;

[0080] Step 322: The first subkey Divide into two parts, as the initial round key of the current round number i;

[0081] Step 323: The second subkey Assign to the first temporary variable , the fourth subkey Assign to the second temporary variable ;

[0082] Step 324: The second subkey The cyclic shift result and the first subkey Perform an XOR operation and update the second subkey based on the XOR result ; The fourth subkey The cyclic shift result and the third subkey Perform an XOR operation and update the fourth subkey based on the XOR result ;

[0083] Step 325: Set the first temporary variable k t1 The value of is assigned to the first subkey ; Set the second temporary variable The value of is assigned to the third subkey ;

[0084] Step 326: The second subkey , the fourth subkey Perform an XOR operation with the current round number i, and update the second subkey based on the XOR result ;

[0085] Step 327: Determine whether the current round number i is equal to the external encryption round number r. If not, execute steps 322 to 327; if so, output the round key.

[0086] Furthermore, step 3 is a specific step of the round key generation algorithm, such as Figure 2 As shown, specifically:

[0087] For the first version: Divided into two n / 2-bit subkeys and ,Right now In the process of cyclically generating round keys, Directly split into the i-th round key and Through XOR and circular shift operations, a temporary variable is first introduced, and After cyclic left shift by three bits, the result of XOR operation is XORed with the round number i to obtain Make corresponding updates to achieve the purpose of updating the round key.

[0088] For the second version: Split the master key K into four n / 4-bit subkeys , , , ,Right now , in the process of cyclically generating round keys, Directly split into the round i key and The difference from the first version is that two temporary variables need to be introduced here, and and Perform circular left shift and XOR operation on and after circular left shift Perform XOR operation and then update , thereby achieving the purpose of updating the round key.

[0089] Furthermore, the round key generation algorithm for the 64-bit version of the plaintext data is as follows:

[0090] Assume that the master key consists of two parts. Start the loop operation, looping from round 0 to round r: first, the master key Divide into two variables and , and assign it to two variables; then Divided equally and As the round key of the current round i, the round key is composed of the two variables assigned previously. Make the following update: Assign to a temporary variable k t ,right Make the following updates: The result of rotating left 3 bits and Perform XOR operation with the current round number i and finally assign it to ; Then the temporary variable Assign to , the loop ends.

[0091] The key generation algorithm for the 128-bit plaintext data version is as follows:

[0092] Assume that the master key is divided into four parts , , , , similar to the previous version Divided equally and As the round key of the current round i, the cycle starts from round 0 to round r: and Assign values ​​to two temporary variables respectively and , and then respectively and k3 make the following updates: The result of rotating left 7 bits and The result of the XOR operation is assigned to , and The result of rotating left 3 bits and The result of the XOR operation is assigned to . Then and Assign values ​​to and ; Finally, update :Will The result of XOR operation of k3 and round number i is assigned to , the loop ends.

[0093] In one embodiment, if n is 4, step 4 is specifically as follows:

[0094] Input the four data blocks to be encrypted into the four branches of the encryption round function in sequence;

[0095] Performing initial transformation on the data block to be encrypted of the second branch and the data block to be encrypted of the fourth branch respectively to generate a first initial data block to be encrypted and a second initial data block to be encrypted;

[0096] Perform an XOR operation on the first initial data block to be encrypted and the data block to be encrypted in the third branch to generate a first intermediate variable P2;

[0097] Perform an XOR operation on the second initial data block to be encrypted and the data block to be encrypted of the first branch to generate a second intermediate variable P0;

[0098] Performing cyclic shifts on the first intermediate variable P2 and the second intermediate variable P0 respectively to generate a first shift result and a second shift result;

[0099] Performing an XOR operation on the first shift result and the first part of the round key to obtain a first XOR result; performing an XOR operation on the second shift result and the second part of the round key to obtain a second XOR result;

[0100] The first XOR result and the first shift result are modulo-added to obtain the output value of the third branch; the second XOR result and the second shift result are modulo-added to obtain the output value of the first branch; and the first shift result is used as the output value of the fourth branch; and the second shift result is used as the output value of the second branch.

[0101] Furthermore, step 4 is the round function encryption process, such as Figure 3 As shown, specifically:

[0102] The four plaintext data blocks in step 1 are respectively entered into the four branches of the encryption round function from low to high. First, the first and the fourth branch Perform initial transformations respectively to generate a first initial data block to be encrypted and a second initial data block to be encrypted; the first initial data block to be encrypted and the round key Perform XOR operation to generate the first XOR result; the second initial data block to be encrypted and the round key Perform XOR operation to generate the second XOR result; the first initial data block to be encrypted and the third branch Perform XOR operation to obtain intermediate variable P2; perform modulo addition operation on intermediate variable P2 after 11 digits of circular left shift and the second XOR result; perform modulo addition operation on the second initial data block to be encrypted and the first branch. An XOR operation is performed to obtain an intermediate variable P0; the intermediate variable P0 is circularly shifted left by five bits and then a modular addition operation is performed with the first XOR result, and finally a linear permutation operation is performed.

[0103] If the number of external encryption rounds r is equal to 1: function and function The input data is circularly shifted left by three bits and circularly shifted left by seven bits respectively.

[0104] If the number of external encryption rounds r is greater than 1: function and function The input data is XORed with the result of its cyclic left shift by three bits and the result of its cyclic left shift by seven bits.

[0105] In addition to the last round of encryption operation, the intermediate variables obtained after the circular shift and XOR modular addition operation in step 4 are linearly exchanged, that is, the first branch and the second branch are linearly permuted, and the third branch and the fourth branch are linearly permuted.

[0106] In one embodiment, if Figure 4 As shown in the figure, when decrypting the ciphertext, the decryption process is completely symmetrical with the encryption process, using the reverse round key and performing the operations in reverse order.

[0107] After the above steps, the data rotation operation of the information in the encryption round function can be realized, and the pseudo-random round number mechanism can fully ensure the obfuscation and diffusion of the data.

[0108] On the other hand, this embodiment further discloses an ARX lightweight block encryption system based on pseudo-random dynamic rounds, including:

[0109] The pre-processing module is used to evenly divide the data to be encrypted into n data blocks to be encrypted and set the master key;

[0110] The dynamic round number generation module is used to obtain the basic round number and the 8-bit knt of the master key, calculate the external encryption round number r based on knt and the basic round number; and determine the internal encryption round number rd based on the external encryption round number r according to the preset rules;

[0111] The key generation module is used to split the master key into multiple subkeys, split any subkey to generate the initial round key, introduce temporary variables, and use the round function algorithm to update the initial round key based on the external encryption round number r and the subkey to generate the round key;

[0112] The round function encryption module is used to sequentially input n data blocks to be encrypted into n branches of the encryption round function, perform an initial transformation on n / 2 data blocks to be encrypted to generate an initial data block to be encrypted, perform an XOR operation on the initial data block to be encrypted and the round key to generate an XOR result; perform an XOR operation on the initial data block to be encrypted and the corresponding data block to be encrypted to obtain n / 2 intermediate variables; and perform modular addition of the XOR result with the cyclically shifted intermediate variables.

[0113] The ciphertext generation module is used to determine whether the current encryption round number is less than the external encryption round number r. If so, it performs linear permutation on the modular addition result and the cyclic shift result, and transmits the generated output to the round function encryption module; if not, it outputs the ciphertext.

[0114] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.

[0115] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An ARX lightweight block encryption method based on pseudo-random dynamic rounds, characterized in that: The specific steps are: Step 1: Divide the data to be encrypted into n blocks of data to be encrypted and set the master key; Step 2: Obtain a basic round number and the 8-bit knt of the master key, calculate an outer encryption round number r based on the knt and the basic round number; and determine an inner encryption round number rd based on the outer encryption round number r according to a preset rule; Step 3: Split the master key into multiple subkeys, split any of the subkeys to generate an initial round key, introduce a temporary variable, and use a round function algorithm to update the initial round key based on the external encryption round number r and the subkey to generate a round key; Step 4: Input the n data blocks to be encrypted into the n branches of the encryption round function in sequence, perform an initial transformation on the n / 2 data blocks to be encrypted to generate an initial data block to be encrypted, perform an XOR operation on the initial data block to be encrypted and the round key to generate an XOR result; and perform an XOR operation on the initial data block to be encrypted and the corresponding data block to be encrypted to obtain n / 2 intermediate variables; Modulo-adding the intermediate variable after cyclic shifting to the XOR result; Step 5: Determine whether the current encryption round number is less than the external encryption round number r. If so, perform linear permutation on the modular addition result and the cyclic shift result, and jump to step 4; if not, output the ciphertext.

2. The ARX lightweight block encryption method based on pseudo-random dynamic rounds according to claim 1, characterized in that: The calculation method of the external encryption round number r is: The 8-bit knt of the master key is divided modulo 7 and added to the basic round number to obtain the external encryption round number r.

3. The ARX lightweight block encryption method based on pseudo-random dynamic rounds according to claim 1, characterized in that: The steps for generating the round key are: Step 311: Divide the master key into the first subkey and the second subkey , and for the first subkey and the second subkey Assign a value; Step 312: The first subkey Divide into two parts, as the initial round key of the current round number i; Step 313: The second subkey Assign to a temporary variable ; Step 314: The second subkey Cyclic shift result, the first subkey Perform an XOR operation on the current round number i and update the second subkey based on the XOR result ; Step 315: Set the temporary variable The value of the first subkey is assigned to ; Step 316: Determine whether the current round number i is equal to the external encryption round number r. If not, execute steps 312 to 316; if so, output the round key.

4. The ARX lightweight block encryption method based on pseudo-random dynamic rounds according to claim 1, characterized in that: The steps for generating the round key are: Step 321: Divide the master key into the first subkey , the second subkey , the third subkey and the fourth subkey , and for the first subkey , the second subkey , the third subkey and the fourth subkey Assign a value; Step 322: The first subkey Divide into two parts, as the initial round key of the current round number i; Step 323: The second subkey Assign to the first temporary variable , the fourth subkey Assign the value to the second temporary variable ; Step 324: The second subkey The cyclic shift result and the first subkey Perform an XOR operation and update the second subkey based on the XOR result ; The fourth subkey The cyclic shift result and the third subkey Perform an XOR operation and update the fourth subkey based on the XOR result ; Step 325: Set the first temporary variable The value of the first subkey is assigned to ; The second temporary variable The value of the third subkey is assigned to ; Step 326: The second subkey , the fourth subkey Perform an XOR operation with the current round number i, and update the second subkey based on the XOR result ; Step 327: Determine whether the current round number i is equal to the external encryption round number r. If not, execute steps 322 to 327; if so, output the round key.

5. The ARX lightweight block encryption method based on pseudo-random dynamic rounds according to claim 1, characterized in that: The steps for generating the initial data block to be encrypted are: When the number of external encryption rounds r=1, performing a cyclic left shift on the data block to be encrypted to generate the initial data block to be encrypted; When the number of external encryption rounds r>1, an XOR operation is performed on the data block to be encrypted and the data block to be encrypted after cyclic left shift to generate the initial data block to be encrypted.

6. The ARX lightweight block encryption method based on pseudo-random dynamic rounds according to claim 3 or 4, characterized in that: If n is 4, step 4 is as follows: Inputting the four data blocks to be encrypted into the four branches of the encryption round function in sequence; Performing initial transformation on the data block to be encrypted of the second branch and the data block to be encrypted of the fourth branch, respectively, to generate a first initial data block to be encrypted and a second initial data block to be encrypted; Perform an XOR operation on the first initial data block to be encrypted and the data block to be encrypted in the third branch to generate a first intermediate variable P2; Perform an XOR operation on the second initial data block to be encrypted and the data block to be encrypted of the first branch to generate a second intermediate variable P0; Performing cyclic shift on the first intermediate variable P2 and the second intermediate variable P0 respectively to generate a first shift result and a second shift result; Performing an XOR operation on the first initial data block to be encrypted and the first part of the round key to obtain a first XOR result; Performing an XOR operation on the second initial data block to be encrypted and the second part of the round key to obtain a second XOR result; Modulo-add the first XOR result and the second shift result to obtain an output value of the first branch; Modulo-add the second XOR result and the first shift result to obtain an output value of the third branch; and using the first shift result as the output value of the fourth branch; The second shift result is used as the output value of the second branch.

7. The ARX lightweight block encryption method based on pseudo-random dynamic rounds according to claim 1, characterized in that: When decrypting the ciphertext, the decryption process is completely symmetrical with the encryption process, and the reverse round key is used to perform the inverse operation steps of the round function.

8. An ARX lightweight block encryption system based on pseudo-random dynamic rounds, characterized in that: include: The pre-processing module is used to evenly divide the data to be encrypted into n data blocks to be encrypted and set the master key; A dynamic round number generation module is used to obtain a basic round number and an 8-bit knt of the master key, and calculate an external encryption round number r based on the knt and the basic round number; and determining the number of internal encryption rounds rd based on the number of external encryption rounds r according to a preset rule; a key generation module, configured to split the master key into multiple subkeys, split any of the subkeys to generate an initial round key, introduce a temporary variable, and use a round function algorithm to update the initial round key based on the external encryption round number r and the subkey to generate a round key; a round function encryption module, configured to sequentially input n data blocks to be encrypted into n branches of an encryption round function, perform an initial transformation on n / 2 of the data blocks to be encrypted to generate an initial data block to be encrypted, perform an XOR operation on the initial data block to be encrypted and the round key to generate an XOR result; and perform an XOR operation on the initial data block to be encrypted and the corresponding data block to be encrypted to obtain n / 2 intermediate variables; Modulo-adding the intermediate variable after cyclic shifting to the XOR result; The ciphertext generation module is used to determine whether the current encryption round number is less than the external encryption round number r. If so, it performs linear permutation on the modular addition result and the cyclic shift result, and transmits the generated output to the round function encryption module; if not, it outputs the ciphertext.

Citation Information

Patent Citations

  • Implementation method of a lightweight block cipher algorithm Wheel

    CN109768854A

  • Implementation method of lightweight AEROGEL block cipher

    CN111245598A

  • Lightweight block cipher encryption and decryption method

    CN113645615A

  • Implementation method and system of high-diffusion lightweight block cipher HDLBC

    CN116455558A

  • Password implementation method and system for lightweight joint coding

    CN116722967A