Large file secure transmission method and system

By splitting and splicing large files on edge computing devices, and using hardware encryption and multiple encryption algorithms, the problem of time-consuming hash calculation and security risks in large file transmission is solved, and efficient and secure integrity verification and transmission are achieved. .

CN118802902APending Publication Date: 2024-10-18FUJIAN STAR NET COMM
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411267965.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

When transferring large files on edge computing devices, hash calculations take a long time and affect the transmission efficiency. Moreover, traditional methods have security risks and are difficult to effectively verify the integrity of large files.

Method used

By setting file split size and data extraction rules, large files are divided into small files, and sub-data is extracted and spliced ​​for MAC calculation based on these rules. Hardware encryption chips and GPU acceleration technology are used for encryption and decryption, using multiple encryption algorithms and The TLS protocol ensures transmission security.

Benefits of technology

It improves the security and integrity verification efficiency of large file transmission, reduces calculation time, and enhances data security through the use of multiple encryption and hardware encryption chips.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118802902A_ABST
    Figure CN118802902A_ABST
Patent Text Reader

Abstract

The invention provides a large file secure transmission method and system in the technical field of edge computing. The method comprises the steps that S1, the file segmentation size is set, and a data extraction rule is preset to edge computing equipment; s2, segmenting the large file into small files based on the file segmentation size; s3, extracting sub-data from each small file based on a data extraction rule and splicing the sub-data into first spliced data; step S4, performing MAC calculation on the first spliced data to obtain a first MAC value, encrypting the first MAC value into an MAC ciphertext, and sending the large file and the MAC ciphertext to an edge computing device; s5, the edge computing device stores the large file into a memory and stores the MAC ciphertext into a hardware encryption chip; step S6, calculating second spliced data of the large file and performing MAC calculation to obtain a second MAC value, and decrypting the MAC ciphertext to obtain a first MAC value; and S7, performing integrity verification through the first MAC value and the second MAC value. The method has the advantages that the security of large file transmission and the integrity verification efficiency are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of edge computing technology, and in particular to a large file secure transmission method and system. Background Art

[0002] With the popularization of computer technology, a large number of electronic files have been generated, such as photos, videos and other electronic files. In order to share these electronic files, they need to be transmitted on the Internet. However, there is an inevitable risk of tampering during the transmission process, or electronic files may be lost during the transmission process. Therefore, there is a need to verify whether the electronic files are complete.

[0003] The hash algorithm is used to transform an input of arbitrary length (also called a pre-image) into an output of fixed length. The output is the hash value. Since hash calculations are irreversible, it is only necessary to calculate the hash values ​​before and after the electronic file is transmitted. The integrity of the electronic file can be checked by comparing the calculated hash values ​​to see if they are consistent.

[0004] However, when transmitting large files in GB, it takes a long time to perform hash calculations on large files, and hash calculations must be performed both before sending and after receiving. Especially when applied to edge computing devices with limited computing resources, this seriously affects the efficiency of large file integrity verification, and thus affects the timeliness of large file transmission. In addition, traditionally, hash calculations are performed on the entire large file. If the large file is intercepted, it can be easily determined whether the large file is complete, which poses certain security risks.

[0005] Therefore, how to provide a large file secure transmission method and system to improve the security of large file transmission and the efficiency of integrity verification has become a technical problem that needs to be solved urgently. Summary of the invention

[0006] The technical problem to be solved by the present invention is to provide a large file secure transmission method and system to improve the security of large file transmission and the efficiency of integrity verification.

[0007] In a first aspect, the present invention provides a method for securely transmitting a large file, comprising the following steps: Step S1, setting a file segmentation size and a data extraction rule, and presetting the file segmentation size and the data extraction rule to the edge computing device; Step S2, obtaining a large file to be transmitted, dividing the large file into a plurality of small files based on the file segmentation size, and numbering each of the small files in sequence; Step S3, extracting sub-data from each small file based on the data extraction rule and the number, and splicing each sub-data into first spliced ​​data based on each number; Step S4: Perform MAC calculation on the first concatenated data to obtain a first MAC value, encrypt the first MAC value into MAC ciphertext, and send the large file and the MAC ciphertext to an edge computing device; Step S5: The edge computing device receives the large file and the MAC ciphertext, stores the large file in real time in the memory, and stores the MAC ciphertext in real time in the hardware encryption chip; Step S6: The edge computing device calculates the second splicing data of the large file based on the file segmentation size and the data extraction rule, performs MAC calculation on the second splicing data to obtain a second MAC value, and decrypts the MAC ciphertext through the hardware encryption chip to obtain the first MAC value; Step S7: Perform integrity check on the large file by comparing the first MAC value and the second MAC value, thereby completing the transmission of the large file; In step S1, the data extraction rule is specifically: A data extraction length and a padding character are set, wherein the data extraction length is shorter than the data length of the small file; the data extraction start bit is set to a×3-2, where a is the number of the small file; Sub-data is extracted from the small file with the corresponding number based on the data extraction start bit. When the length of the sub-data is less than the data extraction length, the end of the sub-data is padded with the padding character until the length meets the data extraction length.

[0008] Furthermore, the step S3 is specifically as follows: Extracting sub-data from each small file based on the data extraction rule and the number, and splicing each sub-data into first spliced ​​data based on each number and a preset splicing rule; The splicing rules are specifically: A positive integer b having a value greater than 1 is set, and the sub-data corresponding to the numbers that can divide the positive integer b are sequentially spliced, and then the remaining sub-data corresponding to the numbers are sequentially spliced ​​at the end.

