Data processing method and device, electronic equipment and storage medium

By combining encrypted data blocks and using auxiliary patches, combined with the national secret algorithm based on instruction set acceleration, the problem of low decryption efficiency of native national secret algorithm is solved, and the data decryption efficiency of SSL encrypted communication is improved.

CN119583203APending Publication Date: 2025-03-07Fisherman Information Technology Co Ltd
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411860160.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

The native national secret algorithm can process data blocks in a single time when decrypting data, resulting in low data decryption efficiency and affecting the efficiency of SSL encryption communication.

Method used

By combining the encrypted data blocks of the encrypted data packet with the size of the first data block size into merged encrypted data blocks with the size of the second data block size, and using auxiliary patches to merge the encrypted data blocks that are not sufficient for merge, the national secret algorithm based on instruction set acceleration is used for decryption.

Benefits of technology

It improves the data decryption efficiency in SSL encryption communication scenarios and improves the SSL encryption communication efficiency between the client and the server.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119583203A_ABST
    Figure CN119583203A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and device, electronic equipment and a storage medium, and relates to the field of network security. When an SSL connection with an opposite terminal is established based on a national cryptographic algorithm and an encrypted data packet sent by the opposite terminal based on the SSL connection is received, the encrypted data packet is sent to the opposite terminal; the method comprises the following steps of: merging encrypted data blocks with the size of a first data block in an encrypted data packet into a merged encrypted data block with the size of a second data block, and merging the encrypted data blocks which are not enough to be merged into the merged encrypted data block into the merged encrypted data block by using an auxiliary patch; the size of the first data block is the size of the data block processed by the native national cryptographic algorithm, the size of the second data block is the size of the data block processed by the national cryptographic algorithm accelerated based on the instruction set, and the size of the second data block is larger than the size of the first data block and is a multiple of the size of the first data block. In this way, the combined encrypted data block can be decrypted by using the national cryptographic algorithm accelerated based on the instruction set, so that the data decryption efficiency in an SSL encryption communication scene can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network security, and in particular to a data processing method, device, electronic equipment and storage medium. Background Art

[0002] To improve the security of network data transmission, the client and the server can establish an SSL connection (Secure Socket Layer) and perform encrypted communication based on the SSL connection. The national encryption algorithm is a commonly used encryption algorithm in SSL connections. However, when decrypting data, the native national encryption algorithm can process a small data block size at a time, which leads to low data decryption efficiency and affects the efficiency of SSL encrypted communication between the client and the server. Summary of the invention

[0003] The purpose of the present invention is to provide a data processing method, device, electronic device and storage medium, which can use the national encryption algorithm based on instruction set acceleration to decrypt the merged encrypted data blocks, thereby improving the data decryption efficiency in SSL encrypted communication scenarios.

[0004] In order to solve the above technical problems, the present invention provides a data processing method, comprising:

[0005] Establishing an SSL connection with the peer based on the national encryption algorithm, and receiving an encrypted data packet sent by the peer based on the SSL connection;

[0006] Merge encrypted data blocks of a first data block size in the encrypted data packet into a merged encrypted data block of a second data block size, and use an auxiliary patch to merge encrypted data blocks that are not large enough to be merged into the merged encrypted data block into the merged encrypted data block; wherein the first data block size is a data block size processed by a native national encryption algorithm, the second data block size is a data block size processed by a national encryption algorithm based on instruction set acceleration, and the second data block size is larger than the first data block size and is a multiple of the first data block size;

[0007] Decrypting the combined encrypted data block using the national encryption algorithm based on instruction set acceleration to obtain a decrypted data block;

[0008] Patches are removed from the decrypted data blocks corresponding to the combined encrypted data blocks containing the auxiliary patches, and the decrypted data blocks are combined into decrypted data.

[0009] Optionally, after the decrypted data blocks are spliced ​​into decrypted data, the method further includes:

[0010] Determining whether an encryption patch is added to the end of the decrypted data;

[0011] If so, the encryption patch is removed.

[0012] Optionally, it also includes:

[0013] Get the data packet to be encrypted;

