CN113515766A - File transmission method and device - Google Patents

File transmission method and device Download PDF

Info

Publication number
CN113515766A
CN113515766A CN202110872141.2A CN202110872141A CN113515766A CN 113515766 A CN113515766 A CN 113515766A CN 202110872141 A CN202110872141 A CN 202110872141A CN 113515766 A CN113515766 A CN 113515766A
Authority
CN
China
Prior art keywords
file
subfile
subfiles
sequence information
encrypted
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110872141.2A
Other languages
Chinese (zh)
Inventor
李湘河
唐振
张荣华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shengjing Intelligent Technology Jiaxing Co ltd
Original Assignee
Shengjing Intelligent Technology Jiaxing Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shengjing Intelligent Technology Jiaxing Co ltd filed Critical Shengjing Intelligent Technology Jiaxing Co ltd
Priority to CN202110872141.2A priority Critical patent/CN113515766A/en
Publication of CN113515766A publication Critical patent/CN113515766A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/606Protecting data by securing the transmission between two devices or processes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2107File encryption

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a file transmission method and a device, wherein the method comprises the following steps: determining the file size of a file to be transmitted; if the size of the file is larger than a preset value, carrying out fragmentation processing on the file to be transmitted to obtain a plurality of subfiles and generating an encrypted file; the encrypted file is used for storing the sequence information of each subfile; and sending the plurality of subfiles and the encrypted file to a file receiving end so that the file receiving end decrypts the encrypted file, obtains the sequence information of each subfile, and combines the plurality of subfiles based on the sequence information of each subfile. The invention not only can ensure the data security of the file to be transmitted, but also can encrypt the sequence information of each subfile, thereby avoiding the problem that the file transmission efficiency is influenced because the large file is directly encrypted in the traditional method.

Description