[0009] Furthermore, the step S4 is specifically as follows: Perform MAC calculation on the first spliced ​​data to obtain a first MAC value, encrypt the first MAC value through an RSA algorithm to obtain first-level encrypted data, map each character of the first-level encrypted data through a preset mapping rule to obtain second-level encrypted data, divide the second-level encrypted data according to a preset division ratio and swap the order to obtain third-level encrypted data, swap characters a and z, and characters q and p in the third-level encrypted data to obtain fourth-level encrypted data, encrypt the fourth-level encrypted data into MAC ciphertext through a 3DES algorithm, and send the large file and MAC ciphertext to the edge computing device in real time through the TLS protocol.

[0010] Furthermore, the step S6 is specifically as follows: The edge computing device divides the large file in the memory into a plurality of small files based on the file segmentation size by using GPU hardware acceleration technology, numbers each of the small files in sequence, extracts sub-data from each of the small files based on the data extraction rule and the number, splices each of the sub-data into second spliced ​​data based on each of the numbers and a preset splicing rule, and performs MAC calculation on the second spliced ​​data to obtain a second MAC value; The edge computing device calls the hardware encryption chip, decrypts the MAC ciphertext into fourth-level encrypted data through the 3DES algorithm, swaps the characters a and z, and swaps the characters q and p in the fourth-level encrypted data to obtain third-level encrypted data, divides the third-level encrypted data by the inverse of a preset division ratio and swaps the order to obtain second-level encrypted data, maps each character of the second-level encrypted data according to a preset mapping rule to obtain first-level encrypted data, and decrypts the first-level encrypted data into a first MAC value through the RSA algorithm.

[0011] Furthermore, the step S7 is specifically as follows: The edge computing device reads the first MAC value obtained by decryption from the hardware encryption chip, and compares the first MAC value with the calculated second MAC value to see if they are consistent. If so, the integrity check succeeds and the transmission of the large file is completed; if not, the integrity check fails and the received large file and MAC ciphertext are deleted.

[0012] In a second aspect, the present invention provides a large file secure transmission system, comprising the following modules: A rule setting module, used to set a file segmentation size and a data extraction rule, and preset the file segmentation size and the data extraction rule to the edge computing device; A large file segmentation module is used to obtain a large file to be transmitted, segment the large file into a plurality of small files based on the file segmentation size, and number each of the small files in sequence; A sub-data extraction and splicing module, used for extracting sub-data from each small file based on the data extraction rule and the number, and splicing each sub-data into first spliced ​​data based on each number; A first MAC value calculation module, configured to perform MAC calculation on the first concatenated data to obtain a first MAC value, encrypt the first MAC value into a MAC ciphertext, and send the large file and the MAC ciphertext to an edge computing device; A file receiving and storing module, used for the edge computing device to receive the large file and the MAC ciphertext, store the large file in the memory in real time, and store the MAC ciphertext in the hardware encryption chip in real time; A second MAC value calculation module is used for the edge computing device to calculate the second spliced ​​data of the large file based on the file segmentation size and the data extraction rule, perform MAC calculation on the second spliced ​​data to obtain a second MAC value, and decrypt the MAC ciphertext through the hardware encryption chip to obtain the first MAC value; An integrity check module, used to perform integrity check on the large file by comparing the first MAC value and the second MAC value, thereby completing the transmission of the large file; In the rule setting module, the data extraction rules are specifically: A data extraction length and a padding character are set, wherein the data extraction length is shorter than the data length of the small file; the data extraction start bit is set to a×3-2, where a is the number of the small file; Sub-data is extracted from the small file with the corresponding number based on the data extraction start bit. When the length of the sub-data is less than the data extraction length, the end of the sub-data is padded with the padding character until the length meets the data extraction length.

[0013] Furthermore, the sub-data extraction and splicing module is specifically used for: Extracting sub-data from each small file based on the data extraction rule and the number, and splicing each sub-data into first spliced ​​data based on each number and a preset splicing rule; The splicing rules are specifically as follows: A positive integer b having a value greater than 1 is set, and the sub-data corresponding to the numbers that can divide the positive integer b are sequentially spliced, and then the remaining sub-data corresponding to the numbers are sequentially spliced ​​at the end.

[0014] Furthermore, the first MAC value calculation module is specifically used for: Perform MAC calculation on the first spliced ​​data to obtain a first MAC value, encrypt the first MAC value through an RSA algorithm to obtain first-level encrypted data, map each character of the first-level encrypted data through a preset mapping rule to obtain second-level encrypted data, divide the second-level encrypted data according to a preset division ratio and swap the order to obtain third-level encrypted data, swap characters a and z, and characters q and p in the third-level encrypted data to obtain fourth-level encrypted data, encrypt the fourth-level encrypted data into MAC ciphertext through a 3DES algorithm, and send the large file and MAC ciphertext to the edge computing device in real time through the TLS protocol.

