SM3 and SM4-based data flow encryption authentication method and application

By introducing a salt value algorithm to generate SM4 keys, combining SM2 and SM3 algorithms for key exchange and data integrity verification, multi-thread encryption of large files, solving the security and efficiency problems in data flow, and are suitable for cloud computing, financial transactions, and the Internet of Things and other fields.

CN120455086APending Publication Date: 2025-08-08GUIZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510603343.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-12
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The existing data flow scheme based on SM4 and SM3 has problems such as keys being susceptible to dictionary attacks, lack of data integrity verification, insufficient security during remote transmission, and low efficiency in large files processing.

Method used

The salt value algorithm is used to generate the SM4 encryption key, and the key exchange is performed in combination with the SM2 asymmetric encryption algorithm. The cryptographic text digest is generated through the SM3 algorithm to verify data integrity, and large file data are encrypted using multi-threads.

Benefits of technology

It improves the security of keys, ensures the integrity and confidentiality of data transmission, improves the encryption speed and processing efficiency of large files, and is suitable for cloud computing, financial transactions and the Internet of Things scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120455086A_ABST
    Figure CN120455086A_ABST
Patent Text Reader

Abstract

The invention discloses a data flow encryption authentication method and application based on SM3 and SM4. The core of the scheme comprises the following steps: introducing a salt value algorithm when a secret key is generated, splicing a secret character string and a random salt value, then carrying out SHA-256 Hash operation, intercepting first 16 bytes as an SM4 secret key, and enhancing dictionary attack resistance; key exchange is realized based on an SM2 asymmetric encryption algorithm, a sender transmits a public key to a receiver, the receiver encrypts an SM4 key and then returns the SM4 key, and secure transmission of the key is ensured through decryption of a private key; during data processing, fragmentation is carried out according to a preset size, multiple threads are adopted to carry out independent SM4 encryption on each fragment, and after combination, a ciphertext abstract is generated through an SM3 algorithm to verify integrity. According to the scheme, through salt value enhancement, SM2 key protection, multi-thread optimization and SM3 authentication, the problems of key management, transmission security and large file processing efficiency are solved, the method is suitable for scenes such as cloud computing, financial transactions and the Internet of Things, and confidentiality, integrity and availability guarantee is provided for data circulation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of data security technology, and in particular relates to key management, SM3 encryption algorithm, SM4 encryption algorithm and encryption authentication in the field of data security, and more particularly to a data flow encryption authentication method and application based on SM3 and SM4. Background Art

[0002] With the rapid development of the internet and information technology, the flow and transmission of data has become increasingly frequent and widespread. However, data transmission faces many security and privacy challenges, such as the risk of data tampering, forgery, and leakage, placing higher demands on data security and integrity.

[0003] Researching an effective data flow encryption and authentication scheme to ensure the security and integrity of data during transmission and processing is of great significance for protecting user privacy and ensuring data reliability.

[0004] In the field of data flow encryption and authentication, domestic and international scholars and research institutions have conducted extensive research, covering various algorithms, protocols, and application scenarios. Among them, the SM3 encryption algorithm is a hash algorithm independently developed by Chinese cryptographers. The SM3 algorithm is a widely used standard hash algorithm with a wide range of applications, including electronic signatures, network security platforms, big data, computer login, and secure communication systems. The algorithm has also been recognized by the Trusted Computing Group (TCG), and is therefore considered a foundational technology for information security.

[0005] In recent years, the SM4 algorithm, originally developed as a specialized cryptographic algorithm for wireless LANs, has become an industry standard for block ciphers. Initially, SM4 was used in the WAPI protocol for wireless LAN chipsets, and a variety of WAPI chipsets supporting this algorithm are now commercially available. In the financial sector alone, there are numerous smart cryptographic keys supporting SM4. Furthermore, SM4 has been included in the Trusted Platform Module (TPM) library specification (TPM 2.0) released by the Trusted Computing Group.

[0006] In terms of data transmission encryption and authentication schemes, scholars and research institutions at home and abroad have proposed many different schemes, including those based on symmetric encryption, asymmetric encryption, and hash algorithms. These schemes use different encryption and authentication technologies during data transmission and processing, with varying levels of security, performance, and applicability, and are suitable for different application scenarios.

[0007] However, the existing data transfer solutions based on SM4 and SM3 still have the following technical problems.

