Encryption and decryption methods and devices applicable to industrial control systems

By using a multi-round iterative encryption algorithm with an SPN structure in the industrial control system, combined with the introduction of round keys, S-box replacement and linear diffusion processing, the problem that traditional algorithms cannot meet the low power consumption requirements of the industrial control system is solved, and efficient confidentiality of data is achieved. reliability and integrity guaranteed.

CN118214539BActive Publication Date: 2024-08-27CHINA ELECTRONICS CORP 6TH RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410414304.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-08
Publication Date
2024-08-27
Estimated Expiration
2044-04-08

AI Technical Summary

Technical Problem

Traditional cryptographic algorithms cannot meet the low power consumption and low computing power requirements of embedded devices in industrial control systems, resulting in a lack of effective lightweight algorithms for data encryption solutions in industrial control systems.

Method used

It uses a multi-round iterative encryption algorithm with an SPN structure, combines round key introduction, S-box replacement and linear diffusion processing, and uses 4-bit S-box and word reorganization and L transformation for encryption. It is suitable for encryption and decryption methods in industrial control systems.

Benefits of technology

It achieves data confidentiality and integrity guarantee in low-latency scenarios, resists common attack methods, such as differential analysis and linear analysis, and consumes little hardware resources, making it suitable for lightweight hardware and software implementation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118214539B
    Figure CN118214539B
Patent Text Reader

Abstract

The present disclosure provides an encryption and decryption method and device applicable to industrial control systems. The encryption method applicable to industrial control systems disclosed in the present disclosure adopts the SPN structure as a whole and performs multiple rounds of iterative encryption operations. The iterative encryption operation includes three parts: round key introduction, S-box replacement, and linear diffusion. Each round of encryption operation introduces a round key, and finally a vector is XORed to obtain the output ciphertext. The present disclosure provides a lightweight encryption and decryption solution applicable to industrial control systems, which can solve the data confidentiality and integrity problems in deterministic low-latency scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing, and in particular to an encryption and decryption method and device applicable to an industrial control system. Background Art

[0002] In recent years, industrial control systems and the industrial Internet have shown a trend of deep integration, which has greatly improved the intelligence of industrial production, but also brought new security challenges. In this case, it is very important to encrypt data in industrial control systems.

[0003] In the design of cryptographic algorithms for industrial control systems, due to the objective conditions of low power consumption and low computing power of embedded devices in industrial control systems, traditional cryptographic algorithms cannot meet the requirements of embedded devices in industrial control systems. Therefore, academic and industrial circles in various countries have begun to study and design lightweight cryptographic algorithms with excellent implementation efficiency. At present, although there are some well-known lightweight cryptographic algorithms in the world, the number of independently designed related algorithms is still relatively limited. Summary of the invention

[0004] The present disclosure at least provides an encryption method and device, and a decryption method applicable to an industrial control system, so as to provide an encryption and decryption solution applicable to the industrial control system.

[0005] According to one aspect of the present disclosure, there is provided an encryption method applicable to an industrial control system, comprising:

[0006] Performing an XOR operation on the plaintext to be encrypted and the preset first vector to obtain input state data corresponding to the first round of encryption process; wherein the plaintext and the input state data are both N bits;

[0007] In the first round of encryption, the round key is XORed to the input state data of the upper N / 2 bits in the order of bits from high to low to obtain the key introduction state data; wherein the round key is N / 2 bits, and the key introduction state data is N bits; and the key introduction state data is permuted by using a preset number of parallel S boxes to obtain permuted state data; and the permuted state data is linearly diffused by using word reorganization and L transformation to obtain the output data corresponding to the first round of encryption process; wherein the S box includes a 4-bit S box;

[0008] In each round of encryption except the first round of encryption and the last round of encryption, the output data corresponding to the previous round of encryption is used as the input state data in the current round of encryption; the round key is XORed to the input state data of the upper N / 2 bits in the order of bits from high to low to obtain the key introduction state data; and the key introduction state data is permuted by using a preset number of parallel S boxes to obtain the permuted state data; and the permuted state data is linearly diffused by using word reorganization and L transformation to obtain the output data corresponding to the current round of encryption;

