Joint encryption and encoding transmission method based on SM4 and polar code and decoding and decryption method
By integrating SM4 with polar codes into a single encryption coding method, the problem of independent processing of encryption modules and channel coding modules in satellite communication systems is solved, achieving stronger security and error correction capabilities, and making it suitable for integration into spaceborne platforms.
Patent Information
- Application Number
- CN202611371314.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-04
- Publication Date
- 2026-11-06
AI Technical Summary
In existing satellite communication systems, the encryption module and the channel coding module are processed independently, resulting in high system complexity, large hardware area, and the inability to enhance security by utilizing coding redundancy. It is also difficult to embed the error correction capability of polar coding into the encryption process while maintaining the security strength of SM4.
The input plaintext is divided into multiple data blocks and SM4 encryption is performed in parallel. In the last four rounds, the linear transformation L is removed and replaced by a polar coding generation matrix as a global diffusion operation, thus integrating encryption and channel coding. The value of the frozen bits is controlled by the key.
Without increasing system overhead, it achieves stronger security and error correction capabilities, reduces computational complexity, has high adaptability, and is suitable for integration with spaceborne platforms.
Smart Images

Figure CN123055265A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of satellite communication and information security, to physical layer secure transmission technology, and particularly to encryption and decryption, specifically a joint encryption and encoding transmission method and decoding and decryption method based on SM4 and polar codes. Background Technology
[0002] Satellite communication systems inherently possess open wireless channels, inevitably facing challenges such as electromagnetic interference, eavesdropping, and long-distance signal attenuation during free-space transmission. In applications like military communications, emergency communications, and satellite broadcasting, communication systems must simultaneously meet the requirements of secure and reliable transmission. Traditional satellite communication systems execute encryption and channel coding sequentially as two independent modules: first, plaintext is encrypted to obtain ciphertext, and then the ciphertext is channel-coded to generate codewords for transmission. This serial processing mode requires each encryption and coding module to occupy a complete set of transformation resources and intermediate buffers, increasing system complexity and hardware implementation area. Furthermore, it creates a clear processing boundary between the two modules, limiting the miniaturization of onboard baseband processing chips. In addition, the channel coding module cannot perceive the statistical characteristics of encrypted data, and the encryption module cannot utilize coding redundancy to enhance security; the two are functionally disconnected.
[0003] In existing serial cryptography schemes, the encryption module often employs the SM4 block cipher algorithm (hereinafter referred to as SM4), which uses linear transformation L to achieve diffusion. The channel coding module often uses polar codes, providing known redundancy through frozen bits. SM4, as a Chinese cryptographic industry standard, adopts an unbalanced Feistel structure. In each iteration, it sequentially performs round key XOR, S-box nonlinear transformation τ, linear transformation L, and feedback word XOR, providing high-strength security protection for the data. Among these, the linear transformation L, through 32-bit cyclic shift and XOR operation, diffuses the confusion effect of the S-box output to the entire state word, which is the core operation for achieving diffusion. Polar codes, as a channel coding scheme proven to achieve channel capacity in binary input discrete memoryless symmetric channels, polarize the synthetic channel into two types of sub-channels—completely reliable and completely unreliable—through the channel polarization principle. Useful data is transmitted at the information bit positions, while fixed values known to both the sender and receiver are placed at the frozen bit positions.
[0004] Therefore, how to embed the error correction capability of polar coding into the encryption process while maintaining the security strength of SM4, so that the two are integrated rather than sequential, has become an important technical direction in the field of satellite communications. Summary of the Invention
[0005] The purpose of this invention is to provide a joint encryption encoding and transmission method and a decoding and decryption method based on SM4 and polar codes, to solve the problems mentioned in the background art.
[0006] In a first aspect, the present invention provides a joint encryption encoding and transmission method based on SM4 and polar codes. The method includes: dividing the input plaintext into D first data blocks of 128 bits each according to the information bit length K of the polar code; independently and in parallel executing the first 28 rounds of SM4 encryption operations on the D first data blocks to obtain D corresponding state word groups; in each round of SM4 encryption operation, sequentially performing round key XOR, S-box nonlinear transformation τ, linear transformation L, and feedback word XOR on the D first data blocks, wherein the round key used in each round is generated from the master key using the SM4 key expansion algorithm; the polar code has a code length of N and a code rate of R; and D... In each of the last four rounds of encryption operations, the state word group sequentially performs round key XOR, S-box nonlinear transformation, and feedback word XOR. After each of the last four rounds of encryption operations, a 32-bit state word is obtained from the encryption output of each of the last four rounds. The state words obtained in the last four rounds are then concatenated to form an information sequence of length K. A frozen bit of length NK bits and the information sequence are input together to a polar encoder to perform polar encoding, thereby obtaining an encoded bit sequence of length N bits, which serves as the ciphertext to be sent. The value of the frozen bit is controlled by a value key.
[0007] In this invention, encryption and channel coding are organically integrated into the same processing flow. The polar coding generator matrix replaces the linear transformation L of the last four rounds of SM4 as a global diffusion operation, making encryption and channel coding inter-embedded and inseparable. Attackers who do not have the SM4 master key and the frozen bit value key cannot correctly reconstruct the coding structure, thus achieving integrated transmission with both anti-interference capability and confidentiality performance.
[0008] In one implementation of the first aspect, K = D × 128 = N × R.
[0009] In one implementation of the first aspect, the polar coding includes: the polar encoder calculating the reliability of each bit position of the polar code according to the code length and the code rate, and selecting the K sub-channels with the highest reliability as information sequence positions, and the remaining NK sub-channels as frozen bit positions; wherein the information sequence positions are used to place the information sequence; and the frozen bit positions are used to place the frozen bits.
[0010] In one implementation of the first aspect, the filling rule of the value retrieval key is as follows: the binary sequence of the value retrieval key starts from the position of the frozen bit with the lowest reliability and fills the binary bits in ascending order of reliability; if the length of the value retrieval key exceeds NK, the first NK bits of the binary sequence are truncated; if the length of the value retrieval key is less than NK, it is extended to NK bits by padding with zeros.
[0011] In one implementation of the first aspect, the value-taking key is a key pre-distributed through an independent key distribution channel, or a subkey derived from the master key via a key derivation function; wherein, when the key derivation method is used, the value-taking key Kfr shares the same master key source as the round key to simplify key management.
[0012] Secondly, the present invention provides a joint decoding and decryption method based on SM4 and polar codes, applied to the aforementioned joint encryption and encoding transmission method based on SM4 and polar codes. The method includes: calculating the log-likelihood ratio of each bit of the received signal, and sending the log-likelihood ratio to a polar decoder so that the polar decoder decodes according to the value key and the log-likelihood ratio to obtain an output sequence; dividing the information bits of the corresponding information sequence in the output sequence into D second data blocks of 128 bits each; for each second data block, first recovering the input values of each state word through SM4 S-box mapping, and then combining the recovered input values, the state words, and the SM4 key... The round keys generated by the expansion algorithm for the last four rounds are XORed together, and the solution is reversed along the Feistel chain to recover the state word group before entering the last four rounds, obtaining D third data blocks. Each of the third data blocks is then independently and in parallel executed with SM4 decryption operations from round 28 to round 1, obtaining the corresponding decrypted data blocks. In each round of SM4 decryption operation, the round key XOR, S-box nonlinear transformation τ, linear transformation L, and feedback word XOR are sequentially performed on each of the third data blocks. The order of the round keys used in the SM4 decryption operation is reversed compared to the encryption operation, and the round function structure is exactly the same. Finally, the decrypted data blocks are concatenated to obtain the input plaintext.
[0013] In one implementation of the second aspect, the polarization decoder performs decoding based on the value key and the log-likelihood ratio, including: when decoding to the bit position corresponding to the information bit of the information sequence, performing a hard decision based on the sign of the log-likelihood ratio; and when decoding to the bit position corresponding to the frozen bit, performing decoding based on the value key.
[0014] As described above, the joint encryption encoding and transmission method and decoding / decryption method based on SM4 and polar codes of the present invention have the following beneficial effects:
[0015] (1) Compared with the prior art, the present invention achieves stronger security under the premise that the system overhead is basically equivalent to the existing serial encryption and encoding scheme. By removing the linear transformation L in the last 4 rounds, the outputs of the 4 round key XOR, S-box nonlinear transformation τ and feedback word XOR are aggregated and then global polarization encoding is performed. This allows encryption and encoding to share the same processing flow and transformation resources. The overall computational complexity of the scheme is mainly determined by the polarization encoding steps, which is comparable to the order of magnitude of the separation scheme of encryption first and then encoding. The difference is that the encoding of the present invention is embedded inside the encryption round and the value of the frozen bit is controlled by the key. Encryption and encoding are structurally bound to each other, while in the separation scheme, the two modules are independent and have clear processing boundaries. The multi-data block parallel architecture of the last 4 rounds makes the processing time of each branch comparable to the processing time of a single data block.
[0016] (2) The present invention enhances security and error correction capabilities; the encoding process embeds the last 4 rounds of encryption and the frozen bit values are protected by the key, so attackers cannot correctly separate the encoding structure and start the decoding process without mastering the encryption key and the frozen bit value key; polar coding achieves global confusion and diffusion at the bit level through the Kronecker power structure of the generator matrix, and can provide diffusion performance no less than that of the traditional SM4 linear transformation L under long code length conditions; in addition, the encoding redundancy is generated under key control, which introduces an additional security dimension to the system without adding extra calculation steps.
[0017] (3) The present invention improves system adaptability; it does not change the structure of the first 28 rounds and the key expansion algorithm of the existing SM4 encryption system, nor does it change the core architecture of polar code encoding and decoding. It only improves the processing flow and frozen bit filling method of the last 4 rounds. It can be directly compatible with the existing satellite communication encryption and encoding infrastructure. The modular design of multi-branch parallel encryption and polar coding in the last 4 rounds is convenient for integration and deployment on the spaceborne FPGA or ASIC platform. Attached Figure Description
[0018] Figure 1 The flowchart shown is a process for a joint encryption encoding and transmission method based on SM4 and polar codes as described in an embodiment of the present invention.
[0019] Figure 2 The diagram shown is a principle block diagram of the joint encryption encoding and transmission method based on SM4 and polar codes according to an embodiment of the present invention.
[0020] Figure 3 The flowchart shown is a joint decoding and decryption method based on SM4 and polar codes as described in an embodiment of the present invention.
[0021] Figure 4 The diagram shown illustrates the principle block diagram of the joint decoding and decryption method based on SM4 and polar codes as described in an embodiment of the present invention. Detailed Implementation
[0022] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, unless otherwise specified, the following embodiments and features described therein can be combined with each other.
[0023] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. The illustrations only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the shape, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0024] See Figures 1 to 4The following embodiments of the present invention provide a joint encryption and encoding transmission method and a decoding and decryption method based on SM4 and polar codes. Compared with the prior art, the present invention achieves stronger security while maintaining a system overhead that is basically equivalent to that of existing serial encryption and encoding schemes. By removing the linear transformation L, retaining the round key XOR, the S-box nonlinear transformation τ, and the feedback word XOR in the last four rounds, the outputs of the four rounds τ are aggregated and then subjected to global polar encoding. The generator matrix of polar encoding is used to replace the linear transformation L as the diffusion operation, so that encryption and encoding share the same processing flow and transformation resources. The overall computational complexity of the scheme is mainly determined by the polar encoding steps, which is comparable to the order of magnitude of the separate scheme of encryption first and then encoding. The difference is that the encoding of the present invention is embedded inside the encryption round and the value of the frozen bit is controlled by the key. Encryption and encoding are structurally bound to each other, while in the separate scheme, the two modules are independent and have clear processing boundaries. The multi-data block parallel architecture in the non-last four rounds makes the processing time of each branch comparable to the processing time of a single data block. The present invention adds This invention enhances security and error correction capabilities. The encoding process embeds the last four rounds of encryption, and the frozen bit values are protected by a key. Attackers cannot correctly separate the encoding structure and initiate the decoding process without possessing the encryption key and the frozen bit value key. Polar coding achieves global confusion and diffusion at the bit level through the Kronecker power structure of the generator matrix, providing diffusion performance no less than that of the traditional SM4 linear transform L under long code length conditions. Furthermore, encoding redundancy is generated under key control, introducing an additional security dimension to the system without adding extra computational steps. This invention improves system adaptability. It does not change the structure of the first 28 rounds and the key expansion algorithm of the existing SM4 encryption system, nor does it change the core architecture of polar coding. It only improves the processing flow of the last four rounds and the frozen bit filling method, making it directly compatible with existing satellite communication encryption and encoding infrastructure. The modular design of multi-branch parallel encryption (excluding the last four rounds) and polar coding in the last four rounds facilitates integration and deployment on onboard FPGA or ASIC platforms.
[0025] The technical solutions of the present invention will now be described in detail with reference to the accompanying drawings.
[0026] like Figure 1 and Figure 2 As shown, in one embodiment, the present invention provides a joint encryption encoding and transmission method based on SM4 and polar codes, the method comprising:
[0027] Step S11: Divide the input plaintext into D first data blocks of 128 bits each according to the information bit length K of the polar code, and make the D first data blocks independently and in parallel perform the first 28 rounds of SM4 encryption operation to obtain D corresponding status word groups respectively.
[0028] It should be noted that, in order to achieve compatibility with polar coding, the input plaintext is segmented according to a length of 128 bits.
[0029] It should be noted that each first data block is independent of the others in the first 28 rounds of SM4 encryption operations, and is executed in complete parallel on the onboard multi-core processor or dedicated hardware.
[0030] In this embodiment, in each round of SM4 encryption operation, the round key XOR, S-box nonlinear transformation τ, linear transformation L and feedback word XOR are sequentially performed on the D first data blocks, and the round key used in each round is generated from the master key through the SM4 key expansion algorithm; the code length of the polar code is N and the code rate is R.
[0031] Specifically, the joint encryption and encoding transmission method based on SM4 and polar codes of the present invention is constructed based on the deep integration of a 32-round SM4 structure and polar coding. The system first generates 32-round sub-keys rk0, rk1, ..., rk from the master key MK using the standard SM4 key expansion algorithm. 31 These are the round keys, used for the first to the 32nd rounds of SM4 encryption.
[0032] It should be noted that the Master Key refers to the initial input key, that is, the seed key provided directly by the user or generated by the system.
[0033] In one embodiment, K = D × 128 = N × R.
[0034] It should be noted that the specific values of K, D, N, and R mentioned above are not intended to limit the invention. In practical applications, they can be determined according to the specific application scenario.
[0035] In one embodiment, N=1024 and R=1 / 2.
[0036] In this embodiment, K=512 and D=4.
[0037] The following explanation uses this embodiment as an example to illustrate the first 28 rounds of SM4 encryption operations.
[0038] Specifically, the S-box nonlinear transformation τ achieves nonlinear mapping of data through the SM4 standard S-box (see GB / T 32907-2016), with 4 S-boxes acting in parallel on the 32-bit input in one round.
[0039] The linear transformation L is a combination of 32-bit circular shift and XOR operation: L(B)=B⊕(B<<<2)⊕(B<<<10)⊕(B<<<18)⊕(B<<<24), which can spread the confusion effect generated by the S-box to the entire state word.
[0040] The formula for one iteration of SM4 is X. i+4 =X i ⊕T(X i+1 ⊕X i+2 ⊕X i+3 ⊕rk i The permutation T(·) = L(τ(·)) is used, where τ is the S-box nonlinear transformation and L is the linear transformation. That is, the three state words are first XORed with the round key, then nonlinearly mapped by τ, then linearly diffused by L, and finally combined with the feedback word X. i XOR completes a state update.
[0041] It should be noted that since there are no dependencies between the D first data blocks, they can perform the first 28 rounds of encryption in complete parallel on the onboard multi-core processor or dedicated hardware, making the total encryption processing time comparable to the processing time of a single data block.
[0042] Step S12: Perform the round key XOR, S-box nonlinear transformation and feedback word XOR on the D state word groups in parallel for the last 4 rounds to obtain 4 corresponding state words of length 32 bits. Then, concatenate the D×4 state words obtained in the last 4 rounds into an information sequence of length K of information bits.
[0043] In one embodiment, obtaining an information sequence of length K based on D state word groups includes: concatenating the D state word groups into the information sequence.
[0044] It should be noted that in the last four rounds of SM4, the round key XOR, S-box nonlinear transformation τ, and feedback word XOR are retained, while only the linear transformation L is removed. The diffusion function of the linear transformation L is uniformly taken over by the subsequent polar coding steps.
[0045] Specifically, for each round i:
[0046] (1) Calculate the XOR sum of the three letters: A i =X i+1 ⊕X i+2 ⊕X i+3 ⊕rk i ;
[0047] (2) Perform S-box nonlinear transformation: τ i =τ(A i ), obtain a 32-bit status word;
[0048] (3) Directly using τ i Update state chain: X i+4 =X i ⊕τ i To maintain the Feistel structure of SM4;
[0049] (4) τ i Import into the information sequence pool.
[0050] After 4 rounds, each data block receives 4 32-bit status words τ 28 , τ 29 , τ 30 , τ 31 The D data blocks will obtain a total of D×4×32=K bits.
[0051] In one embodiment, obtaining an information sequence of length K based on the D×4 status words obtained in the last 4 rounds includes: concatenating the D×4 status words in natural order of round and block number to form the information sequence.
[0052] Step S13: Input the frozen bits of length NK bits and the information sequence together into the polar encoder to perform polar encoding to obtain an encoded bit sequence of length N bits.
[0053] Specifically, the linear transformation L was removed in the last four rounds, and the polarization-coded generation matrix G was used. N It replaces the global diffusion transformation.
[0054] In this embodiment, the value of the frozen bit is determined by the value key K. fr Control; specifically, controlled by a binary sequence of the value key.
[0055] It should be noted that, unlike traditional polar coding which sets all frozen bits to zero, the value of the frozen bits in this invention is determined by a dedicated key K. fr control.
[0056] It should be noted that the construction of this polarization coding is based on the principle of channel polarization.
[0057] In one embodiment, the polar coding includes: the polar encoder calculating the reliability of each bit position of the polar code based on the code length and the code rate, and selecting the K sub-channels with the highest reliability as information sequence positions, and the remaining NK sub-channels as frozen bit positions; wherein, the information sequence positions are used to place the information sequence; and the frozen bit positions are used to place the frozen bits.
[0058] In one embodiment, given a code length N and a code rate R, the reliability of each bit position is calculated using the Bach parameter or density evolution method.
[0059] In one embodiment, the value-taking key K fr The filling rule is: the value key K frThe binary sequence starts from the frozen bit position with the lowest reliability and is filled with binary bits in ascending order of reliability; if the value key K fr If the length exceeds NK, then the first NK bits of the binary sequence are truncated; if the value key K fr If the length of the bit is less than NK, it is extended to NK bits by padding with zeros.
[0060] In one embodiment, the value-taking key K fr It is a key pre-distributed through an independent key distribution channel, or a subkey derived from the master key via a key derivation function; wherein, when the key derivation method is used, the value key K is taken. fr Share the same master key source with the round keys to simplify key management.
[0061] It should be noted that the polarization coding process is uniformly represented as:
[0062] ,
[0063] in, This represents the encoded bit sequence; index i is used to indicate the bit position during polar coding; when index i corresponds to a frozen bit position, For the value key K fr The value at the corresponding position in the binary sequence; when index i corresponds to the information sequence position... The information bits (i.e., the information bits corresponding to the information sequence obtained in step S12) are concatenated and spliced after the first 28 rounds of SM4 encryption operations and the last 4 rounds of key XOR, S-box nonlinear transformation τ, and feedback word XOR; a generation matrix is generated. Let F be the nth power of Kronecker's power, where n = .
[0064] In one embodiment, the kernel matrix F is expressed as:
[0065] .
[0066] It should be noted that the value of the frozen bit is determined by the value key K. fr Controlling this design will not negatively impact the error correction performance of polar codes; the specific value of the frozen bit theoretically does not affect the capacity reachability of the channel after polarization, because the sub-channel corresponding to the frozen bit position is itself a symmetric unreliable channel with near-zero capacity, and its value is considered as fixed information known to both the sender and receiver in polar coding theory; from a security perspective, the value of the frozen bit is determined by the value-determining key K. frControl does not increase the risk of the system being compromised. Freezing the bit positions corresponds to unreliable sub-channels with near-zero capacity after channel polarization, making it almost impossible for eavesdroppers to extract their values from the intercepted signal. This requires attackers to simultaneously possess both the SM4 master key and the value extraction key K. fr Only then can the encoding structure be correctly reconstructed and decoded; therefore, the value of the frozen bits is determined by the value key K. fr Control makes the encoding process itself key-dependent, providing an additional security dimension for the system.
[0067] Step S14: Use the encoded bit sequence as the ciphertext to be sent.
[0068] Specifically, after the polarization encoding in step S13 is completed, the encoded bit sequence is directly output as ciphertext.
[0069] The protection scope of the joint encryption encoding and transmission method based on SM4 and polar codes described in this embodiment is not limited to the execution order of the steps listed in this embodiment. Any scheme implemented by adding, subtracting, or replacing steps in the prior art based on the principle of this invention is included within the protection scope of this invention.
[0070] The present invention also provides a joint decoding and decryption method based on SM4 and polar codes, which is applied to the above-mentioned joint encryption and encoding transmission method based on SM4 and polar codes.
[0071] Specifically, the sending end transmits ciphertext to the receiving end using a joint encryption and encoding transmission method based on SM4 and polar codes, so that the receiving end can decode and decrypt the ciphertext using a joint decoding and decryption method based on SM4 and polar codes.
[0072] In one embodiment, the receiving end receives ciphertext transmitted through a fading channel from the sending end, which can be modeled as follows: Where h is the fading channel parameter and n is additive white Gaussian noise.
[0073] like Figure 3 and Figure 4 As shown, in one embodiment, the joint decoding and decryption method based on SM4 and polar codes includes:
[0074] Step S21: Calculate the log-likelihood ratio of each bit in the received signal, and send the log-likelihood ratio to the polarization decoder so that the polarization decoder can decode according to the value key and the log-likelihood ratio to obtain the output sequence.
[0075] It should be noted that the received signal is a ciphertext sent by the transmitting end that has been affected by noise interference.
[0076] It should be noted that the above calculation of the log-likelihood ratio is directly obtained using the definition of the log-likelihood ratio, which is a conventional technique in the field, so it will not be elaborated on here.
[0077] It should be noted that in traditional polarization decoding, the frozen bit is set to all zeros. The receiver treats "frozen bit all zeros" as a known condition, and when decoding to the frozen bit position, it directly determines that bit as 0. In this invention, the frozen bit is set as the value key K. fr The binary sequence, since the receiving end has already received the key K. fr At this point, for the receiving end, "the frozen bits are the value key K". fr The binary sequence is still a known condition. When decoding to the position of the frozen bit, that bit will be directly determined as the value key K. fr The bit value at the corresponding position.
[0078] In one embodiment, the polarization decoder performs decoding based on the value key and the log-likelihood ratio, including:
[0079] (1) When the bit position corresponding to the information bit of the information sequence is decoded, a hard decision is made based on the sign of the log-likelihood ratio.
[0080] Specifically, if the log-likelihood ratio is greater than or equal to 0, that is, the sign of the log-likelihood ratio is +, then the decoding result is 0; otherwise, the decoding result is 1.
[0081] (2) When the bit position corresponding to the frozen bit is decoded, the value key K is used. fr Decode it.
[0082] Specifically, the decoding result is determined as the value key K. fr The value at the corresponding position in the binary sequence.
[0083] It should be noted that after calculating the log-likelihood ratio of each bit in step S21, the log-likelihood ratio is used as the input sequence and input to the polarization decoder. The polarization decoder will decode from the first bit to the last bit according to the order of the input sequence, and the polarization decoder knows which bits are frozen bits and which are information bits.
[0084] In this embodiment, before communication, the sending end and the receiving end have pre-shared the value key K through a key distribution mechanism. fr Therefore, the value of the frozen bit is completely known to the receiving end.
[0085] Step S22: Divide the information bits of the corresponding information sequence in the output sequence into D second data blocks of 128 bits each. For each second data block, first recover the input value corresponding to each state word by querying the S-box mapping of SM4, then perform an XOR operation between the recovered input value and the round keys of the last 4 rounds generated by the SM4 key expansion algorithm, and backtrack along the Feistel chain to the state word group before entering the last 4 rounds to obtain D third data blocks.
[0086] It should be noted that each second data block is 128 bits long and contains four 32-bit status words τ generated by the encryption end in the last four rounds. 31 , τ 30 , τ 29 , τ 28 In the last four rounds of the encryption process, the linear transformation L was removed, and only A was executed in each round. i =X i+1 ⊕X i+2 ⊕X i+3 ⊕rk i τ i =τ(A i ), X i+4 = X i ⊕τ i Three steps. The decryption end processes each τ in the second data block. i A is recovered through S-box mapping of SM4 i Then, combined with the round key rk generated by the SM4 key expansion algorithm i By using an XOR operation to backtrack step by step along the Feistel chain, the state word group before entering the last four rounds is restored, containing X. 31 X 30 X 29 X 28 , as the third data block.
[0087] Step S23: Perform the SM4 decryption operation from round 28 to round 1 independently and in parallel on each of the third data blocks to obtain the corresponding decrypted data blocks.
[0088] In this embodiment, in each round of the SM4 decryption operation, the round key XOR, S-box nonlinear transformation, linear transformation L, and feedback word XOR are sequentially performed on each of the third data blocks; the order of the round keys used in the SM4 decryption operation is the reverse of that in the encryption operation, and the round function structure is exactly the same.
[0089] It should be noted that since the decryption process of each third data block is independent of each other, they can be executed in parallel, making the total decryption processing time comparable to the processing time of a single data block; after 28 rounds of decryption transformation, D third data blocks are completely recovered, and after being spliced together, they become the original plaintext data (i.e., the input plaintext in step S11).
[0090] It should be noted that throughout the entire decoding and decryption process, the confidentiality provided by encryption and the error correction capability provided by encoding work synergistically. Because the encoding process embeds the last four rounds of encryption and the frozen bit values are protected by the value-taking key, even if an attacker intercepts the ciphertext and knows the publicly available polar coding algorithm, they cannot correctly separate the encoded structure and initiate the decoding process without the SM4 master key and the frozen bit value key. In the parallel decryption architecture, the processing time of each branch on the decryption end is symmetrical to that on the encryption end; polar decoding and linear transformation L are both diffusion operations, with computational open-endedness on the same order of magnitude, and the introduction of polar decoding will not create a new processing bottleneck.
[0091] Step S24: Concatenate the decrypted data blocks described in S23 to obtain the input plaintext.
[0092] The protection scope of the joint decoding and decryption method based on SM4 and polar codes described in this embodiment is not limited to the execution order of the steps listed in this embodiment. Any scheme implemented by adding, subtracting, or replacing steps in the prior art based on the principle of this invention is included within the protection scope of this invention.
[0093] Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing a processor. The program can be stored in a computer-readable storage medium, which is a non-transitory medium, such as random access memory, read-only memory, flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disk, and any combination thereof. The storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. This available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state drive (SSD)).
[0094] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0095] The descriptions of the processes or structures corresponding to the above figures each have their own emphasis. For parts of a process or structure that are not described in detail, please refer to the relevant descriptions of other processes or structures.
[0096] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
Claims
1. A joint encryption encoding and transmission method based on SM4 and polar codes, characterized in that, The method includes: The input plaintext is divided into D first data blocks of 128 bits each according to the information bit length K of the polar code. The first 28 rounds of SM4 encryption are then executed independently and in parallel on each of the D first data blocks, yielding D corresponding state word groups. In each round of SM4 encryption, the round key XOR, S-box nonlinear transformation, linear transformation L, and feedback word XOR are sequentially performed on the D first data blocks. The round key used in each round is generated from the master key using the SM4 key expansion algorithm. The polar code has a code length of N and a code rate of R. In each of the last four rounds of encryption operations, the D state word groups are sequentially XORed with the round key, S-box nonlinear transformation and feedback word XORed. After each of the last four rounds of encryption operations is completed, the state word with a length of 32 bits is obtained from the encryption output of each of the last four rounds of encryption operations. The state words obtained in the last four rounds are then concatenated to form an information sequence with a length of information bit length K. The frozen bits of length NK bits and the information sequence are input together into the polar encoder to perform polar encoding to obtain an encoded bit sequence of length N bits; wherein, the value of the frozen bits is controlled by the value key; Use the encoded bit sequence as the ciphertext to be sent.
2. The joint encryption encoding and transmission method based on SM4 and polar codes according to claim 1, characterized in that, K = D × 128 = N × R.
3. The joint encryption and encoding transmission method based on SM4 and polar codes according to claim 1, characterized in that, The polar coding includes: the polar encoder calculates the reliability of each bit position of the polar code according to the code length and the code rate, and selects the K sub-channels with the highest reliability as information sequence positions, and the remaining NK sub-channels as frozen bit positions; wherein, the information sequence positions are used to place the information sequence; and the frozen bit positions are used to place the frozen bits.
4. The joint encryption encoding and transmission method based on SM4 and polar codes according to claim 3, characterized in that, The filling rule for the value retrieval key is as follows: the binary sequence of the value retrieval key starts from the position of the frozen bit with the lowest reliability and fills the binary bits in ascending order of reliability; if the length of the value retrieval key exceeds NK, the first NK bits of the binary sequence are truncated; if the length of the value retrieval key is less than NK, it is extended to NK bits by padding with zeros.
5. The joint encryption and encoding transmission method based on SM4 and polar codes according to any one of claims 1 to 4, characterized in that, The value-taking key is a key pre-distributed through an independent key distribution channel, or a subkey derived from the master key via a key derivation function; When using the key derivation method, the value key Kfr and the round key share the same master key source to simplify key management.
6. A joint decoding and decryption method based on SM4 and polar codes, characterized in that, The method applied to the joint encryption encoding and transmission method based on SM4 and polar codes according to any one of claims 1 to 5, the method comprising: The log-likelihood ratio of each bit of the received signal is calculated, and the log-likelihood ratio is sent to the polarization decoder so that the polarization decoder can decode according to the value key and the log-likelihood ratio to obtain the output sequence; The information bits of the corresponding information sequence in the output sequence are decomposed into D×4 second data blocks in the order of 32 bits for each of the last 4 rounds. For each second data block, the input value of each state word is first recovered by the S-box mapping of SM4. Then, the recovered input value, the state word, and the round key of each of the last 4 rounds generated by the SM4 key expansion algorithm are XORed. The solution is then reversed along the Feistel chain to recover the state word group before entering the last 4 rounds and obtain D third data blocks. Each of the third data blocks is independently and in parallel to perform SM4 decryption operations from round 28 to round 1, respectively obtaining the corresponding decrypted data blocks, and concatenating the decrypted data blocks to obtain the input plaintext; in each round of SM4 decryption operation, round key XOR, S-box nonlinear transformation, linear transformation L and feedback word XOR are sequentially performed on each of the third data blocks.
7. The joint decoding and decryption method based on SM4 and polar codes according to claim 6, characterized in that, The polarization decoder performs decoding based on the value key and the log-likelihood ratio, including: When the bit position corresponding to the information bit of the information sequence is decoded, a hard decision is made based on the sign of the log-likelihood ratio; When the bit position corresponding to the frozen bit is decoded, decoding is performed according to the value key.
