A file ferrying method and system

During the file ferrying process, the hash function and quantum encryption technology solve the problems of low file ferrying efficiency and insufficient security in the existing technology, achieve efficient and safe file transmission and storage, and ensure the integrity of files and users. experience.

CN115276959BActive Publication Date: 2024-09-24MATRICTIME DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210858860.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-21
Publication Date
2024-09-24
Estimated Expiration
2042-07-21

AI Technical Summary

Technical Problem

Existing technologies have low efficiency, insufficient security, and risks of information loss or tampering during the file ferrying process, and excessive local storage space usage affects device performance.

Method used

Using hash function and quantum encryption technology, the target file is hashed and encrypted through the initial user terminal, the hash value and ciphertext are generated, stored in the ferry carrier, and transmitted between different user terminals through shared quantum encryption keys and decryption to ensure file security and integrity.

Benefits of technology

It realizes efficient file ferrying without external devices, ensures the real-time and security of files, saves local storage space, avoids information loss and tampering, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115276959B
    Figure CN115276959B
Patent Text Reader

Abstract

The present invention discloses a file ferrying method and a system thereof. The file ferrying method is applied to an initial user terminal, a subsequent user terminal and a ferrying carrier based on network communication. The file is ferried between the initial user terminal, the subsequent user terminal and the ferrying carrier. The file is protected by encryption during the ferrying process, and the integrity of the file during the ferrying process is guaranteed by multiple hash calculations. In this way, files that need to improve privacy and security are protected, and users are prevented from being unaware of information loss or tampering during the ferrying process. At the same time, users can remotely retrieve files anytime and anywhere, ensuring the real-time nature of file retrieval and improving work efficiency. The file name, seed key, hash calculation result and index are retained in the local space, the original file is not retained, and the ciphertext is sent to other storage spaces, thereby effectively saving local space and device resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of file transmission, and in particular to a file ferrying method and a system thereof. Background Art

[0002] According to Article 6 of the Confidentiality System in Chapter 2 of the Regulations on Confidentiality Management of International Networking of Computer Information Systems promulgated and implemented by the State Security Bureau, "Computer information systems involving state secrets shall not be directly or indirectly connected to the international Internet or other public information networks, and physical isolation must be implemented." In view of the security needs of data sharing and exchange between networks with different security levels of industrial information systems, how to achieve the safe "ferrying" between industrial information data has become a major "pain point" that needs to be urgently solved in the use scenarios of industrial enterprises. The so-called "ferrying" literally means rowing a boat to transport items from one side of the river to the other, and then from the other side to this side. The process of file ferrying is similar. In order to prevent network attacks, through the idea of ​​physical isolation, two completely unconnected carriers copy files from one carrier to another through external devices. Everyone figuratively calls this process "file ferrying."

[0003] Currently, existing technologies mostly use external devices such as USB flash drives or hard drives or directly transfer files to the cloud to achieve file transfer. However, the use of external devices is not only inefficient and cannot guarantee real-time performance, but also requires manpower and material resources. At the same time, external devices are also likely to be damaged, lost, or stolen. Traditional cloud transmission not only has the defects of low storage security and low privacy, but also has the problem of asynchronous storage file content. Information may be lost or tampered with during the transfer process, which in turn affects the integrity of the file. When the file storage volume is too large, it is easy to consume local storage space when stored on the local terminal device. If the file occupies too much memory, it will also affect the computer's running speed, causing the computer to freeze, unable to run system applications normally, and some applications to be unresponsive. It may also cause the CPU usage rate to soar, and even cause system crashes and blue screens.

[0004] Setting the local terminal device memory too large is also a waste of resources: the speed at which the local terminal device processes data

[0005] It not only relies on the running memory, but also on the processor. If the running memory does not match the processor, then the large running memory of the local terminal device is a waste of resources. Therefore, there is no need to choose the largest running memory, otherwise the cost will increase but the local terminal device will have excessive performance. When there are a large number of legitimate user terminals or a large number of shared files and a large file capacity, the security and efficiency of shared files are difficult to guarantee, affecting the user experience. Therefore, it is urgent to design a file ferrying method and system. Summary of the invention

[0006] Purpose of the invention: The purpose of the present invention is to provide a file ferrying method and system, which can safely ferry files to another carrier, solving the problem that the current technical solution of ferrying files by external devices cannot solve the problem of real-time and safe call of files. The present invention can also solve the problem of large storage space occupied by local terminal devices, information security and file integrity during file ferrying. The method can be used in the file ferrying process between different carriers with the same security.

[0007] Technical solution: The present invention provides a file ferrying method, which includes the following steps:

[0008] S1, the initial user end selects the target file to be transferred, determines the file name of the target file, and performs hash calculation on the target file through a preset hash function to generate a hash value Hash1; and encrypts the target file and Hash1 through a seed key to form a ciphertext, and then performs hash calculation on the formed ciphertext through a hash function to generate a hash value Hash2;

[0009] S2, the initial user terminal sends the ciphertext formed in S1 to the ferry carrier and stores it in the ferry carrier, records the storage location of the ciphertext in the ferry carrier, and makes a one-to-one correspondence between it and the file name of the target file and the storage location of the seed key and Hash2 in the initial user terminal, thereby forming an index of the target file;

[0010] S3. When the initial user terminal needs to obtain the target file, the ciphertext obtained by ferrying from the ferry carrier is obtained based on the ciphertext storage location in the index to obtain the target file;

[0011] S4. When the subsequent user terminal needs to obtain the target file, the subsequent user terminal establishes a communication connection with the initial user terminal and shares the quantum encryption key. The initial user terminal encrypts the index of the target file as well as the seed key and Hash2 through the shared quantum encryption key and transmits them to the subsequent user terminal. After receiving it, the subsequent user terminal decrypts it through the shared quantum encryption key. After obtaining the index of the target file, it obtains the ciphertext from the ferry carrier based on the ciphertext storage location in the index, verifies the ciphertext based on Hash2, and obtains the target file based on the seed key after the verification passes.

[0012] As an improvement of the present invention, in step S1, the target file and Hash1 are encrypted by the seed key to form a ciphertext, specifically:

[0013] The quantum random number of at least 128 bits preset in the initial user terminal is called as the seed key, the seed key is expanded into a quantum extended key through the quantum key expansion algorithm, the target file and Hash1 are encrypted using the quantum extended key, and the quantum extended key is deleted after obtaining the ciphertext.

[0014] As an improvement of the present invention, in step S1, the hash function is a Toeplitz one-way hash function based on a linear shift register.

[0015] As an improvement of the present invention, in step S3, the ciphertext obtained by ferrying from the ferry carrier based on the ciphertext storage position in the index to obtain the target file is specifically:

[0016] S3-1. First, the initial user end retrieves the index according to the file name of the target file, finds the ciphertext storage location in the ferry carrier based on the index, and ferry the corresponding ciphertext from the ferry carrier back to the initial user end. Then, the ciphertext ferryed from the ferry carrier is hashed by the hash function to obtain the hash value Hash. ′ 2;

[0017] S3-2, the initial user end will Hash ′ 2 is compared with Hash2. If Hash ′ 2 is equal to Hash2, then the seed key is called and expanded to the quantum expansion key, and the ciphertext ferrying from the ferry carrier is decrypted to obtain the target file and Hash1. Otherwise, the ferry carrier reports an error to the initial user end and performs the ferrying operation again;

[0018] S3-3, the initial user end uses the hash function to calculate the target file obtained in S3-2, and obtains Hash ′ 1;

[0019] S3-4, the initial user end will Hash ′ 1 is compared with Hash1. If Hash ′ 1 is equal to Hash1, then the target file is displayed in the initial user terminal, otherwise the initial user terminal reports an error and the ferry operation is performed again.

[0020] As an improvement of the present invention, in step S4, the subsequent user terminal establishes a communication connection with the initial user terminal and shares the quantum encryption key. The initial user terminal encrypts the index of the target file and the seed key and Hash2 through the shared quantum encryption key and transmits them to the subsequent user terminal, specifically:

[0021] S4-1. The initial user terminal establishes a communication connection with the subsequent user terminal and shares a quantum encryption key, wherein the shared quantum encryption key is a shared first quantum encryption key and a second quantum encryption key; the initial user terminal uses the shared first quantum encryption key to encrypt the index of the target file and transmits it to the subsequent user terminal, and uses the shared second quantum encryption key to encrypt the seed key and Hash2 and transmit them to the subsequent user terminal.

[0022] As an improvement of the present invention, in step S4, the subsequent user terminal decrypts the received data using the shared quantum encryption key, obtains the index of the target file, and then obtains the ciphertext from the ferry carrier based on the ciphertext storage position in the index, verifies the ciphertext based on Hash2, and obtains the target file based on the seed key after the verification is passed, specifically:

[0023] S4-2, after the subsequent user end receives the index of the target file, the seed key and Hash2 encrypted and transmitted by the initial user end, it uses the shared first quantum encryption key to decrypt the ciphertext of the index of the target file, retrieves the index, and based on the ciphertext storage location in the index, transfers the ciphertext corresponding to the target file from the ferry carrier back to the subsequent user end, and then performs hash calculation on the ciphertext transferred from the ferry carrier through a preset hash function to obtain a hash value Hash ′ 2 ′ ;

[0024] S4-3, the user end then uses the shared second quantum encryption key to decrypt the seed key and the ciphertext of Hash2, and ′ 2 ′ Compare with Hash2, if Hash ′ 2 ′ If it is equal to Hash2, then the seed key is called and expanded to the quantum expanded key to decrypt the ciphertext obtained from the ferry carrier to obtain the target file and Hash1. Otherwise, the ferry carrier reports an error to the subsequent user end and performs the ferry operation again.

[0025] S4-4, the user end then uses the hash function to calculate the target file obtained in S4-3, and obtains Hash ′ 1 ′ ;

[0026] S4-5, the user will then hash ′ 1 ′ Compare with Hash1, if Hash ′ 1 ′ If it is equal to Hash1, the target file will be displayed in the subsequent user terminal. Otherwise, the subsequent user terminal will report an error and perform the ferry operation again.

[0027] As an improvement of the present invention, the hash function preset in the subsequent user terminal is the same as the hash function preset in the initial user terminal.

[0028] As an improvement of the present invention, the initial user terminal is a mobile terminal or a PC terminal, the subsequent user terminal is a mobile terminal or a PC terminal, and the ferry carrier is the cloud.

[0029] As an improvement of the present invention, a file ferrying system is also provided. The file ferrying system includes an initial user terminal, a subsequent user terminal and a ferrying carrier based on network communication.

[0030] As an improvement of the present invention, the initial user terminal includes the following modules:

[0031] Acquisition module: used to obtain target files and seed keys;

[0032] The first expansion module is used to expand the seed key into a quantum expansion key;

[0033] The first hash operation module is used to calculate the hash value Hash1 of the target file through the preset hash function, calculate the hash value Hash2 of the ciphertext before the ferry carrier is transferred through the hash function, and calculate the hash value Hash after the ciphertext is transferred back from the ferry carrier through the hash function. ′ 2 and calculate the hash value Hash of the target file after decrypting the ciphertext through the hash function ′ 1;

[0034] Encryption and decryption module: used to encrypt the target file and Hash1 using the quantum extended key to obtain the ciphertext; used to decrypt the ciphertext using the quantum extended key to obtain the target file and Hash1; used to encrypt the index of the target file using the first quantum encryption key; used to encrypt the seed key and Hash2 using the second quantum encryption key;

[0035] The first storage module: used to store the file name, seed key, Hash2 and index of the target file;

[0036] The first cache module: used to cache the decrypted target file and Hash1;

[0037] The first judgment module: used to judge Hash2 and Hash ′ 2 are equal; used to determine whether Hash1 and Hash ′ 1 are equal;

[0038] The first ferry module is used to ferry the ciphertext from the initial user end to the ferry carrier;

[0039] The first key sharing module is used to share the first quantum encryption key and the second quantum encryption key with subsequent user terminals;

[0040] The first transmission module is used for encrypting and transmitting the seed key, Hash2 and index with subsequent user terminals.

[0041] As an improvement of the present invention, the subsequent user terminal includes the following modules:

[0042] The second expansion module is used to expand the seed key into a quantum expansion key;

[0043] The second hash operation module is used to calculate the hash value Hash of the ciphertext ferrying from the ferry carrier through the preset hash function ′ 2 ′ , used to calculate the hash value Hash of the target file after decrypting the ciphertext through the hash function ′ 1 ′ ; Decryption module: used to decrypt the index of the target file using the first quantum encryption key; used to decrypt the seed key and Hash2 using the second quantum encryption key; used to decrypt the ciphertext using the quantum expansion key to obtain the target file and Hash1;

[0044] The second storage module is used to store the seed key and Hash2, index transmitted from the initial user end through encryption;

[0045] The second cache module: used to cache the decrypted target file and Hash1;

[0046] The second judgment module: used to judge Hash2 and Hash ′ 2 ′ Are they equal? ​​Used to determine whether Hash1 and Hash ′ 1 ′ whether they are equal;

[0047] The second key sharing module is used to share the first quantum encryption key and the second quantum encryption key with the initial user terminal;

[0048] The second transmission module is used for encrypted transmission of the seed key, Hash2 and index with the initial user end.

[0049] As an improvement of the present invention, the ferry carrier includes the following modules:

[0050] The third storage module is used to store the ciphertext transferred from the initial user end;

[0051] The second ferry module is used to ferry the ciphertext from the ferry carrier back to the initial user end and / or the subsequent user end.

[0052] The beneficial effects of the present invention are:

[0053] 1. Compared with the prior art, the present invention does not require external devices to participate in the file ferrying process, which firstly improves the ferrying efficiency, and secondly ensures the real-time nature of the file ferrying, and can ferry and call the required files anytime and anywhere;

[0054] 2. The present invention adopts a one-time quantum encryption method to ensure the security and privacy of encrypted files and avoid information security issues caused by file content leakage;

[0055] 3. The present invention performs hash calculations on the contents before and after encryption and decryption and before and after ferrying, and compares the obtained multiple hash values ​​in pairs. Only when they are equal can the plain text be decrypted and displayed, which can avoid the loss of information caused by file tampering during the ferrying process, and further ensure the integrity of the file;

[0056] 4. Only the file name, seed key, Hash2 and index are saved locally, the plaintext content is deleted, and the ciphertext including the target file and Hash1 is stored in the cloud. The ciphertext is called back to the local computer through the index for decryption, which can greatly save local storage space and avoid wasting resources.

[0057] 5. The present invention not only provides a method and system for a single user terminal to independently ferry files, but also provides a method and system for multiple user terminals to ferry and share files, broadening the actual application scenarios, providing work support for multiple users, effectively improving convenience, and greatly enhancing user experience and retention rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 It is a flowchart of the file ferrying method;

[0059] Figure 2 A schematic diagram of the structure of a high-security file ferry system. DETAILED DESCRIPTION

[0060] The present invention will be further explained below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention.

[0061] like Figure 1 As shown, the present invention provides a file ferrying method, which is applied to the initial user terminal, subsequent user terminal and ferry carrier of network communication, the initial user terminal and subsequent user terminal are mobile terminals or PC terminals, and the ferry carrier is the cloud. In an embodiment of the present invention, the initial user terminal and subsequent user terminal include mobile phones, tablets, portable laptops, desktop computers, etc.

[0062] In the file ferrying method of this embodiment, the initial user terminal establishes a communication connection with the cloud, and the initial user terminal uploads and downloads files. The file ferrying method includes the following steps:

[0063] S1. The initial user terminal selects the target file to be transferred, determines the file name of the target file, and uses the Toeplitz one-way hash function based on a linear shift register to perform hash calculation on the target file to generate a hash value Hash1; calls a quantum random number of at least 128 bits preset in the initial user terminal as a seed key, expands the seed key into a quantum extended key through a quantum key expansion algorithm, encrypts the target file and Hash1 using the quantum extended key, and deletes the quantum extended key after obtaining the ciphertext; then performs hash calculation on the formed ciphertext through the Toeplitz one-way hash function to generate a hash value Hash2; wherein the length of the quantum extended key can be set in proportion to the size of the target file, for example: the size of the target file is 100M, and the length of the quantum extended key is 50M;

[0064] S2, the initial user terminal sends the ciphertext formed in S1 to the ferry carrier and stores it in the ferry carrier, records the storage location of the ciphertext in the ferry carrier, and makes a one-to-one correspondence between it and the file name of the target file and the storage location of the seed key and Hash2 in the initial user terminal, thereby forming an index of the target file;

[0065] S3. When the initial user terminal needs to obtain the target file, the target file is obtained according to the following steps:

[0066] S3-1. First, the initial user end retrieves the index according to the file name of the target file, finds the ciphertext storage location in the ferry carrier based on the index, and ferry the corresponding ciphertext from the ferry carrier back to the initial user end. Then, the ciphertext ferryed from the ferry carrier is hashed by the hash function to obtain the hash value Hash. ′ 2;

[0067] S3-2, the initial user end will Hash ′ 2 is compared with Hash2. If Hash ′ 2 is equal to Hash2, then the seed key is called and expanded to the quantum expansion key, and the ciphertext ferrying from the ferry carrier is decrypted to obtain the target file and Hash1. Otherwise, the ferry carrier reports an error to the initial user end and performs the ferrying operation again;

[0068] S3-3, the initial user end uses the same hash function as in S1 to calculate the target file obtained in S3-2, and obtains Hash ′ 1;

[0069] S3-4, the initial user end will Hash ′ 1 is compared with Hash1. If Hash ′ 1 is equal to Hash1, then the target file is displayed in the initial user terminal, otherwise the initial user terminal reports an error and the ferry operation is performed again.

[0070] S4. When the subsequent user terminal needs to obtain the target file, the subsequent user terminal establishes a communication connection with the initial user terminal and shares the quantum encryption key. The initial user terminal transmits the index of the target file, the seed key and Hash2 encryption to the subsequent user terminal through the shared quantum encryption key. After receiving the target file, the subsequent user terminal obtains the target file according to the following steps:

[0071] S4-1, the initial user terminal establishes a communication connection with the subsequent user terminal and shares a quantum encryption key, wherein the shared quantum encryption key is a shared first quantum encryption key and a shared second quantum encryption key; the initial user terminal encrypts the index of the target file using the shared first quantum encryption key and transmits it to the subsequent user terminal, and encrypts the seed key and Hash2 using the shared second quantum encryption key and transmits them to the subsequent user terminal;

[0072] S4-2, after receiving the index of the target file, the seed key and Hash2 encrypted and transmitted by the initial user end, the subsequent user end uses the shared first quantum encryption key to decrypt the ciphertext of the index of the target file, retrieves the index, and based on the ciphertext storage position in the index, transfers the ciphertext corresponding to the target file from the ferry carrier back to the subsequent user end, and then performs hash calculation on the ciphertext transferred from the ferry carrier through a preset hash function to obtain a hash value Hash″2;

[0073] S4-3, the subsequent user end uses the shared second quantum encryption key to decrypt the seed key and the ciphertext of Hash2, and compares Hash″2 with Hash2. If Hash″2 is equal to Hash2, then the seed key is called and expanded to the quantum extended key, and the ciphertext obtained from the ferry carrier is decrypted to obtain the target file and Hash1. Otherwise, the ferry carrier reports an error to the subsequent user end and performs the ferry operation again; wherein the method of expanding the seed key to the quantum extended key is the same as the seed key expansion method in step S1;

[0074] S4-4, the user terminal subsequently performs hash calculation on the target file obtained in S4-3 through a hash function to obtain Hash″1;

[0075] S4-5. The subsequent user terminal compares Hash″1 with Hash1. If Hash″1 is equal to Hash1, the target file is displayed in the subsequent user terminal. Otherwise, the subsequent user terminal reports an error and performs the ferry operation again.

[0076] In steps S1, S3 and S4, since the quantum extended key is used to encrypt and decrypt the files, the anti-quantum attack characteristics of the quantum key can be utilized to effectively prevent the files stored in the ferry carrier from being obtained through brute force cracking, database collision, etc., effectively protect the security of the files stored in the ferry carrier, and prevent information leakage.

[0077] In the above-mentioned embodiment of the present invention, the file to be ferryed is encrypted according to the quantum key and the encryption algorithm. For each encryption of the file to be ferryed, the quantum key used is different, which can ensure the security of each encrypted file stored in the cloud. In this embodiment, the storage location of the seed key in the initial user terminal is associated with the storage location of the ciphertext in the ferry carrier, rather than directly associating the seed key with the ciphertext, which can ensure the security of the quantum extended key corresponding to the seed key. In this embodiment, the larger the data volume of the file to be uploaded, the longer the length of the seed key and the corresponding quantum extended key obtained by the corresponding module in the initial user terminal and the subsequent user terminal, which can provide more secure encryption services for files to be uploaded with different data volumes, and meet the various needs of users for storage security. Users can use a close-range handheld device or computer to view the files that need to be encrypted and saved anytime, anywhere.

[0078] The present invention also provides a file ferrying system, which includes an initial user terminal, a subsequent user terminal and a ferrying carrier based on network communication. The initial user terminal includes an acquisition module, a first expansion module, a first hash operation module, an encryption and decryption module, a first storage module, a first cache module, a first judgment module, a first ferrying module, a first key sharing module, and a first transmission module. The acquisition module is used to obtain a target file and a seed key. The first expansion module is used to expand the seed key into a quantum expansion key. The first hash operation module is used to calculate a hash value Hash1 for the target file through a preset hash function, calculate a hash value Hash2 for the ciphertext before the ferrying carrier is ferryed through a hash function, calculate a hash value Hash′2 for the ciphertext after being ferryed back from the ferrying carrier through a hash function, and calculate a hash value Hash′1 for the target file after the ciphertext is decrypted through a hash function. The encryption and decryption module is used to encrypt the target file and Hash1 using the quantum extended key to obtain the ciphertext; to decrypt the ciphertext using the quantum extended key to obtain the target file and Hash1; to encrypt the index of the target file using the first quantum encryption key; and to encrypt the seed key and Hash2 using the second quantum encryption key. The first storage module is used to store the file name, seed key, Hash2 and index of the target file. The first cache module is used to cache the decrypted target file and Hash1. The first judgment module is used to judge whether Hash2 is equal to Hash′2; and to judge whether Hash1 is equal to Hash′1. The first ferry module is used to ferry the ciphertext from the initial user end to the ferry carrier. The first key sharing module is used to share the first quantum encryption key and the second quantum encryption key with subsequent user ends. The first transmission module is used to encrypt and transmit the seed key, Hash2 and index with subsequent user ends.

[0079] In an embodiment of the present invention, the subsequent user terminal includes a second expansion module, a second hash operation module, a decryption module, a second storage module, a second cache module, a second judgment module, a second key sharing module, and a second transmission module. The second expansion module is used to expand the seed key into a quantum extended key. The second hash operation module is used to calculate the hash value Hash″2 of the ciphertext obtained by ferrying from the ferry carrier through a preset hash function, and to calculate the hash value Hash″1 of the target file after the ciphertext is decrypted through the hash function. The decryption module is used to decrypt the index of the target file using the first quantum encryption key; to decrypt the seed key and Hash2 using the second quantum encryption key; to decrypt the ciphertext using the quantum extended key to obtain the target file and Hash1. The second storage module is used to store the seed key, Hash2, and index encrypted and transmitted from the initial user terminal. The second cache module is used to cache the decrypted target file and Hash1. The second judgment module is used to determine whether Hash2 is equal to Hash″2; and to determine whether Hash1 is equal to Hash″1. The second key sharing module is used to share the first quantum encryption key and the second quantum encryption key with the initial user end, and to perform encrypted transmission of the seed key, Hash2 and index with the initial user end.

[0080] In the above embodiment of the present invention, both the initial user terminal and the subsequent user terminal have their own encryption and decryption modules, which can prevent the illegal user terminal encryption and decryption devices from occupying resources, and prevent the encryption and decryption modules of the initial user terminal and the subsequent user terminal from being connected to illegal network-side management devices and being deceived into obtaining key information. In this embodiment, the encryption algorithm and the corresponding decryption algorithm are pre-stored in the encryption and decryption modules of the initial user terminal and the subsequent user terminal, and the types of the encryption algorithm and the corresponding decryption algorithm are not limited, such as symmetric encryption algorithm and decryption algorithm.

[0081] In an embodiment of the present invention, the ferry carrier includes a third storage module and a second ferry module. The third storage module is used to store the ciphertext ferryed from the initial user terminal. The second ferry module is used to ferry the ciphertext from the ferry carrier back to the initial user terminal and / or the subsequent user terminal.

[0082] As mentioned above, each module complements each other and jointly assists the file ferry system to complete the file ferry process.

[0083] Embodiment 1

[0084] In this embodiment, the initial user terminal alone performs file ferrying as an example: the user holds the initial user terminal equipped with a cloud application. After the user determines the target file to be saved, the target file is first hashed by the Toeplitz one-way hash function based on a linear shift register preset in the initial user terminal to obtain a hash value Hash1. Then the initial user terminal calls a quantum random number pre-distributed in the mobile phone as a seed key, and expands it into a quantum extended key through the quantum key expansion algorithm, and uses it to encrypt the target file and Hash1 to obtain a ciphertext. In this embodiment, the quantum key expansion algorithm is not limited. It should be noted that the length of the seed key selected by the present invention is very small, and the storage space occupied is also very small, but the minimum shall not be shorter than 128 bits, and the length of the extended key depends on the size of the target file, and is generally set in proportion, so that a larger file can be encrypted with a longer extended key, and a smaller file can be encrypted with a shorter extended key, ensuring encryption security while improving encryption efficiency. After the encryption is completed, the quantum extended key will be automatically deleted, not occupying local storage space, but also further ensuring the security of the ciphertext. Hash calculation is performed on the ciphertext that has not been transferred to the cloud to obtain the hash value Hash2. The initial user terminal forms a mapping relationship between the file metadata of the target file (including file name, file size, storage path, etc.) and the storage location of the seed key and Hash2 in the initial user terminal. This mapping relationship reflects the one-to-one correspondence between the file name of the target file and the storage location of the seed key, and the corresponding seed key can be retrieved by the file name; then the initial user terminal sends the above-formed ciphertext to the cloud and stores it, records the storage location of the ciphertext in the cloud, and forms an index with this storage location and the above mapping relationship, so that the ciphertext of the corresponding storage location in the cloud can be retrieved by the file name. At this time, the initial user terminal saves the target file and its file metadata (including file name, file size, storage path, etc.), seed key and Hash2. The initial user terminal will delete the target file, retain the file name of the target file for subsequent index calls, and retain the seed key and Hash2. The ciphertext has been sent to the cloud and stored in the cloud. The key and hash value are local, and the ciphertext is in the cloud. They are stored in isolation to increase the security of the files that need to be protected. When the user needs to view the content of a file on the client side, he only needs to click on the file name, and the background will promptly execute the command to retrieve the file: retrieve the index based on the file name from the cloud to get the ciphertext corresponding to the file name, and after ferrying the ciphertext back to the local, a hash calculation must be performed first to get Hash′2. The purpose of this step is to compare Hash′2 with Hash2. If they are equal, it means that there is no information loss or tampering during the process of sending to the cloud and storing it, and the decryption work can be performed; otherwise, it means that there is a problem in the ferrying process of the file, and it needs to be restarted.The decryption process is similar to the encryption process. First, the corresponding seed key needs to be retrieved using the index, and then expanded to the quantum extended key for decryption in the same way as above. The target file after ciphertext decryption needs to be hashed again to obtain Hash′1. This is to compare Hash′1 with Hash1. If they are equal, it means that the file content before and after encryption is consistent, and the file has not been tampered with. It can be displayed on the initial user end. Otherwise, the system reports an error and re-performs the ferrying operation. If the file content needs to be modified, the user can modify the file directly on the initial user end after viewing the file content. The initial user end repeats the above steps for the modified file, but calls the new seed key for encryption and deletes the keys, ciphertexts, hash values ​​and indexes corresponding to the original file. The above encryption and decryption process and multiple hash calculation and comparison processes ensure the integrity and security of the file data information. These encryption and decryption and data ferrying processes are all processed jointly in the background and cloud of the mobile phone. The process is fast and users do not need to wait. Before clicking the file name, the file content is not saved in the initial user terminal, and the user cannot directly see the file content. This reduces the burden on the memory of the initial user terminal and provides encryption protection for important files, making file information more secure and reliable.

[0085] Embodiment 2

[0086] In this embodiment, take the case where a subsequent user terminal needs to ferry files as an example. The subsequent user terminal cannot ferry files to the cloud alone. If it needs to view the file content, it is necessary to first ensure that it has established a communication connection with the initial user terminal. This is to ensure that multiple subsequent user terminals are legitimate user terminals; then it is necessary to ensure that the first quantum encryption key and the second quantum encryption key have been shared with the initial user terminal to prepare for subsequent request commands. In this embodiment, the method of sharing quantum encryption keys between the initial user terminal and the subsequent user terminal includes quantum key distribution, quantum conference key negotiation, etc. After proving that the subsequent user terminal is legitimate, the initial user terminal uses the shared first quantum encryption key to encrypt the index of the target file and transmit it to the subsequent user terminal, and uses the shared second quantum encryption key to encrypt the seed key and Hash2 and transmit them to the subsequent user terminal. The index of the target file is encrypted and transmitted separately from the seed key and Hash2 to improve the security of both during transmission. After receiving the target file, the subsequent user terminal decrypts the index of the target file using the first quantum encryption key, so that the ciphertext at the corresponding storage location in the cloud can be retrieved through the index, and the ciphertext ferrying from the cloud is ferrying back to the local computer. The ciphertext ferrying from the cloud is hashed using the same hash function as in the first embodiment to obtain a hash value Hash″2. The initial user terminal then encrypts the seed key and Hash2 using the second quantum encryption key and transmits them to the subsequent user terminal. After receiving the target file, the subsequent user terminal decrypts the ciphertext using the shared second quantum encryption key and compares the Hash″2 with Hash2. The ciphertext is ferrying from the cloud to the local computer ... The seed key is called and expanded to a quantum extended key, and the ciphertext obtained from the cloud is decrypted to obtain the target file and Hash1. Otherwise, the cloud reports an error to the subsequent user terminal and performs the ferrying operation again; wherein the method of expanding the seed key to the quantum extended key is the same as the seed key expansion method in Example 1. The obtained target file is hashed by the same hash function as in Example 1 to obtain Hash″1, and Hash″1 is compared with Hash1. Only when Hash″1 is equal to Hash1 can the target file be displayed in the subsequent user terminal, otherwise the subsequent user terminal reports an error and performs the ferrying operation again. In this embodiment, the encryption algorithm used by the subsequent user terminal in this embodiment can be the same as the encryption and decryption algorithm in the encryption and decryption module in the initial user terminal, and the operation of ferrying the ciphertext from the cloud back to the local is also the same, and the implementation method of hash calculation and seed key expansion is also roughly the same as the implementation method of the steps in Example 1. The only difference is that the initial user terminal is replaced by the subsequent user terminal, so it will not be repeated here. However, the operation of encrypting files and transferring them to the cloud can only be performed by the initial user end, and subsequent users do not have the function of encrypting files and transferring them to the cloud.

[0087] It should be noted that the above content only illustrates the technical idea of ​​the present invention and cannot be used to limit the protection scope of the present invention. For ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications all fall within the protection scope of the claims of the present invention.

Claims

1. A file ferrying method, characterized in that: The file ferrying method comprises the following steps: S1. The initial user terminal selects the target file to be transferred and determines the file name of the target file. The initial user terminal performs hash calculation on the target file through a preset hash function to generate a hash value. ; and use the seed key to encrypt the target file and Encrypt to form ciphertext, then use hash function to calculate the ciphertext to generate hash value ; S2, the initial user sends the ciphertext formed in S1 to the ferry carrier and stores it in the ferry carrier, records the ciphertext storage location in the ferry carrier, and compares it with the file name of the target file and the seed key and The storage locations in the initial user end correspond one by one to form an index of the target file; S3. When the initial user terminal needs to obtain the target file, the ciphertext obtained by ferrying from the ferry carrier is obtained based on the ciphertext storage location in the index to obtain the target file; S4. When the subsequent user terminal needs to obtain the target file, the subsequent user terminal establishes a communication connection with the initial user terminal and shares the quantum encryption key. The initial user terminal uses the shared quantum encryption key to send the index of the target file and the seed key and After encryption, it is transmitted to the subsequent user end. After receiving it, the subsequent user end decrypts it using the shared quantum encryption key. After obtaining the index of the target file, the ciphertext is obtained from the ferry carrier based on the ciphertext storage location in the index. Verify the ciphertext, and obtain the target file based on the seed key after the verification passes; In step S1, the target file and Encrypt to form ciphertext, specifically: The quantum random number of at least 128 bits preset in the initial user terminal is called as the seed key, and the seed key is expanded into a quantum extended key through the quantum key expansion algorithm. The quantum extended key is used to access the target file and Encryption is performed and the quantum expansion key is deleted after obtaining the ciphertext.

2. The file ferrying method according to claim 1, characterized in that: In step S1, the hash function is a Toeplitz one-way hash function based on a linear shift register.

3. The file ferrying method according to claim 1, characterized in that: In step S3, the ciphertext obtained by ferrying from the ferry carrier based on the ciphertext storage location in the index is obtained to obtain the target file, specifically: S3-1. First, the initial user end retrieves the index according to the file name of the target file, finds the ciphertext storage location in the ferry carrier based on the index, and ferry the corresponding ciphertext from the ferry carrier back to the initial user end. Then, the ciphertext ferryed from the ferry carrier is hashed by the hash function to obtain the hash value. ; S3-2, the initial user end will and For comparison, if equal , then call the seed key, expand it into the quantum expansion key, decrypt the ciphertext ferrying from the ferry carrier, and get the target file and ,Otherwise, the ferry carrier reports an error to the initial user end and performs the ferry operation again; S3-3, the initial user end performs hash calculation on the target file obtained in S3-2 through a hash function, and obtains ; S3-4, the initial user end will and For comparison, if equal , then the target file is displayed in the initial user terminal, otherwise the initial user terminal reports an error and the ferry operation is performed again.

