Implementation method and system for block cipher MSBC of novel mixed structure
By combining SPN and Feistel structures in the packet password, the new P permutation table and F function are designed, which solves the problem that existing packet passwords are difficult to achieve efficient encryption in resource-constrained environments, and improves the security and performance efficiency of the algorithm.
Patent Information
- Application Number
- CN202510038624.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2045-01-10
AI Technical Summary
Existing packet passwords are difficult to achieve efficient encryption in resource-constrained environments, and the single structure of traditional cryptographic algorithms is vulnerable to attacks, and the key expansion operation is simple, resulting in low security.
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 improve the complexity and security of the algorithm.
It realizes efficient encryption in resource-constrained environments, improves the security and robustness of the algorithm, reduces hardware implementation costs, and provides higher performance efficiency.
Smart Images

Figure CN119853889A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of computer security, and particularly designs a method and system for realizing a block cipher MSBC with a novel hybrid structure. Background Art
[0002] With the development of computer and communication technology, 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, e-mail, electronic automatic transfer payment system and automatic retail business network, information security and cryptographic technology are indispensable. Block cipher is an important branch of cryptography, which has received widespread attention and has become a hot topic in cryptography research. Block cipher essentially converts plaintext of fixed length into ciphertext of the same length through a finite number of rounds of iterative permutation transformation. Block cipher has the characteristics of fast speed, easy standardization and easy hardware and software implementation. Faced with the rapid improvement of computer computing power and various attack methods based on mathematical analysis, the security of block ciphers is seriously threatened. It is of great significance to develop block ciphers with higher strength and efficiency.
[0003] In recent years, with the extensive application and continuous development of new systems such as IoT embedded systems and wireless sensor networks, data security issues in the fields of smart cards, mobile computing devices, drones and autonomous driving have become increasingly prominent, and block cipher encryption technology is used to solve these problems. Considering the low-cost, low-power resource-constrained application environments such as RFID tags and sensor nodes, traditional block cipher standards such as AES and SMS4 cannot be implemented at all. Therefore, the study of lightweight block ciphers specifically suitable for such resource-constrained environments has attracted widespread attention from scholars at home and abroad. It is an emerging research field and a hot topic in international cryptography research.
[0004] In recent years, in order to adapt to 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. my country has also achieved fruitful results in the research of lightweight block cipher algorithms. In 2011, Wu and Zhang et al proposed Piccolo, and in 2013, Wu and Zhang et al proposed PRESENT.
[0005] Lblock was proposed by Gong et al. KLEIN was proposed by Gong et al. Li et al proposed encryption algorithms such as QTL, Magpie, Surge, and SFN in 2016, 2017, and 20 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) If the block length of a traditional block cipher is 64 bits, the 64-bit data will undergo P permutation, S-box transformation or adopt the Feistel structure as a whole, and the algorithm structure is single; in the overall cipher structure, one is a cipher based on the SPN structure, and the encryption and decryption implementation methods of this structure are inconsistent. Therefore, a specially designed decryption algorithm is required, which makes the encryption and decryption speed slow and consumes more software and hardware resources; the P permutation of a single SPN structure cipher is simple, resulting in poor algorithm diffusion ability; a single cipher algorithm design structure is vulnerable to attack. Another is a cipher based on the Feistel network structure. Although the encryption and decryption of this structure are similar and consume less software and hardware resources, the diffusion speed of the cipher algorithm of this structure is slow. In one round of iterative operation, only half of the groups enter the round function, so only half of the group data can be changed. (2) Most of the existing dedicated cipher chips only implement a cipher algorithm with a fixed cipher mode. This implementation method is difficult to meet the multi-level security requirements of different users. Although different cryptographic algorithms have been reconstructed and the same or similar operations between different algorithms have been extracted during the design process, there are many differences between different algorithms, which will cause a lot of area resource overhead, making the hardware implementation cost high and greatly reducing the performance efficiency. (3) The security of block cipher algorithms is not high. With the increase in computing power, many ciphers have been exposed to various security issues, especially lightweight block ciphers. The main reason is that the obfuscation and diffusion speed of the cryptographic algorithm itself is a bit slow. (4) The key expansion operation of the block cipher is too simple, or the key expansion operation is not performed. Such a design poses a hidden danger to the security of the cryptographic algorithm. Summary of the invention
[0007] Aiming at the problems existing in the traditional block cipher structure in the prior art, the present invention provides an implementation method and system of a block cipher MSBC with a novel hybrid structure, constructs a block cipher by combining an SPN structure with a Feistel structure, divides 64-bit encrypted data into four branches, and each branch performs a different encryption operation; designs a novel P permutation table for operating on 16-bit data; and proposes a new F function in a Feistel-like structure.
[0008] The technical solution provided by the present invention is as follows:
[0009] On the one hand, a method for implementing a new hybrid block cipher MSBC includes:
[0010] Step 1: Load 64-bit plaintext or 64-bit ciphertext into the register as the data to be encrypted / decrypted;
[0011] 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;
[0012] The round operation process of the encryption process is as follows:
[0013] (1) First, the 64-bit plaintext and the round key are subjected to the round key addition operation;
[0014] (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;
[0015] (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;
[0016] 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.
[0017] (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;
[0018] (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;
[0019] The decryption process is the inverse of the encryption process;
[0020] Step 3: Repeat (1)-(5) to complete the specified number of rounds of operations. The calculation result of the last round of operations is the ciphertext / plaintext.
[0021] Encrypt or decrypt 64-bit plaintext or ciphertext, with 16 bits in one branch, a total of 4 branches, 16 bits in each branch, each branch has its own encryption method, and there is a cross operation between the branches (the first branch and the second branch perform an XOR operation, and the fourth branch and the third branch perform an XOR operation), that is, the branches are both independent and connected. This setting makes the branches intricate and makes the algorithm difficult to be cracked;
[0022] In addition, the first and third branches adopt a structure similar to SPN, and the fourth branch adopts a structure similar to Fesitel. Overall, the entire algorithm adopts a hybrid structure of SPN and Fesitel. Compared with most of the existing ones that only use SPN structure, and the optimization method is usually to process one of the P permutation or S box or Fesitel function in the SPN structure, the present application improves both the S box and the Fesitel function at the same time, and adopts a lightweight S box, a novel P permutation algorithm and a unique Fesitel F function.
[0023] Furthermore, the Feistel-like operation refers to operating the data to be processed according to the following formula:
[0024]
[0025] 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.
[0026] Compared with the existing Feistel operation, this Feistel-like operation uses the F function to perform an XOR operation on the data after the S-box transformation, making the algorithm less vulnerable to attacks;
[0027] Furthermore, 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:
[0028]
[0029] The encryption process is more complicated by shuffling the intermediate state data and then sorting it.
[0030] Furthermore, the updating of the round key refers to transforming and updating the round key of the previous round by replacing the S-box.
[0031] Furthermore, the S-box transformation operation is performed according to the following formula:
[0032] X i '=S[X i ](0≤i≤15)
[0033] 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}.
[0034] Furthermore, 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:
[0035]
[0036] Here, i represents the 16-bit data to be replaced.
[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 {1, 1, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2}.
[0038] 20 rounds of operations are performed to achieve and ensure the security of encryption, without the need for more rounds of processing;
[0039] In the second aspect, a system for implementing a new hybrid structure block cipher MSBC includes:
[0040] Loading module: loads 64-bit plaintext or 64-bit ciphertext into the register as data to be encrypted / decrypted;
[0041] 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;
[0042] Round operation module: including round operation encryption unit and round operation decryption unit;
[0043] Round operation encryption unit:
[0044] (1) First, the 64-bit plaintext and the round key are subjected to the round key addition operation;
[0045] (5) 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;
[0046] (6) 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;
[0047] 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.
[0048] (7) 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;
[0049] (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;
[0050] The decryption process of the round operation decryption unit and the encryption process of the round operation encryption unit are mutually inverse operations;
[0051] Repeated call module: Repeatedly call the round operation module, perform 20 rounds of operations in total, and use the calculation result of the last round of operations as the ciphertext / plaintext.
[0052] In a third aspect, an electronic terminal at least comprises:
[0053] one or more processors;
[0054] and a memory storing one or more computer programs;
[0055] 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, wherein 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 new hybrid block cipher MSBC, which adopts a hybrid structure of SPN and Feistel. Each round of encryption operation is divided into 4 branches, each branch performs a series of different calculations, and also proposes a P permutation table for performing P permutation operations on 16-bit data. Compared with existing block ciphers, the cipher has higher efficiency and robustness. The round function of a traditional cryptographic algorithm generally adopts an 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 cryptographic algorithms, and the F function used is to perform an XOR operation on the data after the S-box transformation, making the algorithm less vulnerable to attack.
[0061] The cryptographic algorithm MSBC disclosed in the technical solution of the present invention not only shows high security but also shows compactness in hardware implementation, because the cryptographic algorithm adopts novel design and implementation technology. In the smallest implementation, the hardware requirement of the 64-bit key mode is only 2030 gate equivalents. And through experimental results, it is shown that the technical solution MSBC of the present invention provides sufficient security for known security analysis (including recent differential attacks and linear attacks, etc.) and future potential attacks, and this encryption algorithm provides a safer choice for fields that need encryption schemes. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 A schematic diagram of a process of the method according to an embodiment of the present invention;
[0063] Figure 2 A schematic diagram of the structure of branch A of the encryption method according to an embodiment of the present invention;
[0064] Figure 3 A schematic diagram of the B branch structure of the encryption method according to an embodiment of the present invention;
[0065] Figure 4 A schematic diagram of the C branch structure of the encryption method according to an embodiment of the present invention;
[0066] Figure 5 A schematic diagram of the D branch structure of the encryption method according to an embodiment of the present invention;
[0067] Figure 6 The figure is a schematic diagram of the matrix transformation structure of the encryption method described in the embodiment of the present invention. DETAILED DESCRIPTION
[0068] The present invention is described in detail below through specific embodiments in conjunction with the accompanying drawings.
[0069] The design goal of the technical solution described in the present invention is to provide encryption security for resource-constrained environments, such as IOT.
[0070] The technical solution of the present invention provides a method for implementing a new hybrid block cipher MSBC, 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 iterations of the algorithm is 20. 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 new hybrid structure block cipher MSBC, comprising:
[0072] Step 1: Load 64-bit plaintext or 64-bit ciphertext into the register as the data to be encrypted / decrypted;
[0073] Step 2: Using the round key, the data to be encrypted / decrypted is divided into 4 branches for 20 rounds of operations, and the round key is updated after each round of operations;
[0074] 20 rounds of operations are performed to achieve and ensure the security of encryption, without the need for more rounds of processing;
[0075] The round operation process of the encryption process is as follows:
[0076] (1) First, the 64-bit plaintext and the round key are subjected to the round key addition operation;
[0077] (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;
[0078] (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;
[0079] 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.
[0080] (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;
[0081] (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;
[0082] The decryption process is the inverse of the encryption process;
[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] The four branches in this example are named A branch, B branch, C branch, and D branch. The working process of each branch is as follows:
[0085] The A branch takes 16 bits of intermediate state data as input and 16 bits of intermediate state data as output. All operations performed by the A branch include the following four steps: round key addition → S-box conversion → shift operation → matrix transposition, as shown in the following figure. Figure 2 As shown;
[0086] The B branch uses 16-bit intermediate state data as input and 16-bit intermediate state data as output. The operations of the B branch include: round key addition → circular shift operation → XOR operation → shift operation → matrix transposition. Figure 3 As shown;
[0087] The C branch uses 16-bit intermediate state data as input and 16-bit intermediate state data as output. The operation of the C branch includes the following five steps: round key addition → P permutation → XOR operation → shift operation → matrix transposition. Figure 4 As shown;
[0088] The D branch uses 16-bit intermediate state data as input and 16-bit intermediate state data as output. The operations of the D branch include: AddRoundKey→Feistel structure operation→shift operation→matrix transposition. Figure 5 As shown;
[0089] The Feistel-like operation refers to operating the data to be processed according to the following formula:
[0090]
[0091] 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.
[0092] Compared with the existing Feistel operation, this Feistel-like operation uses the F function to perform an XOR operation on the data after the S-box transformation, making the algorithm less vulnerable to attacks;
[0093] The 64-bit intermediate state data is represented as a group of 4 bits as S=s 15 …s0, perform matrix transposition operation according to the following expression, such as Figure 6 As shown:
[0094]
[0095] The encryption process is more complicated by shuffling the intermediate state data and then sorting it.
[0096] The updating of the round key refers to the transformation and updating of the round key of the previous round by replacing the S box. The S box transformation operation is performed according to the following formula:
[0097] X i '=S[X i ](0≤i≤15)
[0098] 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}.
[0099] Table 1S 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 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:
[0102]
[0103] Here, i represents the 16-bit data to be replaced.
[0104] The substitution table is shown in Table 2.
[0105] Table 2P substitution 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 {1, 1, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2}.
[0108] The pseudo code of MSBC block cipher encryption is described as follows. The encryption process of MSBC block cipher is as follows Figure 1 shown.
[0109] Algorithm 1: Encryption process of MSBC block cipher
[0110]
[0111] Algorithm test data,The MSBC algorithm data is shown in Table 3.
[0112] Table 3 MSBC algorithm data
[0113] Plain text Key Ciphertext 0000000000000000 0000000000000000 2019BE3943C92CAD 0000000000000000 FFFFFFFFFFFFFFFF 0F5275B11F659A1C 0123456789ABCDEF 0000000000000000 5F7D1D98E241660A FFFFFFFFFFFFFFFF 0123456789ABCDEF 0CD78D5F70A46479 AAAAAAAAAAAAAAAA 0123456789ABCDEF 4E1E6D0C7B4E760E 0123456789ABCDEF 0123223389ABCDEF 5E22B47650E95EB1 0123456789ABCDEF 0123456701345678 5F5C1779243A6CFC
[0114] The MSBC algorithm described in the technical solution of the present invention is implemented in ASIC hardware. The resource area occupied by the SMIC0.18um algorithm of the comprehensive process library is 2020GE. The ASIC implementation of each lightweight block cipher algorithm is shown in Table 4.
[0115] Table 4 ASIC implementation of lightweight block cipher
[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 Area required is only 2020, and the speed is 200kbps, which 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 obvious improvement in performance.
[0118] First, MSBC was implemented in VHDL; second, ModelSim SE PLUS 6.1f was used to evaluate and simulate MSBC; finally, it was synthesized on a 0.18μm CMOS process to verify its hardware complexity. The area cost occupied by the combinational logic bit operations is as follows: the area cost occupied by the OR / AND gate is 1.33GE, the area cost occupied by the XOR / XNOR gate is 2.67GE, the area cost occupied by the NOR / NAND gate is 1GE, and the area cost occupied by the NOT gate is 0.67GE. In the technical solution of the present invention, using a 64-bit key to encrypt 64-bit plaintext takes 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 state. Storing a 64-bit data state requires 384GE (64×6), and storing a 64-bit key requires 384GE (64×6). For the round operation, it consists of AddRoundKey, S-box Conversion, and P-Permutation, Feistel-like structure operations. AddRoundKey is an XOR operation on a 64-bit plaintext and a 64-bit key. This step requires approximately 170.88GE (64×2.67), and the s-box conversion consists of 16 4×4s-boxes in parallel, which requires approximately 27.32×4=109.28GE. Therefore, the hardware implementation of MSBC is estimated to require an area of 2020.72GE.
[0120] Example 2
[0121] A new hybrid structure block cipher MSBC implementation system, including:
[0122] Loading module: loads 64-bit plaintext or 64-bit ciphertext into the register as data to be encrypted / decrypted;
[0123] 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;
[0124] Round operation module: including round operation encryption unit and round operation decryption unit;
[0125] Round operation encryption unit:
[0126] (1) First, the 64-bit plaintext and the round key are subjected to the round key addition operation;
[0127] (8) 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;
[0128] (9) 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;
[0129] 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.
[0130] (10) 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;
[0131] (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;
[0132] The decryption process of the round operation decryption unit and the encryption process of the round operation encryption unit are mutually inverse operations;
[0133] Repeated call module: Repeatedly call the round operation module, perform 20 rounds of operations in total, and use the calculation result of the last round of operations as the ciphertext / plaintext.
[0134] It should be understood that the implementation process of each module can refer to the content of the aforementioned method. The division of the above functional modules is only a division of logical functions. There may be other division methods in actual implementation, such as 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 units can be implemented in the form of hardware or software functional units.
[0135] Example 3
[0136] An electronic terminal, comprising at least:
[0137] one or more processors;
[0138] and a memory storing one or more computer programs;
[0139] The processor calls the computer program to execute:
[0140] The steps of the implementation method of the above-mentioned novel hybrid structure block cipher MSBC.
[0141] For the specific implementation process of each step, please refer to the description of the above method.
[0142] It should be understood that in the embodiments of the present invention, the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A 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 portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the type of device.
[0143] Example 4
[0144] A computer-readable storage medium stores a computer program, wherein 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 above 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 aforementioned embodiments, such as a hard disk or memory of a controller. The readable storage medium may also be an external storage device of the controller, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the controller. Furthermore, the readable storage medium may also include both an internal storage unit of the controller and an 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 this understanding, the technical solution of the present invention, in essence or in other words, 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, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned readable storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., various media that can store program codes.
[0149] Those skilled in the art will appreciate 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. 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 storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The present application is a device for realizing the function specified in one flow or multiple flows of the flow chart and / or one or multiple blocks of the block diagram with reference to the instructions executed by the processor according to the method, device (system) and computer program product of the embodiment of the present application. These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which realizes the function specified in one flow or multiple flows of the flow chart and / or one or multiple blocks of the block diagram. These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0150] It should be emphasized that the examples described in the present invention are illustrative rather than restrictive, and therefore the present invention is not limited to the examples described in the specific embodiments. Any other embodiments derived by those skilled in the art based on the technical solution of the present invention that do not depart from the purpose and scope of the present invention, whether modified or replaced, also fall within the scope of protection 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)-(5) to complete the specified number of rounds of operations. The calculation result of the last round of operations is the ciphertext / plaintext.
2. The method according to claim 1, characterized in that 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.
3. 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:
4. 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.
5. 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}.
6. The method according to claim 1, characterized in that 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. 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}.
8. 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 operations in total, and use the calculation result of the last round of operations as the ciphertext / plaintext.
9. 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 7.
10. 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 7.
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
Improved lightweight grouping encryption and decryption method and device based on P replacement and storage medium
CN111614457A
Decryption processing unit, information processing unit, decryption processing method, and computer program
JP2012143011A
Real time block data encryption / decryption processorusing Rijndael block cipher and method therefor
KR1020040045517A