[0009] In the last round of encryption, the output data corresponding to the previous round of encryption is used as the input state data in the current round of encryption; the round key is XORed to the input state data of the upper N / 2 bits in the order of bits from high to low to obtain the key introduction state data; and the key introduction state data is permuted using a preset number of parallel S boxes to obtain the output data corresponding to the current round of encryption;

[0010] The output data corresponding to the last round of encryption process is XORed with the preset second vector to obtain the ciphertext.

[0011] In a possible implementation manner, the linear diffusion processing of the permuted state data by using word reorganization and L transformation includes:

[0012] Performing word reorganization on the replaced state data to obtain reorganized state data;

[0013] Performing L transformation on the restructured data to obtain L transformation data;

[0014] The L transformed data is word-reorganized to obtain output data of the corresponding round encryption process.

[0015] In a possible implementation, the S-box is queried in parallel based on a Bit-Slice approach, including multiple Boolean logic operations;

[0016] The multiple Boolean logic operations include at least one of the following: a negation operation; a data transfer operation; an or operation; an exclusive or operation; and an and operation.

[0017] In a possible implementation manner, the word reorganization reorganizes data based on 16 bits.

[0018] In a possible implementation, the L transform includes two Perm transforms, and the Perm transform adopts a Feistel-like structure including a cyclic shift operation and an XOR operation.

[0019] In a possible implementation manner, the number of differential branches of the Perm transform is 6, and includes 5 rounds of iterative cyclic shift operations and XOR operations; wherein the cyclic shift parameters are 0, 1, 2, 3, and 1, respectively.

[0020] In a possible implementation, the round key is expanded according to the following steps:

[0021] Rewrite the initial round key according to the preset number of bits to obtain the rewritten round key corresponding to the first round of iteration;

[0022] Execute multiple rounds of iterative processes, and in each round of iterative process, perform cyclic shift, XOR operation and AND operation on the rewritten state round key corresponding to the round of iterative process to obtain the extended state round key corresponding to the round of iterative process; wherein the extended state round key corresponding to the round of iterative process is used as the rewritten state round key corresponding to the next round of iterative process;

[0023] The extended round key corresponding to the last round of iteration is used as the final round key.

[0024] According to another aspect of the present disclosure, a decryption method applicable to an industrial control system is provided, comprising an inverse operation of any of the above encryption methods, wherein the inverse operation of the L transform comprises calling the cyclic shift parameters in the L transform in reverse order.

[0025] According to another aspect of the present disclosure, a round key expansion method is provided, comprising:

[0026] Rewrite the initial round key according to the preset number of bits to obtain the rewritten round key corresponding to the first round of iteration;

[0027] Execute multiple rounds of iterative processes, and in each round of iterative process, perform cyclic shift, XOR operation and AND operation on the rewritten state round key corresponding to the round of iterative process to obtain the extended state round key corresponding to the round of iterative process; wherein the extended state round key corresponding to the round of iterative process is used as the rewritten state round key corresponding to the next round of iterative process;

[0028] The extended round key corresponding to the last round of iteration is used as the final round key.

[0029] According to another aspect of the present disclosure, there is provided an encryption device applicable to an industrial control system, comprising:

[0030] A preliminary processing module, used for performing an XOR operation on the plaintext to be encrypted and a preset first vector to obtain input state data corresponding to the first round of encryption process; wherein the plaintext and the input state data are both N bits;

[0031] The encryption processing module is used to, in the first round of encryption process, XOR the round key to the input state data of the upper N / 2 bits in the order of bits from high to low, to obtain the key introduction state data; wherein the round key is N / 2 bits, and the key introduction state data is N bits; and, using a preset number of parallel S boxes to perform a permutation operation on the key introduction state data to obtain permutation state data; and, using word recombination and L transformation, perform linear diffusion processing on the permutation state data to obtain the output data corresponding to the first round of encryption process; wherein the S box includes a 4-bit S box;