[0015] Furthermore, the second MAC value calculation module is specifically used for: The edge computing device divides the large file in the memory into a plurality of small files based on the file segmentation size by using GPU hardware acceleration technology, numbers each of the small files in sequence, extracts sub-data from each of the small files based on the data extraction rule and the number, splices each of the sub-data into second spliced ​​data based on each of the numbers and a preset splicing rule, and performs MAC calculation on the second spliced ​​data to obtain a second MAC value; The edge computing device calls the hardware encryption chip, decrypts the MAC ciphertext into fourth-level encrypted data through the 3DES algorithm, swaps the characters a and z, and swaps the characters q and p in the fourth-level encrypted data to obtain third-level encrypted data, divides the third-level encrypted data by the inverse of a preset division ratio and swaps the order to obtain second-level encrypted data, maps each character of the second-level encrypted data according to a preset mapping rule to obtain first-level encrypted data, and decrypts the first-level encrypted data into a first MAC value through the RSA algorithm.

[0016] Furthermore, the integrity verification module is specifically used for: The edge computing device reads the first MAC value obtained by decryption from the hardware encryption chip, and compares the first MAC value with the calculated second MAC value to see if they are consistent. If so, the integrity check succeeds and the transmission of the large file is completed; if not, the integrity check fails and the received large file and MAC ciphertext are deleted.

[0017] The advantages of the present invention are: 1. By setting the file segmentation size and data extraction rules and presetting them to the edge computing device; then obtain the large file to be transmitted, divide the large file into several small files based on the file segmentation size, and number each small file in sequence, then extract sub-data from each small file based on the data extraction rules and numbers, splice each sub-data into the first spliced ​​data based on each number and perform MAC calculation to obtain a first MAC value, encrypt the first MAC value into MAC ciphertext, and send the large file and MAC ciphertext to the edge computing device; then the edge computing device stores the large file in real time in the memory, stores the MAC ciphertext in real time in the hardware encryption chip, calculates the second spliced ​​data of the large file based on the file segmentation size and data extraction rules, performs MAC calculation on the second spliced ​​data to obtain a second MAC value, decrypts the MAC ciphertext through the hardware encryption chip to obtain the first MAC value, and finally performs integrity verification on the large file by comparing the first MAC value and the second MAC value, thereby completing the transmission of the large file; that is, divide the large file into several small files based on the file segmentation size, and then encrypt the large file from Part of the data is extracted from each small file as sub-data, and then each sub-data is spliced ​​into spliced ​​data (first spliced ​​data / second spliced ​​data). The file size of the spliced ​​data is much smaller than the size of the large file. Performing MAC calculation on the spliced ​​file can effectively improve the calculation speed. The edge computing device stores the large file in the memory for calculation. Combined with GPU hardware acceleration technology, the calculation speed of the second MAC value is further improved. The hardware encryption chip has a high timely response capability and can quickly decrypt the MAC ciphertext. By encrypting the first MAC value into MAC ciphertext for transmission, the first MAC value is prevented from being stolen and tampered with in plain text during transmission. The storage security is further guaranteed by storing the MAC ciphertext in the hardware encryption chip. Based on the set data extraction rules and splicing rules, if the corresponding rules are not known, the second spliced ​​data cannot be generated, and the integrity of the large file cannot be verified. The MAC calculation is based on a Hash function with a secret key, which has higher security than ordinary hash calculation, and ultimately greatly improves the security of large file transmission and the efficiency of integrity verification.

[0018] 2. By setting the data extraction length and padding characters, the data extraction length is shorter than the data length of the small file, and the data extraction start bit is set to a×3-2, a is the number of the small file, and sub-data is extracted from the small file with the corresponding number based on the data extraction start bit. When the length of the sub-data is less than the data extraction length, the end of the sub-data is padded with padding characters. If the data extraction length, padding characters or data extraction start bit calculation rules are unknown, the sub-data cannot be extracted correctly, and then the integrity of the large file cannot be verified, which effectively improves security.

[0019] 3. By setting a positive integer b greater than 1, the sub-data corresponding to the numbers that can divide the positive integer b are spliced ​​in sequence, and then the sub-data corresponding to the remaining numbers are spliced ​​in sequence at the end. If the value of the positive integer b or the sorting rule is unknown, the correct splicing data cannot be obtained, and then the integrity of the large file cannot be verified, which effectively improves security.

[0020] 4. Encrypt the first MAC value through the RSA algorithm to obtain the first-level encrypted data, map each character of the first-level encrypted data through the preset mapping rule to obtain the second-level encrypted data, divide the second-level encrypted data according to the preset segmentation ratio and swap the order to obtain the third-level encrypted data, swap the characters a and z, and swap the characters q and p in the third-level encrypted data to obtain the fourth-level encrypted data, encrypt the fourth-level encrypted data into MAC ciphertext through the 3DES algorithm, and send the large file and the MAC ciphertext to the edge computing device in real time through the TLS protocol; that is, multiple first MAC values ​​are encrypted and data transformed multiple times. If the corresponding encryption algorithm or data transformation rule is not known, the MAC ciphertext cannot be cracked, and the TLS protocol is a secure transmission protocol. At least 7 security measures are taken before and after (RSA algorithm, mapping rule, segmentation ratio, swapping characters a and z, swapping characters q and p, 3DES algorithm, TLS protocol), which greatly improves the security of the first MAC value transmission and avoids illegal acquisition to verify the integrity of large files. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The present invention will be further described below in conjunction with embodiments with reference to the accompanying drawings.

[0022] Figure 1 The present invention is a flowchart of a large file secure transmission method.

[0023] Figure 2 It is a structural schematic diagram of a large file secure transmission system of the present invention. DETAILED DESCRIPTION

