Encryption method and device supporting 64-bit block cipher

By dividing the plaintext to be encrypted and the master key into four groups for XOR operation and circular shift, the traditional permutation module is discarded, and dynamic key update is used to solve the problem of low security of existing block ciphers in resource-limited environments. , improves the security and diffusion of the algorithm, and achieves avalanche effect and anti-analysis capabilities.

CN118764175APending Publication Date: 2024-10-11福建福链科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410913067.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-09
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

Existing block ciphers have low security in resource-limited environments, and the fixed keys and substitution module designs of lightweight algorithms increase the risk of being analyzed and cracked, reducing performance and efficiency.

Method used

Using a 64-bit block cipher encryption method, by dividing the plaintext to be encrypted and the master key into four groups, performing XOR operations and circular shifts, discarding the traditional S box and P table replacement, and adopting a dynamic key update mode. Enhance the nonlinearity and analysis resistance of the algorithm.

Benefits of technology

It significantly improves the security and diffusion of the algorithm, reduces the consumption of hardware resources, realizes the avalanche effect, and enhances the algorithm's resistance to analysis and overall security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118764175A_ABST
    Figure CN118764175A_ABST
Patent Text Reader

Abstract

The invention discloses an encryption method and device supporting 64-bit block cipher. The encryption method comprises the following steps: acquiring a plaintext to be encrypted and dividing the plaintext into four groups of plaintexts from a high bit to a low bit; obtaining a master key and dividing the master key into four keys from a high order to a low order; combining every two of the four keys to obtain two to-be-encrypted key combinations; performing XOR operation on the keys in each to-be-encrypted key combination to obtain four round keys; two different plaintexts in the four plaintexts are selected in sequence to be combined to obtain four to-be-encrypted plaintext combinations; performing XOR operation on the four groups of to-be-encrypted plaintext combinations and the four round keys to obtain four groups of encrypted plaintexts; judging whether the current encryption round number reaches a preset round or not, and if yes, connecting the four groups of encrypted plaintexts to obtain a ciphertext; and if not, updating the master key and returning to the step of dividing the master key into the four keys from the high order to the low order to carry out the next round of encryption. The plaintexts of the four branches are all subjected to logical operation, the avalanche effect is achieved, the anti-analysis capacity is improved, and the overall safety of the algorithm is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and in particular to a 64-bit block cipher encryption method and device. Background Art

[0002] The existing block cipher designs mainly adopt Feistel and SPN structures. Feistel structure is popular due to its good symmetry, low resource consumption and similar encryption and decryption process, but its data diffusion speed is slow and its security is low when facing high-performance computing attacks. SPN structure is known for its clear architecture, excellent obfuscation and diffusion capabilities, but its asymmetry leads to large differences in encryption and decryption, high resource consumption and low efficiency; in a resource-limited environment, SPN structure is not conducive to implementation due to the high resource requirements of S-box.

[0003] Existing lightweight algorithms usually adopt a fixed key approach, using a fixed-bit key to participate in the calculation in the round function. Even if keys of different bits are provided, the calculation and replacement modules are the same except for the number of rounds in the encryption / decryption process. Not only does it fail to significantly improve security, but it also significantly reduces the performance and efficiency of the algorithm, while also increasing hardware resource consumption.

[0004] Some algorithms simply replace the permutation modules in the round function in sequence, use a single S-box to participate in calculations and transformations, adopt fixed keys to participate in transformations in the round function, etc., which provides attackers with exploitable patterns, increases the risk of the algorithm being analyzed and cracked, and weakens the overall security. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a 64-bit block cipher encryption method and device to improve the overall security of the algorithm.

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

[0007] A 64-bit block cipher encryption method, comprising:

[0008] Obtaining plaintext to be encrypted, and dividing the plaintext to be encrypted into four groups of plaintext from high to low bits;

[0009] Obtain a master key, and divide the master key into four keys from high to low;

[0010] Combining the four keys in pairs to obtain two groups of key combinations to be encrypted;

[0011] Performing an XOR operation on the keys in each of the key combinations to be encrypted to obtain four round keys;

[0012] Sequentially selecting two different groups of the plaintexts from the four groups of plaintexts to combine to obtain four groups of plaintext combinations to be encrypted;

[0013] Performing XOR operations on the four groups of plaintext combinations to be encrypted and the four round keys to obtain four groups of encrypted plaintexts;