[0014] Dividing the to-be-encrypted data packet into to-be-encrypted data blocks according to the second data block size, and padding the to-be-encrypted data blocks whose sizes are smaller than the second data block size to the second data block size using the encryption patch;

[0015] Encrypting the data block to be encrypted using the national encryption algorithm based on instruction set acceleration to obtain an encrypted data block;

[0016] The encrypted data blocks are combined into an encrypted data packet, and the encrypted data packet is sent to the opposite end based on the SSL connection.

[0017] Optionally, the step of merging encrypted data blocks that are insufficient to be merged into the merged encrypted data block into the merged encrypted data block by using the auxiliary patch includes:

[0018] Merging the encrypted data blocks that are insufficient to be merged into the merged encrypted data block into an initial merged encrypted data block;

[0019] Determine the size to be filled using the second data block size and the size of the initial combined encrypted data block;

[0020] An auxiliary patch having a size equal to the size to be filled is filled at the end of the initial merged encrypted data block to obtain the merged encrypted data block.

[0021] Optionally, removing the patch from the decrypted data block corresponding to the merged encrypted data block containing the auxiliary patch includes:

[0022] Marking the decrypted data block corresponding to the merged encrypted data block containing the auxiliary patch as a decrypted data block to be processed;

[0023] The auxiliary patch at the end of the to-be-processed decrypted data block, whose size is the to-be-filled size, is removed.

[0024] Optionally, after determining the size to be filled by using the second data block size and the size of the initial combined encrypted data block, the method further includes:

[0025] The data content of the auxiliary patch is set according to the size to be filled.

[0026] Optionally, combining the decrypted data blocks into decrypted data comprises:

[0027] According to the order of each of the combined encrypted data blocks in the encrypted data packet, the decrypted data blocks corresponding to each of the combined encrypted data blocks are combined into the decrypted data.

[0028] The present invention also provides a data processing device, comprising:

[0029] A connection establishment module, used to establish an SSL connection with the peer end based on the national encryption algorithm, and receive an encrypted data packet sent by the peer end based on the SSL connection;

[0030] a merging module, configured to merge encrypted data blocks of a first data block size in the encrypted data packet into a merged encrypted data block of a second data block size, and to merge encrypted data blocks that are insufficient to be merged into the merged encrypted data block into the merged encrypted data block using an auxiliary patch; wherein the first data block size is a data block size processed by a native national encryption algorithm, the second data block size is a data block size processed by a national encryption algorithm based on instruction set acceleration, and the second data block size is larger than the first data block size and is a multiple of the first data block size;

[0031] A decryption module, used to decrypt the combined encrypted data block using the national encryption algorithm based on instruction set acceleration to obtain a decrypted data block;

[0032] The decrypted data combining module is used to remove patches from the decrypted data blocks corresponding to the combined encrypted data blocks containing the auxiliary patches, and combine the decrypted data blocks into decrypted data.

[0033] The present invention also provides an electronic device, comprising:

[0034] Memory for storing computer programs;

[0035] A processor is used to implement the data processing method as described above when executing the computer program.

[0036] The present invention also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are loaded and executed by a processor, the data processing method as described above is implemented.

[0037] The present invention provides a data processing method, comprising: establishing an SSL connection with a peer end based on a national secret algorithm, and receiving an encrypted data packet sent by the peer end based on the SSL connection; merging encrypted data blocks of a first data block size in the encrypted data packet into a merged encrypted data block of a second data block size, and merging encrypted data blocks that are not large enough to be merged into the merged encrypted data block into the merged encrypted data block using an auxiliary patch; wherein the first data block size is the data block size processed by the native national secret algorithm, the second data block size is the data block size processed by the national secret algorithm based on instruction set acceleration, and the second data block size is larger than the first data block size and is a multiple of the first data block size; decrypting the merged encrypted data block using the national secret algorithm based on instruction set acceleration to obtain a decrypted data block; performing patch removal on the decrypted data block corresponding to the merged encrypted data block containing the auxiliary patch, and combining the decrypted data blocks into decrypted data.