[0008] First, traditional SM4 key generation uses a fixed padding rule and lacks a salt mechanism. The padding bytes remain constant, resulting in identical keys generated from the same secret string, making them vulnerable to dictionary attacks. For example, attackers can quickly crack fixed keys by pre-calculating hash values for commonly used passwords. Furthermore, existing key exchange techniques rely on offline negotiation or dedicated channels, lacking identity authentication and encryption protection during remote transmission, making them vulnerable to man-in-the-middle (MITM) attacks. Attackers can steal or tamper with keys through methods like ARP spoofing and DNS hijacking, rendering data encryption ineffective. Furthermore, the key exchange process presents numerous inconveniences and security issues (e.g., offline negotiation or online exchange, which can be easily intercepted by attackers).

[0009] Second, existing methods lack data integrity verification mechanisms. This is primarily due to the lack of a hash algorithm for integrity verification of encrypted fragmented data, making it impossible to detect data tampering during transmission. For example, an attacker could intercept fragmented data and modify portions of it, but the recipient would be unaware due to the lack of a digest comparison mechanism. Furthermore, existing fragment padding rules are poorly designed, such as using fixed byte padding or failing to integrate a hash algorithm. This allows the padding data to be maliciously exploited, compromising data integrity.

[0010] Furthermore, existing technologies for large file processing present a conflict between security and efficiency. When encrypting large files, the plaintext is grouped and padded, resulting in a significant amount of redundant information. For example, traditional single-threaded shard encryption results in inefficient large file processing, and long transmission times increase the risk of data interception. Furthermore, the lack of correlation checks between shards allows attackers to compromise data integrity by reassembling shards. Furthermore, key management is separated from the shard encryption process. If keys are leaked or shard keys are not updated promptly, the entire encryption system will fail. Summary of the Invention

[0011] Based on the SM3 and SM4 algorithms, the present invention proposes a new data stream transfer authentication method and application, aiming to solve the security and integrity issues of data during transmission and processing.

[0012] According to the first main aspect of the present invention, a data flow encryption authentication method based on SM3 and SM4 is provided, comprising one or a combination of the following steps:

[0013] S1, key generation step: generating an SM4 encryption key through a salt value algorithm, including: defining a string as a secret string; generating a random salt value and concatenating the secret string and the random salt value into a new string; performing a hash operation on the new string to generate an array; extracting part of the data from the array as the SM4 encryption key;

[0014] S2, a key exchange step: encrypting and transmitting the SM4 encryption key using the SM2 asymmetric encryption algorithm, including: the sender transmits the SM2 public key to the receiver via the Internet; the receiver uses the SM2 public key to encrypt the SM4 encryption key to generate ciphertext, and returns the ciphertext to the sender; the sender decrypts the ciphertext using its own SM2 private key to obtain the SM4 encryption key;

[0015] S3, data processing step: the encrypted data is divided into slices, each slice is independently encrypted using the SM4 encryption key and then merged, and a ciphertext digest is generated using the SM3 algorithm to verify data integrity.

[0016] As a further preferred solution, the random salt value is a 16-byte random byte array, the hash operation uses the SHA-256 algorithm to generate a 32-byte hash value array, and the SM4 encryption key is the first 16 bytes of the hash value array.

[0017] As a further preferred solution, in the data processing step, the encrypted data is fragmented according to a preset size, and the preset size is dynamically set according to the system memory capacity and data processing efficiency. The last fragment is padded to the packet length of the symmetric encryption algorithm using the PKCS5Padding standard.

[0018] As a further preferred solution, the PKCS5Padding standard filling rule is: if the fragment data length is less than the packet length, the filling byte value is equal to the number of missing bytes; if the fragment data length is an integer multiple of the packet length, the preset byte value equal to the packet length is filled.

[0019] As a further preferred solution, in the data processing step, multi-threading technology is used to encrypt each data slice in parallel, each thread processes a slice independently, and the encrypted data slices are merged in the original order to generate a complete ciphertext.

[0020] As a further preferred solution, in the key exchange step, the SM2 asymmetric encryption algorithm is based on the elliptic curve cryptography system, and the sender and the receiver transmit the SM2 public key and the encrypted SM4 key ciphertext through the Internet, and the transmission process adopts the TCP / IP protocol or a dedicated secure channel.