[0032] In each round of encryption except the first round of encryption and the last round of encryption, the output data corresponding to the previous round of encryption is used as the input state data in the current round of encryption; the round key is XORed to the input state data of the upper N / 2 bits in the order of bits from high to low to obtain the key introduction state data; and the key introduction state data is permuted by using a preset number of parallel S boxes to obtain the permuted state data; and the permuted state data is linearly diffused by using word reorganization and L transformation to obtain the output data corresponding to the current round of encryption;

[0033] In the last round of encryption, the output data corresponding to the previous round of encryption is used as the input state data in the current round of encryption; the round key is XORed to the input state data of the upper N / 2 bits in the order of bits from high to low to obtain the key introduction state data; and the key introduction state data is permuted using a preset number of parallel S boxes to obtain the output data corresponding to the current round of encryption;

[0034] The ciphertext processing module is used to perform an XOR operation on the output data corresponding to the last round of encryption process and a preset second vector to obtain a ciphertext.

[0035] The encryption method for an industrial control system disclosed in the present invention adopts the SPN structure as a whole and performs multiple rounds of iterative encryption operations. The iterative encryption operation includes three parts: round key introduction, S-box replacement, and linear diffusion. Each round of encryption operation introduces a round key, and finally a vector is XORed to obtain the output ciphertext. The SPN structure is selected in the algorithm structure of the present invention, which can provide fast diffusion and facilitate the estimation of the security bound based on the number of active S-boxes; the S-box selected in the present invention is a differential, linearly optimal 4-bit S-box, that is, the upper bound of the differential probability is optimal, which is 2 -2 , the upper bound of the linear correlation coefficient reaches the optimal value, which is 2 -1, using 4-bit S-boxes for parallel query based on Bit-Slice, which is easy to implement in lightweight software and hardware. After analysis, the algorithm can resist common attack methods, such as differential analysis, linear analysis, impossible differential analysis, zero-correlation linear analysis, integral analysis and other attacks. In addition, the core of the scheme disclosed in the present invention is reusable, with low hardware resource consumption, suitable for lightweight hardware usage scenarios, and is not limited to hardware implementation, but also suitable for software implementation. Furthermore, the present invention uses word reorganization and L transformation for linear diffusion processing. The word reorganization operation is equivalent to the reorganization based on 16-bit numbers, with excellent hardware performance, and is suitable for 8-bit and above processors; L transformation facilitates the estimation of the number of active S boxes based on MILP technology; at the same time, the combination of word reorganization and L transformation also realizes the linear transformation between bits inside the nibble, which increases a certain degree of diffusion. In summary, the scheme disclosed in the present invention can solve the problems of data confidentiality and integrity in deterministic low-latency scenarios, and can be applied to embedded controllers in industrial control systems, such as PLC and DCS systems.

[0036] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0038] Figure 1 is a flow chart of an encryption method applicable to an industrial control system according to an embodiment of the present disclosure;

[0039] Figure 2 is a schematic diagram of an encryption method according to an embodiment of the present disclosure;

[0040] Figure 3 is a schematic diagram of an S-box processing method according to an embodiment of the present disclosure;

[0041] Figure 4A is a schematic diagram of L transformation according to an embodiment of the present disclosure;

[0042] Figure 4B is a schematic diagram of linear diffusion processing according to an embodiment of the present disclosure;

[0043] Figure 5 It is a schematic diagram of the structure of an encryption device applicable to an industrial control system according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0044] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0045] The present disclosure is to solve the problem that there is a lack of lightweight encryption and decryption solutions applicable to industrial control systems. It provides an encryption method and device, a decryption method, and a round key expansion method applicable to industrial control systems. The encryption method of the present disclosure adopts the SPN structure as a whole and performs multiple rounds of iterative encryption operations. The iterative encryption operation includes three parts: round key introduction, S box replacement, and linear diffusion. Each round of encryption operation introduces a round key, and finally a vector is XORed to obtain the output ciphertext. The present disclosure provides a lightweight encryption and decryption solution applicable to industrial control systems, which can solve the data confidentiality and integrity problems in deterministic low-latency scenarios.