[0038] It can be seen that the present invention can first establish an SSL connection with the opposite end based on the national secret algorithm, and receive an encrypted data packet sent by the opposite end based on the SSL connection. Subsequently, the encrypted data blocks of the first data block size in the encrypted data packet can be merged into a merged encrypted data block of the second data block size, and the encrypted data blocks that are not large enough to be merged into a merged encrypted data block can be merged into a merged encrypted data block using an auxiliary patch. Among them, the first data block size is the data block size processed by the native national secret algorithm, the second data block size is the data block size processed by the national secret algorithm based on instruction set acceleration, and the second data block size is larger than the first data block size and is a multiple of the first data block size. In other words, the instruction set can be used to expand the data block size that can be processed by the national secret algorithm at a time to increase the decryption speed; at the same time, the auxiliary patch can be used to fill the encrypted data blocks that are not large enough to be merged into a merged encrypted data block to ensure that they can be decrypted using the national secret algorithm based on instruction set acceleration. Furthermore, the national encryption algorithm based on instruction set acceleration can be used to decrypt the merged encrypted data block to obtain a decrypted data block, and after removing the patch of the decrypted data block corresponding to the merged encrypted data block containing the auxiliary patch, the decrypted data block can be combined into decrypted data, thereby improving the data decryption efficiency in the SSL encrypted communication scenario, thereby improving the SSL encrypted communication efficiency between the two ends. The present invention also provides a data processing device, an electronic device and a computer-readable storage medium, which have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0040] Figure 1 A flowchart of a data processing method provided by an embodiment of the present invention;

[0041] Figure 2 A flow chart of data decryption provided by an embodiment of the present invention;

[0042] Figure 3 A flowchart of data encryption provided by an embodiment of the present invention;

[0043] Figure 4 A structural block diagram of a data processing device provided by an embodiment of the present invention;

[0044] Figure 5 The present invention provides a structural block diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0046] To improve the security of network data transmission, the client and the server can establish an SSL connection and perform encrypted communication based on the SSL connection. The national encryption algorithm is a commonly used encryption algorithm in SSL connections. However, when decrypting data, the native national encryption algorithm can process a small data block size at a time, which leads to low data decryption efficiency and affects the efficiency of SSL encrypted communication between the client and the server.

[0047] In view of this, in order to solve the technical problem of how to improve the data decryption efficiency in SSL encrypted communication scenarios, thereby improving the efficiency of SSL encrypted communication, the present invention can provide a data processing method, which can use the national secret algorithm based on instruction set acceleration to decrypt the merged encrypted data blocks, thereby improving the data decryption efficiency in SSL encrypted communication scenarios and improving the efficiency of SSL encrypted communication.

[0048] For easier understanding, please refer to Figure 1 , Figure 1 This is a flow chart of a data processing method provided by an embodiment of the present invention. It should be noted that this method can be applied to either the client or the server, or can be applied to both the client and the server at the same time. This method may include:

[0049] S101. Establish an SSL connection with a peer based on a national encryption algorithm, and receive an encrypted data packet sent by the peer based on the SSL connection.

[0050] In this step, in order to negotiate with the peer end to use the national encryption algorithm (such as the SM4 algorithm) for SSL encrypted communication, it is necessary to establish an SSL connection with the peer end based on the national encryption algorithm and negotiate with the peer end the key suite required for the national encryption algorithm. After the connection is established, the encrypted data packet sent by the peer end based on the SSL connection can be received, and the encrypted data packet is encrypted using the national encryption algorithm.

[0051] It should be noted that this embodiment does not limit the specific process of establishing the SSL connection, and reference may be made to related technologies of SSL.

[0052] S102. Merge the encrypted data blocks of the first data block size in the encrypted data packet into a merged encrypted data block of the second data block size, and use an auxiliary patch to merge the encrypted data blocks that are not large enough to be merged into the merged encrypted data block into the merged encrypted data block; wherein, the first data block size is the data block size processed by the native national encryption algorithm, the second data block size is the data block size processed by the national encryption algorithm based on instruction set acceleration, and the second data block size is larger than the first data block size and is a multiple of the first data block size.