[0021] As a further preferred solution, the step of generating a ciphertext summary using the SM3 algorithm includes: performing a hash operation on the combined ciphertext to generate a summary value of a fixed length, and the summary value is used for integrity pre-verification before data storage and integrity comparison after data reception.

[0022] As a further preferred solution, the data processing step also includes: when sending the ciphertext, the sender uses the SM2 private key to digitally sign the SM3 summary value, and the receiver uses the sender's SM2 public key to verify the signature. After the verification is passed, it is confirmed that the data has not been tampered with and the source is trustworthy.

[0023] According to the second main aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed, the data flow encryption and authentication method based on SM3 and SM4 as described above is implemented.

[0024] According to a third main aspect of the present invention, an encryption authentication application method in a data transmission and storage system is provided, which adopts the data flow encryption authentication method based on SM3 and SM4 as described above, including:

[0025] At the data sending end, an SM4 encryption key is generated by a salt value algorithm, and the key is encrypted and transmitted to the receiving end using the SM2 algorithm;

[0026] Slicing the electronic data to be transmitted or stored, independently encrypting each slice using the SM4 encryption key, and then merging the slices;

[0027] The ciphertext summary is generated based on the SM3 algorithm, and the integrity verification of the data and the sender's identity authentication during transmission are completed through digital signature technology.

[0028] The key innovation of the above technical solution lies in: when using SM4 to generate keys, a salt value algorithm is introduced. By adding a random number to the user-defined string, the digest is calculated using the SHA-256 hash algorithm, and the first 16 bytes are extracted as the key, which reduces collisions and greatly improves the security of the key.

[0029] To address the issues of slow encryption speed for large files and the large amount of redundant information caused by fragmentation, this invention uses multi-threaded encryption to encrypt each block separately and then combine them into a single ciphertext. This significantly improves encryption speed and reduces data redundancy during the encryption process.

[0030] Compared with the closest prior art, the outstanding essential features of the present invention are mainly reflected in:

[0031] When using the SM4 encryption algorithm to generate keys, the present invention adopts a salt value algorithm, so that even if an attacker knows the string used by the user as the key, he cannot know the real key added with the random number, which greatly improves the security of key management.

[0032] When encrypting large file data, in order to solve the problems of data redundancy caused by sharding and slow encryption speed, the present invention adopts a multi-threaded approach to encrypt the sharded data blocks and integrate them into complete ciphertext data blocks.

[0033] Compared with the closest prior art, the significant advancements of the present invention are mainly reflected in:

[0034] Based on the SM3 and SM4 algorithms, this paper proposes a new data flow authentication scheme, aiming to address the security and integrity issues of data during transmission and processing. Specifically, the significant advantages of this invention include the following aspects:

[0035] Improve data security: The present invention adopts SM4 algorithm for symmetric encryption, which can effectively protect the confidentiality of data during transmission and processing, and prevent data from being illegally accessed and stolen.

[0036] Ensure data integrity: The present invention adopts SM3 algorithm to perform digital summary calculation, which can verify the integrity of the transmitted data and prevent the data from being tampered with or forged during the transmission process.

[0037] Strengthening key transmission security: The present invention adopts the public key cryptography algorithm SM2 for key transmission, solving most of the security issues in the key management process.

[0038] Improve data processing efficiency: The present invention adopts a key-based authentication method, which can reduce the overhead of the authentication process while ensuring data security and improve data processing efficiency.

[0039] Wide applicability: The present invention has strong scalability and applicability and can be applied to various scenarios, such as cloud computing, the Internet of Things, finance and other fields, providing a reliable data flow encryption and authentication solution for practical applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, without paying any creative work, other drawings obtained based on these drawings still fall within the scope of the present invention.

[0041] Figure 1 A schematic diagram of key exchange in one embodiment of the present invention is shown;

[0042] Figure 2 A schematic diagram of data shard encryption in one embodiment of the present invention is shown;

[0043] Figure 3 A schematic diagram of multi-threaded encryption in one embodiment of the present invention is shown;

[0044] Figure 4 shows an encrypted communication flow chart in one embodiment of the present invention;

[0045] Figure 5 Shows an information cloud storage flow chart in one embodiment of the present invention;

[0046] Figure 6 A flow chart of a trusted transaction in one embodiment of the present invention is shown;

[0047] Figure 7 A flow chart of a non-trusted transaction in one embodiment of the present invention is shown;