[0046] The technical solution of the present disclosure is described below through specific embodiments.

[0047] like Figure 1 As shown, it is a flowchart of the encryption method applicable to the industrial control system of this embodiment. The execution subject of this embodiment is a component with data processing capability. The specific method of this embodiment may include the following steps:

[0048] S110, performing an XOR operation on the plaintext to be encrypted and a preset first vector to obtain input state data corresponding to the first round of encryption process; wherein the plaintext and the input state data are both N bits.

[0049] The number of bits of the first vector is the same as the number of bits of the plaintext, both being N bits, and the first vector may be set to 0 at the first half of the number of bits, that is, the first vector may be set to 0 at the first 2 / N number of bits.

[0050] like Figure 2 As shown, x0, x1, x2, and x3 are the input data corresponding to the first round of encryption process.

[0051] S120. In the first round of encryption, the round key is XORed with the input state data of the upper N / 2 bits in the order of bits from high to low to obtain the key introduction state data; wherein the round key is N / 2 bits, and the key introduction state data is N bits; and, a preset number of parallel S boxes are used to perform a permutation operation on the key introduction state data to obtain permutation state data; and, using word reorganization and L transformation, a linear diffusion operation is performed on the permutation state data to obtain the output data corresponding to the first round of encryption process; wherein the S box includes a 4-bit S box.

[0052] S130. In each round of encryption except the first round of encryption and the last round of encryption, the output data corresponding to the previous round of encryption is used as the input state data in the current round of encryption; the round key is XORed to the input state data of the upper N / 2 bits in the order of bits from high to low to obtain the key introduction state data; and, a preset number of parallel S boxes are used to perform a permutation operation on the key introduction state data to obtain permutation state data; and, using word reorganization and L transformation, a linear diffusion operation is performed on the permutation state data to obtain the output data corresponding to the current round of encryption.

[0053] S140. In the last round of encryption, the output data corresponding to the previous round of encryption is used as the input state data in the current round of encryption; the round key is XORed with the input state data of the upper N / 2 bits in the order of bits from high to low to obtain the key introduction state data; and a preset number of parallel S boxes are used to perform a permutation operation on the key introduction state data to obtain the output data corresponding to the current round of encryption.

[0054] S120 to S140 illustrate the encryption process of each round. In each round of iteration, the round key is introduced into the encryption process by XORing with the input data. In this algorithm, an N / 2-bit round key is introduced in each round and XORed with the high N / 2 bits of the input data, which is equivalent to XORing the high 2 bits of the round key input in each S box. For details, see Figure 2 In some embodiments, the value of N may be 128, and the round key may be 64 bits. In other embodiments, the round key may also be 128, 256 bits, etc. Figure 2 As shown, RK i represents the round key, and i is the round number.

[0055] like Figure 2 As shown, in this embodiment, a 4-bit S-box is used, which is composed of 32 S-boxes placed in parallel. When the input is represented as The output is expressed as When , the transformation relationship is in:

[0056]

[0057] In the above, k represents the number of rounds, and j represents the bit.

[0058] For the specific replacement process, see Figure 3 .

[0059] The values ​​of the S box are shown in Table 1 below:

[0060] Table 1

[0061]

[0062] In this embodiment, the linear transformation layer for linear diffusion processing includes word reorganization and L transformation, wherein the specific definition of word reorganization is that for the input of four 32-bit words (in0, in1, in2, in3), the output after word reorganization is (out0, out1, out2, out3), and (out0, out1) = (in 0,L ||in 1,L ,in 0,R ||in 1,R );

[0063] (out2,out3)=(in 2,L ||in 3,L ,in 2,R ||in 3,R ); the above L represents the left half of the corresponding input, that is, the upper 16 bits of the corresponding input, and P represents the right half of the corresponding input, that is, the lower 16 bits of the corresponding input.