[0053] In this step, in order to decrypt the encrypted data packet using the national encryption algorithm based on instruction set acceleration, it is necessary to split and merge the encrypted data packet to form a merged encrypted data block that can be processed by the national encryption algorithm based on instruction set acceleration. Specifically, it is necessary to merge the encrypted data blocks of the first data block size in the encrypted data packet into a merged encrypted data block of the second data block size, and use auxiliary patches to merge the encrypted data blocks that are not enough to be merged into a merged encrypted data block into a merged encrypted data block. For example, the encrypted data blocks in the encrypted data packet can be sequentially merged into a merged encrypted data block; and for the end encrypted data block at the end of the encrypted data packet that is not enough to form a merged encrypted data block, the end encrypted block can be filled with an auxiliary patch to obtain a merged encrypted data block. Among them, the above-mentioned first data block size is the data block size processed by the native national encryption algorithm, the above-mentioned second data block size is the data block size processed by the national encryption algorithm based on instruction set acceleration, and the second data block size is larger than the first data block size and is a multiple of the first data block size.

[0054] The reason for generating a merged encrypted data block is that compared with the data block size processed by the native national encryption algorithm, the national encryption algorithm based on instruction set acceleration can process multiple data blocks concurrently, so the data block size that can be processed is larger. For example, the native SM4 national encryption algorithm can generally process a data block size of 16 bytes, while the SM4 national encryption algorithm accelerated by the SSE instruction set (Streaming SIMD Extensions, Internet data stream single instruction sequence extension) can concurrently process a data block size of 64 bytes. Therefore, it is necessary to merge the encrypted data blocks of the first data block size in the encrypted data packet into a merged encrypted data block of the second data block size, so as to meet the processing requirements of the national encryption algorithm based on instruction set acceleration. It can be seen that after instruction set acceleration, the data block size that can be processed by the national encryption algorithm has been significantly improved, so it can effectively improve the efficiency of data decryption.

[0055] In addition, the auxiliary patch is useless data used to fill the data block. The reason why the auxiliary patch can be filled in the encrypted data block to obtain the merged encrypted data block is that: in data decryption, there is no correlation between the encrypted data blocks, and even if useless data is filled in the encrypted data block, it does not affect the decryption result of the encrypted data block itself. After adding the auxiliary patch to the encrypted data block, it is only necessary to remove the auxiliary patch when the decryption is completed. Therefore, in order to meet the needs of the national encryption algorithm based on instruction set acceleration, for encrypted data blocks that are not sufficient to form a merged encrypted data block, auxiliary patches can also be used for filling. In this way, regardless of whether the other end uses the national encryption algorithm based on instruction set acceleration to generate an encrypted data packet, that is, regardless of whether the other end encrypts data based on the first data block size or the second data block size, it does not affect the local end using the national encryption algorithm based on instruction set acceleration for decryption, thereby effectively improving the decryption efficiency.

[0056] Of course, if the length of the encrypted data packet is just a multiple of the size of the second data block, the encrypted data packet can be directly divided into the merged encrypted data blocks without performing the step of filling the auxiliary patch.

[0057] Furthermore, this embodiment does not limit how to fill the auxiliary patch in the encrypted data block, and the auxiliary patch can be filled at a suitable position in the encrypted data block. For example, in order to facilitate the removal of the auxiliary patch, the auxiliary patch can be added at the end of the encrypted data block.

[0058] Based on this, the step of using the auxiliary patch to merge the encrypted data blocks that are insufficient to be merged into the merged encrypted data block into the merged encrypted data block may include:

[0059] Step 11: merging the encrypted data blocks that are insufficient to be merged into the merged encrypted data block into an initial merged encrypted data block;

[0060] Step 12: Determine the size to be filled by using the second data block size and the size of the initial combined encrypted data block;

[0061] Step 13: Fill the end of the initial merged encrypted data block with an auxiliary patch whose size is the size to be filled, to obtain the merged encrypted data block.

[0062] Furthermore, in order to facilitate identification of the auxiliary patch, the data content of the auxiliary patch may be set to specific content. For example, the data content of the auxiliary patch may be set according to the size to be filled.