[0048] Figure 8 A schematic diagram of SM2-SM4 hybrid encryption in an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0049] The preferred embodiments of the present invention will be described in detail below so that the purpose, features and advantages of the present invention can be more clearly understood. It should be understood that the following embodiments are not intended to limit the scope of the present invention, but are only intended to illustrate the substantive content of the technical solution of the present invention.

[0050] In the following description, for the purpose of illustrating the various disclosed embodiments, certain specific details are set forth in order to provide a thorough understanding of the various disclosed embodiments. However, those skilled in the relevant art will recognize that the embodiments may be practiced without one or more of these specific details. In other cases, well-known techniques associated with this application may not be shown or described in detail to avoid unnecessarily obscuring the description of the embodiments.

[0051] Reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment. Thus, the appearances of "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any manner in one or more embodiments.

[0052] In this embodiment, the domestic commercial cryptographic algorithm SM4 is used to encrypt the data, the domestic cryptographic algorithm SM2 is used for key negotiation, the domestic hash cryptographic algorithm SM3 is used to calculate the information summary of the generated ciphertext, and a multi-threaded encryption method is used. The combination of multiple methods ensures the confidentiality, integrity, and availability of the data.

[0053] The solution of the present invention mainly includes the following steps:

[0054] S1, key generation step: generating an SM4 encryption key through a salt value algorithm, including: defining a string as a secret string; generating a random salt value and concatenating the secret string and the random salt value into a new string; performing a hash operation on the new string to generate an array; extracting part of the data from the array as the SM4 encryption key;

[0055] S2, a key exchange step: encrypting and transmitting the SM4 encryption key using the SM2 asymmetric encryption algorithm, including: the sender transmits the SM2 public key to the receiver via the Internet; the receiver uses the SM2 public key to encrypt the SM4 encryption key to generate ciphertext, and returns the ciphertext to the sender; the sender decrypts the ciphertext using its own SM2 private key to obtain the SM4 encryption key;

[0056] S3, data processing step: the encrypted data is divided into slices, each slice is independently encrypted using the SM4 encryption key and then merged, and a ciphertext digest is generated using the SM3 algorithm to verify data integrity.

[0057] Among them, it mainly involves the following improvements to the existing technology:

[0058] In one embodiment, the present invention proposes an improvement in the key generation mechanism.

[0059] Traditional SM4 keys are converted from user-defined strings into byte arrays, with zeros added to any length less than 128 bits. This approach poses a significant threat to dictionary attacks. Using a computer to automatically generate a 16-byte key is difficult for users to remember, resulting in a poor user experience. Therefore, to address key complexity and security issues, this invention introduces a salt algorithm to generate SM4 keys.

[0060] A specific implementation process of the salt value algorithm to generate the SM4 key is as follows:

[0061] First, define a string as the pre-secret. Then, use a random number generator to generate a random 16-byte salt. Concatenate the secret string and the salt into a new string. Calculate the hash value of this new string using the SHA-256 algorithm, resulting in a 32-byte byte array k.

[0062] Since SM4 requires a 16-byte key, the first 16 bytes are intercepted from the Byte array as the SM4 key.

[0063] In the above process, the salt value is added to the original secret string as a random number, strengthening the security of the cryptography. Using a different salt value each time to generate a key, even for the same secret, the key will be different. This way, even if an attacker knows the user's simple key, they cannot decrypt the ciphertext without knowing the salt value.

[0064] In one embodiment, the present invention proposes an improved key exchange mechanism: the traditional SM4 key exchange method is generally set up offline. For remote key exchange, a special secure channel must be opened, which is very cumbersome to implement and expensive to open.

[0065] In one embodiment, the present invention proposes an SM2 algorithm to manage keys.

[0066] SM2-SM4 hybrid encryption diagram is as follows Figure 8 As shown in the figure, the principle is as follows: local user A sends the local SM2 public key to the target user B via the Internet. B uses A's public key and SM2 encryption algorithm to encrypt the SM4 key, and then sends the ciphertext to user A. At that time, user A uses his own private key to decrypt the ciphertext to obtain the SM4 key. This ensures that the SM4 key is transmitted securely. The specific key exchange is as follows Figure 1 shown.

[0067] In one embodiment, the present invention proposes an improvement to the SM4 encryption algorithm.