[0024] The technical solution in the embodiment of the present application has the following overall idea: a large file is divided into several small files based on the file segmentation size, and then part of the data is extracted from each small file as sub-data, and then each sub-data is spliced ​​into spliced ​​data. The file size of the spliced ​​data is much smaller than the size of the large file. Then MAC calculation of the spliced ​​file can effectively improve the calculation speed, and the edge computing device stores the large file in the memory for calculation, and combines the GPU hardware acceleration technology to further improve the calculation speed of the second MAC value. The hardware encryption chip has a high timely response capability and can quickly decrypt the MAC ciphertext; by encrypting the first MAC value into MAC ciphertext for transmission, the first MAC value is prevented from being stolen and tampered with in plain text during the transmission process, and the MAC ciphertext is stored in the hardware encryption chip to further ensure the security of storage. Based on the set data extraction rules and splicing rules, if the corresponding rules are not known, the second spliced ​​data cannot be generated, and thus the integrity of the large file cannot be verified. The MAC calculation is based on a Hash function with a secret key, which has higher security than ordinary hash calculation, thereby improving the security of large file transmission and the efficiency of integrity verification.

[0025] Please refer to Figure 1 to Figure 2 As shown, a preferred embodiment of a large file secure transmission method of the present invention includes the following steps: Step S1: The server sets a file segmentation size and a data extraction rule, and presets the file segmentation size and the data extraction rule to the edge computing device; Step S2, obtaining a large file to be transmitted, dividing the large file into a plurality of small files based on the file segmentation size, and numbering each of the small files in sequence; the numbering value starts from 1 and increases in sequence; Step S3, extracting sub-data from each small file based on the data extraction rule and the number, and splicing each sub-data into first spliced ​​data based on each of the numbers; the file size of the first spliced ​​data is much smaller than the file size of the large file; Step S4: Perform MAC calculation on the first concatenated data to obtain a first MAC value, encrypt the first MAC value into MAC ciphertext, and send the large file and the MAC ciphertext to an edge computing device; Step S5, the edge computing device receives the large file and the MAC ciphertext, stores the large file in real time in the memory, and stores the MAC ciphertext in real time in the hardware encryption chip; the hardware encryption chip has the advantages of high security, fast encryption and decryption, strong instant response capability, low power consumption, strong anti-attack ability, high performance, strong independence, easy management, reliability, stability and tamper-proof; Step S6: The edge computing device calculates the second splicing data of the large file based on the file segmentation size and the data extraction rule, performs MAC calculation on the second splicing data to obtain a second MAC value, and decrypts the MAC ciphertext through the hardware encryption chip to obtain the first MAC value; Step S7: Perform integrity check on the large file by comparing the first MAC value and the second MAC value, thereby completing the transmission of the large file; In step S1, the data extraction rule is specifically: A data extraction length and a padding character are set, wherein the data extraction length is shorter than the data length of the small file; the data extraction start bit is set to a×3-2, where a is the number of the small file; Sub-data is extracted from the small file with the corresponding number based on the data extraction start bit. When the length of the sub-data is less than the data extraction length, the end of the sub-data is padded with the padding character until the length meets the data extraction length.

[0026] By setting the data extraction length and padding characters, the data extraction length is shorter than the data length of the small file, and the data extraction starting bit is set to a×3-2, where a is the number of the small file. Sub-data is extracted from the small file with the corresponding number based on the data extraction starting bit. When the length of the sub-data is less than the data extraction length, the end of the sub-data is padded with padding characters. If the data extraction length, padding characters or data extraction starting bit calculation rules are unknown, the sub-data cannot be extracted correctly, and the integrity of the large file cannot be verified, thereby effectively improving security.

[0027] The step S3 is specifically as follows: Extracting sub-data from each small file based on the data extraction rule and the number, and splicing each sub-data into first spliced ​​data based on each number and a preset splicing rule; The splicing rules are specifically: Set a positive integer b with a value greater than 1, concatenate the sub-data corresponding to the numbers that can divide the positive integer b in sequence, and then concatenate the remaining sub-data corresponding to the numbers in sequence at the end; for example, set the value of the positive integer b to 3.

[0028] By setting a positive integer b with a value greater than 1, the sub-data corresponding to the numbers that can divide the positive integer b are spliced ​​in sequence, and then the sub-data corresponding to the remaining numbers are spliced ​​in sequence at the end. If the value of the positive integer b or the sorting rule is unknown, the correct splicing data cannot be obtained, and then the integrity of the large file cannot be verified, which effectively improves security.

[0029] The step S4 is specifically as follows: Perform MAC calculation on the first spliced ​​data to obtain a first MAC value, encrypt the first MAC value through an RSA algorithm to obtain first-level encrypted data, map each character of the first-level encrypted data through a preset mapping rule to obtain second-level encrypted data, divide the second-level encrypted data according to a preset division ratio and swap the order to obtain third-level encrypted data, swap characters a and z, and characters q and p in the third-level encrypted data to obtain fourth-level encrypted data, encrypt the fourth-level encrypted data into MAC ciphertext through a 3DES algorithm, and send the large file and MAC ciphertext to the edge computing device in real time through the TLS protocol.