[0014] Determine whether the current number of encryption rounds reaches the preset number of rounds. If so, concatenate the four groups of encrypted plaintexts to obtain ciphertext; if not, update the master key and return to the step of dividing the master key from high to low into four keys for the next round of encryption.

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

[0016] A 64-bit block cipher encryption device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step in the above-mentioned 64-bit block cipher encryption method is implemented.

[0017] The beneficial effects of the present invention are as follows: after obtaining the plaintext to be encrypted, a four-branch Feistel structure is used to divide the plaintext to be encrypted into four groups of plaintexts, and the four groups of plaintexts are combined to obtain four groups of plaintext combinations to be encrypted; at the same time, a master key is divided into four keys, and an XOR operation is performed on the keys, thereby providing an obfuscation capability for the encryption process; during encryption, the four groups of plaintext combinations to be encrypted are respectively XOR-encrypted by the four keys, and the traditional S-box substitution and P-table substitution are abandoned; the plaintexts of the four branches are all subjected to logical operations, which is helpful to realize the avalanche effect, improve the anti-analysis capability, solve the defect that the traditional Feistel structure only affects half of the data in each round, improve the diffusion of the algorithm, and thus significantly improve the nonlinearity of the entire algorithm; and the key adopts a dynamic update mode, and the master key is updated before each round of encryption, thereby improving the overall security of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A flowchart of a 64-bit block cipher encryption method according to an embodiment of the present invention;

[0019] Figure 2 A flowchart of key update and round key generation in a 64-bit block cipher encryption method in an embodiment of the present invention;

[0020] Figure 3 4 is a structural diagram of a round function F in a block cipher encryption method supporting 64 bits in an embodiment of the present invention;

[0021] Figure 4 The figure is a schematic diagram of the structure of a 64-bit block cipher encryption device according to an embodiment of the present invention. DETAILED DESCRIPTION

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

[0023] Please refer to Figure 1 , a block cipher encryption method supporting 64 bits, comprising:

[0024] Obtaining plaintext to be encrypted, and dividing the plaintext to be encrypted into four groups of plaintext from high to low bits;

[0025] Obtain a master key, and divide the master key into four keys from high to low;

[0026] Combining the four keys in pairs to obtain two groups of key combinations to be encrypted;

[0027] Performing an XOR operation on the keys in each of the key combinations to be encrypted to obtain four round keys;

[0028] Sequentially selecting two different groups of the plaintexts from the four groups of plaintexts to combine to obtain four groups of plaintext combinations to be encrypted;

[0029] Performing XOR operations on the four groups of plaintext combinations to be encrypted and the four round keys to obtain four groups of encrypted plaintexts;

[0030] Determine whether the current number of encryption rounds reaches the preset number of rounds. If so, concatenate the four groups of encrypted plaintexts to obtain ciphertext; if not, update the master key and return to the step of dividing the master key from high to low into four keys for the next round of encryption.

[0031] The beneficial effects of the present invention are as follows: after obtaining the plaintext to be encrypted, a four-branch Feistel structure is used to divide the plaintext to be encrypted into four groups of plaintexts, and the four groups of plaintexts are combined to obtain four groups of plaintext combinations to be encrypted; at the same time, a master key is divided into four keys, and an XOR operation is performed on the keys, thereby providing an obfuscation capability for the encryption process; during encryption, the four groups of plaintext combinations to be encrypted are respectively XOR-encrypted by the four keys, and the traditional S-box substitution and P-table substitution are abandoned; the plaintexts of the four branches are all subjected to logical operations, which is helpful to realize the avalanche effect, improve the anti-analysis capability, solve the defect that the traditional Feistel structure only affects half of the data in each round, improve the diffusion of the algorithm, and thus significantly improve the nonlinearity of the entire algorithm; and the key adopts a dynamic update mode, and the master key is updated before each round of encryption, thereby improving the overall security of the algorithm.

[0032] Furthermore, performing an XOR operation and a preset operation on the keys in each of the key combinations to be encrypted includes:

[0033] After cyclically shifting a key in a group of the to-be-encrypted key combinations by a first preset number of bits along a first preset direction, an XOR operation is performed with another key in the combination to obtain a round key; and directly using a key in the group as a round key;

