A novel hybrid structure block cipher MSBC implementation method and system

By combining the hybrid structure of SPN and Feistel structures, the new P permutation table and F function are designed, which solves the problem that existing packet ciphers are difficult to achieve efficient encryption in resource-constrained environments, and realizes a more efficient and secure packet cipher algorithm.

CN119853889BActive Publication Date: 2025-06-20HENGYANG NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510038624.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-06-20
Estimated Expiration
2045-01-10

AI Technical Summary

Technical Problem

Existing packet ciphers are difficult to achieve efficient encryption in resource-constrained environments, and a single SPN or Feistel structure leads to poor algorithm diffusion capabilities, vulnerability to attacks, and simple key expansion operations.

Method used

Using a hybrid structure of SPN and Feistel structures, 64-bit data is divided into 4 branches, each branch performs different encryption operations, and a new P permutation table and F function are designed to enhance the complexity and security of the algorithm.

Benefits of technology

Improves the efficiency and robustness of packet passwords, enhances the security of the algorithm, reduces the cost of hardware implementation, and provides higher security and performance efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119853889B_ABST
    Figure CN119853889B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for implementing a new type of block cipher MSBC with a hybrid structure. The method adopts a hybrid structure of an SPN structure with branches and a Feistel structure. Each round of encryption operation is divided into 4 branches, and each branch performs a series of different calculations. A P-permutation table for performing P-permutation operations on 16-bit data is also proposed. Compared with existing block ciphers, this cipher has higher efficiency and robustness. It solves the problem that the encryption and decryption implementation methods of a single SPN structure cipher are inconsistent, thus requiring a dedicated decryption algorithm to be designed, resulting in slow encryption and decryption speeds and consuming more software and hardware resources. Compared with traditional block cipher algorithms, the structure of this algorithm is variable and can resist known attacks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer security, and particularly relates to a method and system for implementing a novel hybrid-structured block cipher MSBC. Background Art

[0002] With the development of computer and communication technologies, it is particularly important to ensure the secure storage, secure processing, and secure transmission of information. In particular, with the widespread application of the Internet, as well as the establishment and implementation of personal communication, multimedia communication, office automation, email, electronic automatic transfer payment systems, and automatic retail business networks, information security and cryptography are indispensable. Block ciphers are an important branch of cryptography, which have received extensive attention and become a hot topic in cryptography research. Essentially, a block cipher transforms a plaintext of a fixed length through a finite number of iterative permutation transformations into a ciphertext of the same length. Block ciphers have the characteristics of fast speed, easy standardization, and convenient implementation in software and hardware. Facing the rapid improvement of computer computing power and various attack methods based on mathematical analysis, the security of block ciphers has been severely threatened. Developing block ciphers with higher strength and efficiency is of great significance.

[0003] In recent years, with the large-scale application and continuous development of new systems such as Internet of Things embedded systems and wireless sensor networks, the data security issues in fields such as smart cards, mobile computing devices, unmanned aerial vehicles, and autonomous driving have become increasingly prominent. Block cipher encryption technology is used to solve these problems. Considering resource-constrained application environments such as RFID tags and sensor nodes with low cost and low power consumption, traditional block cipher standards such as AES and SMS4 cannot be implemented at all. Therefore, the research on lightweight block ciphers specifically applicable to such resource-constrained environments has attracted extensive attention from scholars at home and abroad. It is a new research field and also a hot issue in current international cryptography research.

[0004] In recent years, in order to address the information security issues on resource-constrained devices in the Internet of Things environment, designers have proposed a series of lightweight block cipher algorithms. In 2006, Deukjo Hong proposed HIGHT. In 2007, Bogdanov et al proposed PRESENT. In 2009, Maryam Izadi et al proposed MIBS. In 2011, Shibutani et al proposed Piccolo, Guo et al proposed LED, and Huihui Yap et al proposed EPCBC. In 2012, Julia Borghoff proposed PRINCE, and Suzaki et al proposed TWINE. In 2014, Donggeon Lee proposed LEA. In 2015, G. Yang et al proposed SIMECK, and R. Beaulieu et al proposed SIMON and other encryption algorithms. China has also achieved rich results in the research of lightweight block cipher algorithms. In 2011, Wu and Zhang et al

[0005] proposed Lblock, and Gong et al proposed KLEIN. Li et al proposed encryption algorithms such as QTL, Magpie, Surge, and SFN in 2016, 2017, and 2020 respectively.