File transmission method and device
Technical Field
The present invention relates to the field of file transmission technologies, and in particular, to a file transmission method and apparatus.
Background
With the rapid development of information technology, the application of the internet of things and big data is more and more extensive, and the secure transmission of data becomes more and more important, especially the secure transmission of big files.
At present, the transmission of large files mainly adopts FTP, SFTP, HTTP-based large file fragmentation and other modes. However, some of the file transmission processes are not subjected to security processing, so that the risk of data leakage is caused; some improve the security by encrypting and decrypting the file, for example, the FTP service transmits through the plaintext, the security is low; SFTP uses encryption and decryption to transmit authentication information and data, but the encryption and decryption mode for the whole file reduces the transmission efficiency of the file, and especially aiming at the transmission scene of large files, the efficiency of the mode for improving the security by encrypting and decrypting the file is lower.
Disclosure of Invention
The invention provides a file transmission method and a file transmission device, which are used for overcoming the defect of low file transmission efficiency in the prior art.
The invention provides a file transmission method, which is applied to a file sending end and comprises the following steps:
determining the file size of a file to be transmitted;
if the file size is larger than a preset value, carrying out fragmentation processing on the file to be transmitted to obtain a plurality of subfiles and generating an encrypted file; the encrypted file is used for storing the sequence information of each subfile;
and sending the plurality of subfiles and the encrypted file to a file receiving end so that the file receiving end decrypts the encrypted file, obtains the sequence information of each subfile, and combines the plurality of subfiles based on the sequence information of each subfile.
According to a file transmission method provided by the present invention, the generating of the encrypted file includes:
determining a digest value of each subfile;
generating a list file based on the digest value of each subfile and the sequence information of each subfile, and encrypting the list file to obtain an encrypted file; the summary value of each subfile in the list file is in one-to-one correspondence with the sequence information of each subfile.
The file transmission method provided by the invention further comprises the following steps:
receiving the sequence information of the missing subfiles sent by the file receiving terminal, and sending the corresponding complete subfiles to the file receiving terminal based on the sequence information of the missing subfiles; the missing subfiles are the subfiles of which the file receiving end determines that missing information exists based on the digest values of the subfiles.
According to the file transmission method provided by the invention, the plurality of sub-files are sent to the file receiving terminal in a random sequence.
The file transmission method provided by the invention further comprises the following steps:
and if the size of the file is smaller than or equal to a preset value, encrypting the file to be transmitted, and sending the encrypted file to be transmitted to the file receiving end so that the file receiving end decrypts the encrypted file to be transmitted.
According to the file transmission method provided by the invention, the encrypted file is encrypted and decrypted based on the shared key.
The invention also provides a file transmission method, which is applied to a file receiving end and comprises the following steps:
receiving a plurality of subfiles and encrypted files sent by a file sending end;
decrypting the encrypted file, acquiring the sequence information of each subfile, and merging the plurality of subfiles based on the sequence information of each subfile;
the plurality of subfiles are obtained by carrying out fragmentation processing on the file to be transmitted when the file transmitting end judges that the file size of the file to be transmitted is larger than a preset value, and the encrypted file is used for storing sequence information of each subfile.
According to a file transmission method provided by the present invention, decrypting the encrypted file to obtain the sequence information of each subfile, and merging the plurality of subfiles based on the sequence information of each subfile, includes:
decrypting the encrypted file to obtain the abstract values of the subfiles and the sequence information corresponding to the abstract values;
and judging whether each subfile is a complete file or not based on the abstract value of each subfile, and if so, merging the plurality of subfiles based on the sequence information corresponding to each abstract value.
The file transmission method provided by the invention further comprises the following steps:
and if the missing information of any subfile is judged to exist, the corresponding subfile is used as the missing subfile, and the sequence information of the missing subfile is sent to the file sending terminal, so that the file sending terminal sends the corresponding complete subfile based on the sequence information of the missing subfile.
The invention also provides a file transmission device, which is applied to a file sending end and comprises the following components:
the device comprises a determining unit, a transmitting unit and a receiving unit, wherein the determining unit is used for determining the file size of a file to be transmitted;
the encryption unit is used for carrying out fragmentation processing on the file to be transmitted to obtain a plurality of subfiles and generating an encrypted file if the size of the file is larger than a preset value; the encrypted file is used for storing the sequence information of each subfile;
and the transmission unit is used for sending the plurality of subfiles and the encrypted file to a file receiving end so that the file receiving end decrypts the encrypted file, obtains the sequence information of each subfile, and combines the plurality of subfiles based on the sequence information of each subfile.
The invention also provides a file transmission device, which is applied to a file receiving end and comprises:
the receiving unit is used for receiving a plurality of subfiles and encrypted files sent by the file sending end; a merging unit, configured to decrypt the encrypted file, obtain sequence information of each subfile, and merge the plurality of subfiles based on the sequence information of each subfile;
the plurality of subfiles are obtained by carrying out fragmentation processing on the file to be transmitted when the file transmitting end judges that the file size of the file to be transmitted is larger than a preset value, and the encrypted file is used for storing sequence information of each subfile.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the computer program to realize the steps of any one of the file transmission methods.
The invention also provides a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the file transfer method as any one of the above.
According to the file transmission method and device provided by the invention, if the size of the file to be transmitted is larger than the preset value, the file to be transmitted is subjected to fragmentation processing to obtain a plurality of subfiles, and an encrypted file used for storing the sequence information of each subfile is generated, so that the file receiving end decrypts the encrypted file, obtains the sequence information of each subfile, and combines the plurality of subfiles based on the sequence information of each subfile. The sequence information of each subfile is transmitted to the file receiving end in an encrypted file form, so that the data security of the file to be transmitted can be ensured.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a file transmission method provided by the present invention;
FIG. 2 is a second schematic flow chart of a file transmission method according to the present invention;
FIG. 3 is a schematic structural diagram of a document transportation device according to the present invention;
FIG. 4 is a second schematic structural diagram of a document transportation device according to the present invention;
fig. 5 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
At present, the transmission of large files mainly adopts FTP, SFTP, HTTP-based large file fragmentation and other modes. However, some of the file transmission processes are not subjected to security processing, so that the risk of data leakage is caused; some improve the security by encrypting and decrypting the file, for example, the FTP service transmits through the plaintext, the security is low; SFTP uses encryption and decryption to transmit authentication information and data, but the encryption and decryption mode for the whole file reduces the transmission efficiency of the file, and especially aiming at the transmission scene of large files, the efficiency of the mode for improving the security by encrypting and decrypting the file is lower.
Accordingly, the invention provides a file transmission method. Fig. 1 is a schematic flow diagram of a file transmission method provided by the present invention, and as shown in fig. 1, the method is applied to a file sending end, and includes the following steps:
step 110, determining the file size of a file to be transmitted;
step 120, if the size of the file is larger than a preset value, carrying out fragmentation processing on the file to be transmitted to obtain a plurality of subfiles and generating an encrypted file; the encrypted file is used for storing the sequence information of each subfile;
step 130, sending the plurality of subfiles and the encrypted file to a file receiving end so that the file receiving end decrypts the encrypted file, obtains sequence information of each subfile, and combines the plurality of subfiles based on the sequence information of each subfile.
Specifically, before sending a file to be transmitted to a file receiving end, a file sending end needs to obtain a file size of the file to be transmitted, and if the file size is larger than a preset value (for example, the file size is larger than 10G), it indicates that the file to be transmitted is a large file.
If the large file is directly transmitted to the file receiving end in the conventional method without any security processing, the risk of file data leakage may be caused. If a large file is encrypted at a file sending end and then transmitted to a file receiving end in the traditional method, and then the file receiving end decrypts the large file to obtain an original file, because the file is large, a large amount of resources are consumed in the encryption and decryption processes, and time is consumed, so that the transmission efficiency of the file is affected.
Therefore, if the size of the file is larger than the preset value, the file to be transmitted is subjected to fragmentation processing, so that the file to be transmitted can be divided into a plurality of subfiles. The file sizes of the subfiles may be the same or different, and this is not specifically limited in this embodiment of the present invention.
After a file to be transmitted is divided into a plurality of subfiles, sequence information of each subfile is stored and encrypted to generate an encrypted file. The file sending end can generate an encrypted file based on the shared key, and the encrypted file can be a list file of the digest values of the subfiles and the corresponding sequence information, so that the corresponding sequence information can be quickly and accurately acquired based on the digest values of the subfiles.
And then, the plurality of subfiles and the encrypted file are sent to a file receiving end, so that the file receiving end can decrypt the encrypted file based on the shared key to obtain the sequence information corresponding to each subfile, and then the subfiles are combined in sequence according to the sequence information of each subfile, so that the original file to be transmitted can be obtained. The file sending end may send the subfiles in a random order, or may send the subfiles in a preset order.
Therefore, according to the file transmission method provided by the embodiment of the invention, if the size of the file to be transmitted is larger than the preset value, the file to be transmitted is subjected to fragmentation processing to obtain a plurality of subfiles, and an encrypted file for storing the sequence information of each subfile is generated, so that the file receiving end decrypts the encrypted file, obtains the sequence information of each subfile, and combines the plurality of subfiles based on the sequence information of each subfile. The sequence information of each subfile is transmitted to the file receiving end in an encrypted file form, so that the data security of the file to be transmitted can be ensured.
Based on the above embodiment, generating an encrypted file includes:
determining a digest value of each subfile;
generating a list file based on the digest value of each subfile and the sequence information of each subfile, and encrypting the list file to obtain an encrypted file; the summary value of each subfile in the list file is in one-to-one correspondence with the sequence information of each subfile.
Specifically, after the file to be transmitted is subjected to fragmentation processing to obtain a plurality of subfiles, the digest value of each subfile may be calculated, each digest value is used as the file name of the corresponding subfile, a list file is generated based on the digest value of each subfile and the sequence information of each subfile (e.g., the sequence of the index value of each subfile), and the list file is encrypted to obtain an encrypted file. The list file may be encrypted by using a DES algorithm (Data Encryption Standard), which is not specifically limited in this embodiment of the present invention.
Because the digest values of the subfiles in the list file correspond to the sequence information of the subfiles one to one, after the file receiving end decrypts the encrypted file, the corresponding sequence information can be quickly determined based on the digest values of the subfiles, and then the subfiles are merged based on the sequence information.
Based on any embodiment, receiving the sequence information of the missing subfiles sent by the file receiving terminal, and sending the corresponding complete subfiles to the file receiving terminal based on the sequence information of the missing subfiles; the missing subfiles are the subfiles with missing information determined by the file receiving end based on the abstract values of the subfiles; the digest value of each file is obtained by decrypting the encrypted file by the file receiving end.
Specifically, after receiving the encrypted file, the file receiving end may decrypt the encrypted file based on the shared key to obtain the digest values of the subfiles and the sequence information corresponding to the digest values.
In the process of transmitting each subfile to a file receiving end by a file transmitting end, the subfile may be infected with viruses to cause the incompleteness of the subfile received by the file receiving end, or the incompleteness of the subfile received by the file receiving end due to network transmission failure, so that in order to ensure that a complete file to be transmitted is finally obtained by combination, before combining a plurality of subfiles, whether each subfile is a complete file is judged based on the abstract value of each subfile, if so, the data of each subfile is shown to be complete, and the plurality of subfiles are combined based on the sequence information corresponding to each abstract value, so that the complete file to be transmitted can be obtained, and the phenomenon that the data of the synthesized file is lost is avoided.
If the file receiving terminal judges that any subfile is not a complete file, the file receiving terminal indicates that the subfile data received by the file receiving terminal is lost, at the moment, the file receiving terminal takes the corresponding subfile as a missing subfile and sends the sequence information of the corresponding missing subfile to the file sending terminal, so that the file sending terminal sends the corresponding complete subfile to the file receiving terminal again based on the sequence information of the corresponding missing subfile, and the file receiving terminal can merge the complete subfile and other subfiles to obtain a complete file to be transmitted.
It should be noted that, if the file receiving end determines that any subfile is not a complete file, the information may be recorded and uploaded to the server system, so that the relevant person may locate the reason for analysis. Meanwhile, the file receiving end can delete and isolate the incomplete subfile, so that the data loss of other subfiles caused by the fact that the subfile infects other subfiles is avoided.
According to any of the above embodiments, the plurality of subfiles are sent to the file receiver in a random order.
Specifically, the plurality of subfiles are sent to the file receiving end in a random sequence, so that the subfiles can be prevented from being stolen and decoded in the transmission process, and the data security of the original file to be transmitted is further ensured.
Based on any embodiment above, still include:
and if the size of the file is smaller than or equal to the preset value, encrypting the file to be transmitted, and sending the encrypted file to be transmitted to the file receiving end so that the file receiving end decrypts the encrypted file to be transmitted.
Specifically, if the size of the file is smaller than or equal to a preset value, the file to be transmitted is a small file, if the transmission method of the large file is adopted for the small file, the file is subjected to fragmentation processing, sequence information of each fragmented subfile is encrypted, then each fragmented subfile and the encrypted sequence information are sent to a file receiving end, so that the file receiving end decrypts the encrypted sequence information and then combines each subfile, and the small file is small in size and is also small in fragmentation number, so that a third party can easily crack the small file to obtain the original file to be transmitted based on the small file. If the file is divided into a large number of subfiles, the file size of each subfile is small, and resource waste is caused.
According to any of the above embodiments, the encrypted file is encrypted and decrypted based on the shared key.
Based on any of the above embodiments, the present invention provides a file transmission method, which is applied to a file receiving end, as shown in fig. 2, and the method includes the following steps:
step 210, receiving a plurality of subfiles and encrypted files sent by a file sending end;
step 220, decrypting the encrypted file, acquiring the sequence information of each subfile, and merging the plurality of subfiles based on the sequence information of each subfile;
the plurality of subfiles are obtained after the file sending end carries out fragmentation processing on the file to be transmitted when judging that the file size of the file to be transmitted is larger than a preset value, and the encrypted file is used for storing sequence information of each subfile.
Specifically, after receiving the plurality of subfiles and the encrypted file, the file receiving end may decrypt the encrypted file based on the shared key to obtain the sequence information corresponding to each subfile, and then merge the subfiles in sequence according to the sequence information of each subfile, so as to obtain the original file to be transmitted. The file sending end may send the subfiles in a random order, or may send the subfiles in a preset order.
The file sending end needs to acquire the file size of the file to be transmitted before sending the file to be transmitted to the file receiving end, and if the file size is larger than a preset value (if the file size is larger than 10G), the file to be transmitted is a large file.
Therefore, if the size of the file is larger than the preset value, the file to be transmitted is subjected to fragmentation processing, so that the file to be transmitted can be divided into a plurality of subfiles. The file sizes of the subfiles may be the same or different, and this is not specifically limited in this embodiment of the present invention.
After a file to be transmitted is divided into a plurality of subfiles, sequence information of each subfile is stored and encrypted to generate an encrypted file. The file sending end can generate an encrypted file based on the shared key, and the encrypted file can be a list file of the digest values of the subfiles and the corresponding sequence information, so that the corresponding sequence information can be quickly and accurately acquired based on the digest values of the subfiles.
Therefore, the file transmission method provided by the embodiment of the invention receives a plurality of subfiles and encrypted files sent by a file sending end; the method comprises the steps of decrypting the encrypted file, obtaining sequence information of each subfile, combining a plurality of subfiles based on the sequence information of each subfile, and encrypting the sequence information of each subfile in a form of the encrypted file to a file receiving end, so that the data safety of the file to be transmitted can be guaranteed.
Based on any of the above embodiments, decrypting the encrypted file, obtaining the sequence information of each subfile, and merging the plurality of subfiles based on the sequence information of each subfile includes:
decrypting the encrypted file to obtain the abstract values of the subfiles and the sequence information corresponding to the abstract values;
and judging whether each subfile is a complete file or not based on the abstract value of each subfile, and if so, merging the plurality of subfiles based on the sequence information corresponding to each abstract value.
Specifically, after receiving the encrypted file, the file receiving end may decrypt the encrypted file based on the shared key to obtain the digest values of the subfiles and the sequence information corresponding to the digest values.
In the process of transmitting each subfile to a file receiving end by a file transmitting end, the subfile may be infected with viruses to cause the incompleteness of the subfile received by the file receiving end, or the incompleteness of the subfile received by the file receiving end due to network transmission failure, so that in order to ensure that a complete file to be transmitted is finally obtained by combination, before combining a plurality of subfiles, whether each subfile is a complete file is judged based on the abstract value of each subfile, if so, the data of each subfile is shown to be complete, and the plurality of subfiles are combined based on the sequence information corresponding to each abstract value, so that the complete file to be transmitted can be obtained, and the phenomenon that the data of the synthesized file is lost is avoided.
Based on any embodiment above, still include:
and if the missing information of any subfile is judged to exist, the corresponding subfile is used as the missing subfile, and the sequence information of the missing subfile is sent to the file sending end, so that the file sending end sends the corresponding complete subfile based on the sequence information of the missing subfile.
If the file receiving terminal judges that any subfile is not a complete file, the file receiving terminal indicates that the subfile data received by the file receiving terminal is lost, at the moment, the file receiving terminal takes the corresponding subfile as a missing subfile and sends the sequence information of the corresponding missing subfile to the file sending terminal, so that the file sending terminal sends the corresponding complete subfile to the file receiving terminal again based on the sequence information of the corresponding missing subfile, and the file receiving terminal can merge the complete subfile and other subfiles to obtain a complete file to be transmitted.
The following describes the file transfer device provided by the present invention, and the file transfer device described below and the file transfer method described above may be referred to correspondingly.
Based on any of the above embodiments, the present invention provides a file transmission apparatus, as shown in fig. 3, where the apparatus is applied to a file sending end, and includes:
a determining unit 310, configured to determine a file size of a file to be transmitted;
the encryption unit 320 is configured to perform fragmentation processing on the file to be transmitted to obtain a plurality of subfiles and generate an encrypted file if the size of the file is larger than a preset value; the encrypted file is used for storing the sequence information of each subfile;
the transmission unit 330 is configured to send the plurality of subfiles and the encrypted file to a file receiving end, so that the file receiving end decrypts the encrypted file, obtains sequence information of each subfile, and merges the plurality of subfiles based on the sequence information of each subfile.
According to any of the above embodiments, the encryption unit 320 includes:
the abstract calculation unit is used for determining the abstract value of each subfile;
an encrypted file determining unit, configured to generate a list file based on the digest value of each subfile and the sequence information of each subfile, and encrypt the list file to obtain the encrypted file; the summary value of each subfile in the list file is in one-to-one correspondence with the sequence information of each subfile.
Based on any embodiment above, still include:
the complete subfile sending unit is used for receiving the sequence information of the missing subfile sent by the file receiving terminal and sending the corresponding complete subfile to the file receiving terminal based on the sequence information of the missing subfile; the missing subfiles are the subfiles of which the file receiving end determines that missing information exists based on the digest values of the subfiles.
According to any of the above embodiments, the plurality of subfiles are sent to the file receiving end in a random order.
Based on any embodiment above, still include:
and the small file transmission unit is used for encrypting the file to be transmitted and sending the encrypted file to be transmitted to the file receiving end if the size of the file is smaller than or equal to a preset value, so that the file receiving end decrypts the encrypted file to be transmitted.
According to any one of the above embodiments, the encrypted file is encrypted and decrypted based on a shared key.
The following describes the file transfer device provided by the present invention, and the file transfer device described below and the file transfer method described above may be referred to correspondingly.
Based on any of the above embodiments, the present invention provides a file transmission apparatus, which is applied to a file receiving end, as shown in fig. 4, and the apparatus includes:
a receiving unit 410, configured to receive multiple subfiles and encrypted files sent by a file sending end;
a merging unit 420, configured to decrypt the encrypted file, obtain sequence information of each subfile, and merge the plurality of subfiles based on the sequence information of each subfile;
the plurality of subfiles are obtained by carrying out fragmentation processing on the file to be transmitted when the file transmitting end judges that the file size of the file to be transmitted is larger than a preset value, and the encrypted file is used for storing sequence information of each subfile.
Based on any of the above embodiments, the merging unit 420 includes:
the digest determining unit is used for decrypting the encrypted file and acquiring digest values of the subfiles and sequence information corresponding to the digest values;
and the judging unit is used for judging whether each subfile is a complete file or not based on the abstract value of each subfile, and if so, merging the plurality of subfiles based on the sequence information corresponding to each abstract value.
Based on any embodiment above, still include:
and the missing information sending unit is used for taking the corresponding subfile as the missing subfile and sending the sequence information of the missing subfile to the file sending end if the missing information of any subfile is judged to exist, so that the file sending end sends the corresponding complete subfile based on the sequence information of the missing subfile.
Fig. 5 is a schematic structural diagram of an electronic device provided in the present invention, and as shown in fig. 5, the electronic device may include: a processor (processor)510, a memory (memory)520, a communication Interface (Communications Interface)530, and a communication bus 540, wherein the processor 510, the memory 520, and the communication Interface 530 communicate with each other via the communication bus 540. Processor 510 may invoke logic instructions in memory 520 to perform a file transfer method comprising: determining the file size of a file to be transmitted; if the file size is larger than a preset value, carrying out fragmentation processing on the file to be transmitted to obtain a plurality of subfiles and generating an encrypted file; the encrypted file is used for storing the sequence information of each subfile; and sending the plurality of subfiles and the encrypted file to a file receiving end so that the file receiving end decrypts the encrypted file, obtains the sequence information of each subfile, and combines the plurality of subfiles based on the sequence information of each subfile.
In addition, the logic instructions in the memory 520 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the file transfer method provided by the above methods, the method comprising: determining the file size of a file to be transmitted; if the file size is larger than a preset value, carrying out fragmentation processing on the file to be transmitted to obtain a plurality of subfiles and generating an encrypted file; the encrypted file is used for storing the sequence information of each subfile; and sending the plurality of subfiles and the encrypted file to a file receiving end so that the file receiving end decrypts the encrypted file, obtains the sequence information of each subfile, and combines the plurality of subfiles based on the sequence information of each subfile.
In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium having stored thereon a computer program, which when executed by a processor is implemented to perform the file transfer methods provided above, the method including: determining the file size of a file to be transmitted; if the file size is larger than a preset value, carrying out fragmentation processing on the file to be transmitted to obtain a plurality of subfiles and generating an encrypted file; the encrypted file is used for storing the sequence information of each subfile; and sending the plurality of subfiles and the encrypted file to a file receiving end so that the file receiving end decrypts the encrypted file, obtains the sequence information of each subfile, and combines the plurality of subfiles based on the sequence information of each subfile.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A file transmission method is applied to a file sending end and comprises the following steps:
determining the file size of a file to be transmitted;
if the file size is larger than a preset value, carrying out fragmentation processing on the file to be transmitted to obtain a plurality of subfiles and generating an encrypted file; the encrypted file is used for storing the sequence information of each subfile;
and sending the plurality of subfiles and the encrypted file to a file receiving end so that the file receiving end decrypts the encrypted file, obtains the sequence information of each subfile, and combines the plurality of subfiles based on the sequence information of each subfile.
2. The file transmission method according to claim 1, wherein the generating an encrypted file includes:
determining a digest value of each subfile;
generating a list file based on the digest value of each subfile and the sequence information of each subfile, and encrypting the list file to obtain an encrypted file; the summary value of each subfile in the list file is in one-to-one correspondence with the sequence information of each subfile.
3. The file transfer method according to claim 2, further comprising:
receiving the sequence information of the missing subfiles sent by the file receiving terminal, and sending the corresponding complete subfiles to the file receiving terminal based on the sequence information of the missing subfiles; the missing subfiles are the subfiles of which the file receiving end determines that missing information exists based on the digest values of the subfiles.
4. The file transmission method according to any one of claims 1 to 3, wherein the plurality of subfiles are transmitted to the file receiver in a random order.
5. The file transfer method according to any one of claims 1 to 3, further comprising:
and if the size of the file is smaller than or equal to a preset value, encrypting the file to be transmitted, and sending the encrypted file to be transmitted to the file receiving end so that the file receiving end decrypts the encrypted file to be transmitted.
6. A file transmission method is applied to a file receiving end and comprises the following steps:
receiving a plurality of subfiles and encrypted files sent by a file sending end;
decrypting the encrypted file, acquiring the sequence information of each subfile, and merging the plurality of subfiles based on the sequence information of each subfile;
the plurality of subfiles are obtained by carrying out fragmentation processing on the file to be transmitted when the file transmitting end judges that the file size of the file to be transmitted is larger than a preset value, and the encrypted file is used for storing sequence information of each subfile.
7. The file transmission method according to claim 6, wherein the decrypting the encrypted file, obtaining the sequence information of each subfile, and merging the plurality of subfiles based on the sequence information of each subfile comprises:
decrypting the encrypted file to obtain the abstract values of the subfiles and the sequence information corresponding to the abstract values;
and judging whether each subfile is a complete file or not based on the abstract value of each subfile, and if so, merging the plurality of subfiles based on the sequence information corresponding to each abstract value.
8. The file transfer method according to claim 7, further comprising:
and if the missing information of any subfile is judged to exist, the corresponding subfile is used as the missing subfile, and the sequence information of the missing subfile is sent to the file sending terminal, so that the file sending terminal sends the corresponding complete subfile based on the sequence information of the missing subfile.
9. A file transmission device is applied to a file sending end and comprises:
the device comprises a determining unit, a transmitting unit and a receiving unit, wherein the determining unit is used for determining the file size of a file to be transmitted;
the encryption unit is used for carrying out fragmentation processing on the file to be transmitted to obtain a plurality of subfiles and generating an encrypted file if the size of the file is larger than a preset value; the encrypted file is used for storing the sequence information of each subfile;
and the transmission unit is used for sending the plurality of subfiles and the encrypted file to a file receiving end so that the file receiving end decrypts the encrypted file, obtains the sequence information of each subfile, and combines the plurality of subfiles based on the sequence information of each subfile.
10. A file transmission device is applied to a file receiving end and comprises:
the receiving unit is used for receiving a plurality of subfiles and encrypted files sent by the file sending end;
a merging unit, configured to decrypt the encrypted file, obtain sequence information of each subfile, and merge the plurality of subfiles based on the sequence information of each subfile;
the plurality of subfiles are obtained by carrying out fragmentation processing on the file to be transmitted when the file transmitting end judges that the file size of the file to be transmitted is larger than a preset value, and the encrypted file is used for storing sequence information of each subfile.
CN202110872141.2A 2021-07-30 2021-07-30 File transmission method and device Pending CN113515766A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110872141.2A CN113515766A (en) 2021-07-30 2021-07-30 File transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110872141.2A CN113515766A (en) 2021-07-30 2021-07-30 File transmission method and device