[0034] After a key in another group of the key combinations to be encrypted is cyclically moved along a second preset direction by a second preset number of bits, an XOR operation is performed with another key in the combination to obtain a round key; and a key in the group is directly used as a round key.

[0035] From the above description, it can be seen that by performing a cyclic shift on a key in the key combination to be encrypted and performing an XOR operation with another key in the combination, and different key combinations to be encrypted are encrypted in different preset directions and preset numbers of bits, thereby improving the security of the round key.

[0036] Furthermore, the steps of performing XOR operations on the four groups of plaintext combinations to be encrypted and the four round keys to obtain four groups of encrypted plaintexts include:

[0037] An XOR operation is performed on two plaintexts in the plaintext combination to be encrypted and a preset round key in the four round keys to obtain an encrypted plaintext.

[0038] It can be seen from the above description that the two plaintexts in the plaintext combination to be encrypted are subjected to an XOR operation with a preset round key in the four round keys, thereby improving the security of the encrypted plaintext.

[0039] Furthermore, the steps of performing XOR operations on the four groups of plaintext combinations to be encrypted and the four round keys to obtain four groups of encrypted plaintexts include:

[0040] Circularly shifting one of the plaintexts in the combination of plaintexts to be encrypted by a third preset number of bits along a third preset direction to obtain a first shifted plaintext, and circ ... fourth preset number of bits along a fourth preset direction to obtain a second shifted plaintext;

[0041] An XOR operation is performed on another plaintext in the to-be-encrypted plaintext combination, the first shifted plaintext, the second shifted plaintext, and a preset round key among the four round keys to obtain an encrypted plaintext.

[0042] From the above description, it can be seen that the combination of plaintexts to be encrypted is encrypted through circular shift and XOR operation, or the combination of plaintexts to be encrypted is directly encrypted through XOR operation, and the encrypted plaintext is obtained in two different ways, which improves the security of the encrypted plaintext; and, the traditional S-box substitution and P-table replacement encryption methods are abandoned, and a reusable XOR logic unit is used to reduce the hardware implementation area consumption.

[0043] Furthermore, the XOR operation is implemented by the same XOR unit.

[0044] From the above description, it can be seen that the XOR operation is implemented through the same XOR unit, that is, the XOR operation unit can be reused in the encryption process and the key update process; at the same time, the use of circular shift operation does not occupy hardware area, thereby saving hardware design space and helping to reduce chip area, power consumption and manufacturing costs.

[0045] Further, the updating of the master key includes:

[0046] The master key is circularly moved by a fifth preset number of bits along a fifth preset direction, and then a NOT operation is performed with the master key to obtain an updated master key.

[0047] From the above description, it can be seen that before the next round of encryption, the master key is updated by cyclically moving the master key in a preset direction by a preset number of bits and then performing a NOT operation with itself, so that the master key used for encryption in each round is different, thereby improving the anti-analysis ability of the encryption process.

[0048] Further, the determining whether the current number of encryption rounds reaches a preset number of rounds includes:

[0049] Obtaining a value of a pre-set position in the plaintext to be encrypted;

[0050] The preset round is obtained according to the value, specifically:

[0051] r=pg%10+9; wherein r is a preset round; and pg is a numerical value of a previously preset position in the plaintext to be encrypted.

[0052] From the above description, it can be seen that the number of encryption iterations depends on the plaintext content of each encryption, making it difficult for attackers to know the exact number of iterations in advance, thereby increasing the difficulty of static analysis of the algorithm.

[0053] Furthermore, it also includes:

[0054] Perform shift operation test on each parameter involved in logic operation to obtain parameter data that meets strict avalanche effect;

[0055] According to the parameter data, a first preset direction and a first preset number of bits, a second preset direction and a second preset number of bits, a third preset direction and a third preset number of bits, a fourth preset direction and a fourth preset number of bits, and a fifth preset direction and a fifth preset number of bits are obtained.

[0056] From the above description, it can be seen that by using parameter data that satisfies the strict avalanche effect as the preset direction and preset number of bits of parameters such as the key, plaintext and master key, the algorithm satisfies the avalanche effect. The avalanche effect increases the uncertainty of the cryptographic algorithm, making it impossible for an attacker to accurately infer other parts or the entire output result even if he can control or predict part of the input information, significantly increasing the difficulty of brute force cracking or any attempt to restore the internal state of the algorithm.