[0063] Based on this, after determining the size to be filled by using the second data block size and the size of the initial merged encrypted data block, the method further includes:

[0064] Step 21: setting the data content of the auxiliary patch according to the size to be filled.

[0065] S103, using the national encryption algorithm based on instruction set acceleration to decrypt the combined encrypted data block to obtain a decrypted data block.

[0066] It should be noted that this embodiment does not limit how to use the national encryption algorithm based on instruction set acceleration to decrypt the merged encrypted data block to obtain the decrypted data block. For the SM4 national encryption algorithm based on SSE instruction set acceleration, the SM4NI technology can be used for decryption. Furthermore, in order to improve the security of encryption and decryption, data encryption and decryption can be performed based on the CBC mode (Cipher BlockChaining, ciphertext group chaining mode) of SM4.

[0067] S104: Remove patches from the decrypted data blocks corresponding to the combined encrypted data blocks containing the auxiliary patches, and combine the decrypted data blocks into decrypted data.

[0068] As mentioned above, in order to facilitate the removal of the auxiliary patch, the auxiliary patch can be filled at the end of the encrypted data block. Therefore, after the data decryption is completed, only the auxiliary patch part at the end of the corresponding decrypted data block needs to be removed.

[0069] Based on this, removing the patch from the decrypted data block corresponding to the merged encrypted data block containing the auxiliary patch may include:

[0070] Step 31: marking the decrypted data block corresponding to the merged encrypted data block containing the auxiliary patch as a decrypted data block to be processed;

[0071] Step 32: remove the auxiliary patch at the end of the to-be-processed decrypted data block, which has a size equal to the to-be-filled size.

[0072] Furthermore, after the decrypted data blocks are obtained, the decrypted data blocks may be sequentially combined into decrypted data according to the order of the combined encrypted data blocks in the encrypted data packet.

[0073] Based on this, combining the decrypted data blocks into decrypted data may include:

[0074] Step 41: According to the order of each of the combined encrypted data blocks in the encrypted data packet, the decrypted data blocks corresponding to each of the combined encrypted data blocks are combined into the decrypted data.

[0075] Furthermore, considering that when the peer end encrypts the original data packet to be encrypted, the length of the data packet to be encrypted may not be a multiple of the first data block size / the second data block size, it is necessary to fill the end of the data packet to be encrypted with an encryption patch and expand the data packet to be encrypted to a multiple of the first data block size / the second data block size before encryption can be performed. Therefore, after the decrypted data blocks are spliced ​​into decrypted data, it can be further determined whether there is an encryption patch at the end of the decrypted data. If there is, the encryption patch can be removed to obtain the correct decrypted data.

[0076] Based on this, after the decrypted data blocks are spliced ​​into decrypted data, the following steps may also be included:

[0077] Step 51: Determine whether an encryption patch is added to the end of the decrypted data;

[0078] Step 52: If yes, remove the encryption patch.

[0079] Step 53: If not, ignore.

[0080] For easier understanding, please refer to Figure 2 , Figure 2 A flowchart of data decryption provided by an embodiment of the present invention, which fully illustrates the above data decryption process.

[0081] Based on the above embodiments, the present invention can first establish an SSL connection with the opposite end based on the national secret algorithm, and receive an encrypted data packet sent by the opposite end based on the SSL connection. Subsequently, the encrypted data blocks of the first data block size in the encrypted data packet can be merged into a merged encrypted data block of the second data block size, and the encrypted data blocks that are not large enough to be merged into a merged encrypted data block can be merged into a merged encrypted data block using an auxiliary patch. Among them, the first data block size is the data block size processed by the native national secret algorithm, the second data block size is the data block size processed by the national secret algorithm based on instruction set acceleration, and the second data block size is larger than the first data block size and is a multiple of the first data block size. In other words, the instruction set can be used to expand the data block size that can be processed by the national secret algorithm at a time to increase the decryption speed; at the same time, the auxiliary patch can be used to fill the encrypted data blocks that are not large enough to be merged into a merged encrypted data block to ensure that they can be decrypted using the national secret algorithm based on instruction set acceleration. Furthermore, the national encryption algorithm based on instruction set acceleration can be used to decrypt the merged encrypted data block to obtain a decrypted data block, and after the decrypted data block corresponding to the merged encrypted data block containing the auxiliary patch is patched, the decrypted data blocks can be combined into decrypted data, thereby improving the data decryption efficiency in the SSL encrypted communication scenario, thereby improving the SSL encrypted communication efficiency between the two ends.