[0030] The first MAC value is encrypted by the RSA algorithm to obtain the first-level encrypted data, and each character of the first-level encrypted data is mapped by a preset mapping rule to obtain the second-level encrypted data. The second-level encrypted data is divided by a preset segmentation ratio and the order is swapped to obtain the third-level encrypted data, and the characters a and z in the third-level encrypted data are swapped, and the characters q and p are swapped to obtain the fourth-level encrypted data. The fourth-level encrypted data is encrypted into MAC ciphertext by the 3DES algorithm, and the large file and the MAC ciphertext are sent to the edge computing device in real time through the TLS protocol; that is, multiple first MAC values ​​are encrypted and data transformed multiple times. If the corresponding encryption algorithm or data transformation rule is not known, the MAC ciphertext cannot be cracked, and the TLS protocol is a secure transmission protocol. At least 7 security measures are taken before and after (RSA algorithm, mapping rule, segmentation ratio, swapping characters a and z, swapping characters q and p, 3DES algorithm, TLS protocol), which greatly improves the security of the first MAC value transmission and avoids illegal acquisition to verify the integrity of large files.

[0031] The step S6 is specifically as follows: The edge computing device divides the large file in the memory into a plurality of small files based on the file segmentation size by using GPU hardware acceleration technology, numbers each of the small files in sequence, extracts sub-data from each of the small files based on the data extraction rule and the number, splices each of the sub-data into second spliced ​​data based on each of the numbers and a preset splicing rule, and performs MAC calculation on the second spliced ​​data to obtain a second MAC value; The edge computing device calls the hardware encryption chip, decrypts the MAC ciphertext into fourth-level encrypted data through the 3DES algorithm, swaps the characters a and z, and swaps the characters q and p in the fourth-level encrypted data to obtain third-level encrypted data, divides the third-level encrypted data by the inverse of a preset division ratio and swaps the order to obtain second-level encrypted data, maps each character of the second-level encrypted data according to a preset mapping rule to obtain first-level encrypted data, and decrypts the first-level encrypted data into a first MAC value through the RSA algorithm.

[0032] The step S7 is specifically as follows: The edge computing device reads the first MAC value obtained by decryption from the hardware encryption chip, and compares the first MAC value with the calculated second MAC value to see if they are consistent. If so, the integrity check succeeds and the transmission of the large file is completed; if not, the integrity check fails and the received large file and MAC ciphertext are deleted.

[0033] A preferred embodiment of a large file secure transmission system of the present invention includes the following modules: A rule setting module, used for the server to set a file segmentation size and a data extraction rule, and preset the file segmentation size and the data extraction rule to the edge computing device; A large file segmentation module is used to obtain a large file to be transmitted, segment the large file into a plurality of small files based on the file segmentation size, and number each of the small files in sequence; the numbering value starts from 1 and increases in sequence; A sub-data extraction and splicing module, used for extracting sub-data from each small file based on the data extraction rule and the number, and splicing each sub-data into first spliced ​​data based on each number; the file size of the first spliced ​​data is much smaller than the file size of the large file; A first MAC value calculation module, configured to perform MAC calculation on the first concatenated data to obtain a first MAC value, encrypt the first MAC value into a MAC ciphertext, and send the large file and the MAC ciphertext to an edge computing device; A file receiving and storing module is used for the edge computing device to receive the large file and the MAC ciphertext, store the large file in the memory in real time, and store the MAC ciphertext in the hardware encryption chip in real time; the hardware encryption chip has the advantages of high security, fast encryption and decryption, strong instant response capability, low power consumption, strong anti-attack ability, high performance, strong independence, easy management, reliability, stability and tamper-proof; A second MAC value calculation module is used for the edge computing device to calculate the second spliced ​​data of the large file based on the file segmentation size and the data extraction rule, perform MAC calculation on the second spliced ​​data to obtain a second MAC value, and decrypt the MAC ciphertext through the hardware encryption chip to obtain the first MAC value; An integrity check module, used to perform integrity check on the large file by comparing the first MAC value and the second MAC value, thereby completing the transmission of the large file; In the rule setting module, the data extraction rules are specifically: A data extraction length and a padding character are set, wherein the data extraction length is shorter than the data length of the small file; the data extraction start bit is set to a×3-2, where a is the number of the small file; Sub-data is extracted from the small file with the corresponding number based on the data extraction start bit. When the length of the sub-data is less than the data extraction length, the end of the sub-data is padded with the padding character until the length meets the data extraction length.

[0034] By setting the data extraction length and padding characters, the data extraction length is shorter than the data length of the small file, and the data extraction starting bit is set to a×3-2, where a is the number of the small file. Sub-data is extracted from the small file with the corresponding number based on the data extraction starting bit. When the length of the sub-data is less than the data extraction length, the end of the sub-data is padded with padding characters. If the data extraction length, padding characters or data extraction starting bit calculation rules are unknown, the sub-data cannot be extracted correctly, and the integrity of the large file cannot be verified, thereby effectively improving security.

[0035] The sub-data extraction and splicing module is specifically used for: Extracting sub-data from each small file based on the data extraction rule and the number, and splicing each sub-data into first spliced ​​data based on each number and a preset splicing rule; The splicing rules are specifically as follows: Set a positive integer b with a value greater than 1, concatenate the sub-data corresponding to the numbers that can divide the positive integer b in sequence, and then concatenate the remaining sub-data corresponding to the numbers in sequence at the end; for example, set the value of the positive integer b to 3.

[0036] By setting a positive integer b with a value greater than 1, the sub-data corresponding to the numbers that can divide the positive integer b are spliced ​​in sequence, and then the sub-data corresponding to the remaining numbers are spliced ​​in sequence at the end. If the value of the positive integer b or the sorting rule is unknown, the correct splicing data cannot be obtained, and then the integrity of the large file cannot be verified, which effectively improves security.

