ARX lightweight block encryption method and system based on pseudo-random dynamic wheel number
By using the ARX lightweight block cipher method with pseudo-random dynamic round numbers, combined with a simplified Feistel structure and ARX operations, the number of rounds is dynamically generated, solving the performance bottleneck and security problems of lightweight block cipher algorithms in resource-constrained environments, and realizing an efficient and secure encryption scheme.
Patent Information
- Application Number
- CN202510792516.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2045-06-13
AI Technical Summary
Existing lightweight block cipher algorithms suffer from increased computational complexity and storage requirements in resource-constrained environments, leading to performance bottlenecks and insufficient security, making them difficult to effectively resist side-channel attacks and cryptanalysis.
A lightweight block encryption method based on pseudo-random dynamic rounds is adopted. By simplifying the Feistel structure and combining it with ARX operations, the number of rounds is dynamically generated. The key is updated using the round function algorithm. Combined with the negative feedback mechanism, a round key with strong pseudo-randomness is generated. XOR and cyclic shift operations are performed to generate ciphertext.
It significantly reduces resource consumption, increases encryption speed, enhances resistance to differential and linear analysis, reduces power consumption, and improves security against side-channel attacks.
Smart Images

Figure CN120602075B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of cryptography and information security, more particularly, to an ARX lightweight block encryption method and system based on pseudo-random dynamic round number. BACKGROUND
[0002] At present, with the advent of the era of ubiquitous computing, the wide application of a large number of Internet of Things devices has put forward urgent needs of low delay and low power consumption for block cipher algorithms, prompting the birth of lightweight block cipher algorithms such as RECTANGLE, ITUbee, SIMON, etc. to adapt to resource-constrained environments such as wireless sensor networks and electronic tags. At the same time, in the face of the increasingly advanced cryptographic analysis technology, researchers have continuously improved the security of lightweight algorithms against side-channel attacks, differential analysis and linear analysis through methods such as masking technology (such as applied to PICARO, Zorro, Robin) and wide-track strategy (such as applied to PRINCE, PRIDE). In addition, lightweight block cipher algorithms have become the core components of many information security protocols and authentication encryption algorithms, and their application scenarios have also extended to resource-rich devices such as smartphones that interact with resource-constrained devices. However, in order to further optimize performance or improve security, some innovative solutions attempt to jointly design cryptographic algorithms with error correction coding and other technologies, for example, directly integrating LDPC code encoding in the encryption process (such as the method described in patent CN11622967A, which uses an ARX-type lightweight block algorithm for R rounds of iteration, and performs LDPC encoding and key addition in the R+1th round). This kind of deep integration may bring advantages in theory, but in actual resource-constrained lightweight application scenarios, the additional computational complexity (such as LDPC encoding operations) introduced, potential delay increase, and demand for limited storage resources (such as storing LDPC check matrices) may partially offset the efficiency advantages of lightweight cryptographic algorithms themselves, and even become a new performance bottleneck. Therefore, how to ensure efficient and secure coding is a problem that those skilled in the art need to solve. SUMMARY
[0003] Therefore, the present application provides an ARX lightweight block encryption method and system based on pseudo-random dynamic round number, which overcomes the above-mentioned defects.
[0004] In order to achieve the above-mentioned purpose, the present application adopts the following technical solutions:
[0005] An ARX lightweight block encryption method based on pseudo-random dynamic round number, the specific steps are:
[0006] Step 1, divide the data to be encrypted into n data blocks to be encrypted, and set a master key;
[0007] Step 2, obtaining the basic round number and 8-bit knt of the master key, calculating the external encryption round number r based on the knt and the basic round number, and determining the internal encryption round number rd based on the external encryption round number r according to a preset rule;
[0008] Step 3, splitting the master key into a plurality of sub-keys, segmenting any of the sub-keys to generate an initial round key, and introducing a temporary variable, updating the initial round key based on the external encryption round number r and the sub-key by using a round function algorithm to generate a round key;
[0009] Step 4, inputting n blocks of the to-be-encrypted data into n branches of an encryption round function in sequence, performing initial transformation on n / 2 blocks of the to-be-encrypted data to generate initial to-be-encrypted data blocks, performing exclusive OR operation on the initial to-be-encrypted data blocks and the round key to generate an exclusive OR result, and performing exclusive OR operation on the initial to-be-encrypted data blocks and the corresponding to-be-encrypted data to obtain n / 2 intermediate variables; and performing modulo addition on the intermediate variables after cyclic bit shift and the exclusive OR result;
[0010] Step 5, determining whether the current encryption round number is less than the external encryption round number r, if yes, performing linear permutation on the modulo addition result and the cyclic bit shift result, and jumping to step 4; if not, outputting the ciphertext.
[0011] Optionally, the calculation method of the external encryption round number r is:
[0012] After the 8-bit knt of the master key is divided by 7, the basic round number is added to obtain the external encryption round number r.
[0013] Optionally, the generation step of the round key is:
[0014] Step 311, dividing the master key into a first sub-key and a second sub-key , and assigning values to the first sub-key and the second sub-key ;
[0015] Step 312, dividing the first sub-key into two parts as the initial round key of the current round number i;
[0016] Step 313, assigning the second sub-key to a temporary variable ;
[0017] Step 314, cyclic bit shifting the second sub-key , the first sub-key XORing the second sub-key with the current round number i, and updating the second sub-key based on the XOR result ;
[0018] Step 315, assigning the value of the temporary variable to the first sub-key ;
[0019] Step 316, judging whether the current round number i is equal to the external encryption round number r, if not, executing steps 312-316; if yes, outputting the round key.
[0020] Optionally, the step of generating the round key comprises:
[0021] Step 321, dividing the master key into a first sub-key , a second sub-key , a third sub-key and a fourth sub-key , and assigning values to the first sub-key , the second sub-key , the third sub-key and the fourth sub-key ;
[0022] Step 322, dividing the first sub-key into two parts as the initial round key of the current round number i;
[0023] Step 323, assigning the second sub-key to a first temporary variable , and assigning the fourth sub-key to a second temporary variable ;
[0024] Step 324, XORing the circularly shifted result of the second sub-key with the first sub-key , and updating the second sub-key based on the XOR result ; XORing the circularly shifted result of the fourth sub-key with the third sub-key , and updating the fourth sub-key based on the XOR result ;
[0025] Step 325, assigning the value of the first temporary variable k t1 to the first sub-key ; and assigning the value of the second temporary variable to the third sub-key ;
[0026] Step 326, performing XOR operation on the second sub-key , the fourth sub-key and the current round number i, updating the second sub-key based on the XOR result;
[0027] Step 327, judging whether the current round number i is equal to the external encryption round number r, if not, executing steps 322-327; if yes, outputting the round key.
[0028] Optionally, the step of generating the initial to-be-encrypted data block is:
[0029] when the external encryption round number r = 1, performing cyclic left shift on the to-be-encrypted data block to generate the initial to-be-encrypted data block;
[0030] when the external encryption round number r > 1, performing XOR operation on the to-be-encrypted data block and the to-be-encrypted data block after cyclic left shift to generate the initial to-be-encrypted data block.
[0031] Optionally, if n is 4, step 4 is specifically:
[0032] inputting four to-be-encrypted data blocks into four branches of the encryption round function in sequence respectively;
[0033] performing initial transformation on the to-be-encrypted data block of the second branch and the to-be-encrypted data block of the fourth branch respectively to generate a first initial to-be-encrypted data block and a second initial to-be-encrypted data block;
[0034] performing XOR operation on the first initial to-be-encrypted data block and the to-be-encrypted data block of the third branch to generate a first intermediate variable P2;
[0035] performing XOR operation on the second initial to-be-encrypted data block and the to-be-encrypted data block of the first branch to generate a second intermediate variable P0;
[0036] performing cyclic bit 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 XOR operation on the first shift result and the first part of the round key to obtain a first XOR result; performing XOR operation on the second shift result and the second part of the round key to obtain a second XOR result;
[0038] adding the first XOR result and the first shift result to obtain the output value of the third branch; adding the second XOR result and the second shift result to obtain the output value of the first branch; taking the first shift result as the output value of the fourth branch; and taking the second shift result as the output value of the second branch.
[0039] Optionally, if the ciphertext is decrypted, the decryption process is completely symmetrical with the encryption process, and the inverse operation step of the round function is performed using the reverse order of the round key.
[0040] An ARX lightweight block encryption system based on a pseudo-random dynamic round number, comprising:
[0041] A preprocessing module is configured to evenly divide the data to be encrypted into n data blocks to be encrypted and set a master key.
[0042] A dynamic round number generation module is configured to obtain a basic round number and 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 is configured to split the master key into a plurality of sub-keys, split any of the sub-keys to generate an initial round key, introduce a temporary variable, and update the initial round key based on the external encryption round number r and the sub-key using a round function algorithm to generate a round key.
[0044] A round function encryption module is configured to sequentially input the n data blocks to be encrypted into n branches of an encryption round function, perform initial transformation on n / 2 data blocks to be encrypted to generate initial data blocks to be encrypted, perform XOR operation on the initial data blocks to be encrypted and the round key to generate an XOR result, perform XOR operation on the initial data blocks to be encrypted and the corresponding data blocks to be encrypted to obtain n / 2 intermediate variables, and perform modulo addition on the intermediate variables after cyclic bit shift and the XOR result.
[0045] A ciphertext generation module is configured to determine whether the current encryption round number is less than the external encryption round number r, if yes, perform linear permutation on the modulo addition result and the cyclic bit shift result, and transmit the generated output to the round function encryption module, and if not, output the ciphertext.
[0046] According to the above technical solution, the present application provides an ARX lightweight block encryption method and system based on a pseudo-random dynamic round number, which has the following advantages compared with the prior art:
[0047] 1. The simplified Feistel structure is combined with the optimized ARX operation to significantly reduce the resource overhead of the algorithm, realize lightweight design, and maintain high encryption / decryption speed, so that it can be flexibly adapted to resource-constrained application scenarios such as Internet of Things devices and edge computing nodes.
[0048] 2. Pseudo-random dynamic round number mechanism effectively disrupts the attack mode, greatly improves the ability of the algorithm to resist differential analysis, linear analysis and other classical cryptanalysis attacks.
[0049] 3. By carefully designing the ARX structure and removing the traditional S-box (which is usually vulnerable to side-channel attacks), the power consumption and other physical leakage information are significantly reduced, and the inherent security of the algorithm against side-channel attacks (such as power analysis and electromagnetic analysis) is improved. BRIEF DESCRIPTION OF DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of the provided drawings.
[0051] Figure 1 The method flowchart provided by the present application is shown.
[0052] Figure 2 The key generation encryption round function structure diagram provided by the present application is shown.
[0053] Figure 3 The encryption round function structure diagram provided by the present application is shown.
[0054] Figure 4 The decryption round function structure diagram provided by the present application is shown. DETAILED DESCRIPTION
[0055] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0056] The present application discloses an ARX lightweight block encryption method based on pseudo-random dynamic round number. The round function adopts a simplified Feistel structure and ARX structure, and uses addition, rotation and XOR operations of ARX structure to enhance the security and simplicity of the algorithm. The plaintext data is preprocessed as a 4-branch operation, reducing the size and complexity of each component. The key is the design of the dynamic mechanism 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 data blocks to be encrypted, and set a master key;
[0058] Step 2, obtain the basic round number and the 8-bit knt of the master key, calculate the external encryption round number r based on the knt and the basic round number, and determine the internal encryption round number rd based on the external encryption round number r according to a preset rule;
[0059] Step 3, split the master key into multiple sub-keys, split any sub-key to generate an initial round key, introduce a temporary variable, and update the initial round key based on the external encryption round number r and the sub-key by using a round function algorithm to generate a round key;
[0060] Step 4, input the n data blocks to be encrypted into n branches of the encryption round function in order, perform initial transformation on n / 2 data blocks to be encrypted to generate initial data blocks to be encrypted, perform XOR operation on the initial data blocks to be encrypted and the round key to generate an XOR result, and perform XOR operation on the initial data blocks to be encrypted and the corresponding data blocks to be encrypted to obtain n / 2 intermediate variables; after cyclically shifting the intermediate variables, add the intermediate variables and the XOR result;
[0061] Step 5, determine whether the current encryption round number is less than the external encryption round number r, if yes, perform linear permutation on the addition result and the cyclic shift result, and jump to step 4; if not, output the ciphertext.
[0062] In an embodiment, step 1 is preprocessing of the plaintext data, specifically:
[0063] This embodiment discloses two algorithm versions, the first version is to divide the 64-bit plaintext as the first round data to be encrypted into 4 blocks from low to high, each block length is 16 bits; the second version is to divide the 128-bit plaintext as the first round data to be encrypted into 4 blocks from low to high, each block length is 32 bits; the 4 blocks are respectively denoted as , i = 1, 2, …, r-1; the master key is set to 128 bits, denoted as , the round key of the algorithm is , wherein 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 an embodiment, the calculation method of the external encryption round number r is:
[0065] After the 8-bit knt of the master key is divided by 7, the external encryption round number r is obtained by adding the basic round number.
[0066] Further, step 2 is a dynamic round number generation step, specifically:
[0067] The outer encryption round number r of the current session is generated according to the high 8 bits knt of the master key. When processing 64-bit packets, the outer encryption round number r is obtained by adding the basic round number 34 to knt after being modulo 7; when processing 128-bit packets, the outer encryption round number r is obtained by adding the basic round number 40 to knt after being modulo 7. This round number generation mechanism constitutes a dynamic feedback structure of the algorithm, and can provide adaptive support for security.
[0068] Further, the function and the function constitute a negative feedback mechanism of the algorithm; the outer encryption round number r of the algorithm is determined by the master key; and and have rd round iteration operations. The rd round is determined according to a preset rule according to the outer encryption round number r, and the preset rule is as follows:
[0069] For the first version (64-bit packet), when the outer encryption round number r is in the range of 38 to 40 (including 38 and 40), rd is equal to 1; when the outer encryption round number r is in the range of 36 (including 36) to 38 (not including 38), rd is equal to 2; when the outer encryption round number r is in the range of 34 (including 34) to 36 (not including 36), rd is equal to 3.
[0070] For the second version (128-bit packet), when the outer encryption round number r is in the range of 44 to 46 (including 44 and 46), rd is equal to 1; when the outer encryption round number r is in the range of 42 (including 42) to 44 (not including 44), rd is equal to 2; when the outer encryption round number r is in the range of 40 (including 40) to 42 (not including 42), rd is equal to 3.
[0071] In an embodiment, the generation step of the round key is as follows:
[0072] Step 311, divide the master key into a first sub-key and a second sub-key , and assign values to the first sub-key and the second sub-key ;
[0073] Step 312, divide the first sub-key into two parts as the initial round key of the current round i;
[0074] Step 313, assign the second sub-key to a temporary variable ;
[0075] Step 314, circularly shift the second sub-key , the first sub-key XORing with the current round number i, updating the second sub-key based on the XOR result ;
[0076] Step 315, assigning the value of the temporary variable to the first sub-key ;
[0077] Step 316, judging whether the current round number i is equal to the external encryption round number r, if not, executing steps 312-316; if yes, outputting the round key.
[0078] In an embodiment, the step of generating the round key is:
[0079] Step 321, dividing the master key into the first sub-key , the second sub-key , the third sub-key and the fourth sub-key , and assigning values to the first sub-key , the second sub-key , the third sub-key and the fourth sub-key ;
[0080] Step 322, dividing the first sub-key into two parts as the initial round key of the current round number i;
[0081] Step 323, assigning the second sub-key to the first temporary variable , and assigning the fourth sub-key to the second temporary variable ;
[0082] Step 324, XORing the circularly shifted result of the second sub-key with the first sub-key , and updating the second sub-key based on the XOR result; XORing the circularly shifted result of the fourth sub-key with the third sub-key , and updating the fourth sub-key based on the XOR result;
[0083] Step 325, assigning the value of the first temporary variable k t1 to the first sub-key ; and assigning the value of the second temporary variable to the third sub-key ;
[0084] Step 326, assigning the second sub-key , the fourth sub-key Perform an XOR operation with the current round number i, and update the second subkey based on the XOR result. ;
[0085] Step 327: Determine if the current round number i is equal to the external encryption round number r. If not, proceed to steps 322-327; if yes, output the round key.
[0086] Furthermore, step 3 describes the specific steps of the round key generation algorithm, such as... Figure 2 As shown, specifically:
[0087] For the first version: [Master key] Divided into two n / 2 bit subkeys and ,Right now During the cyclic generation of round keys, Directly split into the i-th round key and By using XOR and circular shift operations, a temporary variable is first introduced to... and After a circular left shift of three bits, the result of the XOR operation is then XORed with the round number i to obtain the result of the XOR operation. Make the necessary updates to achieve the purpose of updating the round key.
[0088] For the second version: Divide the master key K into four n / 4-bit subkeys. , , , ,Right now During the process of generating round keys in a loop, Directly split into round keys for the i-th round. and Unlike the first version, this version requires the introduction of two temporary variables, and... and Perform a circular left shift and XOR operation on the left. and the circular left shift Perform an XOR operation to update This achieves the purpose of updating the round key.
[0089] Furthermore, the round key generation algorithm for the 64-bit plaintext data algorithm version is as follows:
[0090] Assume the master key consists of two parts. Begin the loop operation, from round 0 to round r: first, set the master key... Divide into two variables and And assign the values to two variables; then through Average score and This round key, used for the current i-th round, consists of the two variables previously assigned values. The following update is made: Assigned to a temporary variable k t ,right Make the following updates: The result of a circular left shift by 3 bits Perform an XOR operation with the current round number i, and finally assign the value to Then the temporary variable Assign to The loop ends.
[0091] The key generation algorithm process for the 128-bit plaintext data algorithm version is as follows:
[0092] Assume the master key is divided into four parts. , , , The same principle applies as the previous version. Average score and The loop begins with the current round key (round i) and continues from round 0 to round r: and Assigned to two temporary variables respectively and Then separately The following updates were made to K3: The result of a circular left shift by 7 bits The result of the XOR operation is assigned to Another The result of a circular left shift by 3 bits The result of the XOR operation is assigned to Then and Assign values to respectively and Finally, update :Will The result of the XOR operation between k3 and round number i is assigned to The loop ends.
[0093] In one embodiment, if n is 4, step 4 specifically involves:
[0094] The four data blocks to be encrypted are input into the four branches of the encryption round function in sequence;
[0095] The data blocks to be encrypted in the second branch and the data blocks to be encrypted in the fourth branch are subjected to initial transformations to generate the first initial data block to be encrypted and the second initial data block to be encrypted.
[0096] Perform an XOR operation between the first initial data block to be encrypted and the data block to be encrypted in the third branch to generate the first intermediate variable P2;
[0097] Perform an XOR operation between the second initial data block to be encrypted and the data block to be encrypted in the first branch to generate a second intermediate variable P0;
[0098] The first intermediate variable P2 and the second intermediate variable P0 are cyclically shifted respectively to generate the first shift result and the second shift result;
[0099] Perform an XOR operation between the first shift result and the first part of the round key to obtain the first XOR result; perform an XOR operation between the second shift result and the second part of the round key to obtain the second XOR result;
[0100] The first XOR result is modulo-added with the first shift result to obtain the output value of the third branch; the second XOR result is modulo-added with the second shift result to obtain the output value of the first branch; 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 from step 1 are entered into the four branches of the encryption round function from least significant bit to most significant bit. First, the second branch... and the fourth branch Initial transformations are performed 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 are then used. Perform an XOR operation to generate the first XOR result; the second initial block of data to be encrypted is then combined with the round key. Perform an XOR operation to generate a second XOR result; the first initial data block to be encrypted and the third branch... Perform an XOR operation to obtain intermediate variable P2; after left-shifting intermediate variable P2 by eleven bits, perform a modulo addition operation with the second XOR result; the second initial data block to be encrypted is then compared with the first branch. Perform an XOR operation to obtain the intermediate variable P0; after the intermediate variable P0 is circularly shifted left by five bits, perform a modulo addition operation with the first XOR result, and finally perform a linear permutation operation.
[0103] If the number of external encryption rounds r equals 1: function sum function These are the input data circularly shifted left by three bits and the input data circularly shifted left by seven bits, respectively.
[0104] If the number of external encryption rounds r is greater than 1: function sum function are respectively XOR operation of the input data and the result of cyclic left shift of three bits and XOR operation of the result of cyclic left shift of seven bits.
[0105] In addition to the last round of encryption operation, the intermediate variable obtained after the cyclic shift, XOR module addition operation in step 4 is 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 an embodiment, as shown in Figure 4 When decrypting the ciphertext, the decryption process is completely symmetrical to the encryption process, the reverse order of round keys is used, and the operation sequence is executed in reverse order.
[0107] Through the above steps, the data rotation operation of information in the encryption round function can be realized, and the pseudo-random round number mechanism can fully guarantee the confusion and diffusion of data.
[0108] The embodiment further discloses an ARX lightweight block encryption system based on a pseudo-random dynamic round number, comprising:
[0109] The preprocessing module is configured to divide the to-be-encrypted data into n to-be-encrypted data blocks evenly, and set a master key;
[0110] The dynamic round number generation module is configured to obtain an 8-bit knt of the basic round number and 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;
[0111] The key generation module is configured to split the master key into a plurality of sub-keys, split any sub-key, generate an initial round key, introduce a temporary variable, and update the initial round key based on the external encryption round number r and the sub-key by using a round function algorithm to generate a round key;
[0112] The round function encryption module is configured to input the n to-be-encrypted data blocks into n branches of the encryption round function in sequence, perform initial transformation on n / 2 to-be-encrypted data blocks to generate initial to-be-encrypted data blocks, perform XOR operation on the initial to-be-encrypted data blocks and the round key to generate an XOR result, perform XOR operation on the initial to-be-encrypted data blocks and corresponding to-be-encrypted data blocks to obtain n / 2 intermediate variables, and perform cyclic bit shift on the intermediate variables and module addition on the cyclic bit shift result and the XOR result.
[0113] The ciphertext generation module is configured to determine whether the current encryption round number is less than the external encryption round number r, if yes, perform linear permutation on the module addition result and the cyclic bit shift result, and transmit the generated output to the round function encryption module, and if not, output the ciphertext.
[0114] The various embodiments described in this specification are implemented in a progressive manner, each embodiment focusing on the differences from other embodiments, and the same or similar parts between embodiments can be mutually referred to. For the apparatus disclosed by the embodiments, since it corresponds to the method disclosed by the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0115] The above description of disclosed embodiments enables one of ordinary skill in the art to make or use the application. Various modifications to these embodiments will be readily apparent to those of ordinary skill in the art, and the generic principles defined herein can be applied to other embodiments without departing from the spirit or scope of the application. Therefore, the application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An ARX lightweight block encryption method based on pseudo-random round number, characterized in that, The specific steps are as follows: Step 1, divide the data to be encrypted into n data blocks, and set a master key; Step 2, obtain the basic round number and the high 8 bits of the master key, calculate the external encryption round number r based on the high 8 bits of the master key and the basic round number, and determine the internal encryption round number rd based on the external encryption round number r according to a preset rule; Step 3, split the master key into multiple sub-keys, split any of the sub-keys to generate an initial round key, introduce a temporary variable, and update the initial round key based on the external encryption round number r and the sub-key by using a round function algorithm to generate a round key; Step 4, input the n data blocks to be encrypted into n branches of an encryption round function in sequence, perform initial transformation on n / 2 data blocks to generate initial data blocks to be encrypted, perform XOR operation on the initial data blocks to be encrypted and the round key to generate an XOR result, and perform XOR operation on the initial data blocks to be encrypted and the corresponding data blocks to be encrypted to obtain n / 2 intermediate variables; After cyclically shifting the intermediate variables, add them to the XOR result; Step 5, determine whether the current encryption round number is less than the external encryption round number r, if yes, perform linear permutation on the 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 round number according to claim 1, characterized in that, The calculation method of the external encryption round number r is as follows: After the high 8 bits of the master key are divided by 7, add the basic round number to obtain the external encryption round number r.
3. The ARX lightweight block encryption method based on pseudo-random round number according to claim 1, characterized in that, The generation step of the round key is as follows: Step 311, divide the master key into a first sub-key k0 and a second sub-key k1, and assign values to the first sub-key k0 and the second sub-key k1; Step 312, divide the first sub-key k0 into two parts as the initial round key of the current round number i; Step 313, assign the second sub-key k1 to temporary variable k t ; Step 314, perform XOR operation on the cyclic shift result of the second sub-key k1, the first sub-key k0 and the current round number i, and update the second sub-key k1 based on the XOR result; Step 315, assigning the value of the temporary variable k t to the first sub-key k0; Step 316, determine whether the current round number i is equal to the external encryption round number r, if not, execute steps 312-316; if yes, output the round key.
4. The ARX lightweight block encryption method based on pseudo-random dynamic round number according to claim 1, characterized in that, The generation step of the round key is as follows: Step 321, divide the master key into a first sub-key k0, a second sub-key k1, a third sub-key k2 and a fourth sub-key k3, and assign values to the first sub-key k0, the second sub-key k1, the third sub-key k2 and the fourth sub-key k3; Step 322, divide the first sub-key k0 into two parts as the initial round key of the current round number i; Step 323, assign the second sub-key k1 to a first temporary variable k t1 , assign the fourth sub-key k3 to a second temporary variable k t2 ; Step 324, perform XOR operation on the cyclic shift result of the second sub-key k1 and the first sub-key k0, and update the second sub-key k1 based on the XOR result; perform XOR operation on the cyclic shift result of the fourth sub-key k3 and the third sub-key k2, and update the fourth sub-key k3 based on the XOR result; Step 325, assigning the value of the first temporary variable k t1 to the first sub-key k0; assigning the value of the second temporary variable k t2 to the third sub-key k2; Step 326, performing exclusive-OR operation on the second sub-key k1, the fourth sub-key k3 and the current round number i, and updating the second sub-key k1 based on the exclusive-OR result; Step 327, judging whether the current round number i is equal to the external encryption round number r, if not, performing steps 322-327, and if yes, outputting the round key.
5. The ARX lightweight block encryption method based on pseudo-random round number according to claim 1, characterized in that, The generation step of the initial data block to be encrypted is: When the external encryption round number r = 1, performing cyclic left shift on the data block to be encrypted to generate the initial data block to be encrypted; When the external encryption round number r > 1, performing exclusive-OR operation 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 round number according to claim 3 or 4, characterized in that, If n is 4, step 4 is specifically: Inputting four data blocks to be encrypted in sequence into four branches of an encryption round function respectively; 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; Performing exclusive-OR operation on the first initial data block to be encrypted and the data block to be encrypted of the third branch to generate a first intermediate variable P2; Performing exclusive-OR 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 bit 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 exclusive-OR operation on the first initial data block to be encrypted and a first part of the round key to obtain a first exclusive-OR result; Performing exclusive-OR operation on the second initial data block to be encrypted and a second part of the round key to obtain a second exclusive-OR result; Adding the first exclusive-OR result and the second shift result to obtain an output value of the first branch; Adding the second exclusive-OR result and the first shift result to obtain an output value of the third branch; And taking the first shift result as an output value of the fourth branch; Taking the second shift result as an output value of the second branch.
7. The ARX lightweight block encryption method based on pseudo-random round number according to claim 1, characterized in that, When the ciphertext is decrypted, the decryption process is completely symmetrical with the encryption process, an inverse operation step of the round function is performed using reverse sequence round keys.
8. An ARX lightweight block encryption system based on pseudo-random round number, characterized in that, Comprise: A preprocessing module for equally dividing data to be encrypted into n data blocks to be encrypted and setting a master key; A dynamic round number generation module for obtaining a basic round number and high 8 bits of the master key, calculating an external encryption round number r based on the high 8 bits of the master key and the basic round number, and determining an internal encryption round number rd based on the external encryption round number r according to a preset rule; A key generation module for splitting the master key into a plurality of sub-keys, generating an initial round key by splitting any of the sub-keys, introducing a temporary variable, and updating the initial round key based on the external encryption round number r and the sub-key by using a round function algorithm to generate a round key; a round function encryption module, configured to input n pieces of the to-be-encrypted data blocks in sequence into n branches of an encryption round function, perform initial transformation on n / 2 pieces of the to-be-encrypted data blocks to generate initial to-be-encrypted data blocks, perform XOR operation on the initial to-be-encrypted data blocks and the round key to generate an XOR result, and perform XOR operation on the initial to-be-encrypted data blocks and corresponding to-be-encrypted data blocks to obtain n / 2 intermediate variables; perform modulo addition on the intermediate variables after cyclic bit shift and the XOR result; a ciphertext generation module, configured to determine whether the current encryption round number is less than the external encryption round number r, if yes, perform linear permutation on the modulo addition result and the cyclic bit shift result, and transmit the generated output to the round function encryption module, and if not, output a ciphertext.
Citation Information
Patent Citations
Implementation method of a lightweight block cipher algorithm Wheel
CN109768854A
Implementation method of lightweight AEROGEL block cipher
CN111245598A