[0082] Based on the above embodiment, this embodiment can also use the national secret data based on instruction set acceleration to encrypt data. The following introduces the specific process of using the national secret data based on instruction set acceleration to encrypt data in the SSL encrypted communication scenario. In one possible scenario, this method can also include:

[0083] S201, obtaining a data packet to be encrypted.

[0084] S202: Divide the to-be-encrypted data packet into to-be-encrypted data blocks according to the second data block size, and fill the to-be-encrypted data blocks whose sizes are smaller than the second data block size to the second data block size using the encryption patch.

[0085] In this step, since the data block size processed by the national secret data based on instruction set acceleration is the second data block size, it is necessary to divide the data packet to be encrypted into data blocks to be encrypted according to the second data block size. In addition, during the block division process, there may be data blocks to be encrypted whose size is less than the second data block size, such as the data blocks to be encrypted at the end. At this time, in order to meet the encryption requirements, the encryption patch can also be used to fill the data block to the second data block size. Among them, the encryption patch is useless data used to fill the data block, and the data content of the encryption patch can be set according to the application requirements, such as the length of the encryption patch.

[0086] S203, encrypting the data block to be encrypted by using the national encryption algorithm based on instruction set acceleration to obtain an encrypted data block;

[0087] It should be noted that this embodiment does not limit how to use the national encryption algorithm based on instruction set acceleration to encrypt the encrypted data block to obtain the decrypted data block. For the SM4 national encryption algorithm based on SSE instruction set acceleration, the SM4NI technology can be used for encryption. Furthermore, in order to improve the security of encryption and decryption, data encryption and decryption can be performed based on the CBC mode of SM4.

[0088] S204: assemble the encrypted data blocks into an encrypted data packet, and send the encrypted data packet to the other end based on the SSL connection.

[0089] In this step, after obtaining the encrypted data block, the encrypted data blocks can be sequentially combined into an encrypted data packet according to the order of the corresponding data blocks to be encrypted in the data packet to be encrypted, and the encrypted data packet is sent to the other end based on the SSL connection. It can be seen that after the instruction set acceleration, the data block size that can be processed by the national encryption algorithm has been significantly improved, so it can effectively improve the data encryption efficiency, thereby further improving the efficiency of SSL encrypted communication.

[0090] For easier understanding, please refer to Figure 3 , Figure 3 A flowchart of data encryption provided by an embodiment of the present invention, which fully illustrates the above data encryption process.

[0091] The data processing device, electronic device, computer program product, and computer-readable storage medium provided in the embodiments of the present invention are introduced below. The data processing device, electronic device, computer program product, and computer-readable storage medium described below can be referenced to the data processing method described above.

[0092] Please refer to Figure 4 , Figure 4 A structural block diagram of a data processing device provided by an embodiment of the present invention, the device may include:

[0093] The connection establishment module 401 is used to establish an SSL connection with the peer end based on the national encryption algorithm, and receive an encrypted data packet sent by the peer end based on the SSL connection;

[0094] A merging module 402 is used to merge the encrypted data blocks of the first data block size in the encrypted data packet into a merged encrypted data block of the second data block size, and merge the encrypted data blocks that are not large enough to be merged into the merged encrypted data block into the merged encrypted data block using an auxiliary patch; wherein the first data block size is the data block size processed by the native national encryption algorithm, the second data block size is the data block size processed by the national encryption algorithm based on instruction set acceleration, and the second data block size is larger than the first data block size and is a multiple of the first data block size;

[0095] A decryption module 403, configured to decrypt the combined encrypted data block using the national encryption algorithm based on instruction set acceleration to obtain a decrypted data block;