[0037] The first MAC value calculation module is specifically used for: Perform MAC calculation on the first spliced ​​data to obtain a first MAC value, encrypt the first MAC value through an RSA algorithm to obtain first-level encrypted data, map each character of the first-level encrypted data through a preset mapping rule to obtain second-level encrypted data, divide the second-level encrypted data according to a preset division ratio and swap the order to obtain third-level encrypted data, swap characters a and z, and characters q and p in the third-level encrypted data to obtain fourth-level encrypted data, encrypt the fourth-level encrypted data into MAC ciphertext through a 3DES algorithm, and send the large file and MAC ciphertext to the edge computing device in real time through the TLS protocol.

[0038] The first MAC value is encrypted by the RSA algorithm to obtain the first-level encrypted data, and each character of the first-level encrypted data is mapped by a preset mapping rule to obtain the second-level encrypted data. The second-level encrypted data is divided by a preset segmentation ratio and the order is swapped to obtain the third-level encrypted data, and the characters a and z in the third-level encrypted data are swapped, and the characters q and p are swapped to obtain the fourth-level encrypted data. The fourth-level encrypted data is encrypted into MAC ciphertext by the 3DES algorithm, and the large file and the MAC ciphertext are sent to the edge computing device in real time through the TLS protocol; that is, multiple first MAC values ​​are encrypted and data transformed multiple times. If the corresponding encryption algorithm or data transformation rule is not known, the MAC ciphertext cannot be cracked, and the TLS protocol is a secure transmission protocol. At least 7 security measures are taken before and after (RSA algorithm, mapping rule, segmentation ratio, swapping characters a and z, swapping characters q and p, 3DES algorithm, TLS protocol), which greatly improves the security of the first MAC value transmission and avoids illegal acquisition to verify the integrity of large files.

[0039] The second MAC value calculation module is specifically used for: The edge computing device divides the large file in the memory into a plurality of small files based on the file segmentation size by using GPU hardware acceleration technology, numbers each of the small files in sequence, extracts sub-data from each of the small files based on the data extraction rule and the number, splices each of the sub-data into second spliced ​​data based on each of the numbers and a preset splicing rule, and performs MAC calculation on the second spliced ​​data to obtain a second MAC value; The edge computing device calls the hardware encryption chip, decrypts the MAC ciphertext into fourth-level encrypted data through the 3DES algorithm, swaps the characters a and z, and swaps the characters q and p in the fourth-level encrypted data to obtain third-level encrypted data, divides the third-level encrypted data by the inverse of a preset division ratio and swaps the order to obtain second-level encrypted data, maps each character of the second-level encrypted data according to a preset mapping rule to obtain first-level encrypted data, and decrypts the first-level encrypted data into a first MAC value through the RSA algorithm.

[0040] The integrity check module is specifically used for: The edge computing device reads the first MAC value obtained by decryption from the hardware encryption chip, and compares the first MAC value with the calculated second MAC value to see if they are consistent. If so, the integrity check succeeds and the transmission of the large file is completed; if not, the integrity check fails and the received large file and MAC ciphertext are deleted.

[0041] In summary, the advantages of the present invention are: 1. By setting the file segmentation size and data extraction rules and presetting them to the edge computing device; then obtain the large file to be transmitted, divide the large file into several small files based on the file segmentation size, and number each small file in sequence, then extract sub-data from each small file based on the data extraction rules and numbers, splice each sub-data into the first spliced ​​data based on each number and perform MAC calculation to obtain a first MAC value, encrypt the first MAC value into MAC ciphertext, and send the large file and MAC ciphertext to the edge computing device; then the edge computing device stores the large file in real time in the memory, stores the MAC ciphertext in real time in the hardware encryption chip, calculates the second spliced ​​data of the large file based on the file segmentation size and data extraction rules, performs MAC calculation on the second spliced ​​data to obtain a second MAC value, decrypts the MAC ciphertext through the hardware encryption chip to obtain the first MAC value, and finally performs integrity verification on the large file by comparing the first MAC value and the second MAC value, thereby completing the transmission of the large file; that is, divide the large file into several small files based on the file segmentation size, and then encrypt the large file from Part of the data is extracted from each small file as sub-data, and then each sub-data is spliced ​​into spliced ​​data (first spliced ​​data / second spliced ​​data). The file size of the spliced ​​data is much smaller than the size of the large file. Performing MAC calculation on the spliced ​​file can effectively improve the calculation speed. The edge computing device stores the large file in the memory for calculation. Combined with GPU hardware acceleration technology, the calculation speed of the second MAC value is further improved. The hardware encryption chip has a high timely response capability and can quickly decrypt the MAC ciphertext. By encrypting the first MAC value into MAC ciphertext for transmission, the first MAC value is prevented from being stolen and tampered with in plain text during transmission. The storage security is further guaranteed by storing the MAC ciphertext in the hardware encryption chip. Based on the set data extraction rules and splicing rules, if the corresponding rules are not known, the second spliced ​​data cannot be generated, and the integrity of the large file cannot be verified. The MAC calculation is based on a Hash function with a secret key, which has higher security than ordinary hash calculation, and ultimately greatly improves the security of large file transmission and the efficiency of integrity verification.