Publications (1)

Publication Number Publication Date
CN113515766A true CN113515766A (en) 2021-10-19

Family

ID=78068992

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110872141.2A Pending CN113515766A (en) 2021-07-30 2021-07-30 File transmission method and device

Country Status (1)

Country Link
CN (1) CN113515766A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113949511A (en) * 2021-10-25 2022-01-18 浙江绿色慧联有限公司 Information encryption method
CN114172900A (en) * 2022-02-11 2022-03-11 北京安帝科技有限公司 File transmission method and system based on unidirectional network gate
CN114363321A (en) * 2021-12-30 2022-04-15 支付宝(杭州)信息技术有限公司 File transmission method, equipment and system
CN116668004A (en) * 2023-05-12 2023-08-29 深圳市晶存科技有限公司 Method and device for rapidly identifying abnormal information and storage medium thereof

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101035253A (en) * 2006-11-14 2007-09-12 北京中星微电子有限公司 Encryption or decryption implementing method, device and system
US20140369499A1 (en) * 2013-06-12 2014-12-18 Kabushiki Kaisha Toshiba Cryptographic device, cryptographic processing method, and cryptographic processing program
JP2015069191A (en) * 2013-10-01 2015-04-13 富士電機株式会社 Information processing device, and encryption method
CN107153794A (en) * 2016-03-03 2017-09-12 腾讯科技(深圳)有限公司 File encrypting method and device, file decryption method and apparatus
US10769126B1 (en) * 2017-09-22 2020-09-08 Amazon Technologies, Inc. Data entropy reduction across stream shard
US10986494B1 (en) * 2019-10-18 2021-04-20 Capital One Services, Llc Multi cell phone tower information transfer security
CN113032357A (en) * 2021-04-29 2021-06-25 中国工商银行股份有限公司 File storage method and device and server

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101035253A (en) * 2006-11-14 2007-09-12 北京中星微电子有限公司 Encryption or decryption implementing method, device and system
US20140369499A1 (en) * 2013-06-12 2014-12-18 Kabushiki Kaisha Toshiba Cryptographic device, cryptographic processing method, and cryptographic processing program
JP2015069191A (en) * 2013-10-01 2015-04-13 富士電機株式会社 Information processing device, and encryption method
CN107153794A (en) * 2016-03-03 2017-09-12 腾讯科技(深圳)有限公司 File encrypting method and device, file decryption method and apparatus
US10769126B1 (en) * 2017-09-22 2020-09-08 Amazon Technologies, Inc. Data entropy reduction across stream shard
US10986494B1 (en) * 2019-10-18 2021-04-20 Capital One Services, Llc Multi cell phone tower information transfer security
CN113032357A (en) * 2021-04-29 2021-06-25 中国工商银行股份有限公司 File storage method and device and server

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
胡汉平: "《湖北科学技术出版社》", 《湖北科学技术出版社》, pages: 131 - 136 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113949511A (en) * 2021-10-25 2022-01-18 浙江绿色慧联有限公司 Information encryption method
CN114363321A (en) * 2021-12-30 2022-04-15 支付宝(杭州)信息技术有限公司 File transmission method, equipment and system
CN114172900A (en) * 2022-02-11 2022-03-11 北京安帝科技有限公司 File transmission method and system based on unidirectional network gate
CN116668004A (en) * 2023-05-12 2023-08-29 深圳市晶存科技有限公司 Method and device for rapidly identifying abnormal information and storage medium thereof
CN116668004B (en) * 2023-05-12 2024-05-07 深圳市晶存科技有限公司 Method and device for rapidly identifying abnormal information and storage medium thereof