[0096] The decrypted data combining module 404 is used to remove patches from the decrypted data blocks corresponding to the combined encrypted data blocks containing the auxiliary patches, and combine the decrypted data blocks into decrypted data.

[0097] Optionally, the device may further include:

[0098] The encryption patch removal module is used to determine whether an encryption patch is added to the end of the decrypted data; if so, remove the encryption patch.

[0099] Optionally, the device may further include:

[0100] An acquisition module, used to acquire data packets to be encrypted;

[0101] A block division module, configured to divide the to-be-encrypted data packet into to-be-encrypted data blocks according to the second data block size, and fill the to-be-encrypted data blocks whose sizes are smaller than the second data block size to the second data block size using the encryption patch;

[0102] An encryption module, used to encrypt the data block to be encrypted using the national encryption algorithm based on instruction set acceleration to obtain an encrypted data block;

[0103] The sending module is used to combine the encrypted data blocks into encrypted data packets, and send the encrypted data packets to the other end based on the SSL connection.

[0104] Optionally, the merging module 402 may include:

[0105] A preliminary merging submodule, used for merging the encrypted data blocks that are not sufficient to be merged into the merged encrypted data block into an initial merged encrypted data block;

[0106] a patch size calculation submodule, configured to determine a size to be filled using the second data block size and the size of the initial merged encrypted data block;

[0107] The patch adding submodule is used to fill the end of the initial merged encrypted data block with an auxiliary patch whose size is the size to be filled, so as to obtain the merged encrypted data block.

[0108] Optionally, the decrypted data combination module 404 may include:

[0109] A marking submodule, used for marking the decrypted data block corresponding to the merged encrypted data block containing the auxiliary patch as a decrypted data block to be processed;

[0110] The patch removal submodule is used to remove the auxiliary patch at the end of the to-be-processed decrypted data block, the size of which is the size to be filled.

[0111] Optionally, the merging module 402 may further include:

[0112] The patch setting submodule is used to set the data content of the auxiliary patch according to the size to be filled.

[0113] Optionally, the decrypted data combination module 404 may include:

[0114] The combining submodule is used to combine the decrypted data blocks corresponding to each of the combined encrypted data blocks into the decrypted data according to the order of each of the combined encrypted data blocks in the encrypted data packet.

[0115] Please refer to Figure 5 , Figure 5 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. The embodiment of the present invention provides an electronic device 10, including a processor 11 and a memory 12; wherein the memory 12 is used to store a computer program; and the processor 11 is used to execute the data processing method provided in the aforementioned embodiment when executing the computer program.

[0116] For the specific process of the above data processing method, please refer to the corresponding content provided in the above embodiments, which will not be repeated here.

[0117] Furthermore, the memory 12 as a carrier for storing resources may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the storage method may be temporary storage or permanent storage.

[0118] In addition, the electronic device 10 also includes a power supply 13, a communication interface 14, an input / output interface 15 and a communication bus 16; wherein the power supply 13 is used to provide working voltage for each hardware device on the electronic device 10; the communication interface 14 can create a data transmission channel between the electronic device 10 and an external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present invention, and is not specifically limited here; the input / output interface 15 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0119] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, wherein when the computer program / instruction is executed by a processor, the data processing method described in the above embodiment is implemented.

[0120] Since the embodiments of the computer program product part correspond to the embodiments of the data processing method part, please refer to the description of the embodiments of the data processing method part for the embodiments of the computer program product part, and will not be repeated here.

[0121] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the data processing method described in the above embodiment is implemented.

[0122] Since the embodiments of the computer-readable storage medium part correspond to the embodiments of the data processing method part, please refer to the description of the embodiments of the data processing method part for the embodiments of the storage medium part, which will not be repeated here.

[0123] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0124] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0125] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0126] The above is a detailed introduction to a data processing method, device, electronic device and storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, the present invention can also be improved and modified, and these improvements and modifications also fall within the scope of protection of the present invention.

Claims