[0064] The specific definition of L transform is that for the input of 4 32-bit words (in0, in1, in2, in3), the output after L transform is (out0, out1, out2, out3), and

[0065] (out0,out1)=L(in0,in1); (out2,out3)=L(in2,in3)

[0066] The L transformation is shown in Figure 2. Figure 4A As shown, it includes a cyclic shift operation and an XOR operation, wherein p0, p1, p2, and p3 represent cyclic shift parameters.

[0067] The linear transformation layer word reorganization is performed twice, and an L transformation is performed between the two word reorganizations, such as Figure 4B As shown, specifically including:

[0068] The permuted state data is word-reorganized to obtain reorganized state data; the reorganized state data is L-transformed to obtain L-transformed data; the L-transformed data is word-reorganized to obtain output data of the corresponding round encryption process.

[0069] like Figure 2 As shown, the first word reorganization is (c0, c1) = (b 0,L ||b 1,L ,b 0,R ||b 1,R ) and (c2,c3)=(b 2,L ||b 3,L ,b 2,R ||b 3,R ), (c0, c1, c2, c3) is the above reorganized data, (d0, d1, d2, d3) is the above L transformation data obtained after L transformation. The second word reorganization is (y0, y1) = (d 0,L ||d 1,L ,d 0,R ||d 1,R ) and (y2,y3)=(d 2,L ||d 3,L ,d 2,R ||d 3,R ), (y0, y1, y2, y3) is the output data of the corresponding round encryption process.

[0070] like Figure 4B As shown, input is the above-mentioned permuted state data, and output is the output data of the corresponding round encryption process.

[0071] Considering that the linear diffusion processing in the last round of encryption process has little impact on the security of the algorithm, and in order to make the decryption structure of the algorithm basically consistent with the encryption structure, the linear diffusion operation is not performed in the last round of operations.

[0072] S150, performing an XOR operation on the output data corresponding to the last round of encryption process and a preset second vector to obtain a ciphertext.

[0073] The number of bits of the second vector is the same as the number of bits of the plaintext, both being N bits, and the second vector may be set to 0 at the positions of the last half of the number of bits, that is, the second vector may be set to 0 at the positions of the last 2 / N bits.

[0074] This paper provides a lightweight block cipher algorithm for industrial control programming platforms and embedded platforms, exploring the use of lightweight component search, automated security analysis based on MILP (SAT), provable security and other technologies and methods to solve the data confidentiality and integrity problems in deterministic low-latency scenarios. Ultimately, the solution disclosed in this paper can be applied to safety PLC and DCS systems.

[0075] In some embodiments, an S-box with optimal differential and linear properties is selected, and the operands of the S-box when implemented based on the Bit-Slice method are fully considered, and the operation is completed using as few instructions as possible (MOV, AND, XOR, OR, NOT). The Bit-Slice implementation of the S-box layer is some Boolean logic operations, including negation (NOT), data transfer operation (MOV), or operation (OR), exclusive or operation (XOR), and AND operation (AND).

[0076] In some embodiments, the L transform includes two Perm transforms, and the Perm transform adopts a Feistel-like structure, including a cyclic shift operation and an XOR operation, with low software and hardware implementation cost, consistent encryption and decryption implementation cost, and high efficiency; this embodiment comprehensively considers the implementation performance and security of the algorithm when selecting the number of iterations and cyclic shift parameters of the Perm transform. First, ensure that the number of differential branches is not less than 6; at the same time, the number of differential active S boxes of the 3-round algorithm calculated based on the MILP technology is as large as possible; on the basis of satisfying the above search results, make the number of iterations as small as possible, and the cyclic shift parameter as small as possible. Under this strategy, through the search results, it is determined that when the Perm transform uses 5 rounds of iterations and the cyclic shift parameters are 0, 1, 2, 3, and 1 respectively, the number of differential branches is 6, and the number of differential active S boxes under the 3-round algorithm reaches 15. The number of active S boxes under some other parameters is shown in Table 2 below.