[0042] 2. By setting the data extraction length and padding characters, the data extraction length is shorter than the data length of the small file, and the data extraction start bit is set to a×3-2, a is the number of the small file, and sub-data is extracted from the small file with the corresponding number based on the data extraction start bit. When the length of the sub-data is less than the data extraction length, the end of the sub-data is padded with padding characters. If the data extraction length, padding characters or data extraction start bit calculation rules are unknown, the sub-data cannot be extracted correctly, and then the integrity of the large file cannot be verified, which effectively improves security.

[0043] 3. By setting a positive integer b greater than 1, the sub-data corresponding to the numbers that can divide the positive integer b are spliced ​​in sequence, and then the sub-data corresponding to the remaining numbers are spliced ​​in sequence at the end. If the value of the positive integer b or the sorting rule is unknown, the correct splicing data cannot be obtained, and then the integrity of the large file cannot be verified, which effectively improves security.

[0044] 4. Encrypt the first MAC value through the RSA algorithm to obtain the first-level encrypted data, map each character of the first-level encrypted data through the preset mapping rule to obtain the second-level encrypted data, divide the second-level encrypted data according to the preset segmentation ratio and swap the order to obtain the third-level encrypted data, swap the characters a and z, and swap the characters q and p in the third-level encrypted data to obtain the fourth-level encrypted data, encrypt the fourth-level encrypted data into MAC ciphertext through the 3DES algorithm, and send the large file and the MAC ciphertext to the edge computing device in real time through the TLS protocol; that is, multiple first MAC values ​​are encrypted and data transformed multiple times. If the corresponding encryption algorithm or data transformation rule is not known, the MAC ciphertext cannot be cracked, and the TLS protocol is a secure transmission protocol. At least 7 security measures are taken before and after (RSA algorithm, mapping rule, segmentation ratio, swapping characters a and z, swapping characters q and p, 3DES algorithm, TLS protocol), which greatly improves the security of the first MAC value transmission and avoids illegal acquisition to verify the integrity of large files.

[0045] Although the specific implementation modes of the present invention are described above, those skilled in the art should understand that the specific implementation modes described are only illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included in the scope of protection of the claims of the present invention.

Claims

1. A large file secure transmission method, characterized by: The steps include: Step S1, setting a file segmentation size and a data extraction rule, and presetting the file segmentation size and the data extraction rule to the edge computing device; Step S2, obtaining a large file to be transmitted, dividing the large file into a plurality of small files based on the file segmentation size, and numbering each of the small files in sequence; Step S3, extracting sub-data from each small file based on the data extraction rule and the number, and splicing each sub-data into first spliced ​​data based on each number; Step S4: Perform MAC calculation on the first concatenated data to obtain a first MAC value, encrypt the first MAC value into MAC ciphertext, and send the large file and the MAC ciphertext to an edge computing device; Step S5: The edge computing device receives the large file and the MAC ciphertext, stores the large file in real time in the memory, and stores the MAC ciphertext in real time in the hardware encryption chip; Step S6: The edge computing device calculates the second splicing data of the large file based on the file segmentation size and the data extraction rule, performs MAC calculation on the second splicing data to obtain a second MAC value, and decrypts the MAC ciphertext through the hardware encryption chip to obtain the first MAC value; Step S7: Perform integrity check on the large file by comparing the first MAC value and the second MAC value, thereby completing the transmission of the large file; In step S1, the data extraction rule is specifically: A data extraction length and a padding character are set, wherein the data extraction length is shorter than the data length of the small file; the data extraction start bit is set to a×3-2, where a is the number of the small file; Sub-data is extracted from the small file with the corresponding number based on the data extraction start bit. When the length of the sub-data is less than the data extraction length, the end of the sub-data is padded with the padding character until the length meets the data extraction length.

2. A large file secure transmission method as claimed in claim 1, characterized in that: The step S3 is specifically as follows: Extracting sub-data from each small file based on the data extraction rule and the number, and splicing each sub-data into first spliced ​​data based on each number and a preset splicing rule; The splicing rules are specifically: A positive integer b having a value greater than 1 is set, and the sub-data corresponding to the numbers that can divide the positive integer b are sequentially spliced, and then the remaining sub-data corresponding to the numbers are sequentially spliced ​​at the end.

3. A large file secure transmission method as claimed in claim 1, characterized in that: The step S4 is specifically as follows: Perform MAC calculation on the first spliced ​​data to obtain a first MAC value, encrypt the first MAC value through an RSA algorithm to obtain first-level encrypted data, map each character of the first-level encrypted data through a preset mapping rule to obtain second-level encrypted data, divide the second-level encrypted data according to a preset division ratio and swap the order to obtain third-level encrypted data, swap characters a and z, and characters q and p in the third-level encrypted data to obtain fourth-level encrypted data, encrypt the fourth-level encrypted data into MAC ciphertext through a 3DES algorithm, and send the large file and MAC ciphertext to the edge computing device in real time through the TLS protocol.

4. A large file secure transmission method as claimed in claim 1, characterized in that: The step S6 is specifically as follows: The edge computing device divides the large file in the memory into a plurality of small files based on the file segmentation size by using GPU hardware acceleration technology, numbers each of the small files in sequence, extracts sub-data from each of the small files based on the data extraction rule and the number, splices each of the sub-data into second spliced ​​data based on each of the numbers and a preset splicing rule, and performs MAC calculation on the second spliced ​​data to obtain a second MAC value; The edge computing device calls the hardware encryption chip, decrypts the MAC ciphertext into fourth-level encrypted data through the 3DES algorithm, swaps the characters a and z, and swaps the characters q and p in the fourth-level encrypted data to obtain third-level encrypted data, divides the third-level encrypted data by the inverse of a preset division ratio and swaps the order to obtain second-level encrypted data, maps each character of the second-level encrypted data according to a preset mapping rule to obtain first-level encrypted data, and decrypts the first-level encrypted data into a first MAC value through the RSA algorithm.