[0057] Another embodiment of the present invention provides a 64-bit block cipher encryption device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned 64-bit block cipher encryption method when executing the computer program.

[0058] The 64-bit block cipher encryption method and device provided by the present invention can be applied to lightweight block cipher algorithm scenarios of ultra-low power devices in Internet of Things scenarios, support 64-bit master keys and block sizes, and provide more options for ultra-low power devices. For example, some sensor nodes, disposable medical devices, wearable devices, etc., these devices require extremely low power consumption and computing power to extend battery life or achieve battery-free operation. Another example is Internet of Things application devices such as RFID tags, especially passive RFID tags, whose energy comes from the radio frequency signal emitted by the reader, which is very limited. The following is an explanation through a specific implementation method:

[0059] Embodiment 1

[0060] Please refer to Figure 1 , a block cipher encryption method supporting 64 bits, comprising:

[0061] S1. Obtain the plaintext to be encrypted, and divide the plaintext to be encrypted into four groups of plaintext from high to low. For example, input a 64-bit plaintext P, and before entering the round function F operation, divide the plaintext P from high to low into four 16-bit branches to obtain branch plaintext P1, branch plaintext P2, branch plaintext P3 and branch plaintext P4; wherein, the specific operation of the round function F is as shown in steps S5-S7; before executing the round function F, it is necessary to generate the corresponding round key through the master key, and the specific steps include S2-S4;

[0062] Please refer to Figure 2 , key update and round key generation are as follows:

[0063] S2. Obtain the master key and divide the master key into four keys from high to low; Figure 2 , for example, the master key of round i is Key i , then the master key Key i Divided into four keys, each of which obtains the branch key rk1i , branch key rk2 i , branch key rk3 i And the branch key rk4 i ; Among them, when encrypting for the first time, a 64-bit master key Key is initialized.

[0064] S3. Combine the four keys in pairs to obtain two groups of key combinations to be encrypted. Figure 2 As shown, the branch key rk1 i With branch key rk4 i Combine to get the first group of key combinations to be encrypted, and use the branch key rk2 i With branch key rk3 i The second group of key combinations to be encrypted is obtained by combining.

[0065] S4. Perform an XOR operation and a preset operation on the key in each key combination to be encrypted to obtain four round keys. In an optional implementation, the four round keys are obtained by the following steps, specifically:

[0066] S41, after cyclically moving a key in a group of to-be-encrypted key combinations along a first preset direction by a first preset number of bits, performing an XOR operation with another key in the combination to obtain a round key; and directly using a key in the group as a round key; Figure 2 As shown, for example, the branch key rk1 in the first group of keys to be encrypted is i Circularly shift left by 2 bits and then add the branch key rk4 i Perform XOR operation to obtain a round key rk1 i ; and the branch key rk4 i Perform the preset operation and obtain a round key rk4 i ;

[0067] S42, after cyclically moving a key in another group of key combinations to be encrypted along a second preset direction by a second preset number of bits, performing an XOR operation with another key in the combination to obtain a round key; and directly using a key in the group as a round key; Figure 2 As shown, for example, the branch key rk3 in the second group of keys to be encrypted is combined i Circularly shift left by 7 bits and then add the branch key rk2 i Perform XOR operation to obtain a round key rk3 i ; and the branch key rk2 i Perform the preset operation and obtain a round key rk2 i .

[0068] Please refer to Figure 3, taking the i-th round as an example, the specific operation steps of the round function F are explained as follows:

[0069] S5, select two different groups of plaintexts from the four groups of plaintexts in turn to combine them to obtain four groups of plaintext combinations to be encrypted; Figure 3 As shown, branch plaintext P2 and branch plaintext P4 are used as the first group of plaintext combinations to be encrypted, branch plaintext P3 and branch plaintext P1 are used as the second group of plaintext combinations to be encrypted, branch plaintext P1 and branch plaintext P2 are used as the third group of plaintext combinations to be encrypted, and branch plaintext P1 and branch plaintext P4 are used as the fourth group of plaintext combinations to be encrypted; wherein, after the grouping is determined, each round of encryption is encrypted based on the same grouping method.

[0070] S6. Performing XOR operations on the four groups of plaintext combinations to be encrypted and the four round keys respectively to obtain four groups of encrypted plaintexts; wherein, in an optional implementation manner, the four round keys are obtained by the following steps, specifically:

[0071] 1) Perform an XOR operation on two plaintexts in the plaintext combination to be encrypted and a preset round key in the four round keys to obtain an encrypted plaintext.

[0072] like Figure 3 As shown, the branch plaintext P2 and the branch plaintext P4 in the first group of plaintexts to be encrypted are combined with the round key rk4 i Perform XOR operation to obtain the encrypted plaintext P1 i+1 . And combine the branch plaintext P3 in the second group of plaintexts to be encrypted with the branch plaintext P1 and the round key rk3 i Perform XOR operation to obtain encrypted plaintext P2 i+1 .

[0073] 2) Circularly shift one of the plaintext combinations to be encrypted by a third preset number of bits along a third preset direction to obtain a first shifted plaintext, and circularly shift it by a fourth preset number of bits along a fourth preset direction to obtain a second shifted plaintext; perform an XOR operation on another plaintext combination to be encrypted with the first shifted plaintext, the second shifted plaintext, and a preset round key among the four round keys to obtain an encrypted plaintext.

[0074] like Figure 3 As shown, the branch plaintext P1 in the third group of plaintext combinations to be encrypted is cyclically shifted left by 8 bits to obtain the first shifted plaintext 1P8 i , and circularly shift left by 3 bits to obtain the second shift plaintext 1P3 i ; Then the first shift plaintext 1P8 i , the second shift plaintext 1P3 i , branch plaintext P2 and round key rk2 i Perform XOR operation to obtain the encrypted plaintext P3 i+1 .

[0075] Shift the branch plaintext P4 in the fourth group of plaintexts to be encrypted left by 7 bits to obtain the first shifted plaintext 4P7 i , and circularly shift left by 2 bits to obtain the second shift plaintext 4P2 i ; Then the first shift plaintext 4P7 i , the second shift plaintext 4P2 i , branch plaintext P1 and round key rk1 i Perform XOR operation to obtain the encrypted plaintext P4 i+1 .

[0076] S7, determine whether the current number of encryption rounds has reached the preset number of rounds. If so, concatenate the four groups of encrypted plaintext to obtain the ciphertext; if not, update the master key and return to the step of dividing the master key from high to low into four keys for the next round of encryption. Among them, the total number of rounds r of the round function F is determined by the plaintext to be encrypted, specifically: obtain the value of the preset position in the plaintext to be encrypted, for example, obtain the value pg of the high 8 bits of the 64-bit plaintext to be encrypted P; based on the calculation formula: r = pg% 10 + 9, determine the value of the total number of rounds r; after performing r rounds of encryption, the branch P1 obtained r 、P2 r 、P3 r and P4 r The connection is performed to obtain a 64-bit ciphertext C.

[0077] The specific steps of updating the master key are: cyclically moving the master key along a fifth preset direction by a fifth preset number of bits and then performing a NAND operation with the master key to obtain an updated master key; Figure 2 As shown, the master key Key must be updated before each round function F, thereby generating new 16-bit round keys rk1, rk2, rk3 and rk4; the master key Key of the i-th round i The update operation is: the master key Key of the previous round i-1 After 7 bits of circular left shift, the master key Key7 is obtained i-1 After that, the shifted master key Key i-1 The master key Key7 of the previous round i-1 Perform a NOT operation to obtain a new master key Key i .

[0078] At the same time, the update process for the master key can also be implemented using other logical units. However, after testing, it is difficult to achieve confusion and diffusion under a single XOR and other logical operations. Only one NAND unit can meet this condition; and one NAND unit only occupies 1GE, which is smaller than the area occupied by other logical operations such as XOR; if multiple logical units are used, although it can also achieve the same confusion and diffusion effect as the non-logic, it increases the hardware area. Therefore, the use of the NAND operation in the encryption process for the master key in this embodiment can effectively confuse and diffuse, and reduce the occupied hardware area.

[0079] In this embodiment, the XOR operation in the above steps is implemented by the same XOR unit. Among them, the logical units in the encryption process are all selectable, but the following factors need to be considered: 1. The hardware footprint can be reduced by reusing the logical unit. 2. Whether replacing other single logical operations can achieve the obfuscation and diffusion effects.

[0080] At the same time, the first preset direction and the first preset number of bits, the second preset direction and the second preset number of bits, the third preset direction and the third preset number of bits, the fourth preset direction and the fourth preset number of bits, and the fifth preset direction and the fifth preset number of bits in this embodiment are set based on the shift operation test, and the specific setting method is as follows:

[0081] The main considerations for parameter design include: 1) Strict avalanche effect: only one bit of plaintext change can also affect multiple ciphertext changes. 2) Circular shift does not need to occupy hardware area. The circular shift and multiplexing logic units are used as many times as possible to achieve the circular and diffusion effects; the preset direction can be left shift or right shift, and the shift operation test is performed on each data involved in the logical operation (XOR, NAND) in the code; for example, the master key key is circularly shifted to the left by a bit, and the branch plaintext P1 is circularly shifted to the left by b bits and c bits respectively, and so on. All parameters a, b, c are traversed through the code (for example, each parameter changes from 0 to 15 bits in sequence), and some data that meet the strict avalanche effect are obtained. Then, the data a, b, c that meet the strict avalanche effect are replaced with the parameter results obtained by the test to observe whether the encrypted result meets the requirement of "only one bit of plaintext change can also affect multiple ciphertext changes"; thus finally determining the preset number of bits of circular shift for each parameter.

[0082] Embodiment 2

[0083] This embodiment verifies the encryption method in the first embodiment, and the specific verification method is as follows:

[0084] 1. Use Visual Studio 2022 to write C++ code to test the encryption effect of the encryption algorithm (FERX64) in Example 1. The results are shown in Table 1:

[0085] Table 1. Encryption results of FERX64 algorithm implemented by C++ code

[0086] Key Plain text Ciphertext 0x0000000000000000 0x0000000000000000 ad8fb6a8d834c31f 0x0000000000000000 0x0000000000000001 dcff2c20fd452e17 0xFFFFFFFFFFFFFFFF 0xFFFFFFFFFFFFFFFE ddf345e123378716 0xFFFFFFFFFFFFFFFF 0xFFFFFFFFFFFFFFEF bf7f10a0ffffc317 0xFFFFFFFFFFFFFFFF 0xFFFFFFFFFFFFFFFF dbbf15b07b7f9207 0x89ABCDEF89ABCDEF 0x89ABCDEF89ABCDEE 246c92b71ace0f91 0x89ABCDEF89ABCDEF 0x89ABCDEF89ABCDEF 59e087a6bdca1a91 0x0123456789ABCDEF 0x0123456789ABCDEE 4dab970221efd988 0x0123456789ABCDEF 0x0123456789ABCDEF c1abc30340e798d8

[0087] 2. FERX64 algorithm strict avalanche test

[0088] Avalanche effect is one of the important indicators to measure the security performance of cryptographic algorithms. The following are the reasons why lightweight block ciphers need to have strict avalanche effect:

[0089] Resistance to differential analysis and linear analysis: The avalanche effect can effectively resist differential analysis and linear analysis, two common cryptanalysis methods. Differential analysis relies on the statistical relationship between ciphertext differences and plaintext differences, while linear analysis focuses on the linear relationship between ciphertext and plaintext. The strict avalanche effect means that even a small change in the plaintext or key will cause the ciphertext to change seemingly randomly and over a large area, making it extremely difficult to discover patterns through statistical methods.

[0090] Enhanced security: By ensuring that a small change in the input can cause a significant difference in the output, the avalanche effect increases the uncertainty of the cryptographic algorithm, making it impossible for an attacker to accurately infer other parts or the entire output result even if they can control or predict part of the input information. This greatly enhances the security of the cryptographic system and reduces the chances of success through known plaintext attacks, chosen plaintext attacks, or chosen ciphertext attacks.

[0091] Increased difficulty in cracking: For attackers who want to reverse engineer the original information or key by observing the changes in the ciphertext, they need to face exponentially increasing complexity. The avalanche effect ensures that even the smallest change in the information will cause a huge difference in the output, which significantly increases the difficulty of brute force cracking or any attempt to recover the internal state of the algorithm.