Similar Documents

Publication Publication Date Title
CN113515766A (en) File transmission method and device
CN109309685B (en) Information transmission method and device
CN109194625B (en) Client application protection method and device based on cloud server and storage medium
CN101640682B (en) Method for improving safety of Web service
CN113268715A (en) Software encryption method, device, equipment and storage medium
US20220360441A1 (en) Data encryption and decryption method, device, storage medium and encrypted file
CN113806772A (en) Information encryption transmission method and device based on block chain
CN111131300B (en) Communication method, terminal and server
CN110690956B (en) Bidirectional authentication method and system, server and terminal
CN110611670A (en) API request encryption method and device
CN114143082B (en) Encryption communication method, system and device
CN111600829A (en) Secure communication method and system for Internet of things equipment
CN109729000B (en) Instant messaging method and device
CN111786777B (en) Stream data encryption and decryption method, device, system and storage medium
CN111970114A (en) File encryption method, system, server and storage medium
CN113726743B (en) Method, device, equipment and medium for detecting network replay attack
CN114793184A (en) Security chip communication method and device based on third-party key management node
CN108141353A (en) The method and apparatus of cryptographic algorithm upgrading
CN112261002B (en) Data interface docking method and device
CN112613070A (en) Resource sharing method, resource access method, electronic device and computer readable storage medium
CN112738037A (en) Data encryption communication method
CN111382451A (en) Security level identification method and device, electronic equipment and storage medium
CN114169013B (en) User registration and verification method and system
CN115766119A (en) Communication method, communication apparatus, communication system, and storage medium
US10686592B1 (en) System and method to provide a secure communication of information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination