WO2022100498A1 - 一种文件传输方法及装置 - Google Patents

一种文件传输方法及装置 Download PDF

Info

Publication number
WO2022100498A1
WO2022100498A1 PCT/CN2021/128479 CN2021128479W WO2022100498A1 WO 2022100498 A1 WO2022100498 A1 WO 2022100498A1 CN 2021128479 W CN2021128479 W CN 2021128479W WO 2022100498 A1 WO2022100498 A1 WO 2022100498A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
transmission
client
background server
key
Prior art date
Application number
PCT/CN2021/128479
Other languages
English (en)
French (fr)
Inventor
张晓明
陈林
杨森
张飞
朱晔
Original Assignee
中国银联股份有限公司
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 中国银联股份有限公司 filed Critical 中国银联股份有限公司
Publication of WO2022100498A1 publication Critical patent/WO2022100498A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3297Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving time stamps, e.g. generation of time stamps

Definitions

  • the present application relates to the field of network technologies, and in particular, to a file transmission method and device.
  • the client uploads a file: select a specific file on the client, click upload, and the client reads the file into an I/O byte stream and transmits it to the background server; the background server receives the byte stream, parses the business content, Save the file into the database; the client downloads the file: the client receives the operation instruction of the user clicking the export button, generates the export file instruction according to the operation instruction, and sends the export file instruction to the background server; after receiving the export file instruction, the background server reads the corresponding The business data is written to the file under the specified path in the form of byte stream; the user clicks the download button to download the file generated by the background server and under the specified path to the local.
  • this file transfer method requires high network bandwidth, requires a long transmission time, and has low transmission efficiency.
  • the interceptor can easily read the content of the data file. Less secure.
  • Embodiments of the present application provide a file transmission method and device, so as to improve the security of file transmission.
  • an embodiment of the present application provides a file transmission method, the method includes:
  • the background server Based on the file export request sent by the client, the background server generates the first transmission key and the first transmission identification used for this transmission for the client, and sends the first transmission key and the first transmission identification to the client; the background server obtains the export file based on the file name of the export file requested by the client; the background server encrypts and compresses the export file by using the first transmission key, obtaining a first compressed file; the background server encodes the first compressed file according to a preset reorganization rule to obtain a first reorganized file; the background server will carry the first transmission identifier of the first The reconstituted file is sent to the client.
  • the background server receives the file export request sent by the client, generates the first transmission key and the first transmission identification used for this transmission for the client, and sends the first transmission key and the first transmission identification to the client.
  • the client and the background server encrypt and compress the exported file by using the first transmission key.
  • the client and the background server form a 'contract', and the files sent by the background server to the client can only be successfully decompressed and obtained through the first transmission key and the first transmission identifier. If the first transmission key and the first transmission identifier are used, the export file cannot be obtained, which effectively improves the security of file transmission. And compressing the file can reduce the network bandwidth required in the file transmission process and speed up the transmission efficiency.
  • the background server encodes the first compressed file to obtain the encoded first recombined file, so that the first recombined file only contains a string without any regularity. In this way, even if the character string is intercepted by a hacker, the hacker cannot determine the file type to which the character string belongs, which further improves the security of file transmission.
  • the background server Based on the file import request sent by the client, the background server generates a second transmission key and a second transmission identifier used for this transmission for the client, and sends the second transmission key to the client. and the second transmission identifier are sent to the client; the background server receives the second reorganization file that is sent by the client and carries the second transmission identifier; the background server, according to the reorganization rule, The second reorganized file is decoded to obtain a second compressed file; the background server uses the second transmission key to decompress the second compressed file to obtain an import file and store the import file.
  • the background server generates the second transmission key and the second transmission identification for the client based on the file import request sent by the client, and sends the second transmission key and the second transmission identification to the client. end.
  • the client and the background server form a 'contract'
  • the background server receives the import file sent by the client, and can only successfully decompress and obtain the import file through the second transmission key and the second transmission identifier. That is, if the background server does not have the reorganization rule, the second reorganized file cannot be successfully decoded, and if there is no second transmission key and second transmission identifier, the second compressed file cannot be successfully decrypted and decompressed. Also improves the security of file transfers between the client and the background server.
  • the reorganization rule is: according to the preset coding rule, convert each first code word in the compressed file into each second code word in sequence; wherein, the first code word is composed of a first preset length.
  • the second code word is composed of characters of a second preset length; the first preset length is different from the second preset length.
  • the first transmission key and the first transmission identification are generated in the following manner: the first transmission identification is obtained according to the timestamp and the random number of the first fixed number of digits; the random number is obtained through the universal unique identification
  • the first transmission key is a unique identification code with a second fixed number of digits generated by the universal unique identification code.
  • the background server when the background server receives the file export request or the file import request sent by the client, it will generate a private key correspondingly, that is, the first transmission key and the first transmission identifier, or the second transmission key and the second transmission key. ID; this private key is stored in the cache and sent to the client.
  • the client or the background server is made to perform file transfer according to the private key, and the transmission identifier of the private key matches the private key of the cache area of the background server or client, and the transmission key of the private key of the cache area of the background server or client is obtained. Decrypt to improve the security of file transfer.
  • the private key is based on timestamp and random number, that is, the time sequence of the private key is recorded, and when the client concurrently requests the private key, the random numbers of multiple private keys with the same timestamp are different, which can prevent the client and the backend.
  • the server's concurrent file transfers send confusion.
  • an embodiment of the present application provides a file transmission method, the method comprising:
  • the client sends a file export request to the background server; the client receives the first transmission key and the first transmission identifier used by the background server to generate this transmission; the client receives the the first reorganized file identified by the first transmission; the client decodes the first reorganized file according to a preset reorganization rule to obtain a first compressed file; the client uses the first transmission secret key, decompress the first compressed file, obtain an export file, and store the export file.
  • the first reorganized file is decoded according to a preset reorganization rule. That is, since the first reorganized file is a string without any regularity. Even if the string is intercepted by a hacker, the hacker cannot determine the file type to which the string belongs. Only clients with matching reorganization rules with the backend server can decode the first reorganized file correspondingly, improving the security of file transmission.
  • the client Before receiving the first reorganized file, the client receives the first transmission key and the first transmission identifier sent by the background server. In this way, the client and the background server form a 'contract', and the client can obtain the export file by decompressing the first compressed file through the first transmission key. In this way, after the illegal user intercepts the file, because there is no first transmission key and first transmission identifier, the export file cannot be obtained, which effectively improves the security of file transmission.
  • the client sends a file import request to the background server; the client receives the second transmission key and the second transmission identifier used for this transmission generated by the background server; the client uses The second transmission key encrypts and compresses the imported file to obtain a second compressed file; the client encodes the second compressed file according to a preset reorganization rule to obtain a second reorganized file; The client sends the second reorganized file carrying the second transmission identifier to the background server.
  • the client receives the second transmission key and the second transmission identifier sent by the backend server and sends them to the client, so that the client and the backend server form a 'contract', and the client receives the second transmission key and the second transmission identifier according to the second transmission key and the second transmission identifier.
  • the imported file is encrypted and compressed; therefore, after the illegal user intercepts the file, because there is no second transmission key and second transmission identifier, the imported file cannot be obtained, which effectively improves the security of file transmission. And compressing the file can reduce the network bandwidth required in the file transmission process and speed up the transmission efficiency.
  • the client encodes the second compressed file to obtain the encoded second reorganized file, so that the second reorganized file only contains a string of character strings without any regularity.
  • the hacker cannot determine the file type to which the character string belongs, which further improves the security of file transmission.
  • an embodiment of the present application provides a file transmission device, the device comprising:
  • a transceiver module configured to generate a first transmission key and a first transmission identifier used in this transmission for the client based on the file export request sent by the client, and convert the first transmission key and the first transmission sending the transmission identifier to the client;
  • a file export module used for obtaining the export file based on the file name of the export file requested by the client
  • a compression and decompression module configured to encrypt and compress the export file by using the first transmission key to obtain a first compressed file
  • an encoding and decoding module configured to encode the first compressed file according to a preset reorganization rule to obtain a first reorganized file
  • the transceiver module is further configured to send the first reorganized file carrying the first transmission identifier to the client.
  • an embodiment of the present application provides a file transmission device, the device comprising:
  • the transceiver module is used to send the file export request to the background server;
  • the transceiver module is further configured to receive the first transmission key and the first transmission identifier used by the background server to generate this transmission;
  • the transceiver module is further configured to receive the first reorganized file that carries the first transmission identifier and is sent by the background server;
  • an encoding and decoding module configured to decode the first reorganized file according to the reorganization rule to obtain a first compressed file
  • a compression and decompression module configured to use the first transmission key to decompress the first compressed file to obtain an export file and store the export file.
  • an embodiment of the present application further provides a computing device, including: a memory for storing a program; a processor for calling a program stored in the memory, and executing the first and second aspects according to the obtained program
  • a computing device including: a memory for storing a program; a processor for calling a program stored in the memory, and executing the first and second aspects according to the obtained program
  • embodiments of the present application further provide a computer-readable non-volatile storage medium, including a computer-readable program, when the computer reads and executes the computer-readable program, the computer is made to execute the first aspect and The method described in various possible designs of the second aspect.
  • FIG. 1 is a schematic structural diagram of a file transmission provided by an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a file transmission method provided by an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a file transmission method provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a file transmission method provided by an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of a file transmission method provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of a file transmission device according to an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a file transmission apparatus according to an embodiment of the present application.
  • FIG. 1 is a system architecture for file transfer provided by an embodiment of the present application.
  • the background server 101 can perform file transfer with clients such as the server 102, the computer 103, the tablet 104, and the mobile phone 105.
  • the client shown in FIG. 1 is only As an example, it does not limit the client.
  • the mobile phone 105 is used as an example as a client.
  • the same or matching reorganization rules are set between the mobile phone 105 and the background server 101 .
  • the mobile phone 105 needs to obtain the export file from the background server 101, it sends a file export request to the background server 101.
  • the background server 101 After receiving the file export request sent by the mobile phone 105, the background server 101 generates a first transmission key for the file export request of the mobile phone 105.
  • the mobile phone 105 sends the file name of the export file to the background server 101, and the background server 101 exports the file according to the file name of the export file, and encrypts and compresses the export file according to the first transmission key to obtain the first compressed file, and further according to the The reorganization rule reorganizes the obtained reorganized file from the first compressed file.
  • the background server 101 sends the first reorganized file to the mobile phone 105 .
  • the mobile phone 105 After receiving the first reorganization file, the mobile phone 105 obtains the first compressed file according to the reorganization rule, further obtains the first transmission key from the buffer area according to the first transmission identifier in the first reorganization file, and pairs the first transmission key according to the first transmission key.
  • a compressed file is decrypted and decompressed to obtain the export file.
  • the mobile phone 105 When the mobile phone 105 needs to send the import file to the background server 101, the mobile phone 105 sends the file import request to the background server 101, and the background server 101 generates a second transmission key and a second transmission identifier for the file import request, and the first The second transmission key and the second transmission identification are stored in the buffer area, and the second transmission key and the second transmission identification are sent to the mobile phone 105 .
  • the mobile phone 105 encrypts and compresses the imported file according to the second transmission key, obtains the second compressed file, reorganizes the second compressed file according to the reorganization rule to obtain the second reorganized file, and sends the second reorganized file to the background server 101 .
  • the background server 101 receives the second reorganized file, reorganizes the second reorganized file according to the reorganization rule to obtain a second compressed file, and stores the second compressed file and the second transmission identifier corresponding to the second compressed file for subsequent Obtain a corresponding second transmission key according to the second transmission identifier, and decrypt and decompress the second compressed file.
  • the files transmitted between the mobile phone 105 and the background server 101 are compressed files, network resources are saved and the transmission speed is accelerated; and because the files are encrypted and compressed, and the compressed files are reorganized, the efficiency of file transmission is improved. safety.
  • an embodiment of the present application provides a flow of a file transmission method, as shown in FIG. 2 , including:
  • Step 201 Based on the file export request sent by the client, the background server generates the first transmission key and the first transmission identification used for this transmission for the client, and converts the first transmission key and the first transmission sending the transmission identifier to the client;
  • each file export request will have a unique first transmission key and a first transmission identifier that belong to the request.
  • the client can initiate multiple file export requests at the same time, and because each request has its unique first transfer key and first transfer identifier, the client and the background server can concurrently process these multiple file export requests , without confusion.
  • Step 202 the background server obtains the export file based on the file name of the export file requested by the client;
  • the export file may be a document, a picture, an audio file, etc., and the form of the file is not specifically limited here.
  • Step 203 the background server encrypts and compresses the export file using the first transmission key to obtain a first compressed file
  • Step 204 The background server encodes the first compressed file according to a preset reorganization rule to obtain a first reorganized file
  • Step 205 The background server sends the first reorganized file carrying the first transmission identifier to the client.
  • the background server receives the file export request sent by the client, generates the first transmission key and the first transmission identification used for this transmission for the client, and sends the first transmission key and the first transmission identification to the client.
  • the client and the background server encrypt and compress the exported file by using the first transmission key.
  • the client and the background server form a 'contract', and the files sent by the background server to the client can only be successfully decompressed and obtained through the first transmission key and the first transmission identifier. If the first transmission key and the first transmission identifier are used, the export file cannot be obtained, which effectively improves the security of file transmission. And compressing the file can reduce the network bandwidth required in the file transmission process and speed up the transmission efficiency.
  • the background server encodes the first compressed file, and obtains the encoded first reorganized file, so that the first reorganized file only contains a string without any regularity. In this way, even if the character string is intercepted by a hacker, the hacker cannot determine the file type to which the character string belongs, which further improves the security of file transmission.
  • the embodiment of the present application also provides a method for file transmission, wherein the background server generates a second transmission key and a second transmission identifier used for this transmission for the client based on a file import request sent by the client , and send the second transmission key and the second transmission identifier to the client; the background server receives the second reorganization file that carries the second transmission identifier sent by the client; the The background server decodes the second reorganized file according to the reorganization rule to obtain a second compressed file; the background server uses the second transmission key to decompress the second compressed file to obtain an import file and store the import file.
  • the client needs to import a file, it will first send a file import request to the background server, and the background server generates a second transmission key and a second transmission identifier corresponding to the file import request according to the file import request. That is, each file import request will have a unique second transmission key and second transmission identifier that belong to the request. Therefore, the client can initiate multiple file import requests at the same time, and because each request has its unique second transfer key and second transfer identifier, the client and the background server can concurrently process these multiple file import requests , without confusion.
  • the client can encrypt and compress the imported file according to the second transmission key to obtain a second compressed file, and compress the second file according to the reorganization rule.
  • the file is reorganized to obtain a second reorganized file.
  • the background server obtains the second compressed file according to the reorganization rule, and further decrypts and decompresses the second compressed file according to the second transmission key, and obtains the imported file for storage; or
  • the second compressed file is directly stored. In this way, the imported file is stored in the form of an encrypted and compressed second compressed file.
  • the background server needs to obtain the import file, it can obtain the second transfer key corresponding to the import file from the buffer area or the record of the transfer ID and the transfer key according to the second transfer identifier corresponding to the import file, The second transmission key decompresses the second compressed file to obtain the import file.
  • An embodiment of the present application provides a reorganization rule.
  • the reorganization rule is: according to a preset encoding rule, sequentially converting each first code word in a compressed file into each second code word; wherein, the first code word is composed of characters of a first preset length; the second code word is composed of characters of a second preset length; the first preset length is different from the second preset length. That is to say, the first code word of the compressed file is sequentially converted into the second code word, so that the compressed file property of the compressed file is eliminated, and the converted compressed file 'looks' is just a string of meaningless strings , neither the content of the file nor the string as a compressed file can be obtained.
  • the security of file transmission can be greatly improved.
  • the reorganization rule which can encode the first encoded word in the compressed file from high to low according to the byte stream, in a group of three first encoded words, to encode the three first encoded words.
  • the word is converted into an eight-bit binary string of the first preset length according to the corresponding ASCII code, and a twenty-four-bit binary string is obtained, and the string is sequentially placed in a buffer of twenty-four characters;
  • the first code word in the compressed file is less than three bytes, fill with zeros and put it into the buffer; when encoding, take six characters of the second preset length each time from the 24-character buffer.
  • a second code word is obtained by mapping according to a special code output table reserved in advance in the system (the code table may be a code table obtained according to the Base64 encoding method).
  • the twenty-four characters in the twenty-four-character buffer can sequentially output four second code words in total, and finally convert all the first code words in the compressed file into second code words to obtain a reorganized file.
  • Three second code words Three second code words.
  • the reorganization rules in the above examples are just an implementation manner, and do not limit the reorganization rules.
  • the reorganization rules can also be written by the staff themselves. In this way, the special encoding output table is customized, which further enhances the security of file transmission.
  • An embodiment of the present application provides a method for generating a secret key, wherein a first transmission secret key and a first transmission identifier are generated in the following manner: the first transmission identifier is obtained according to a timestamp and a random number of a first fixed number of digits; The random number is generated through a universal unique identification code; the first transmission key is a unique identification code with a second fixed number of digits generated through the universal unique identification code.
  • the first transmission key may be stored as a key value, and the first transmission identifier may be stored as a primary key.
  • the first transmission identifier is carried for transmission, and the client or the background server can obtain the first transmission key from the record according to the first transmission identifier to decrypt and decompress the compressed file.
  • the first transmission identifier uses the timestamp and the random number as the main keys, that is, the chronological order of the private key is recorded, and when the client concurrently requests the private key, the random numbers of multiple private keys with the same timestamp are different, which can make the background server even Multiple transmission identifiers and transmission keys are generated at the same time, and the multiple transmission identifiers and transmission keys are also different from each other.
  • concurrent file transfers of the client and the background server are prevented from sending confusion.
  • an embodiment of the present application provides a process of a file transmission method, as shown in FIG. 3 , including:
  • Step 301 the client sends a file export request to the background server
  • Step 302 the client receives the first transmission key and the first transmission identifier used by the background server to generate this transmission;
  • Step 303 the client receives the first reorganization file that carries the first transmission identifier and is sent by the background server;
  • Step 304 the client decodes the first reorganized file according to the reorganization rule to obtain a first compressed file
  • Step 305 The client uses the first transmission key to decompress the first compressed file, obtains an export file, and stores the export file.
  • the first reorganized file is decoded according to a preset reorganization rule. That is, since the first reorganized file is a string without any regularity. Even if the string is intercepted by a hacker, the hacker cannot determine the file type to which the string belongs. Only clients with matching reorganization rules with the backend server can decode the first reorganized file correspondingly, improving the security of file transmission.
  • the client Before receiving the first reorganized file, the client receives the first transmission key and the first transmission identifier sent by the background server. In this way, the client and the background server form a 'contract', and the client can obtain the export file by decompressing the first compressed file through the first transmission key. In this way, after the illegal user intercepts the file, because there is no first transmission key and first transmission identifier, the export file cannot be obtained, which effectively improves the security of file transmission.
  • the embodiment of the present application also provides a file transmission and transmission, including: the client sends a file import request to the background server; the client receives a second transmission key generated by the background server and used for this transmission and the second transmission identifier; the client uses the second transmission key to encrypt and compress the imported file to obtain a second compressed file; the client compresses the second compressed file according to a preset reorganization rule
  • the file is encoded to obtain a second reorganized file; the client sends the second reorganized file carrying the second transmission identifier to the background server.
  • the client receives the second transmission key and the second transmission identifier sent by the background server and sends them to the client, and the client can encrypt and compress the imported file according to the second transmission key and the second transmission identifier; even if the illegal user intercepts the file, , because there is no second transmission key and second transmission identifier, the import file cannot be obtained, which effectively improves the security of file transmission. And compressing the file can reduce the network bandwidth required in the file transmission process and speed up the transmission efficiency.
  • the client encodes the second compressed file to obtain the encoded second reorganized file, so that the second reorganized file only contains a string of character strings without any regularity. In this way, even if the character string is intercepted by a hacker, the hacker cannot determine the file type to which the character string belongs, which further improves the security of file transmission.
  • an embodiment of the present application also provides a process of a file transmission method, as shown in FIG. 4 , including:
  • Step 401 The client sends the file export request generated according to the client identifier to the background server.
  • Step 402 after receiving the file export request, the background server generates a first transmission identifier, a first transmission secret key, and a public key; the first transmission identifier and the first transmission secret key are stored in the cache area, or the first transmission identifier and the first transmission secret key are stored in the cache area.
  • the first transmission key is recorded in the transmission identifier and transmission key record corresponding to the file export request.
  • Step 403 The background server sends the first transmission identifier and the first transmission secret key to the client.
  • Step 404 after the client receives the first transmission identification and the first transmission secret key, stores the first transmission identification and the first transmission secret key, and sends the file name of the exported file to the background server, where the background server receives the After the file name of the export file is exported, the file name of the exported file may be stored corresponding to the first transmission identifier and the first transmission key.
  • Step 405 The background server determines the export file according to the file name of the export file, encrypts and compresses the export file according to the first transmission secret key and the public key, obtains the first compressed file, and further compresses the first compressed file according to the reorganization rule. Convert to the first restructured file.
  • Step 406 The background server sends the first reorganized file to the client.
  • Step 407 after the client receives the first reorganized file, converts the first reorganized file into a first compressed file according to the reorganization rule, and determines the corresponding first transmission key according to the first transmission identifier, and determines the corresponding first transmission key according to the first transmission key and
  • the public key generated by the client decrypts and decompresses the first compressed file to obtain an export file.
  • step 404 may not be executed, and in step 402, the background server may transfer the first transmission identifier and the first transmission secret.
  • the key is stored corresponding to the file name of the export file.
  • the storage manner of the first transmission identifier and the first transmission key is not specifically limited here. It is only necessary to make a one-to-one correspondence between the file export request and the first transmission identifier and the first transmission key.
  • an embodiment of the present application also provides a process of a file transmission method, as shown in FIG. 5 , including:
  • Step 501 The client sends the file import request generated according to the client identifier to the background server.
  • Step 502 after receiving the file import request, the background server generates a second transmission identifier, a second transmission secret key, and a public key; the second transmission identifier and the second transmission secret key are stored in the cache area, or the second transmission identifier and the second transmission secret key are stored in the cache area.
  • the second transmission key is recorded in the transmission identification and transmission key records corresponding to the file export request.
  • Step 503 The background server sends the second transmission identifier and the second transmission key to the client.
  • Step 504 after the client receives the second transmission identifier and the second transmission secret key, stores the second transmission identifier and the second transmission secret key, and performs the import file according to the second transmission secret key and the public key generated by the client.
  • the second compressed file is obtained by encrypting and compressing, and the second compressed file is converted into the second reorganized file according to the reorganization rule.
  • Step 505 The client sends the second reorganized file to the background server.
  • Step 506 After receiving the second reorganized file, the background server converts the second reorganized file into a second compressed file for storage according to the reorganization rule.
  • the second reorganized file can be determined according to the second transmission identifier corresponding to the imported file.
  • the transmission secret key and the public key are used to decompress and decrypt the second compressed file to obtain the imported file.
  • FIG. 6 is a schematic diagram of a file transmission device provided by an embodiment of the present application, as shown in FIG. 6 , including:
  • the transceiver module 601 is configured to generate a first transmission key and a first transmission identifier used in this transmission for the client based on the file export request sent by the client, and convert the first transmission key and the first transmission A transmission identifier is sent to the client;
  • a file export module 602 configured to obtain the export file based on the file name of the export file requested by the client;
  • a compression and decompression module 603, configured to encrypt and compress the export file using the first transmission key to obtain a first compressed file
  • An encoding and decoding module 604 configured to encode the first compressed file according to a preset reorganization rule to obtain a first reorganized file
  • the transceiver module 601 is further configured to send the first reorganized file carrying the first transmission identifier to the client.
  • the transceiver module 601 is further configured to, based on the file import request sent by the client, generate a second transmission key and a second transmission identifier used in this transmission for the client, and store the The second transmission key and the second transmission identifier are sent to the client;
  • the transceiver module 601 is further configured to receive a second reorganized file that carries the second transmission identifier and is sent by the client;
  • the encoding and decoding module 604 is further configured to, according to the reorganization rule, decode the second reorganized file to obtain a second compressed file;
  • the compression and decompression module 603 is further configured to decompress the second compressed file by using the second transmission key to obtain an import file and store the import file.
  • the reorganization rule is: according to the preset coding rule, convert each first code word in the compressed file into each second code word in sequence; wherein, the first code word is composed of a first preset length.
  • the second code word is composed of characters of a second preset length; the first preset length is different from the second preset length.
  • the first transmission key and the first transmission identification are generated in the following manner: the first transmission identification is obtained according to the timestamp and the random number of the first fixed number of digits; the random number is obtained through the universal unique identification
  • the first transmission key is a unique identification code with a second fixed number of digits generated by the universal unique identification code.
  • FIG. 7 is a schematic diagram of a file transmission device provided by an embodiment of the present application, as shown in FIG. 7 , including:
  • the transceiver module 701 is further configured to receive the first transmission key and the first transmission identifier used by the background server to generate this transmission;
  • the transceiver module 701 is further configured to receive the first reorganized file that carries the first transmission identifier and is sent by the background server;
  • An encoding and decoding module 702 configured to decode the first reorganized file according to the reorganization rule to obtain a first compressed file
  • the compression and decompression module 703 is configured to use the first transmission key to decompress the first compressed file to obtain an export file and store the export file.
  • the transceiver module 701 is further configured to send a file import request to the background server;
  • the transceiver module 701 is further configured to receive the second transmission key and the second transmission identifier used for this transmission generated by the background server;
  • the compression and decompression module 703 is further configured to encrypt and compress the import file by using the second transmission key to obtain a second compressed file;
  • the encoding and decoding module 702 is further configured to, according to the reorganization rule, encode the second compressed file to obtain a second reorganized file;
  • the transceiver module 701 is further configured to send the second reorganized file carrying the second transmission identifier to the background server.
  • the embodiments of the present application may be provided as a method, a system, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions
  • the apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.