[0077] Table 2

[0078] Serial number <![CDATA[(p0,p1,p2,p3,p4))]]> Number of differential branches The number of active S-boxes in the three-round algorithm difference 1 0,1,2,3,1 6 15 2 0,1,3,2,1 6 14 3 0,1,3,4,1 6 15 4 0,1,3,5,1 6 9 5 0,1,3,10,1 6 9 6 0,1,4,0,1 6 12 7 0,1,4,4,1 6 10 8 0,1,6,6,1 6 15

[0079] In some embodiments, the round keys are expanded as follows:

[0080] First, the initial round key is rewritten according to a preset number of bits to obtain a rewritten round key corresponding to the first round of iteration; then, multiple rounds of iterations are performed, and in each round of iterations, the rewritten round key corresponding to the round of iterations is cyclically shifted, XORed, and ANDed to obtain an extended round key corresponding to the round of iterations; wherein the extended round key corresponding to the round of iterations is used as the rewritten round key corresponding to the next round of iterations; finally, the extended round key corresponding to the last round of iterations is used as the final round key.

[0081] The expanded round key can be 256 bits, 128 bits, etc.

[0082] The above key expansion scheme is mainly based on a simple and lightweight design. In this algorithm, circular shift, XOR, and AND operations are used in combination with 4-branch and 8-branch generalized Feistel structures to achieve round key expansion. The software and hardware resource usage introduced by key expansion is reduced as much as possible. The round constant related to the "number of rounds" is introduced during the key expansion process, which can effectively resist related key attacks.

[0083] The present disclosure also provides a decryption method applicable to an industrial control system, including the inverse operation of the encryption method in the above embodiment, inputting N-bit ciphertext and round key, and outputting N-bit plaintext P, wherein the inverse operation of L transformation includes calling the cyclic shift parameters in L transformation in reverse order. In addition, the inverse operation of S box is also performed, and the replacement correspondence is shown in Table 3 below:

[0084] Table 3

[0085]

[0086] The present disclosure provides a round key expansion method, which is the same as the expansion method in the above embodiment and will not be described again here.

[0087] Based on the same inventive concept, the present disclosure provides an encryption device applicable to an industrial control system. The steps performed by the components of the device are the same or similar to those of the above method, so similar parts are not repeated. Figure 5 As shown, the encryption device applicable to the industrial control system of this embodiment includes:

[0088] The preliminary processing module 510 is used to perform an XOR operation on the plaintext to be encrypted and a preset first vector to obtain input state data corresponding to the first round of encryption process; wherein the plaintext and the input state data are both N bits.

[0089] The encryption processing module 520 is used to, during the first round of encryption, XOR the round key with the input state data of the upper N / 2 bits in the order of bits from high to low, to obtain the key introduction state data; wherein the round key is N / 2 bits, and the key introduction state data is N bits; and, using a preset number of parallel S-boxes to perform a permutation operation on the key introduction state data to obtain permutation state data; and, using word reorganization and L transformation, performing linear diffusion processing on the permutation state data to obtain the output data corresponding to the first round of encryption process; wherein the S-box includes a 4-bit S-box.

[0090] The encryption processing module 520, in each round of encryption process except the first round of encryption process and the last round of encryption process, uses the output data corresponding to the previous round of encryption process as the input state data in the current round of encryption process; XORs the round key to the input state data of the upper N / 2 bits in order of bits from high to low to obtain key introduction state data; and uses a preset number of parallel S boxes to perform a permutation operation on the key introduction state data to obtain permutation state data; and uses word recombination and L transformation to perform linear diffusion processing on the permutation state data to obtain output data corresponding to the current round of encryption process.

[0091] The encryption processing module 520, in the last round of encryption process, uses the output data corresponding to the previous round of encryption process as the input state data in the current round of encryption process; XORs the round key to the input state data of the upper N / 2 bits in the order of bits from high to low to obtain the key introduction state data; and uses a preset number of parallel S boxes to perform a permutation operation on the key introduction state data to obtain the output data corresponding to the current round of encryption process;