[0068] The SM4 encryption algorithm is a symmetric encryption algorithm. Before encryption, the plaintext must be grouped into 128-bit blocks. If the final block of data is less than 128 bits, the SM4 encryption algorithm typically uses either PKCS#5 or ISO / IEC 7816-4 as the padding rule.

[0069] This embodiment uses the PKCS5Padding standard filling method. The PKCS5Padding filling rules are as follows:

[0070] If the plaintext block is less than 128 bits long, padding bytes are used to fill it up to 128 bits. The padding byte value is equal to the number of missing bytes. For example, if 3 bytes are missing, 3 bytes with a value of 0x03 are used to fill it. If the plaintext block is an integer multiple of 128 bits, 16 bytes with a value of 0xF are used to fill it.

[0071] Because of this padding rule, when the plaintext is fragmented, no matter how it is fragmented, padding data will be generated, and the padding data must be cleared during decryption.

[0072] In one embodiment, the present invention proposes encryption algorithm improvements.

[0073] In today's era of rapid development of digital information, our data volume is also increasing. The common API file reading stream provided by Java8 has a maximum capacity of 256MB at a time. Therefore, for data larger than 256MB, we have to read it in pieces. However, the problem that comes with it is that, except for the last group, padding data will inevitably be generated at the end of the piece, and measures must be taken to remove this padding data during decryption.

[0074] These padding data are mixed in each part of the ciphertext. When decrypting, we must know the encryption fragmentation rules and fragmentation data size. Through programming practice, when the fragmentation size is 1MB, the impact on memory consumption is moderate and the encryption speed is fast. Therefore, the encryption fragmentation size is 1MB, and the decryption fragmentation size should be 1MB+16Byte. Figure 2 shown.

[0075] In one embodiment, the present invention proposes a multi-threaded encryption of large file data to solve the problem of redundant information caused by shard encryption. As a result, large data can be processed in blocks. After the blocks are reasonably divided, multiple threads are started to encrypt each block, and then the ciphertext data blocks are merged. The process is as follows Figure 3 shown.

[0076] In one embodiment, the present invention proposes a design and implementation of data flow encryption authentication based on SM3 and SM4 algorithms.

[0077] This embodiment mainly describes in detail the following four data flow methods:

[0078] (1) Two users communicate encrypted:

[0079] This type of data flow belongs to the application scenario of instant messaging. The data type is short and does not require a particularly complex encryption algorithm. When selecting an encryption algorithm, you should consider reducing the CPU burden, so you can choose a single-threaded mode. In addition, in actual operation, you also need to consider issues such as the time delay of message sending and receiving. The implementation process is as follows Figure 4 shown.

[0080] (2) Users save important data on cloud servers:

[0081] When storing large amounts of data on a cloud server, encryption algorithms are required to ensure data security. To verify the feasibility of this test solution, a website is built in the local environment to simulate a cloud storage server responsible for storing user-uploaded data. The IP address and port number of the server are as follows: Figure 5 shown.

[0082] (3) User-trusted data transactions:

[0083] For important data transactions, such as financial transactions, in order to ensure the security and credibility of the data, it is necessary to adopt authentication measures such as digital signatures on the basis of data encryption. Digital signatures can prevent the sender from denying the authenticity of the data and ensure the integrity of the data during transmission. In order to ensure the reliability of digital signatures, it is necessary to use public key encryption algorithms and ensure the security of the public key. The process is as follows: Figure 6 shown.

[0084] (4) In a non-trusted situation, users introduce a trusted third party to conduct transactions:

[0085] In non-trusted data transactions, the two parties do not trust each other, so a third-party trust institution is needed to ensure the security of the transaction. For example, in financial transactions, authoritative institutions such as the People's Bank of China can be used as third-party institutions.

[0086] The specific operation process is as follows: Party A signs with its own private key, and then sends the ciphertext, encrypted SM4 key and signature value to a third party. The third party compares the signature value with Party A. If a match is successful, the key is sent to Party B. Party B verifies the signature with Party A's public key, and then digitally signs the signature result and personal information and sends it to the third party. The third party compares the signature value again. If a match is successful, it notifies Party B that the transaction is successful. Otherwise, it notifies both parties that the transaction has failed. The process is as follows: Figure 7 shown.

[0087] Any related technologies in the field involved in the above implementation process that are not described in detail are common knowledge to those skilled in the art.