Abstract

本申请实施例提供一种文件传输方法及装置,该方法包括:后台服务器基于客户端发送的文件导出请求,为所述客户端生成本次传输使用的第一传输秘钥和第一传输标识,并将所述第一传输秘钥和所述第一传输标识发送给所述客户端;所述后台服务器基于所述客户端请求的导出文件的文件名,获得所述导出文件;所述后台服务器使用所述第一传输秘钥对所述导出文件进行加密压缩,得到第一压缩文件;所述后台服务器根据预设的重组规则,对所述第一压缩文件进行编码,得到第一重组文件;所述后台服务器将携带所述第一传输标识的所述第一重组文件发送给所述客户端。上述方法可以有效提高文件传输的安全性。

Description

一种文件传输方法及装置
相关申请的交叉引用
本申请要求在2020年11月16日提交中国专利局、申请号为202011277330.7、申请名称为“一种文件传输方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及网络技术领域,尤其涉及一种文件传输方法及装置。
背景技术
随着互联网技术的快速发展,越来越多的个人用户或者企业用户具有将文件通过网络传输保存到后台服务器中,或从后台服务器中获取文件的需求。例如,在境外前置二维码项目产品维护中,商户终端、个人用户终端文件的上传、下载通过传统的I/O字节流传输方式进行处理。其中,客户端上传文件:在客户端选择具体文件,点击上传,客户端则将文件读取成I/O字节流,传给后台服务器;后台服务器接收到该字节流,解析业务内容,存入数据库;客户端下载文件:客户端接收用户点击导出按钮的操作指令,根据操作指令生成导出文件指令,并将导出文件指令发给后台服务器;后台服务器接收到导出文件指令后,读取对应的业务数据,并以字节流的方式写到指定路径下的文件;用户通过点击下载按钮,将后台服务器生成的,在该指定路径下的文件下载到本地。但这种文件传输方法对网络带宽要求较高,且需要较长的传输时长,传输效率低,且,若数据文件在传输过程中被截获,截获者很容易读取到数据文件内容,文件传输安全性较低。
因此,现在亟需一种文件传输方法及装置,以提高文件传输的安全性。
发明内容
本申请实施例提供一种文件传输方法及装置,以提高文件传输的安全性。
第一方面,本申请实施例提供一种文件传输方法,该方法包括:
后台服务器基于客户端发送的文件导出请求,为所述客户端生成本次传输使用的第一传输秘钥和第一传输标识,并将所述第一传输秘钥和所述第一传输标识发送给所述客户端;所述后台服务器基于所述客户端请求的导出文件的文件名,获得所述导出文件;所述后台服务器使用所述第一传输秘钥对所述导出文件进行加密压缩,得到第一压缩文件;所述后台服务器根据预设的重组规则,对所述第一压缩文件进行编码,得到第一重组文件;所述后台服务器将携带所述第一传输标识的所述第一重组文件发送给所述客户端。
上述方法中,后台服务器接收通过客户端发送的文件导出请求,为客户端生成本次传输使用的第一传输秘钥和第一传输标识,并将第一传输秘钥和第一传输标识发送给客户端,后台服务器通过第一传输秘钥对导出文件加密压缩。如此,使得客户端和后台服务器形成‘合约’,后台服务器发送至客户端的文件,只有通过第一传输秘钥和第一传输标识才能成功解压获取导出文件;因此,非法用户截取文件后,因为没有第一传输秘钥和第一传输标识,则不能获取导出文件,有效的提升文件传输的安全性。且将文件压缩,可以降低文件传输过程中需要的网络带宽,加快传输效率。又且,后台服务器将第一压缩文件进行编码,获得编码后的第一重组文件,使得第一重组文件只以一串没有任何规律的字符串。如此,即使该字符串被黑客截取,黑客也无法判断该字符串所属的文件类型,进一步提高文件传输的安全性。
可选的,所述后台服务器基于所述客户端发送的文件导入请求,为所述客户端生成本次传输使用的第二传输秘钥和第二传输标识,并将所述第二传输秘钥和所述第二传输标识发送给所述客户端;所述后台服务器接收所述客户端发送的携带所述第二传输标识的第二重组文件;所述后台服务器根据所述重组规则,对所述第二重组文件进行解码,得到第二压缩文件;所述后台服务器使用所述第二传输秘钥,对所述第二压缩文件进行解压,得到导入文 件并存储所述导入文件。
上述方法中,后台服务器基于客户端发送的文件导入请求,为客户端生成本次传输使用的第二传输秘钥和第二传输标识,并将第二传输秘钥和第二传输标识发送给客户端。如此,使得客户端和后台服务器形成‘合约’,后台服务器接收客户端发送的导入文件,只有通过第二传输秘钥和第二传输标识才能成功解压获取导入文件。即,后台服务器若没有重组规则,则无法成功解码第二重组文件,若没有第二传输秘钥和第二传输标识,则无法成功解密解压缩第二压缩文件。同样提高了客户端与后台服务器之间的文件传输的安全性。
可选的,所述重组规则为:依照预设编码规则,对压缩文件中各第一编码字依序转换为各第二编码字;其中,所述第一编码字是由第一预设长度的字符组成;所述第二编码字是由第二预设长度的字符组成;所述第一预设长度与所述第二预设长度不同。
可选的,第一传输秘钥和第一传输标识通过如下方式生成:所述第一传输标识是根据时间戳和第一固定位数的随机数得到的;所述随机数是通过通用唯一识别码生成的;所述第一传输秘钥为通过所述通用唯一识别码生成的第二固定位数的唯一标识码。
上述方法中,后台服务器接收到客户端发送的文件导出请求或文件导入请求,都会对应生成私钥,也即:第一传输秘钥和第一传输标识,或第二传输秘钥和第二传输标识;将该私钥存储在缓存区,并发送至客户端。如此,使得客户端或后台服务器根据该私钥进行文件传输,根据该私钥的传输标识与后台服务器或客户端的缓存区的私钥匹配,获取后台服务器或客户端的缓存区私钥的传输密钥进行解密,提高文件传输的安全性。且私钥以时间戳和随机数为主键,即记录了私钥的时间顺序,且在客户端并发请求私钥时,同一时间戳的多个私钥的随机数不同,可以防止客户端和后台服务器的并发文件传输发送混乱。
第二方面,本申请实施例提供一种文件传输方法,该方法包括:
客户端发送文件导出请求至后台服务器;所述客户端接收所述后台服务器生成本次传输使用的第一传输秘钥和第一传输标识;所述客户端接收所述后台服务器发送的携带所述第一传输标识的所述第一重组文件;所述客户端根据预设的重组规则,对所述第一重组文件进行解码,得到第一压缩文件;所述客户端使用所述第一传输秘钥,对所述第一压缩文件进行解压,得到导出文件并存储所述导出文件。
上述方法中,接收第一重组文件后,根据预设的重组规则解码第一重组文件。也就是说,由于第一重组文件是一串没有任何规律的字符串。即使该字符串被黑客截取,黑客也无法判断该字符串所属的文件类型,只有与后台服务器设有匹配的重组规则的客户端才能对应解码第一重组文件,提高文件传输的安全性。客户端在接收第一重组文件前,接收后台服务器发送的第一传输秘钥和第一传输标识。如此,使得客户端和后台服务器形成‘合约’,客户端可以通过第一传输秘钥解压第一压缩文件获取导出文件。如此,非法用户截取文件后,因为没有第一传输秘钥和第一传输标识,不能获取导出文件,有效的提升文件传输的安全性。
可选的,所述客户端发送文件导入请求至所述后台服务器;所述客户端接收所述后台服务器生成的本次传输使用的第二传输秘钥和第二传输标识;所述客户端使用所述第二传输秘钥对所述导入文件进行加密压缩,得到第二压缩文件;所述客户端根据预设的重组规则,对所述第二压缩文件进行编码,得到第二重组文件;所述客户端将携带所述第二传输标识的所述第二重组文件发送给所述后台服务器。
上述方法中,客户端接收后台服务器发送的第二传输秘钥和第二传输标识发送给客户端,使得客户端和后台服务器形成‘合约’,客户端根据第二传输秘钥和第二传输标识将导入文件加密压缩;因此,非法用户截取文件后,因为没有第二传输秘钥和第二传输标识,则不能获取导入文件,有效的提升文件传输的安全性。且将文件压缩,可以降低文件传输过程中需要的网络带宽,加快传输效率。又且,客户端将第二压缩文件进行编码,获得编码后的第二 重组文件,使得第二重组文件只以一串没有任何规律的字符串。如此,即使该字符串被黑客截取,黑客也无法判断该字符串所属的文件类型,进一步提高文件传输的安全性。
第三方面,本申请实施例提供一种文件传输装置,该装置包括:
收发模块,用于基于客户端发送的文件导出请求,为所述客户端生成本次传输使用的第一传输秘钥和第一传输标识,并将所述第一传输秘钥和所述第一传输标识发送给所述客户端;
文件导出模块,用于基于所述客户端请求的导出文件的文件名,获得所述导出文件;
压缩解压模块,用于使用所述第一传输秘钥对所述导出文件进行加密压缩,得到第一压缩文件;
编码解码模块,用于根据预设的重组规则,对所述第一压缩文件进行编码,得到第一重组文件;
所述收发模块还用于,将携带所述第一传输标识的所述第一重组文件发送给所述客户端。
第四方面,本申请实施例提供一种文件传输装置,该装置包括:
收发模块,用于发送文件导出请求至后台服务器;
所述收发模块还用于,接收所述后台服务器生成本次传输使用的第一传输秘钥和第一传输标识;
所述收发模块还用于,接收所述后台服务器发送的携带所述第一传输标识的所述第一重组文件;
编码解码模块,用于根据所述重组规则,对所述第一重组文件进行解码,得到第一压缩文件;
压缩解压模块,用于使用所述第一传输秘钥,对所述第一压缩文件进行解压,得到导出文件并存储所述导出文件。
第五方面,本申请实施例还提供一种计算设备,包括:存储器,用于存储程序;处理器,用于调用所述存储器中存储的程序,按照获得的程序执行 如第一方面和第二方面的各种可能的设计中所述的方法。
第六方面,本申请实施例还提供一种计算机可读非易失性存储介质,包括计算机可读程序,当计算机读取并执行所述计算机可读程序时,使得计算机执行如第一方面和第二方面的各种可能的设计中所述的方法。
本申请的这些实现方式或其他实现方式在以下实施例的描述中会更加简明易懂。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种文件传输的架构示意图;
图2为本申请实施例提供的一种文件传输方法的流程示意图;
图3为本申请实施例提供的一种文件传输方法的流程示意图;
图4为本申请实施例提供的一种文件传输方法的流程示意图;
图5为本申请实施例提供的一种文件传输方法的流程示意图;
图6为本申请实施例提供的一种文件传输装置示意图;
图7为本申请实施例提供的一种文件传输装置示意图。
具体实施方式
为了使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请作进一步地详细描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。
图1为本申请实施例提供的一种文件传输的系统架构,后台服务器101 可以和服务器102、电脑103、平板104、手机105等客户端进行文件传输,图1中所示出的客户端仅为一种示例,并不对客户端做限制。此处以手机105为客户端为例。手机105与后台服务器101之间设置有相同的或匹配的重组规则。当手机105需要从后台服务器101中获取导出文件时,向后台服务器101发送文件导出请求,后台服务器101接收手机105发送的文件导出请求后,为手机105的该文件导出请求生成第一传输秘钥和第一传输标识,将该第一传输秘钥和第一传输标识存储在缓存区,并将该第一传输秘钥和第一传输标识发送至手机105。手机105将导出文件的文件名发送至后台服务器101,后台服务器101根据导出文件的文件名,导出该文件,并根据第一传输秘钥将该导出文件加密压缩,获得第一压缩文件,进一步根据重组规则将该第一压缩文件重组获取的重组文件。后台服务器101获取第一重组文件后,将该第一重组文件发送至手机105。手机105接收第一重组文件后,根据重组规则获取第一压缩文件,进一步,根据第一重组文件中的第一传输标识从缓存区获得第一传输秘钥,并根据第一传输秘钥对第一压缩文件进行解密解压,获取导出文件。
当手机105需要将导入文件发送至后台服务器101中时,手机105将文件导入请求发送至后台服务器101,后台服务器101为该文件导入请求生成第二传输密钥和第二传输标识,将该第二传输密钥和第二传输标识存储在缓存区,并将第二传输密钥和第二传输标识发送至手机105。手机105根据第二传输密钥对导入文件进行加密压缩,获取第二压缩文件,根据重组规则将第二压缩文件重组得到第二重组文件,并将该第二重组文件发送至后台服务器101。后台服务器101接收该第二重组文件,并根据重组规则将该第二重组文件重组获得第二压缩文件,并将该第二压缩文件以及该第二压缩文件对应的第二传输标识存储,以便后续根据第二传输标识获取对应的第二传输秘钥,将该第二压缩文件解密解压。如此,即使得手机105与后台服务器101之间传输的文件为压缩后的文件,节约网络资源,加快传输速度;又因为对文件进行加密压缩,以及将压缩文件进行重组,而提高了文件传输的安全性。
基于此,本申请实施例提供了一种文件传输方法的流程,如图2所示,包括:
步骤201、后台服务器基于客户端发送的文件导出请求,为所述客户端生成本次传输使用的第一传输秘钥和第一传输标识,并将所述第一传输秘钥和所述第一传输标识发送给所述客户端;
此处,每个文件导出请求都会有属于该请求的,独一无二的第一传输秘钥和第一传输标识。如此,客户端可以同时发起多个文件导出请求,且因为每个请求都有其独一无二的第一传输秘钥和第一传输标识,因此,客户端和后台服务器可以并发处理这多个文件导出请求,而不会发生混乱。
步骤202、所述后台服务器基于所述客户端请求的导出文件的文件名,获得所述导出文件;
此处,导出文件可以是文档,图片,音频文件等等,这里对文件的形式具体不做限定。
步骤203、所述后台服务器使用所述第一传输秘钥对所述导出文件进行加密压缩,得到第一压缩文件;
步骤204、所述后台服务器根据预设的重组规则,对所述第一压缩文件进行编码,得到第一重组文件;
步骤205、所述后台服务器将携带所述第一传输标识的所述第一重组文件发送给所述客户端。
上述方法中,后台服务器接收通过客户端发送的文件导出请求,为客户端生成本次传输使用的第一传输秘钥和第一传输标识,并将第一传输秘钥和第一传输标识发送给客户端,后台服务器通过第一传输秘钥对导出文件加密压缩。如此,使得客户端和后台服务器形成‘合约’,后台服务器发送至客户端的文件,只有通过第一传输秘钥和第一传输标识才能成功解压获取导出文件;因此,非法用户截取文件后,因为没有第一传输秘钥和第一传输标识,则不能获取导出文件,有效的提升文件传输的安全性。且将文件压缩,可以降低文件传输过程中需要的网络带宽,加快传输效率。又且,后台服务器将第一 压缩文件进行编码,获得编码后的第一重组文件,使得第一重组文件只以一串没有任何规律的字符串。如此,即使该字符串被黑客截取,黑客也无法判断该字符串所属的文件类型,进一步提高文件传输的安全性。
本申请实施例还提供了一种文件传输的方法,所述后台服务器基于所述客户端发送的文件导入请求,为所述客户端生成本次传输使用的第二传输秘钥和第二传输标识,并将所述第二传输秘钥和所述第二传输标识发送给所述客户端;所述后台服务器接收所述客户端发送的携带所述第二传输标识的第二重组文件;所述后台服务器根据所述重组规则,对所述第二重组文件进行解码,得到第二压缩文件;所述后台服务器使用所述第二传输秘钥,对所述第二压缩文件进行解压,得到导入文件并存储所述导入文件。也就是说,若客户端需要导入文件时,会先向后台服务器发送文件导入请求,后台服务器根据文件导入请求生成对应该文件导入请求的第二传输秘钥和第二传输标识。也即,每个文件导入请求都会有属于该请求的,独一无二的第二传输秘钥和第二传输标识。因此,客户端可以同时发起多个文件导入请求,且因为每个请求都有其独一无二的第二传输秘钥和第二传输标识,因此,客户端和后台服务器可以并发处理这多个文件导入请求,而不会发生混乱。进一步,客户端接收到后台服务器返回的第二传输秘钥和第二传输标识后,可以根据第二传输秘钥对导入文件加密压缩,得到第二压缩文件,并根据重组规则对该第二压缩文件进行重组获取第二重组文件。客户端将该第二重组文件发送至后台服务器后,后台服务器根据重组规则获取第二压缩文件后,进一步根据第二传输秘钥对该第二压缩文件进行解密解压,获取导入文件进行存储;或者直接将该第二压缩文件存储。如此,将该导入文件以加密压缩的第二压缩文件形式存储,即使黑客盗取该第二压缩文件,也无法获取第二传输密钥对该第二压缩文件进行解密解压。提高导入文件安全性。当后台服务器需要获取导入文件时,则可以根据该导入文件对应的第二传输标识从缓存区,或者传输标识及传输秘钥的记录中获取该导入文件对应的第二传输秘钥,通过该第二传输秘钥对第二压缩文件进行解压,获得导入文件。
本申请实施例提供了一种重组规则,所述重组规则为:依照预设编码规则,对压缩文件中各第一编码字依序转换为各第二编码字;其中,所述第一编码字是由第一预设长度的字符组成;所述第二编码字是由第二预设长度的字符组成;所述第一预设长度与所述第二预设长度不同。也就是说,将压缩文件的第一编码字依照顺序转换为第二编码字,使得压缩文件的压缩文件性质被消除,转换后的压缩文件‘看起来’仅为一串毫无意义的字符串,既不能获取文件内容,也不能获取该字符串为压缩文件。如此,通过该重组规则,可以大大提升文件传输的安全性。这里提供了一种重组规则的实现方式,可以将压缩文件中的第一编码字按字节流从高位到低位,以每三个第一编码字一组的方式,将该三个第一编码字分别根据对应的ASCII码转换成第一预设长度的八位二进制字符串,获得二十四位二进制的字符串,并将该字符串依次放入一个二十四位字符的缓冲区内;压缩文件中的第一编码字不足三个字节时,补零放入缓冲区;编码的时候,再从该二十四位字符的缓冲区内每次取第二预设长度的六位字符,根据系统内事先预留的特殊编码输出表(该编码表可以是根据Base64编码方式获取的编码表)映射获得一个第二编码字。如此,二十四位字符的缓冲区内的二十四位字符可以依次共计输出四个第二编码字,最后将压缩文件中的所有第一编码字转换为第二编码字获取重组文件。上述例子中,也可以先通过Base64编码方式按字节流顺序将压缩文件中的四个第一编码字转换为二十四位字符,再通过ASCII码的方式将该二十四位字符转换为三个第二编码字。上述例子的重组规则只是一种实现方式,并不对重组规则做限制。该重组规则也可以是工作人员自行编写,如此,特殊编码输出表是自定义的,则进一步增强了文件传输的安全性。
本申请实施例提供了一种秘钥生成方法,第一传输秘钥和第一传输标识通过如下方式生成:所述第一传输标识是根据时间戳和第一固定位数的随机数得到的;所述随机数是通过通用唯一识别码生成的;所述第一传输秘钥为通过所述通用唯一识别码生成的第二固定位数的唯一标识码。其中,可以将第一传输秘钥为键值,第一传输标识为主键的方式进行存储。如此,在文件 传输的过程中,第一传输标识被携带传输,客户端或后台服务器可以根据第一传输标识从记录中获取第一传输秘钥,以对压缩文件进行解密解压。第一传输标识以时间戳和随机数为主键,即记录了私钥的时间顺序,且在客户端并发请求私钥时,同一时间戳的多个私钥的随机数不同,可以使得后台服务器即使在同一时间生成多个传输标识和传输秘钥,该多个传输标识和传输秘钥也各不相同。因此,可以防止客户端和后台服务器的并发文件传输发送混乱。
基于上述流程,本申请实施例提供了一种文件传输方法的流程,如图3所示,包括:
步骤301、客户端发送文件导出请求至后台服务器;
步骤302、所述客户端接收所述后台服务器生成本次传输使用的第一传输秘钥和第一传输标识;
步骤303、所述客户端接收所述后台服务器发送的携带所述第一传输标识的所述第一重组文件;
步骤304、所述客户端根据所述重组规则,对所述第一重组文件进行解码,得到第一压缩文件;
步骤305、所述客户端使用所述第一传输秘钥,对所述第一压缩文件进行解压,得到导出文件并存储所述导出文件。
上述方法中,接收第一重组文件后,根据预设的重组规则解码第一重组文件。也就是说,由于第一重组文件是一串没有任何规律的字符串。即使该字符串被黑客截取,黑客也无法判断该字符串所属的文件类型,只有与后台服务器设有匹配的重组规则的客户端才能对应解码第一重组文件,提高文件传输的安全性。客户端在接收第一重组文件前,接收后台服务器发送的第一传输秘钥和第一传输标识。如此,使得客户端和后台服务器形成‘合约’,客户端可以通过第一传输秘钥解压第一压缩文件获取导出文件。如此,非法用户截取文件后,因为没有第一传输秘钥和第一传输标识,不能获取导出文件,有效的提升文件传输的安全性。
本申请实施例还提供了一种文件传输发送,包括:所述客户端发送文件导入请求至所述后台服务器;所述客户端接收所述后台服务器生成的本次传输使用的第二传输秘钥和第二传输标识;所述客户端使用所述第二传输秘钥对所述导入文件进行加密压缩,得到第二压缩文件;所述客户端根据预设的重组规则,对所述第二压缩文件进行编码,得到第二重组文件;所述客户端将携带所述第二传输标识的所述第二重组文件发送给所述后台服务器。如此,客户端接收后台服务器发送的第二传输秘钥和第二传输标识发送给客户端,客户端可以根据第二传输秘钥和第二传输标识将导入文件加密压缩;即使非法用户截取文件后,因为没有第二传输秘钥和第二传输标识,也不能获取导入文件,有效的提升文件传输的安全性。且将文件压缩,可以降低文件传输过程中需要的网络带宽,加快传输效率。又且,客户端将第二压缩文件进行编码,获得编码后的第二重组文件,使得第二重组文件只以一串没有任何规律的字符串。如此,即使该字符串被黑客截取,黑客也无法判断该字符串所属的文件类型,进一步提高文件传输的安全性。
基于上述流程,本申请实施例还提供了一种文件传输方法流程,如图4所示,包括:
步骤401、客户端将根据客户端标识生成的文件导出请求发送至后台服务器。
步骤402、后台服务器接收文件导出请求后,生成第一传输标识和第一传输秘钥,以及公钥;将第一传输标识和第一传输秘钥存储在缓存区,或将第一传输标识和第一传输秘钥与文件导出请求对应记录在传输标识和传输秘钥记录中。
步骤403、后台服务器将第一传输标识和第一传输秘钥发送至客户端。
步骤404、客户端接收第一传输标识和第一传输秘钥后,将该第一传输标识和第一传输秘钥存储,并将导出文件的文件名发送至后台服务器,这里后台服务器在接收到导出文件的文件名后,可以将导出文件的文件名与第一传输标识和第一传输秘钥对应存储。
步骤405、后台服务器根据导出文件的文件名,确定导出文件,并将该导出文件根据第一传输秘钥和公钥进行加密压缩,获取第一压缩文件,进一步根据重组规则将该第一压缩文件转换为第一重组文件。
步骤406、后台服务器将该第一重组文件发送至客户端。
步骤407、客户端接收第一重组文件后,根据重组规则将该第一重组文件转换为第一压缩文件,并根据第一传输标识确定对应的第一传输秘钥,根据第一传输秘钥和客户端生成的公钥对第一压缩文件进行解密解压获取导出文件。
这里需要说明的是,上述流程步骤并不唯一,文件导出请求中可以包括导出文件的文件名,则步骤404则可以不用执行,且步骤402中后台服务器可以将第一传输标识和第一传输秘钥和导出文件的文件名对应存储。这里对第一传输标识和第一传输秘钥的存储方式具体不做限定。只将文件导出请求与第一传输标识和第一传输秘钥一一对应即可。
基于上述流程,本申请实施例还提供了一种文件传输方法流程,如图5所示,包括:
步骤501、客户端将根据客户端标识生成的文件导入请求发送至后台服务器。
步骤502、后台服务器接收文件导入请求后,生成第二传输标识和第二传输秘钥,以及公钥;将第二传输标识和第二传输秘钥存储在缓存区,或将第二传输标识和第二传输秘钥与文件导出请求对应记录在传输标识和传输秘钥记录中。
步骤503、后台服务器将第二传输标识和第二传输秘钥发送至客户端。
步骤504、客户端接收第二传输标识和第二传输秘钥后,将该第二传输标识和第二传输秘钥存储,并根据第二传输秘钥和客户端生成的公钥将导入文件进行加密压缩获得第二压缩文件,根据重组规则将第二压缩文件转换为第二重组文件。
步骤505、客户端将第二重组文件发送至后台服务器。
步骤506、后台服务器接收第二重组文件后,根据重组规则将该第二重组文件转换为第二压缩文件存储,当需要获取导入文件时,可以根据该导入文件对应的第二传输标识确定第二传输秘钥和公钥对第二压缩文件进行解压解密,获取导入文件。
基于同样的构思,本申请实施例提供一种文件传输装置,图6为本申请实施例提供的一种文件传输装置示意图,如图6示,包括:
收发模块601,用于基于客户端发送的文件导出请求,为所述客户端生成本次传输使用的第一传输秘钥和第一传输标识,并将所述第一传输秘钥和所述第一传输标识发送给所述客户端;
文件导出模块602,用于基于所述客户端请求的导出文件的文件名,获得所述导出文件;
压缩解压模块603,用于使用所述第一传输秘钥对所述导出文件进行加密压缩,得到第一压缩文件;
编码解码模块604,用于根据预设的重组规则,对所述第一压缩文件进行编码,得到第一重组文件;
所述收发模块601还用于,将携带所述第一传输标识的所述第一重组文件发送给所述客户端。
可选的,所述收发模块601还用于,基于所述客户端发送的文件导入请求,为所述客户端生成本次传输使用的第二传输秘钥和第二传输标识,并将所述第二传输秘钥和所述第二传输标识发送给所述客户端;
所述收发模块601还用于,接收所述客户端发送的携带所述第二传输标识的第二重组文件;
所述编码解码模块604还用于,根据所述重组规则,对所述第二重组文件进行解码,得到第二压缩文件;
所述压缩解压模块603还用于,使用所述第二传输秘钥,对所述第二压缩文件进行解压,得到导入文件并存储所述导入文件。
可选的,所述重组规则为:依照预设编码规则,对压缩文件中各第一编 码字依序转换为各第二编码字;其中,所述第一编码字是由第一预设长度的字符组成;所述第二编码字是由第二预设长度的字符组成;所述第一预设长度与所述第二预设长度不同。
可选的,第一传输秘钥和第一传输标识通过如下方式生成:所述第一传输标识是根据时间戳和第一固定位数的随机数得到的;所述随机数是通过通用唯一识别码生成的;所述第一传输秘钥为通过所述通用唯一识别码生成的第二固定位数的唯一标识码。
基于同样的构思,本申请实施例提供一种文件传输装置,图7为本申请实施例提供的一种文件传输装置示意图,如图7示,包括:
收发模块701,用于发送文件导出请求至后台服务器;
所述收发模块701还用于,接收所述后台服务器生成本次传输使用的第一传输秘钥和第一传输标识;
所述收发模块701还用于,接收所述后台服务器发送的携带所述第一传输标识的所述第一重组文件;
编码解码模块702,用于根据所述重组规则,对所述第一重组文件进行解码,得到第一压缩文件;
压缩解压模块703,用于使用所述第一传输秘钥,对所述第一压缩文件进行解压,得到导出文件并存储所述导出文件。
可选的,所述收发模块701还用于,发送文件导入请求至所述后台服务器;
所述收发模块701还用于,接收所述后台服务器生成的本次传输使用的第二传输秘钥和第二传输标识;
所述压缩解压模块703还用于,使用所述第二传输秘钥对所述导入文件进行加密压缩,得到第二压缩文件;
所述编码解码模块702还用于,根据所述重组规则,对所述第二压缩文件进行编码,得到第二重组文件;
所述收发模块701还用于,将携带所述第二传输标识的所述第二重组文 件发送给所述后台服务器。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。