5. A large file secure transmission method as claimed in claim 1, characterized in that: The step S7 is specifically as follows: The edge computing device reads the first MAC value obtained by decryption from the hardware encryption chip, and compares the first MAC value with the calculated second MAC value to see if they are consistent. If so, the integrity check succeeds and the transmission of the large file is completed; if not, the integrity check fails and the received large file and MAC ciphertext are deleted.

6. A large file secure transmission system, characterized by: Includes the following modules: A rule setting module, used to set a file segmentation size and a data extraction rule, and preset the file segmentation size and the data extraction rule to the edge computing device; A large file segmentation module is used to obtain a large file to be transmitted, segment the large file into a plurality of small files based on the file segmentation size, and number each of the small files in sequence; A sub-data extraction and splicing module, used for extracting sub-data from each small file based on the data extraction rule and the number, and splicing each sub-data into first spliced ​​data based on each number; A first MAC value calculation module, configured to perform MAC calculation on the first concatenated data to obtain a first MAC value, encrypt the first MAC value into a MAC ciphertext, and send the large file and the MAC ciphertext to an edge computing device; A file receiving and storing module, used for the edge computing device to receive the large file and the MAC ciphertext, store the large file in the memory in real time, and store the MAC ciphertext in the hardware encryption chip in real time; A second MAC value calculation module is used for the edge computing device to calculate the second spliced ​​data of the large file based on the file segmentation size and the data extraction rule, perform MAC calculation on the second spliced ​​data to obtain a second MAC value, and decrypt the MAC ciphertext through the hardware encryption chip to obtain the first MAC value; An integrity check module, used to perform integrity check on the large file by comparing the first MAC value and the second MAC value, thereby completing the transmission of the large file; In the rule setting module, the data extraction rules are specifically: A data extraction length and a padding character are set, wherein the data extraction length is shorter than the data length of the small file; the data extraction start bit is set to a×3-2, where a is the number of the small file; Sub-data is extracted from the small file with the corresponding number based on the data extraction start bit. When the length of the sub-data is less than the data extraction length, the end of the sub-data is padded with the padding character until the length meets the data extraction length.

7. A large file secure transmission system as claimed in claim 6, characterized in that: The sub-data extraction and splicing module is specifically used for: Extracting sub-data from each small file based on the data extraction rule and the number, and splicing each sub-data into first spliced ​​data based on each number and a preset splicing rule; The splicing rules are specifically: A positive integer b having a value greater than 1 is set, and the sub-data corresponding to the numbers that can divide the positive integer b are sequentially spliced, and then the remaining sub-data corresponding to the numbers are sequentially spliced ​​at the end.

8. A large file secure transmission system as claimed in claim 6, characterized in that: The first MAC value calculation module is specifically used for: Perform MAC calculation on the first spliced ​​data to obtain a first MAC value, encrypt the first MAC value through an RSA algorithm to obtain first-level encrypted data, map each character of the first-level encrypted data through a preset mapping rule to obtain second-level encrypted data, divide the second-level encrypted data according to a preset division ratio and swap the order to obtain third-level encrypted data, swap characters a and z, and characters q and p in the third-level encrypted data to obtain fourth-level encrypted data, encrypt the fourth-level encrypted data into MAC ciphertext through a 3DES algorithm, and send the large file and MAC ciphertext to the edge computing device in real time through the TLS protocol.

9. A large file secure transmission system as claimed in claim 6, characterized in that: The second MAC value calculation module is specifically used for: The edge computing device divides the large file in the memory into a plurality of small files based on the file segmentation size by using GPU hardware acceleration technology, numbers each of the small files in sequence, extracts sub-data from each of the small files based on the data extraction rule and the number, splices each of the sub-data into second spliced ​​data based on each of the numbers and a preset splicing rule, and performs MAC calculation on the second spliced ​​data to obtain a second MAC value; The edge computing device calls the hardware encryption chip, decrypts the MAC ciphertext into fourth-level encrypted data through the 3DES algorithm, swaps the characters a and z, and swaps the characters q and p in the fourth-level encrypted data to obtain third-level encrypted data, divides the third-level encrypted data by the inverse of a preset division ratio and swaps the order to obtain second-level encrypted data, maps each character of the second-level encrypted data according to a preset mapping rule to obtain first-level encrypted data, and decrypts the first-level encrypted data into a first MAC value through the RSA algorithm.

10. A large file secure transmission system as claimed in claim 6, characterized in that: The integrity check module is specifically used for: The edge computing device reads the first MAC value obtained by decryption from the hardware encryption chip, and compares the first MAC value with the calculated second MAC value to see if they are consistent. If so, the integrity check succeeds and the transmission of the large file is completed; if not, the integrity check fails and the received large file and MAC ciphertext are deleted.

Citation Information

Patent Citations

  • Data secure access method used for cloud storage and user terminal system

    CN102664928A

  • Method for generating file verification information, file verifying method and file verifying equipment

    CN103699610A

  • Data encryption method and device

    CN107147616A

  • Data transmission method and device, electronic equipment and storage medium

    CN115801315A

  • Anti-crawler method and device

    CN116366296A