[0006] At present, there are still many theoretical and practical application problems in block cipher algorithms that need to be further studied. The main problems are as follows: (1) In traditional block ciphers, if the block length is 64 bits, all 64-bit data go through P permutation, S-box transformation, or the overall Feistel structure is adopted, and the algorithm structure is single; in the overall structure of the cipher, one is the cipher based on the SPN structure, and the encryption and decryption implementation methods of this structure are inconsistent. Therefore, a dedicated decryption algorithm needs to be designed, resulting in slow encryption and decryption speeds and consuming more software and hardware resources; the P permutation of the single SPN structure cipher is simple, resulting in poor diffusion ability of the algorithm; the single cipher algorithm design structure is vulnerable to attacks. The other is the cipher based on the Feistel network structure. Although the encryption and decryption of this structure are similar and consume less software and hardware resources. However, the diffusion speed of the cipher algorithm of this structure is slow, and only half of the blocks enter the round function in one round of iterative operation, so only half of the block data can be changed. (2) Most of the existing dedicated cipher chips only implement a cipher algorithm with a fixed cipher mode, and this implementation method is difficult to meet the multi-level security requirements of different users. Although different cipher algorithms are reconstructed and designed, and during the design process, the same or similar operations between different algorithms are extracted, there are many differences between different algorithms, which will cause a lot of area resource overhead, resulting in high hardware implementation costs and greatly reducing the performance efficiency. (3) The security of block cipher algorithms is not high. With the enhancement of computing power, many ciphers are exposed to various security problems, especially lightweight block ciphers. The main reason is that the confusion and diffusion speeds of the cipher algorithms themselves are a bit slow. (4) The key expansion operation of block ciphers is too simplistic, or there is no key expansion operation, and such a design poses a hidden danger to the security of cipher algorithms. Summary of the Invention

[0007] Aiming at the problems existing in the traditional block cipher structure in the prior art, the present invention provides a method and system for implementing a new type of hybrid structure block cipher MSBC. The block cipher is constructed by combining the SPN structure and the Feistel structure, and the 64-bit encrypted data is divided into 4 branches, and each branch performs different encryption operations; a new type of P permutation table for operating on 16-bit data is designed; a new F function is proposed in the Feistel-like structure.

[0008] The technical solutions provided by the present invention are as follows:

[0009] On the one hand, a method for implementing a new type of hybrid structure block cipher MSBC, including:

[0010] Step 1: Load 64-bit plaintext or 64-bit ciphertext into a register as the data to be encrypted / decrypted;

[0011] Step 2: Use the round key to divide the data to be encrypted / decrypted into 4 branches for round operations for a specified number of rounds, and update the round key after each round operation;

[0012] The specific process of the round operation in the encryption process is as follows:

[0013] (1) First, perform the round key addition operation on the 64-bit plaintext and the round key;

[0014] (2) Divide the 64-bit data after the round key addition operation from the high bit to the low bit into 4 branches, each branch with 16-bit data, namely the 1st branch, the 2nd branch, the 3rd branch, and the 4th branch;

[0015] (3) The 1st branch sequentially performs the S-box transformation and shift operation; the 2nd branch sequentially performs the circular shift, exclusive OR operation, and shift operation; the 3rd branch sequentially performs the P-permutation, exclusive OR operation, and shift operation; the 4th branch sequentially performs the Feistel-like operation and shift operation;

[0016] Among them, the data for the exclusive OR operation of the 2nd branch is the 1st branch after the S-box transformation and the 2nd branch after the circular shift, and the data for the exclusive OR operation of the 3rd branch is the 3rd branch after the P-permutation and the 4th branch after the Feistel-like operation;

[0017] (4) Combine the data of the 1st and 2nd branches after the operation in step (3) into 32-bit data, combine the data of the 3rd and 4th branches after the operation in step (3) into 32-bit data, and then exchange the left and right 32-bit data to obtain 64-bit intermediate state data;

[0018] (5) Represent the 64-bit intermediate state data in groups of 4 bits as S = s 15 …s0, perform the matrix transpose operation to obtain the ciphertext of one round of operation;

[0019] The decryption process is the inverse operation of the encryption process;

[0020] Step 3: Repeat (1)-(5) to complete the round operations for the specified number of rounds. The calculation result of the last round of round operation is the ciphertext / plaintext.