Claims (10)

  1. 一种文件传输方法,其特征在于,包括:
    后台服务器基于客户端发送的文件导出请求,为所述客户端生成本次传输使用的第一传输秘钥和第一传输标识,并将所述第一传输秘钥和所述第一传输标识发送给所述客户端;
    所述后台服务器基于所述客户端请求的导出文件的文件名,获得所述导出文件;
    所述后台服务器使用所述第一传输秘钥对所述导出文件进行加密压缩,得到第一压缩文件;
    所述后台服务器根据预设的重组规则,对所述第一压缩文件进行编码,得到第一重组文件;
    所述后台服务器将携带所述第一传输标识的所述第一重组文件发送给所述客户端。
  2. 如权利要求1所述的方法,其特征在于,还包括:
    所述后台服务器基于所述客户端发送的文件导入请求,为所述客户端生成本次传输使用的第二传输秘钥和第二传输标识,并将所述第二传输秘钥和所述第二传输标识发送给所述客户端;
    所述后台服务器接收所述客户端发送的携带所述第二传输标识的第二重组文件;
    所述后台服务器根据所述重组规则,对所述第二重组文件进行解码,得到第二压缩文件;
    所述后台服务器使用所述第二传输秘钥,对所述第二压缩文件进行解压,得到导入文件并存储所述导入文件。
  3. 如权利要求1或2所述的方法,其特征在于,所述重组规则为:
    依照预设编码规则,对压缩文件中各第一编码字依序转换为各第二编码字;其中,所述第一编码字是由第一预设长度的字符组成;所述第二编码字 是由第二预设长度的字符组成;所述第一预设长度与所述第二预设长度不同。
  4. 如权利要求1或2所述的方法,其特征在于,第一传输秘钥和第一传输标识通过如下方式生成:
    所述第一传输标识是根据时间戳和第一固定位数的随机数得到的;所述随机数是通过通用唯一识别码生成的;
    所述第一传输秘钥为通过所述通用唯一识别码生成的第二固定位数的唯一标识码。
  5. 一种文件传输方法,其特征在于,包括:
    客户端发送文件导出请求至后台服务器;
    所述客户端接收所述后台服务器生成本次传输使用的第一传输秘钥和第一传输标识;
    所述客户端接收所述后台服务器发送的携带所述第一传输标识的所述第一重组文件;
    所述客户端根据预设的重组规则,对所述第一重组文件进行解码,得到第一压缩文件;
    所述客户端使用所述第一传输秘钥,对所述第一压缩文件进行解压,得到导出文件并存储所述导出文件。
  6. 如权利要求5所述的方法,其特征在于,还包括:
    所述客户端发送文件导入请求至所述后台服务器;
    所述客户端接收所述后台服务器生成的本次传输使用的第二传输秘钥和第二传输标识;
    所述客户端使用所述第二传输秘钥对所述导入文件进行加密压缩,得到第二压缩文件;
    所述客户端根据所述重组规则,对所述第二压缩文件进行编码,得到第二重组文件;
    所述客户端将携带所述第二传输标识的所述第二重组文件发送给所述后台服务器。
  7. 一种文件传输装置,其特征在于,包括:
    收发模块,用于基于客户端发送的文件导出请求,为所述客户端生成本次传输使用的第一传输秘钥和第一传输标识,并将所述第一传输秘钥和所述第一传输标识发送给所述客户端;
    文件导出模块,用于基于所述客户端请求的导出文件的文件名,获得所述导出文件;
    压缩解压模块,用于使用所述第一传输秘钥对所述导出文件进行加密压缩,得到第一压缩文件;
    编码解码模块,用于根据预设的重组规则,对所述第一压缩文件进行编码,得到第一重组文件;
    所述收发模块还用于,将携带所述第一传输标识的所述第一重组文件发送给所述客户端。
  8. 一种文件传输装置,其特征在于,包括:
    收发模块,用于发送文件导出请求至后台服务器;
    所述收发模块还用于,接收所述后台服务器生成本次传输使用的第一传输秘钥和第一传输标识;
    所述收发模块还用于,接收所述后台服务器发送的携带所述第一传输标识的所述第一重组文件;
    编码解码模块,用于根据所述重组规则,对所述第一重组文件进行解码,得到第一压缩文件;
    压缩解压模块,用于使用所述第一传输秘钥,对所述第一压缩文件进行解压,得到导出文件并存储所述导出文件。
  9. 一种计算机可读存储介质,其特征在于,所述存储介质存储有程序,当所述程序在计算机上运行时,使得计算机实现执行权利要求1至6中任一项所述的方法。
  10. 一种计算机设备,其特征在于,包括:
    存储器,用于存储计算机程序;
    处理器,用于调用所述存储器中存储的计算机程序,按照获得的程序执行如权利要求1至6任一权利要求所述的方法。