1. A data processing method, characterized in that: include: Establishing an SSL connection with the peer based on the national encryption algorithm, and receiving an encrypted data packet sent by the peer based on the SSL connection; Merge encrypted data blocks of a first data block size in the encrypted data packet into a merged encrypted data block of a second data block size, and use an auxiliary patch to merge encrypted data blocks that are not large enough to be merged into the merged encrypted data block into the merged encrypted data block; wherein the first data block size is a data block size processed by a native national encryption algorithm, the second data block size is a data block size processed by a national encryption algorithm based on instruction set acceleration, and the second data block size is larger than the first data block size and is a multiple of the first data block size; Decrypting the combined encrypted data block using the national encryption algorithm based on instruction set acceleration to obtain a decrypted data block; Patches are removed from the decrypted data blocks corresponding to the combined encrypted data blocks containing the auxiliary patches, and the decrypted data blocks are combined into decrypted data.

2. The data processing method according to claim 1, characterized in that: After combining the decrypted data blocks into decrypted data, the method further comprises: Determining whether an encryption patch is added to the end of the decrypted data; If so, the encryption patch is removed.

3. The data processing method according to claim 2, characterized in that: Also includes: Get the data packet to be encrypted; Dividing the to-be-encrypted data packet into to-be-encrypted data blocks according to the second data block size, and padding the to-be-encrypted data blocks whose sizes are smaller than the second data block size to the second data block size using the encryption patch; Encrypting the data block to be encrypted using the national encryption algorithm based on instruction set acceleration to obtain an encrypted data block; The encrypted data blocks are combined into an encrypted data packet, and the encrypted data packet is sent to the opposite end based on the SSL connection.

4. The data processing method according to claim 1, characterized in that: The step of using the auxiliary patch to merge the encrypted data blocks that are insufficient to be merged into the merged encrypted data block into the merged encrypted data block comprises: Merging the encrypted data blocks that are insufficient to be merged into the merged encrypted data block into an initial merged encrypted data block; Determine the size to be filled using the second data block size and the size of the initial combined encrypted data block; An auxiliary patch having a size equal to the size to be filled is filled at the end of the initial merged encrypted data block to obtain the merged encrypted data block.

5. The data processing method according to claim 4, characterized in that: The patch removal of the decrypted data block corresponding to the merged encrypted data block containing the auxiliary patch includes: Marking the decrypted data block corresponding to the merged encrypted data block containing the auxiliary patch as a decrypted data block to be processed; The auxiliary patch at the end of the to-be-processed decrypted data block, whose size is the to-be-filled size, is removed.

6. The data processing method according to claim 4, characterized in that: After determining the size to be filled by using the second data block size and the size of the initial merged encrypted data block, the method further includes: The data content of the auxiliary patch is set according to the size to be filled.

7. The data processing method according to claim 1, characterized in that: The step of combining the decrypted data blocks into decrypted data comprises: According to the order of each of the combined encrypted data blocks in the encrypted data packet, the decrypted data blocks corresponding to each of the combined encrypted data blocks are combined into the decrypted data.

8. A data processing device, characterized in that: include: A connection establishment module, used to establish an SSL connection with the peer end based on the national encryption algorithm, and receive an encrypted data packet sent by the peer end based on the SSL connection; a merging module, configured to merge encrypted data blocks of a first data block size in the encrypted data packet into a merged encrypted data block of a second data block size, and to merge encrypted data blocks that are insufficient to be merged into the merged encrypted data block into the merged encrypted data block using an auxiliary patch; wherein the first data block size is a data block size processed by a native national encryption algorithm, the second data block size is a data block size processed by a national encryption algorithm based on instruction set acceleration, and the second data block size is larger than the first data block size and is a multiple of the first data block size; A decryption module, used to decrypt the combined encrypted data block using the national encryption algorithm based on instruction set acceleration to obtain a decrypted data block; The decrypted data combining module is used to remove patches from the decrypted data blocks corresponding to the combined encrypted data blocks containing the auxiliary patches, and combine the decrypted data blocks into decrypted data.

9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the data processing method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are loaded and executed by the processor, the data processing method according to any one of claims 1 to 7 is implemented.