[0092] The tests were repeated 1000, 10000, 100000, 1000000, and 10000000 times. Each test involved generating a random 64-bit plaintext, encrypting it, flipping a random bit in the plaintext, encrypting it again, and comparing the difference between the two encrypted results. The statistics of the difference bits help calculate how many bits change in each round on average, and then get the average avalanche effect percentage. The FERX64 algorithm was tested for avalanche degree, and the results were 59.19% (1000 times), 59.23% (10000 times), 59.27% ​​(100000 times), 59.24% (1000000 times), and 59.24% (10000000 times). It can be preliminarily judged that the algorithm meets the strict avalanche standard.

[0093] 3. List of FERX64 algorithm area resources

[0094] The efficiency of hardware implementation of lightweight cryptography depends mainly on factors such as design complexity, CMOS process, power and energy consumption, throughput, critical path length, delay, and clock cycle. Among them, design complexity is one of the most important factors, which is determined by the number of logic gates required for a cryptography, and is often measured by the gate equivalent (GE) metric. GE is a unit of measurement that describes the complexity of digital electronic circuits independent of the manufacturing process. In addition to indicating complexity, the number of logic gates or GE also reflects the part of the chip area occupied by the hardware implementation and is often used as an intuitive way to express the chip area of ​​the design. Different platforms have common frequency, RAM, ROM and power consumption characteristics. For example, out of 1000-10000 logic gates in the RFID tag space, about 250-4000 logic gates can be used for security-related work; in lightweight devices, it can be as high as 3000GE; for smaller devices (such as low-cost RFID and 4-bit microcontrollers), there are limits of 2000GE and 1000GE respectively. In CMOS process, the silicon area of ​​NAND2 gate usually constitutes a process-related unit area, usually called gate equivalent. Different technologies and standard cell libraries will produce different results. For example, the same implementation of PRESENT produces 1075GE on 0.18μm CMOS process, 1169GE on 0.25μm, and 1000GE on 0.35μm.

[0095] The FERX64 cryptographic algorithm described in the present invention is simulated on Modelsim SE-64 10.4 and synthesized on Synopsys Design Compiler Version B-2008.09, using the IBM 130nm-8RF standard cell library. In the synthesis experiment, the area resource is measured by the equivalent gate number GE, as shown in Table 2. The GE metric is calculated by dividing a μm 2 The area required for the implementation is calculated by dividing it by the corresponding area of ​​a NAND2 gate.

[0096] Table 2. Basic cell footprint of IBM 130nm-8RF standard cell library

[0097] NOT NAND AND OR XOR XNOR 2-1MUX Dip-op Scanip-op GE 0.75 1.00 1.25 1.25 2.00 2.00 2.25 4.25 6.25

[0098] For FERX64, to store 64-bit keys and plaintext data, if a D flip-flop is used, about 64×4.25=272GE is required. Each round function F needs to perform a cyclic shift and a 16-bit XOR operation. The cyclic shift process does not require any gates; the 16-bit XOR operation requires 16×2=32GE. In addition to the 16-bit XOR operation, the key update process also includes a 64-bit NAND operation, which requires 64×1=64GE. As shown in Table 3, the hardware implementation of FERX64 occupies at least 640GE, meeting the lightweight requirement.

[0099] Table 3. Area resource list of FERX64 hardware implementation

[0100]

[0101]

[0102] Embodiment 3

[0103] Please refer to Figure 4 A 64-bit block cipher encryption device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step of a 64-bit block cipher encryption method as described in Example 1 is implemented.

[0104] In summary, the block cipher encryption method and device supporting 64 bits provided by the present invention, in terms of structure, FERX64 adopts a four-branch Feistel structure, cyclic shift (Rotation) and XOR (XOR); the four branches all perform logical operations (cyclic shift, XOR), the cyclic shift provides diffusion capability, and the XOR operation provides confusion capability, which solves the defect that the traditional Feistel structure only affects half of the data in each round, and improves the diffusion of the algorithm; at the same time, the parallel use of multiple S-box substitutions and P-table replacement operations is abandoned, reducing the area consumption of hardware implementation. In the key mode, a dynamic key update operation is adopted, and the master key must be updated by logical operation before each round of encryption to obtain a new round of round keys. In the encryption mode, in order to make the strict avalanche effect better, a large number of cyclic shift bit parameters are traversed using C++ code, and data that meets the strict avalanche effect is obtained, and the shift parameters that make the ciphertext results encrypted from similar plaintexts are not similar are selected. FERX64 only uses circular shift and XOR operation to achieve strict avalanche effect; moreover, circular shift operation does not occupy hardware area, and XOR operation unit can be reused in encryption process and key update process, saving space. In addition, the number of iterations of the present invention depends on the plaintext content of each encryption, and it is difficult for attackers to know the exact number of iterations in advance, which increases the difficulty of static analysis of the algorithm.

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

Claims

1. A block cipher encryption method supporting 64 bits, characterized in that: include: Obtaining plaintext to be encrypted, and dividing the plaintext to be encrypted into four groups of plaintext from high to low bits; Obtain a master key, and divide the master key into four keys from high to low; Combining the four keys in pairs to obtain two groups of key combinations to be encrypted; Performing an XOR operation and a preset operation on the keys in each of the key combinations to be encrypted to obtain four round keys; Sequentially selecting two different groups of the plaintexts from the four groups of plaintexts to combine to obtain four groups of plaintext combinations to be encrypted; Performing XOR operations on the four groups of plaintext combinations to be encrypted and the four round keys to obtain four groups of encrypted plaintexts; Determine whether the current number of encryption rounds reaches a preset number of rounds, and if so, concatenate the four groups of encrypted plaintexts to obtain a ciphertext; If not, the master key is updated and the process returns to the step of dividing the master key from high to low bits into four keys for the next round of encryption.

2. A 64-bit block cipher encryption method according to claim 1, characterized in that: The performing of an XOR operation and a preset operation on the keys in each of the key combinations to be encrypted comprises: After cyclically shifting a key in a group of the to-be-encrypted key combinations by a first preset number of bits along a first preset direction, an XOR operation is performed with another key in the combination to obtain a round key; and directly using a key in the group as a round key; After a key in another group of the key combinations to be encrypted is cyclically moved along a second preset direction by a second preset number of bits, an XOR operation is performed with another key in the combination to obtain a round key; and a key in the group is directly used as a round key.

3. A 64-bit block cipher encryption method according to claim 1, characterized in that: The four groups of plaintext combinations to be encrypted are respectively subjected to XOR operation with the four round keys to obtain four groups of encrypted plaintexts, including: An XOR operation is performed on two plaintexts in the plaintext combination to be encrypted and a preset round key in the four round keys to obtain an encrypted plaintext.

4. A 64-bit block cipher encryption method according to claim 1, characterized in that: The four groups of plaintext combinations to be encrypted are respectively subjected to XOR operation with the four round keys to obtain four groups of encrypted plaintexts, including: Circularly shifting one of the plaintexts in the combination of plaintexts to be encrypted by a third preset number of bits along a third preset direction to obtain a first shifted plaintext, and circ ... fourth preset number of bits along a fourth preset direction to obtain a second shifted plaintext; An XOR operation is performed on another plaintext in the to-be-encrypted plaintext combination, the first shifted plaintext, the second shifted plaintext, and a preset round key among the four round keys to obtain an encrypted plaintext.

5. A 64-bit block cipher encryption method according to claim 1, 2, 3 or 4, characterized in that: The XOR operation is implemented by the same XOR unit.

6. A 64-bit block cipher encryption method according to claim 1, characterized in that: The updating of the master key comprises: The master key is circularly moved by a fifth preset number of bits along a fifth preset direction, and then a NOT operation is performed with the master key to obtain an updated master key.

7. A 64-bit block cipher encryption method according to claim 1, characterized in that: The step of determining whether the current number of encryption rounds reaches the preset number of rounds includes: Obtaining a value of a pre-set position in the plaintext to be encrypted; The preset round is obtained according to the numerical value.

8. A 64-bit block cipher encryption method according to claim 7, characterized in that: The obtaining the preset round according to the value comprises: r = pg%10+9; Among them, r is the preset round; pg is the value of the previous preset position in the plaintext to be encrypted.

9. A 64-bit block cipher encryption method according to claim 2, 4 or 6, characterized in that: Also includes: Perform shift operation test on each parameter involved in logic operation to obtain parameter data that meets strict avalanche effect; According to the parameter data, a first preset direction and a first preset number of bits, a second preset direction and a second preset number of bits, a third preset direction and a third preset number of bits, a fourth preset direction and a fourth preset number of bits, and a fifth preset direction and a fifth preset number of bits are obtained.

10. A 64-bit block cipher encryption device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the processor implements the steps of a 64-bit block cipher encryption method as described in any one of claims 1 to 9.