PCT/CN2021/128479 2020-11-16 2021-11-03 一种文件传输方法及装置 WO2022100498A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011277330.7A CN112491832B (zh) 2020-11-16 2020-11-16 一种文件传输方法及装置
CN202011277330.7 2020-11-16

Publications (1)

Publication Number Publication Date
WO2022100498A1 true WO2022100498A1 (zh) 2022-05-19

Family

ID=74930551

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/128479 WO2022100498A1 (zh) 2020-11-16 2021-11-03 一种文件传输方法及装置

Country Status (2)

Country Link
CN (1) CN112491832B (zh)
WO (1) WO2022100498A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115865530A (zh) * 2023-02-22 2023-03-28 美云智数科技有限公司 文件管理方法、文件管理系统及计算机存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112491832B (zh) * 2020-11-16 2023-12-05 中国银联股份有限公司 一种文件传输方法及装置
CN114422499B (zh) * 2021-12-27 2023-12-05 北京奇艺世纪科技有限公司 一种文件下载方法、系统及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020019387A1 (zh) * 2018-07-26 2020-01-30 网宿科技股份有限公司 一种视频资源文件的获取方法和管理系统
CN111079163A (zh) * 2019-12-16 2020-04-28 国网山东省电力公司威海市文登区供电公司 加解密信息系统
CN111479029A (zh) * 2020-04-03 2020-07-31 广州惠侨计算机科技有限公司 基于dicom的影像文件传输方法、系统及计算机设备
CN112491832A (zh) * 2020-11-16 2021-03-12 中国银联股份有限公司 一种文件传输方法及装置

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102306114B (zh) * 2010-09-25 2013-04-10 广东电子工业研究院有限公司 基于云存储的数据定时备份和恢复方法
CN102638565A (zh) * 2012-02-27 2012-08-15 无锡华赛信息技术有限公司 一种基于云架构的手机云加密备份与恢复方法
US8874908B2 (en) * 2012-11-07 2014-10-28 Wolfgang Raudaschl Process for storing data on a central server
CN106790359A (zh) * 2016-11-18 2017-05-31 杭州萨宝科技有限公司 一种分布式多端数据传输同步系统及其方法
CN106559427B (zh) * 2016-11-22 2020-04-28 台州库得软件有限公司 一种数据存储及数据传输系统
CN106789004A (zh) * 2016-12-15 2017-05-31 国云科技股份有限公司 一种高效安全的网络通信方法
CN111683046B (zh) * 2020-04-29 2022-11-08 深圳赛安特技术服务有限公司 文件压缩以及获取的方法、装置、设备及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020019387A1 (zh) * 2018-07-26 2020-01-30 网宿科技股份有限公司 一种视频资源文件的获取方法和管理系统
CN111079163A (zh) * 2019-12-16 2020-04-28 国网山东省电力公司威海市文登区供电公司 加解密信息系统
CN111479029A (zh) * 2020-04-03 2020-07-31 广州惠侨计算机科技有限公司 基于dicom的影像文件传输方法、系统及计算机设备
CN112491832A (zh) * 2020-11-16 2021-03-12 中国银联股份有限公司 一种文件传输方法及装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115865530A (zh) * 2023-02-22 2023-03-28 美云智数科技有限公司 文件管理方法、文件管理系统及计算机存储介质