[0021] For encrypting or decrypting 64-bit plaintext or ciphertext, there are 4 branches with 16 bits in each branch. Each branch has its own encryption method, and there are cross operations between branches (the 1st branch and the 2nd branch perform the exclusive OR operation, and the 4th branch and the 3rd branch perform the exclusive OR operation). That is, each branch is both independent and related. This setting makes the relationship between branches intricate, further making the algorithm difficult to break;

[0022] In addition, the first branch and the third branch adopt a structure similar to the SPN structure, and the fourth branch adopts a structure similar to the Feistel structure. Overall, the entire algorithm adopts a hybrid structure of SPN and Feistel. Compared with most of the existing algorithms that only adopt the SPN structure, and the optimization methods usually process one of the P permutation, S-box, or Feistel function in the SPN structure, while this application improves both the S-box and the Feistel function simultaneously, and uses a lightweight S-box, a novel P permutation algorithm, and a unique Feistel F function.

[0023] Further, the so-called Feistel-like operation means operating on the data to be processed according to the following formula:

[0024]

[0025] where F() represents the F function: F(X) = L(S(X)), S(X) represents performing an S-box transformation on X, and L represents performing an exclusive OR operation on the input data after dividing it from the high-order bit to the low-order bit according to the following expression: X0X1X2X3 represents the 64-bit data arranged from the high-order bit to the low-order bit input to L.

[0026] This Feistel-like operation, compared with the existing Feistel operations, uses an F function that performs an exclusive OR operation on the data after S-box transformation, making the algorithm more difficult to attack;

[0027] Further, representing the 64-bit intermediate state data in groups of 4 bits as S = s 15 …s0, perform a matrix transpose operation according to the following expression:

[0028]

[0029] Shuffle and then sort the intermediate state data, making the encryption process more complex;

[0030] Further, the update of the round key means performing a transformation update on the round key of the previous round through S-box substitution.

[0031] Further, the S-box transformation operation is performed according to the following formula:

[0032] X i ' = S[X i (0 ≤ i ≤ 15)

[0033] where X i and X i' represents the i-th bit in the data before and after the S-box substitution operation; S[] represents the S-box. When the data input to the S-box takes values from {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}, the corresponding values are {C, 5, 6, B, 9, 0, A, D, 3, E, F, 8, 4, 7, 1, 2}.

[0034] Further, the P permutation is to perform a permutation operation on the 16-bit data to be permuted according to the P permutation table generated by the following formula:

[0035]

[0036] where i represents the 16-bit data to be permuted.

[0037] Further, the circular left shift list of the circular left shift operation refers to that from the 1st round to the 20th round, the number of circular left shift bits is successively {1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2}.

[0038] The 20-round round operation realizes and ensures the security after encryption, and no more rounds of processing are required;

[0039] In the second aspect, an implementation system of a new type of hybrid structure block cipher MSBC includes:

[0040] Loading module: loading 64-bit plaintext or 64-bit ciphertext into a register as the data to be encrypted / decrypted;

[0041] Partitioning module: using the round key to partition the data to be encrypted / decrypted into 4 branches for 20-round round operations, and updating the round key after each round operation;

[0042] Round operation operation module: including a round operation encryption unit and a round operation decryption unit;

[0043] Round operation encryption unit:

[0044] (1) First, perform a round key addition operation on the 64-bit plaintext and the round key;

[0045] (5) Divide the 64-bit data after the round key addition operation from high to low into 4 branches, each branch with 16-bit data, namely the 1st branch, the 2nd branch, the 3rd branch, and the 4th branch;

[0046] (6) The 1st branch sequentially performs S-box transformation and shift operation; the 2nd branch sequentially performs circular shift, exclusive OR operation, and shift operation; the 3rd branch sequentially performs P permutation, exclusive OR operation, and shift operation; the 4th branch sequentially performs a Feistel-like operation and shift operation;

[0047] Among them, the data for the XOR operation in the second branch are the first branch after S-box transformation and the second branch after circular shift, and the data for the XOR operation in the third branch are the third branch after P-permutation and the fourth branch after a kind of Feistel-like operation;

[0048] (7) Combine the data of the first and second branches after the operation in step (3) into 32-bit data, combine the data of the third and fourth branches after the operation in step (3) into 32-bit data, and then exchange the left and right 32-bit data to obtain the data of the 64-bit intermediate state;

[0049] (5) Represent the data of the 64-bit intermediate state in groups of 4 bits as S = s 15 …s0, perform a matrix transpose operation to obtain the ciphertext of one round of operation;

[0050] The decryption process of the round operation decryption unit and the encryption process of the round operation encryption unit are inverse operations;

[0051] Repeated call module: Repeatedly call the round operation module, perform a total of 20 rounds of round operations, and use the calculation result of the last round of round operation as the ciphertext / plaintext.

[0052] In a third aspect, an electronic terminal includes at least:

[0053] One or more processors;

[0054] And a memory storing one or more computer programs;

[0055] Among them, the processor calls the computer program to execute:

[0056] The steps of the implementation method of the above-mentioned novel hybrid structure block cipher MSBC.

[0057] In a fourth aspect, a computer-readable storage medium stores a computer program, and the computer program is called by a processor to execute:

[0058] The steps of the implementation method of the above-mentioned novel hybrid structure block cipher MSBC.

[0059] Beneficial effects

[0060] The technical solution of the present invention provides a method and system for implementing a novel hybrid - structured block cipher MSBC. It adopts a hybrid structure of SPN and Feistel. Each round of encryption operation is divided into 4 branches, and each branch performs a series of different calculations. A P - permutation table for performing P - permutation operation on 16 - bit data is also proposed. Compared with existing block ciphers, this cipher has higher efficiency and robustness. The round function of traditional cipher algorithms generally adopts SPN or Feistel structure, and its single structure poses a threat to the security of the algorithm. The design of the technical solution of the present invention fully considers the security issues of traditional cipher algorithms. The F function adopted is to perform an exclusive - OR operation on the data after S - box transformation, making the algorithm more difficult to be attacked.

[0061] The block cipher MSBC disclosed by the technical solution of the present invention not only exhibits high security but also compactness in hardware implementation. The reason is that this cipher algorithm adopts novel design and implementation techniques. In the minimum implementation, the hardware requirement for the 64 - bit key mode is only 2030 gate equivalents. And through experimental results, it shows that the MSBC of the technical solution of the present invention provides sufficient security for known security analyses (including recent differential attacks and linear attacks, etc.) and future potential attacks. This encryption algorithm provides a more secure choice for fields that require encryption solutions. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is a schematic flow chart of the method described in the embodiment of the present invention;

[0063] Figure 2 It is a schematic diagram of the A - branch structure of the encryption method described in the embodiment of the present invention;

[0064] Figure 3 It is a schematic diagram of the B - branch structure of the encryption method described in the embodiment of the present invention;

[0065] Figure 4 It is a schematic diagram of the C - branch structure of the encryption method described in the embodiment of the present invention;

[0066] Figure 5 It is a schematic diagram of the D - branch structure of the encryption method described in the embodiment of the present invention;

[0067] Figure 6 It is a schematic diagram of the matrix transformation structure of the encryption method described in the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0068] The following will make a detailed description of the present invention through specific embodiments and in combination with the accompanying drawings.

[0069] The design goal of the technical solution of the present invention is to provide encryption security for resource - constrained environments, such as IOT, etc.

[0070] The technical solution of the present invention provides a method for implementing a block cipher MSBC with a novel hybrid structure, which adopts a hybrid structure of SPN and Feistel. The block length of the algorithm is 64 bits, the key length is 64 bits, and the number of iterative rounds of the algorithm is 20 rounds. Each round of MSBC encryption operation is divided into 4 branches, and each branch performs a series of different calculations.

[0071] A method for implementing a block cipher MSBC with a novel hybrid structure, comprising:

[0072] Step 1: Load 64-bit plaintext or 64-bit ciphertext into a register as the data to be encrypted / decrypted;

[0073] Step 2: Use the round key to divide the data to be encrypted / decrypted into 4 branches for 20 rounds of round operations, and update the round key after each round operation;

[0074] The 20 rounds of round operations are implemented and ensure the security after encryption, without the need for more rounds of processing;

[0075] The specific process of the round operation in the encryption process is as follows:

[0076] (1) First, perform an XOR operation on the 64-bit plaintext and the round key;

[0077] (2) Divide the 64-bit data after the XOR operation with the round key into 4 branches from high to low, with 16-bit data for each branch, namely the first branch, the second branch, the third branch, and the fourth branch;

[0078] (3) The first branch sequentially performs S-box transformation and shift operation; the second branch sequentially performs circular shift, XOR operation, and shift operation; the third branch sequentially performs P-permutation, XOR operation, and shift operation; the fourth branch sequentially performs a Feistel-like operation and shift operation;

[0079] Among them, the data for the XOR operation in the second branch is the first branch after S-box transformation and the second branch after circular shift, and the data for the XOR operation in the third branch is the third branch after P-permutation and the fourth branch after Feistel-like operation;

[0080] (4) Combine the data of the first and second branches after the operation in step (3) into 32-bit data, combine the data of the third and fourth branches after the operation in step (3) into 32-bit data, and then exchange the left and right 32-bit data to obtain 64-bit intermediate state data;

[0081] (5) Represent the 64-bit intermediate state data in groups of 4 bits as S = s 15 …s0, and perform a matrix transpose operation to obtain the ciphertext of one round of operation;

[0082] The decryption process and the encryption process are inverse operations;

[0083] Step 3: Repeat (1)-(5) for a total of 20 rounds of operations. The calculation result of the last round of operations is the ciphertext / plaintext.

[0084] Among them, the four branches are named Branch A, Branch B, Branch C, and Branch D in this example. The working processes of each branch are as follows:

[0085] Branch A takes 16-bit intermediate state data as input and 16-bit intermediate state data as output. All operations performed by Branch A include the following 4 steps: AddRoundKey → S-box transformation → Shift operation → Matrix transposition, specifically as Figure 2 shown;

[0086] Branch B uses 16-bit intermediate state data as input and 16-bit intermediate state data as output. The operations of Branch B include: AddRoundKey → Circular shift operation → XOR operation → Shift operation → Matrix transposition, specifically as Figure 3 shown;

[0087] Branch C uses 16-bit intermediate state data as input and 16-bit intermediate state data as output. The operations of Branch C include the following 5 steps: AddRoundKey → P permutation → XOR operation → Shift operation → Matrix transpose, specifically as Figure 4 shown;

[0088] Branch D uses 16-bit intermediate state data as input and 16-bit intermediate state data as output. The operations of Branch D include: AddRoundKey → Feistel-like structure operation → Shift operation → Matrix transpose, specifically as Figure 5 shown;

[0089] The so-called Feistel-like operation refers to operating on the data to be processed according to the following formula:

[0090]

[0091] Among them, F() represents the F function: F(X) = L(S(X)), S(X) represents performing S-box transformation on X, and L represents performing XOR operation on the input data after dividing it from high bit to low bit according to the following expression: X0X1X2X3 represents the 64-bit data arranged from high bit to low bit input to L.

[0092] This Feistel-like operation, compared with the existing Feistel operation, uses an F function that performs XOR operation on the data after S-box transformation, making the algorithm more resistant to attacks;

[0093] The 64-bit intermediate state data is represented in groups of 4 bits as S = s 15 …s0, and the matrix transpose operation is performed according to the following expression, as Figure 6 shown:

[0094]

[0095] The intermediate state data is shuffled and then sorted to make the encryption process more complex;

[0096] The update of the round key refers to the transformation and update of the round key of the previous round through S-box substitution. The S-box transformation operation is performed according to the following formula:

[0097] X i ' = S[X i (0 ≤ i ≤ 15)

[0098] where, X i and X i ' represent the i-th bit in the data before and after the S-box substitution operation; S[] represents the S-box. When the data value input to the S-box is {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}, the corresponding values are {C, 5, 6, B, 9, 0, A, D, 3, E, F, 8, 4, 7, 1, 2}.

[0099] Table 1 S-box

[0100] X 0 1 2 3 4 5 6 7 S[X] C 5 6 B 9 0 A D X 8 9 A B C D E F S[X] 3 E F 8 4 7 1 2

[0101] The P-permutation is to perform a permutation operation on the 16-bit data to be permuted according to the P-permutation table generated by the following formula:

[0102]

[0103] where, i represents the 16-bit data to be permuted.

[0104] The permutation table is shown in Table 2.

[0105] Table 2 P-permutation table

[0106] i 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 P(i) 10 4 8 12 1 15 9 13 2 6 0 14 3 7 11 5

[0107] The circular left shift list of the circular left shift operation refers to that from the 1st round to the 20th round, the circular left shift bits are successively {1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2}.

[0108] The pseudo-code description of the MSBC block cipher encryption is as follows, and the encryption process of the MSBC block cipher is as Figure 1 shown.

[0109] Algorithm 1: Encryption Process of MSBC Block Cipher