[0092] The ciphertext processing module 530 is used to perform an XOR operation on the output data corresponding to the last round of encryption process and a preset second vector to obtain a ciphertext.

[0093] In some embodiments, when the encryption processing module 520 performs linear diffusion processing on the permuted state data by using word reorganization and L transformation, it is used to:

[0094] Performing word reorganization on the replaced state data to obtain reorganized state data;

[0095] Performing L transformation on the restructured data to obtain L transformation data;

[0096] The L transformed data is word-reorganized to obtain output data of the corresponding round encryption process.

[0097] In some embodiments, the S-box is queried in parallel based on the Bit-Slice method, including multiple Boolean logic operations; the multiple Boolean logic operations include at least one of the following: a negation operation; a data transfer operation; an or operation; an exclusive or operation; and an and operation.

[0098] In some embodiments, the word reassembly is performed based on 16 bits to reassemble data.

[0099] In some embodiments, the L transform includes two Perm transforms, and the Perm transform adopts a Feistel-like structure including a cyclic shift operation and an XOR operation.

[0100] In some embodiments, the Perm transform has 6 differential branches and includes 5 rounds of iterative cyclic shift operations and XOR operations; wherein the cyclic shift parameters are 0, 1, 2, 3, and 1, respectively.

[0101] In some embodiments, a round key expansion module 540 is further included, and the round key expansion module 540 expands the round key according to the following steps:

[0102] Rewrite the initial round key according to the preset number of bits to obtain the rewritten round key corresponding to the first round of iteration;

[0103] Execute multiple rounds of iterative processes, and in each round of iterative process, perform cyclic shift, XOR operation and AND operation on the rewritten state round key corresponding to the round of iterative process to obtain the extended state round key corresponding to the round of iterative process; wherein the extended state round key corresponding to the round of iterative process is used as the rewritten state round key corresponding to the next round of iterative process;

[0104] The extended round key corresponding to the last round of iteration is used as the final round key.

[0105] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0106] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0107] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0108] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0109] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0110] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0111] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0112] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. An encryption method applicable to an industrial control system, characterized in that: include: Performing an XOR operation on the plaintext to be encrypted and the preset first vector to obtain input state data corresponding to the first round of encryption process; wherein the plaintext and the input state data are both N bits; In the first round of encryption, the round key is XORed to the input state data of the upper N / 2 bits in the order of bits from high to low to obtain the key introduction state data; wherein the round key is N / 2 bits, and the key introduction state data is N bits; and the key introduction state data is permuted by using a preset number of parallel S boxes to obtain permuted state data; and the permuted state data is linearly diffused by using word reorganization and L transformation to obtain the output data corresponding to the first round of encryption process; wherein the S box includes a 4-bit S box; In each round of encryption except the first round of encryption and the last round of encryption, the output data corresponding to the previous round of encryption is used as the input state data in the current round of encryption; the round key is XORed to the input state data of the upper N / 2 bits in the order of bits from high to low to obtain the key introduction state data; and the key introduction state data is permuted by using a preset number of parallel S boxes to obtain the permuted state data; and the permuted state data is linearly diffused by using word reorganization and L transformation to obtain the output data corresponding to the current round of encryption; In the last round of encryption, the output data corresponding to the previous round of encryption is used as the input state data in the current round of encryption; the round key is XORed to the input state data of the upper N / 2 bits in the order of bits from high to low to obtain the key introduction state data; and the key introduction state data is permuted using a preset number of parallel S boxes to obtain the output data corresponding to the current round of encryption; Perform an XOR operation on the output data corresponding to the last round of encryption process and the preset second vector to obtain a ciphertext; The round key is expanded according to the following steps: Rewrite the initial round key according to the preset number of bits to obtain the rewritten round key corresponding to the first round of iteration; Perform multiple rounds of iterations, and in each round of iterations, perform cyclic shift, XOR operation, and AND operation on the rewritten state round key corresponding to the round of iterations to obtain the extended state round key corresponding to the round of iterations; wherein the extended state round key corresponding to the round of iterations is used as the rewritten state round key corresponding to the next round of iterations; The extended round key corresponding to the last round of iteration is used as the final round key.