[0088] The basic principles, main features, and advantages of the present invention are shown and described above. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are merely illustrative of the principles of the present invention. Various changes and modifications may be made to the present invention without departing from the substantive content and scope of the present invention. Such changes and modifications are intended to fall within the scope of the present invention. The scope of protection claimed in the present invention is defined by the appended claims and their equivalents.

Claims

1. A data flow encryption authentication method based on SM3 and SM4, characterized in that: It includes one or a combination of the following steps: S1, key generation step: generating an SM4 encryption key through a salt value algorithm, including: defining a string as a secret string; generating a random salt value and concatenating the secret string and the random salt value into a new string; performing a hash operation on the new string to generate an array; extracting part of the data from the array as the SM4 encryption key; S2, a key exchange step: encrypting and transmitting the SM4 encryption key using the SM2 asymmetric encryption algorithm, including: the sender transmits the SM2 public key to the receiver via the Internet; the receiver uses the SM2 public key to encrypt the SM4 encryption key to generate ciphertext, and returns the ciphertext to the sender; the sender decrypts the ciphertext using its own SM2 private key to obtain the SM4 encryption key; S3, data processing step: the encrypted data is divided into slices, each slice is independently encrypted using the SM4 encryption key and then merged, and a ciphertext digest is generated using the SM3 algorithm to verify data integrity.

2. The data flow encryption authentication method of SM3 and SM4 according to claim 1 is characterized in that: The random salt value is a 16-byte random byte array, the hash operation uses the SHA-256 algorithm to generate a 32-byte hash value array, and the SM4 encryption key is the first 16 bytes of the hash value array.

3. The data flow encryption authentication method of SM3 and SM4 according to claim 1 is characterized in that: In the data processing step, the encrypted data is fragmented into pieces according to a preset size, and the preset size is dynamically set according to the system memory capacity and data processing efficiency. The last fragment is padded to the packet length of the symmetric encryption algorithm using the PKCS5Padding standard.

4. The data flow encryption authentication method of SM3 and SM4 according to claim 3 is characterized in that: The PKCS5Padding standard filling rule is: if the fragment data length is less than the packet length, the padding byte value is equal to the number of missing bytes; if the fragment data length is an integer multiple of the packet length, the padding is a preset byte value equal to the packet length.

5. The data flow encryption authentication method of SM3 and SM4 according to claim 1 is characterized in that: In the data processing step, multi-threading technology is used to encrypt each data slice in parallel, each thread processes a slice independently, and the encrypted data slices are merged in the original order to generate a complete ciphertext.

6. The data flow encryption authentication method of SM3 and SM4 according to claim 1 is characterized in that: In the key exchange step, the SM2 asymmetric encryption algorithm is based on the elliptic curve cryptosystem, and the sender and the receiver transmit the SM2 public key and the encrypted SM4 key ciphertext via the Internet, and the transmission process adopts the TCP / IP protocol or a dedicated secure channel.

7. The data flow encryption authentication method of SM3 and SM4 according to claim 1 is characterized in that: The step of generating a ciphertext summary using the SM3 algorithm includes performing a hash operation on the combined ciphertext to generate a summary value of a fixed length, wherein the summary value is used for integrity pre-check before data storage and integrity comparison after data reception.

8. The data flow encryption authentication method of SM3 and SM4 according to claim 1 is characterized in that: The data processing step also includes: when sending the ciphertext, the sender uses the SM2 private key to digitally sign the SM3 summary value, and the receiver uses the sender's SM2 public key to verify the signature. After the verification is passed, it is confirmed that the data has not been tampered with and the source is credible.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed, the data flow encryption authentication method and application based on SM3 and SM4 as described in any one of claims 1 to 8 are implemented.

10. An encryption authentication application method in a data transmission and storage system, characterized in that: The data flow encryption authentication method based on SM3 and SM4 according to any one of claims 1 to 8 includes: At the data sending end, an SM4 encryption key is generated by a salt value algorithm, and the key is encrypted and transmitted to the receiving end using the SM2 algorithm; Slicing the electronic data to be transmitted or stored, independently encrypting each slice using the SM4 encryption key, and then merging the slices; The ciphertext summary is generated based on the SM3 algorithm, and the integrity verification of the data and the sender's identity authentication during transmission are completed through digital signature technology.