[0110]

[0111] The algorithm test data, and the MSBC algorithm data is shown in Table 3.

[0112] Table 3 MSBC Algorithm Data

[0113] Plaintext Key Ciphertext 0000000000000000 0000000000000000 2019BE3943C92CAD 0000000000000000 FFFFFFFFFFFFFFFF 0F5275B11F659A1C 0123456789ABCDEF 0000000000000000 5F7D1D98E241660A FFFFFFFFFFFFFFFF 0123456789ABCDEF 0CD78D5F70A46479 AAAAAAAAAAAAAAAA 0123456789ABCDEF 4E1E6D0C7B4E760E 0123456789ABCDEF 0123223389ABCDEF 5E22B47650E95EB1 0123456789ABCDEF 0123456701345678 5F5C1779243A6CFC

[0114] In the ASIC hardware implementation of the MSBC algorithm described in the technical solution of the present invention, the resource area occupied by the algorithm in the comprehensive process library SMIC0.18um is 2020GE, and the ASIC implementations of various lightweight block ciphers are shown in Table 4.

[0115] Table 4 ASIC Implementations of Lightweight Block Ciphers

[0116]

[0117] It can be seen from the data in Table 4 that when the MSBC algorithm of the technical solution of the present invention is implemented in ASIC, the minimum required for Area is only 2020, and the speed of 200kbps is much higher than other block cipher algorithms in the prior art. It can be seen that the MSBC algorithm described in the technical solution of the present invention has a significant improvement in performance.

[0118] First, MSBC was implemented in VHDL; secondly, ModelSim SE PLUS 6.1f was used for evaluation to simulate MSBC; finally, it was synthesized on a 0.18μm CMOS process to verify its hardware complexity. The area cost occupied by combinational logic bit operations is as follows: the area cost occupied by OR / AND gates is 1.33GE, the area cost occupied by XOR / XNOR gates is 2.67GE, the area cost occupied by NOR / NAND gates is 1GE, and the area cost occupied by NOT gates is 0.67GE. In the technical solution of the present invention, encrypting 64-bit plaintext with a 64-bit key occupies approximately 2020.72GE and requires 20 clock cycles. Table 4 compares the hardware performance of MSBC with other lightweight block ciphers.

[0119] Specifically, in the above implementation, the trigger is used to store the key and data status. Storing a 64-bit data status requires 384 GE (64 × 6), and storing a 64-bit key requires 384 GE (64 × 6). For the round operation, it consists of AddRoundKey, S-box Conversion, P-Permutation, and Feistel-like structure operations. AddRoundKey performs an exclusive OR operation on the 64-bit plaintext and the 64-bit key, and this step requires approximately 170.88 GE (64 × 2.67). The s-box conversion consists of 16 parallel 4×4 s-boxes, which requires approximately 27.32 × 4 = 109.28 GE. Therefore, the hardware implementation of MSBC is estimated to require an area of 2020.72 GE.

[0120] Embodiment 2

[0121] An implementation system of a new type of block cipher MSBC with a hybrid structure, comprising:

[0122] Loading module: Loading 64-bit plaintext or 64-bit ciphertext into a register as the data to be encrypted / decrypted;

[0123] Partitioning module: Using the round key, partitioning the data to be encrypted / decrypted into 4 branches for 20 rounds of round operations, and updating the round key after each round operation;

[0124] Round operation operation module: Comprising a round operation encryption unit and a round operation decryption unit;

[0125] Round operation encryption unit:

[0126] (1) First, perform a round key addition operation on the 64-bit plaintext and the round key;

[0127] (8) Divide the 64-bit data after the round key addition operation from high to low into 4 branches, each branch having 16-bit data, namely the first branch, the second branch, the third branch, and the fourth branch;

[0128] (9) The first branch sequentially performs S-box transformation and shift operations; the second branch sequentially performs circular shift, exclusive OR operation, and shift operations; the third branch sequentially performs P-permutation, exclusive OR operation, and shift operations; the fourth branch sequentially performs Feistel-like operations and shift operations;

[0129] Among them, the data for the exclusive OR operation of the second branch is the first branch after S-box transformation and the second branch after circular shift, and the data for the exclusive OR operation of the third branch is the third branch after P-permutation and the fourth branch after Feistel-like operations;

[0130] (10) Combine the data of the first and second branches after the operation in step (3) into 32-bit data, combine the data of the third and fourth branches after the operation in step (3) into 32-bit data, and then exchange the two 32-bit data on the left and right to obtain 64-bit intermediate state data;

[0131] (5) Represent the 64-bit intermediate state data in groups of 4 bits as S = s 15 …s0, perform a matrix transpose operation to obtain the ciphertext of one round of operation;

[0132] The decryption process of the round operation decryption unit and the encryption process of the round operation encryption unit are inverse operations;

[0133] Repeated call module: Repeatedly call the round operation module, perform 20 rounds of round operations in total, and use the calculation result of the last round of round operation as the ciphertext / plaintext.

[0134] It should be understood that the implementation process of each module can refer to the content description of the foregoing method. The above division of functional modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. At the same time, the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0135] Embodiment 3

[0136] An electronic terminal includes at least:

[0137] One or more processors;

[0138] And a memory storing one or more computer programs;

[0139] Wherein, the processor calls the computer program to execute:

[0140] The steps of the foregoing implementation method of a new type of hybrid structure block cipher MSBC.

[0141] For the specific implementation process of each step, please refer to the description of the foregoing method.

[0142] It should be understood that in the embodiments of the present invention, the so-called processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A part of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.

[0143] Embodiment 4

[0144] A computer-readable storage medium stores a computer program, and the computer program is called by a processor to execute:

[0145] The steps of the implementation method of the above-mentioned novel hybrid structure block cipher MSBC.

[0146] For the specific implementation process of each step, please refer to the description of the foregoing method.

[0147] The readable storage medium is a computer-readable storage medium, which may be an internal storage unit of the software and hardware device described in any of the foregoing embodiments, such as the hard disk or memory of the controller. The readable storage medium may also be an external storage device of the controller, such as a plug-in hard disk equipped on the controller, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the readable storage medium may also include both the internal storage unit of the controller and the external storage device. The readable storage medium is used to store the computer program and other programs and data required by the controller. The readable storage medium may also be used to temporarily store data that has been output or is to be output.

[0148] Based on such understanding, the technical solution of the present invention, in essence or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned readable storage medium includes: various media that can store program codes such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.

[0149] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) that contain computer-usable program codes. The present application refers to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. The instructions executed by the processor generate a device for realizing the functions specified in one or more processes of the flowchart and / or one or more blocks of the block diagram. These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device realizes the functions specified in one or more processes of the flowchart and / or one or more blocks of the block diagram. These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate computer-implemented processing. Thus, the instructions executed on the computer or other programmable device provide steps for realizing the functions specified in one or more processes of the flowchart and / or one or more blocks of the block diagram.

[0150] It should be emphasized that the examples described in the present invention are illustrative rather than restrictive. Therefore, the present invention is not limited to the examples described in the specific embodiments. Any other embodiments obtained by those skilled in the art based on the technical solution of the present invention, without departing from the spirit and scope of the present invention, whether modified or replaced, equally fall within the protection scope of the present invention.

Claims

1. A method for implementing a new hybrid structure block cipher MSBC, characterized in that: include: Step 1: Load 64-bit plaintext or 64-bit ciphertext into the register as the data to be encrypted / decrypted; Step 2: Using the round key, the data to be encrypted / decrypted is divided into 4 branches for a specified number of round operations, and the round key is updated after each round operation; The round operation process of the encryption process is as follows: (1) First, the 64-bit plaintext and the round key are subjected to the round key addition operation; (2) Divide the 64-bit data after the round key addition operation into four branches from high to low, each branch has 16 bits of data, namely the first branch, the second branch, the third branch and the fourth branch; (3) The first branch performs S-box transformation and shift operation in sequence; the second branch performs circular shift, XOR operation, and shift operation in sequence; the third branch performs P permutation, XOR operation, and shift operation in sequence; the fourth branch performs Feistel-like operation and shift operation in sequence; The data for the XOR operation of the second branch is the first branch after the S-box transformation and the second branch after the cyclic shift, and the data for the XOR operation of the third branch is the third branch after the P permutation and the fourth branch after the Feistel-like operation. (4) merging the data of the first and second branches after the operation in step (3) into 32-bit data, merging the data of the third and fourth branches after the operation in step (3) into 32-bit data, and then exchanging the left and right 32-bit data to obtain 64-bit intermediate state data; (5) The 64-bit intermediate state data is expressed as a group of 4 bits as S = s 15 …s0, perform matrix transposition operation to obtain the ciphertext of one round of operation; The decryption process is the inverse of the encryption process; Step 3: Repeat (1) to (5) to complete the specified number of rounds of operations. The calculation result of the last round of operations is the ciphertext / plaintext. The Feistel-like operation refers to operating the data to be processed according to the following formula: Wherein, F() represents the F function: F(X)=L(S(X)), S(X) represents the S-box transformation of X, and L represents the XOR operation of the input data after dividing it from high to low bits according to the following expression: X0X1X2X3 represents the 64-bit data input to L arranged from high to low; The P substitution is to perform a substitution operation on the 16-bit data to be substituted according to the P substitution table generated by the following formula: Here, i represents the 16-bit data to be replaced.