2. The method according to claim 1, characterized in that The method of performing linear diffusion processing on the permuted state data by using word reorganization and L transformation includes: Performing word reorganization on the replaced state data to obtain reorganized state data; Performing L transformation on the restructured data to obtain L transformation data; The L transformed data is word-reorganized to obtain output data of the corresponding round encryption process.

3. The method according to claim 1, characterized in that The S-box is queried in parallel based on the Bit-Slice method, including multiple Boolean logic operations; The multiple Boolean logic operations include at least one of the following: a negation operation; a data transfer operation; an or operation; an exclusive or operation; and an and operation.

4. The method according to claim 1, characterized in that: The word reassembly is performed based on 16 bits to reassemble data.

5. The method according to claim 1, characterized in that The L transform includes two Perm transforms, and the Perm transform adopts a Feistel-like structure, including a cyclic shift operation and an XOR operation.

6. The method according to claim 5, characterized in that The number of differential branches of the Perm transformation is 6, and includes 5 rounds of iterative cyclic shift operations and XOR operations; wherein the cyclic shift parameters are 0, 1, 2, 3, and 1 respectively.

7. A decryption method applicable to an industrial control system, characterized in that: The method comprises the inverse operation of the encryption method according to any one of claims 1 to 6, wherein the inverse operation of the L transform comprises calling the cyclic shift parameters in the L transform in reverse order.

8. An encryption device suitable for an industrial control system, characterized in that: include: A preliminary processing module, used for performing an XOR operation on the plaintext to be encrypted and a preset first vector to obtain input state data corresponding to the first round of encryption process; wherein the plaintext and the input state data are both N bits; The encryption processing module is used to, in the first round of encryption process, XOR the round key to the input state data of the upper N / 2 bits in the order of bits from high to low, to obtain the key introduction state data; wherein the round key is N / 2 bits, and the key introduction state data is N bits; and, using a preset number of parallel S boxes to perform a permutation operation on the key introduction state data to obtain permutation state data; and, using word recombination and L transformation, perform linear diffusion processing on the permutation state data to obtain the output data corresponding to the first round of encryption process; wherein the S box includes a 4-bit S box; In each round of encryption except the first round of encryption and the last round of encryption, the output data corresponding to the previous round of encryption is used as the input state data in the current round of encryption; the round key is XORed to the input state data of the upper N / 2 bits in the order of bits from high to low to obtain the key introduction state data; and the key introduction state data is permuted by using a preset number of parallel S boxes to obtain the permuted state data; and the permuted state data is linearly diffused by using word reorganization and L transformation to obtain the output data corresponding to the current round of encryption; In the last round of encryption, the output data corresponding to the previous round of encryption is used as the input state data in the current round of encryption; the round key is XORed to the input state data of the upper N / 2 bits in the order of bits from high to low to obtain the key introduction state data; and the key introduction state data is permuted using a preset number of parallel S boxes to obtain the output data corresponding to the current round of encryption; The ciphertext processing module is used to perform an XOR operation on the output data corresponding to the last round of encryption process and a preset second vector to obtain a ciphertext; The encryption device expands the round key according to the following steps: Rewrite the initial round key according to the preset number of bits to obtain the rewritten round key corresponding to the first round of iteration; Perform multiple rounds of iterations, and in each round of iterations, perform cyclic shift, XOR operation, and AND operation on the rewritten state round key corresponding to the round of iterations to obtain the extended state round key corresponding to the round of iterations; wherein the extended state round key corresponding to the round of iterations is used as the rewritten state round key corresponding to the next round of iterations; The extended round key corresponding to the last round of iteration is used as the final round key.