4. The file ferrying method according to claim 1, characterized in that: In step S4, the subsequent user terminal establishes a communication connection with the initial user terminal and shares the quantum encryption key. The initial user terminal transmits the index of the target file and the seed key and After encryption, it is transmitted to the subsequent user end, specifically: S4-1. The initial user terminal establishes a communication connection with the subsequent user terminal and shares a quantum encryption key, wherein the shared quantum encryption key is a shared first quantum encryption key and a shared second quantum encryption key; the initial user terminal encrypts the index of the target file using the shared first quantum encryption key and transmits it to the subsequent user terminal, and uses the shared second quantum encryption key to encrypt the seed key and the index of the target file to the subsequent user terminal. After encryption, it is transmitted to the subsequent user end.

5. The file ferrying method according to claim 4, characterized in that: In step S4, the subsequent user end receives the decrypted data using the shared quantum encryption key, obtains the index of the target file, and then obtains the ciphertext from the ferry carrier based on the ciphertext storage location in the index. Verify the ciphertext. After verification, obtain the target file based on the seed key. Specifically: S4-2, the subsequent user end receives the index of the target file and the seed key and Afterwards, the shared first quantum encryption key is used to decrypt the ciphertext of the target file's index, retrieve the index, and ferry the ciphertext corresponding to the target file from the ferry carrier back to the subsequent user end based on the ciphertext storage location in the index. Then, the ciphertext ferryed from the ferry carrier is hashed using a preset hash function to obtain a hash value. ; S4-3, the user end then uses the shared second quantum encryption key to convert the seed key and Decrypt the ciphertext of and For comparison, if equal , then call the seed key, expand it into the quantum expansion key, decrypt the ciphertext obtained from the ferry carrier, and get the target file and ,Otherwise, the ferry carrier reports an error to the subsequent user end and performs the ferry operation again; S4-4, the user terminal then uses a hash function to calculate the target file obtained in S4-3, and obtains ; S4-5, the subsequent user end will and For comparison, if equal , then the target file will be displayed in the subsequent user terminal, otherwise the subsequent user terminal will report an error and the ferry operation will be performed again.

6. The file ferrying method according to claim 5, characterized in that: The hash function preset in the subsequent user terminal is the same as the hash function preset in the initial user terminal.

7. The file ferrying method according to claim 1, characterized in that: The initial user terminal is a mobile terminal or a PC terminal, the subsequent user terminal is a mobile terminal or a PC terminal, and the ferry carrier is the cloud.

8. A file ferry system, used to implement the file ferry method according to any one of claims 1 to 7, characterized in that: The file ferrying system includes an initial user terminal, a subsequent user terminal and a ferrying carrier based on network communication.

9. The file ferry system according to claim 8, characterized in that: The initial user terminal includes the following modules: Acquisition module: used to obtain target files and seed keys; The first expansion module is used to expand the seed key into a quantum expansion key; The first hash operation module: used to calculate the hash value of the target file through a preset hash function , calculate the hash value of the ciphertext before the ferry carrier on the ferry through the hash function , calculate the hash value of the ciphertext after it is ferryed back from the ferry carrier through the hash function And calculate the hash value of the target file after decrypting the ciphertext through the hash function ; Encryption and decryption module: used to use quantum extended keys to encode target files and Encrypt to obtain ciphertext; use quantum extended key to decrypt ciphertext to obtain target file and ; for encrypting an index of a target file using a first quantum encryption key; For utilizing the second quantum encryption key pair seed key and Encryption is performed; The first storage module: used to store the file name, seed key and and indexes; The first cache module: used to cache the decrypted target file and ; The first judgment module: used to judge and Whether they are equal; used to judge and whether they are equal; The first ferry module is used to ferry the ciphertext from the initial user end to the ferry carrier; The first key sharing module is used to share the first quantum encryption key and the second quantum encryption key with subsequent user terminals; The first transmission module is used to exchange seed keys and and encrypted transmission of indexes.

10. The file ferry system according to claim 8, characterized in that: The subsequent user terminal includes the following modules: The second expansion module is used to expand the seed key into a quantum expansion key; The second hash operation module: used to calculate the hash value of the ciphertext ferrying from the ferry carrier through the preset hash function , used to calculate the hash value of the target file after decrypting the ciphertext through the hash function ; Decryption module: used to decrypt the index of the target file using the first quantum encryption key; for utilizing a second quantum encryption key pair seed key, Decryption; used to decrypt the ciphertext using the quantum extended key to obtain the target file and ; The second storage module is used to store the seed key and ,index; The second cache module: used to cache the decrypted target file and ; The second judgment module: used to judge and Whether they are equal; used to judge and whether they are equal; The second key sharing module is used to share the first quantum encryption key and the second quantum encryption key with the initial user terminal; The second transmission module is used to exchange seed keys with the initial user end. and encrypted transmission of indexes.

11. The file ferry system according to claim 8, characterized in that: The ferry carrier includes the following modules: The third storage module is used to store the ciphertext transferred from the initial user end; The second ferry module is used to ferry the ciphertext from the ferry carrier back to the initial user end and / or the subsequent user end.