2. The method according to claim 1, characterized in that The 64-bit intermediate state data is represented as a group of 4 bits as S=s 15 …s0, perform the matrix transposition operation according to the following expression:

3. The method according to claim 1, characterized in that The updating of the round key refers to transforming and updating the round key of the previous round by replacing the S box.

4. The method according to claim 1, characterized in that: The S-box transformation operation is performed according to the following formula: X i '=S[X i ](0≤i≤15) Among them, X i and X i ' represents the i-th bit in the data before and after the S-box replacement operation; S[] represents the S-box. When the data input to the S-box is {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}, the corresponding values ​​are {C, 5, 6, B, 9, 0, A, D, 3, E, F, 8, 4, 7, 1, 2}.

5. The method according to claim 1, characterized in that The circular left shift list of the circular left shift operation refers to that from the 1st round to the 20th round, the circular left shift bits are {1, 1, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2}.

6. A new hybrid structure block cipher MSBC implementation system, characterized in that: include: Loading module: loads 64-bit plaintext or 64-bit ciphertext into the register as data to be encrypted / decrypted; Division module: using the round key, the data to be encrypted / decrypted is divided into 4 branches for 20 round operations, and the round key is updated after each round operation; Round operation module: including round operation encryption unit and round operation decryption unit; Round operation encryption unit: (1) First, the 64-bit plaintext and the round key are subjected to the round key addition operation; (2) Divide the 64-bit data after the round key addition operation into four branches from high to low, each branch has 16 bits of data, namely the first branch, the second branch, the third branch and the fourth branch; (3) The first branch performs S-box transformation and shift operation in sequence; the second branch performs circular shift, XOR operation, and shift operation in sequence; the third branch performs P permutation, XOR operation, and shift operation in sequence; the fourth branch performs Feistel-like operation and shift operation in sequence; The data for the XOR operation of the second branch is the data of the first branch after the S-box transformation and the second branch after the cyclic shift, and the data for the XOR operation of the third branch is the data of the XOR operation of the third branch after the P permutation and the fourth branch after the Feistel-like operation; (4) merging the data of the first and second branches after the operation in step (3) into 32-bit data, merging the data of the third and fourth branches after the operation in step (3) into 32-bit data, and then exchanging the left and right 32-bit data to obtain 64-bit intermediate state data; (5) The 64-bit intermediate state data is expressed as a group of 4 bits as S = s 15 …s0, perform matrix transposition operation to obtain the ciphertext of one round of operation; The decryption process of the round operation decryption unit and the encryption process of the round operation encryption unit are mutually inverse operations; Repeated call module: repeatedly call the round operation module, perform 20 rounds of round operations in total, and use the calculation result of the last round of round operations as the ciphertext / plaintext; The Feistel-like operation refers to operating the data to be processed according to the following formula: Wherein, F() represents the F function: F(X)=L(S(X)), S(X) represents the S-box transformation of X, and L represents the XOR operation of the input data after dividing it from high to low bits according to the following expression: X0X1X2X3 represents the 64-bit data input to L arranged from high to low; The P substitution is to perform a substitution operation on the 16-bit data to be substituted according to the P substitution table generated by the following formula: Here, i represents the 16-bit data to be replaced.

7. An electronic terminal, characterized in that: At least: one or more processors; and a memory storing one or more computer programs; The processor calls the computer program to execute: The steps of the method according to any one of claims 1 to 6.

8. A computer-readable storage medium, characterized in that: A computer program is stored, which is called by a processor to execute: The steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • SP network structure lightweight LBT block cipher realizing method with consistent encryption and decryption

    CN107707343A

  • Method and device for realizing Shield block cipher generated by novel secret key and readable storage medium

    CN111262685A