Also Published As

Publication number Publication date
CN112491832B (zh) 2023-12-05
CN112491832A (zh) 2021-03-12

Similar Documents

Publication Publication Date Title
WO2022100498A1 (zh) 一种文件传输方法及装置
US9842217B2 (en) Method and system for securing data
TW202029690A (zh) 基於區塊鏈的業務檔案儲存方法及裝置
US7821427B2 (en) Data processing system and method
US20140082376A1 (en) System, Method and Apparatus for Securely Saving/Retrieving Data on a Data Storage
US10608813B1 (en) Layered encryption for long-lived data
US11303617B2 (en) Methods and apparatuses for oblivious transfer using trusted environment
CN102804800B (zh) 带有加密段的段去除重复系统
CN112511514A (zh) 一种http加密传输方法、装置、计算机设备及存储介质
US10476663B1 (en) Layered encryption of short-lived data
CN108737353B (zh) 一种基于数据分析系统的数据加密方法及装置
GB2528959A (en) Encoder, decoder and method
CN113014580A (zh) 文件传输方法、装置、电子设备及存储介质
US20230111001A1 (en) Secure encryption of partial blocks
WO2022028484A1 (zh) 共享文件的方法、装置及系统
KR20230024342A (ko) 데이터의 압축 및 암호화를 위한 시스템들 및 방법들
US11356254B1 (en) Encryption using indexed data from large data pads
TW201317823A (zh) 一種雲端安全儲存系統
US10754973B2 (en) Secure cloud storage system
CN113704206B (zh) 一种元数据的处理方法、装置、电子设备及存储介质
CN116566597A (zh) 基于比特币地址混淆密文的可控安全等级隐蔽通信方法
US20180019977A1 (en) Multi-layered data security
CN109818743B (zh) 一种椭圆曲线公钥文本化传递方法及系统
JPH10294669A (ja) データ圧縮を伴う暗号通信方法
CN114726564B (zh) 安全检测方法、安全检测装置、电子设备及介质

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21891025

Country of ref document: EP

Kind code of ref document: A1