File security caching method and device for instant messaging
By segmenting and encrypting instant messaging files, and using a combination of symmetric and self-encryption algorithms, the problem of insufficient file caching security in instant messaging systems is solved, thereby improving file security and privacy protection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-03-10
AI Technical Summary
The lack of security measures for file caching in existing instant messaging systems makes it easy for users' privacy information to be leaked, especially when the device is lost or misplaced, as the file manager can easily open the cached files.
Instant messaging files are segmented, an index file is built and stored encrypted, and symmetric and self-encryption algorithms are superimposed for encryption. The encryption strategy and storage location are randomly selected to ensure file security and privacy protection.
By employing fragmented encryption and random storage strategies, file reading efficiency is improved, file security is enhanced, privacy information leakage is prevented, the confidentiality of encryption algorithms and keys is ensured, and the risk of cracking is avoided.
Smart Images

Figure CN121637530A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a method and apparatus for secure file caching in instant messaging. Background Technology
[0002] In the context of instant messaging on mobile devices, the importance of secure file caching is becoming increasingly prominent. Its core value lies in three dimensions: data security, user privacy protection, and system efficiency improvement. First, mobile devices, as frequently used tools, often transmit files over public networks. In instant messaging systems, file-related messages are very common (such as pictures, voice messages, videos, and other files). To reduce unnecessary data consumption and improve file access efficiency, file caching is generally implemented.
[0003] However, existing technologies lack security strategies for encryption and access control of caching mechanisms. If file caching is not secured, files in the cache can be opened by file managers or other software, which could lead to the leakage of user privacy information if the user's mobile device is accidentally lost or misplaced. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a file security caching method for instant messaging to eliminate or improve one or more defects existing in the prior art.
[0005] One aspect of the present invention provides a file security caching method for instant messaging, the method comprising the steps of: The instant messaging file to be received is segmented, and an index file corresponding to each segment is built and stored. Based on the index file, the fragmented files of the file to be received are downloaded, and an encryption strategy is selected in the encryption library. The fragmented files are then encrypted and stored based on the encryption strategy. Obtain a file read instruction, parse the encrypted file corresponding to the file read instruction, decrypt the encrypted file, and obtain the index file; The file location of the fragment file is determined based on the index file, and the fragment file is read at that file location.
[0006] The above scheme first pre-builds an index of the file before receiving it. The index file can hide the storage location of the file. On the other hand, when reading the file, it is not necessary to read the entire file. Instead, the corresponding segments can be read, which improves the reading efficiency. Furthermore, this scheme encrypts each segment file by selecting an encryption strategy in the encryption library. Different segments may select different encryption methods, which can further ensure the security of the file.
[0007] In some embodiments of the present invention, the encryption library includes a symmetric encryption algorithm library and a self-encryption algorithm library. The step of selecting an encryption strategy from the encryption library, encrypting and storing the fragmented files based on that encryption strategy is as follows: Randomly generate a key factor, and construct the actual key based on the key factor and the file content of the fragmented file; Based on the actual key and the plaintext content of the index file corresponding to the symmetric encryption algorithm selected from the symmetric encryption algorithm library, the ciphertext is output. The ciphertext, the actual key, and the selected symmetric encryption algorithm number are re-encrypted using a self-encryption algorithm selected from the self-encryption algorithm library to obtain the re-encrypted ciphertext. The re-encrypted ciphertext and the self-encryption algorithm number are saved.
[0008] In some embodiments of the present invention, in the step of randomly generating a key factor and constructing an actual key based on the key factor and the file content of the fragment file, the key factor is randomly generated and then combined with the fragment file number, the MD5 hash of the fragment file and the file content of the fragment file to generate the actual key.
[0009] The above scheme employs two encryption methods in combination during the encryption of fragmented files. On the one hand, the combination enhances the security effect. On the other hand, in the specific application of the two encryption methods, the index file is first encrypted using a symmetric encryption algorithm to obtain ciphertext. Then, a self-encryption algorithm is used to encrypt the ciphertext and the number of the symmetric encryption algorithm again. This further hides the ciphertext and the symmetric encryption algorithm. Even if the re-encrypted ciphertext is cracked, only the number of the symmetric encryption algorithm can be obtained, but the actual symmetric encryption algorithm cannot be determined. Therefore, the ciphertext cannot be cracked, ensuring the encryption effect.
[0010] In some embodiments of the present invention, the steps of selecting a self-encryption algorithm from the self-encryption algorithm library and selecting a symmetric encryption algorithm from the symmetric encryption algorithm library are both performed by random selection.
[0011] By adopting the above scheme, even for the same file, the encryption methods of its various segments may be different through random selection, thus ensuring the confidentiality of the file.
[0012] In some embodiments of the present invention, in the steps of obtaining a file read instruction, parsing the encrypted file corresponding to the file read instruction, decrypting the encrypted file, and obtaining the index file, a self-encryption algorithm is determined based on the self-encryption algorithm number in the encrypted file; the re-encrypted ciphertext is parsed based on the self-encryption algorithm to obtain the ciphertext and the number of the symmetric encryption algorithm; and the ciphertext is parsed based on the number of the symmetric encryption algorithm to determine the plaintext content of the index file.
[0013] In some embodiments of the present invention, a preset number of storage files are constructed in local storage. In the step of segmenting the instant messaging file to be received and constructing an index file corresponding to each segment file, the file size of each storage file is obtained, and the storage location of the index file is selected based on the file size of the storage file. In the step of encrypting and storing the segment files based on the encryption strategy, the file size of each storage file is obtained again, and the storage location of the encrypted file is selected based on the file size of the storage file.
[0014] In some embodiments of the present invention, in the step of encrypting and storing the fragmented files based on the encryption strategy, in the step of re-obtaining the file size of each stored file and selecting the storage location of the encrypted file based on the file size of the stored file, a random UUID is assigned to the fragmented file, and a directory is generated for every two bits of the first eight bits of the UUID, and the files are stored in the corresponding storage locations.
[0015] By adopting the above scheme, the storage location is selected based on the file size of each storage file during both saving processes. Therefore, due to the change in the size of each storage file, the selected storage file may be different in the two saving processes. This scheme can further ensure the confidentiality of the files through the above method.
[0016] In some embodiments of the present invention, in the steps of obtaining a file read instruction and parsing the encrypted file corresponding to the file read instruction, the number of the next segment file of the current segment file is determined based on the number of the segment file corresponding to the encrypted file, the corresponding encrypted file is determined based on the number of the next segment file, and whether to activate the encrypted file corresponding to the next segment file is determined based on the reading progress of the current segment file.
[0017] In some embodiments of the present invention, in the steps of obtaining a file read instruction and parsing the encrypted file corresponding to the file read instruction, the number range of the file segments corresponding to the file read instruction is used to sequentially determine the corresponding encrypted files based on the numbers of the file segments in the number range, and then sequentially decrypt and read the encrypted files.
[0018] A second aspect of the present invention also provides a file security caching device for instant messaging, the device including a computer device including a processor and a memory, the memory storing computer instructions, the processor executing the computer instructions stored in the memory, and the device performing the steps of the method described above when the computer instructions are executed by the processor.
[0019] A third aspect of the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the aforementioned file security caching method for instant messaging.
[0020] Additional advantages, objects, and features of the invention will be set forth in part in the description which follows, and will also become apparent in part to those skilled in the art upon studying the text, or may be learned by practice of the invention. The objects and other advantages of the invention will become apparent from the description and the accompanying drawings.
[0021] Those skilled in the art will understand that the objectives and advantages achievable with the present invention are not limited to those specifically described above, and that the above and other objectives achievable with the present invention will become clearer from the following detailed description. Attached Figure Description
[0022] The accompanying drawings, which are provided to further illustrate the invention and form part of this application, are not intended to limit the scope of the invention.
[0023] Figure 1 This is a schematic diagram of one embodiment of the file security caching method for instant messaging according to the present invention; Figure 2 This is a schematic diagram of the overall process of the file security caching method for instant messaging of the present invention; Figure 3 This is a schematic diagram of the encryption and decryption process of this scheme. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the embodiments and accompanying drawings. Here, the illustrative embodiments and descriptions of this invention are used to explain the invention, but are not intended to limit the invention.
[0025] It should also be noted that, in order to avoid obscuring the invention with unnecessary details, only the structures and / or processing steps closely related to the solution according to the invention are shown in the accompanying drawings, while other details that are not closely related to the invention are omitted.
[0026] The following scenarios are common in daily life: 1. In instant messaging systems, file-related messages are very common (such as pictures, voice messages, videos, and other files). To reduce unnecessary data consumption and improve file access efficiency, files are generally cached.
[0027] 2. For some users, certain files and related messages have sentimental value and will not be deleted.
[0028] 3. In instant messaging systems, to reduce server storage resource consumption, servers generally impose expiration limits on associated files. Expired files are automatically deleted from the background, which means that mobile devices can no longer download them from the background after they expire.
[0029] 4. With the widespread adoption and continuous updates of mobile devices, users may own more than one device, meaning that some devices are not actually in their possession.
[0030] 5. With the widespread use of mobile devices, users frequently lose their phones.
[0031] In summary, if file caching is not secured, cached files can be opened by file managers or other software, which could easily lead to the leakage of user privacy information if the user's mobile device is accidentally lost or misplaced.
[0032] like Figure 1 and 2 As shown, this invention proposes a secure file caching method for instant messaging, the steps of which include: Step S100: The instant messaging file to be received is segmented, an index file corresponding to each segment is constructed, and the index file is stored. In the specific implementation process, before downloading the file, the entire file is divided into several parts according to the file size, an index file is generated, and the index file is encrypted and stored on the disk of the mobile device; specifically, there can be one index file corresponding to each of the said fragment files.
[0033] Step S200: Download the fragmented files of the file to be received based on the index file, select an encryption strategy in the encryption library, encrypt the fragmented files based on the encryption strategy, and store them. Using the above scheme, the file is downloaded in segments based on the content of the index file; after each segment is downloaded, it is encrypted according to the content of the index file.
[0034] Step S300: Obtain a file read instruction, parse the encrypted file corresponding to the file read instruction, decrypt the encrypted file, and obtain the index file; Specifically, based on the file number stored in the message, the index file is located, and its contents are decrypted and read.
[0035] Step S400: Determine the file location of the fragment file based on the index file, and read the fragment file at that file location.
[0036] Specifically, if the file to be received is a video file or an audio file, then according to the playback requirements, the required file segments are found, decrypted, and loaded into the player for playback.
[0037] Based on the above scheme, to improve the efficiency of each of the four stages (download, encryption, decryption, and playback), the file needs to be segmented. For example, when playing a video file, only 15 minutes of video content needs to be read in advance to effectively improve playback efficiency; the same applies to encryption and decryption.
[0038] Specifically, taking the example of splitting a 1GB file into 10 parts, the general content is as follows: Each line represents a segment of information, and 10 segments are 10 lines. Key information in each line includes: Fragment index: Used to identify the splicing order of the fragments. The file must be spliced in the order of this index to form a complete file; Fragmentation encryption strategy: This refers to the encryption strategy for the fragment. This part of the information is stored in ciphertext, and the algorithm and key are provided by the application software code. Fragment start and end positions: These indicate the position of the fragment within the complete file. For example, the start and end positions of fragment 5 are 400MB and 500MB within the complete file, respectively.
[0039] The above scheme first pre-builds an index of the file before receiving it. The index file can hide the storage location of the file. On the other hand, when reading the file, it is not necessary to read the entire file. Instead, the corresponding segments can be read, which improves the reading efficiency. Furthermore, this scheme encrypts each segment file by selecting an encryption strategy in the encryption library. Different segments may select different encryption methods, which can further ensure the security of the file.
[0040] like Figure 3 As shown, in some embodiments of the present invention, the encryption library includes a symmetric encryption algorithm library and a self-encryption algorithm library. The step of selecting an encryption strategy from the encryption library, encrypting and storing the fragmented file based on that encryption strategy is as follows: Randomly generate a key factor, and construct the actual key based on the key factor and the file content of the fragmented file; Based on the actual key and the plaintext content of the index file corresponding to the symmetric encryption algorithm selected from the symmetric encryption algorithm library, the ciphertext is output. The ciphertext, the actual key, and the selected symmetric encryption algorithm number are re-encrypted using a self-encryption algorithm selected from the self-encryption algorithm library to obtain the re-encrypted ciphertext. The re-encrypted ciphertext and the self-encryption algorithm number are saved.
[0041] In some embodiments of the present invention, in the step of randomly generating a key factor and constructing an actual key based on the key factor and the file content of the fragment file, the key factor is randomly generated and then combined with the fragment file number, the MD5 hash of the fragment file and the file content of the fragment file to generate the actual key.
[0042] In practice, the MD5 calculation of the fragmented file is to read the file blocks (such as 8KB / 64KB) in a fixed order, update the hash value of each block using MessageDigest (Java) or hashlib (Python), and finally merge them to generate a complete MD5.
[0043] In existing technologies, file encryption and decryption using keys and algorithms provided in application software code is quite common. However, it has drawbacks including: the possibility of leaks in the front-end software leading to key and algorithm leaks; the keys and algorithms being relatively fixed, making it easy to crack one file and then others; and the inability to change the keys and algorithms in the application software, as doing so would render historical files undecryptable. While it's possible to upgrade along with historical files, it's important to note that since both the application software and these files reside on the mobile device, the reliability of a complete update is too low (e.g., the update might be interrupted if the user uninstalls the application during the update process). In summary, using the above encryption methods makes it difficult to improve the security and strength of the encryption strategy during continuous application iteration.
[0044] The above scheme employs two encryption methods in combination during the encryption of fragmented files. On the one hand, the combination enhances the security effect. On the other hand, in the specific application of the two encryption methods, the index file is first encrypted using a symmetric encryption algorithm to obtain ciphertext. Then, a self-encryption algorithm is used to encrypt the ciphertext and the number of the symmetric encryption algorithm again. This further hides the ciphertext and the symmetric encryption algorithm. Even if the re-encrypted ciphertext is cracked, only the number of the symmetric encryption algorithm can be obtained, but the actual symmetric encryption algorithm cannot be determined. Therefore, the ciphertext cannot be cracked, ensuring the encryption effect.
[0045] In some embodiments of the present invention, the steps of selecting a self-encryption algorithm from the self-encryption algorithm library and selecting a symmetric encryption algorithm from the symmetric encryption algorithm library are both performed by random selection.
[0046] By adopting the above scheme, even for the same file, the encryption methods of its various segments may be different through random selection, thus ensuring the confidentiality of the file.
[0047] During the specific encryption process, the application retrieves and updates the symmetric encryption algorithm library and self-encryption algorithm library of the foreground application from the server when it starts up; When writing to the index file, follow these steps: Key generation: The software code randomly generates key factors, which are then mixed with information such as the file number, file MD5 hash, and the file content itself to generate the actual key; Randomly select one algorithm from the symmetric encryption algorithm library and one self-encryption algorithm library in the front-end application; Symmetric encryption: Encrypts the plaintext content of the index file using the actual key and a chosen symmetric encryption algorithm, outputting ciphertext. Self-encryption: The ciphertext is re-encrypted using a selected self-encryption algorithm, hiding the actual key and symmetric algorithm number in the re-encryption result; Write to file: Write the re-encryption result and the self-encryption algorithm number to the disk.
[0048] In some embodiments of the present invention, in the steps of obtaining a file read instruction, parsing the encrypted file corresponding to the file read instruction, decrypting the encrypted file, and obtaining the index file, a self-encryption algorithm is determined based on the self-encryption algorithm number in the encrypted file; the re-encrypted ciphertext is parsed based on the self-encryption algorithm to obtain the ciphertext and the number of the symmetric encryption algorithm; and the ciphertext is parsed based on the number of the symmetric encryption algorithm to determine the plaintext content of the index file.
[0049] This encryption and decryption scheme uses a server-provided encryption algorithm, reducing the risk of algorithm leakage in application software. The symmetric algorithm and key are variable, with one key per file, preventing the cracking of one file from leading to the cracking of others. The key, symmetric algorithm, and self-encryption algorithm are hidden within the file, eliminating the need to consider historical files and facilitating algorithm changes for new files. Examples of encryption algorithms include: using AES symmetric encryption, inserting unnecessary characters into the ciphertext. These overlays can be simple or complex, primarily providing different symmetric encryption strategies. Examples of self-encryption algorithms include: inserting a key character every 10 bytes of the ciphertext, with similar algorithm numbering. These overlays can also be simple or complex, primarily providing different self-encryption strategies.
[0050] In some embodiments of the present invention, a preset number of storage files are constructed in local storage. In the step of segmenting the instant messaging file to be received and constructing an index file corresponding to each segment file, the file size of each storage file is obtained, and the storage location of the index file is selected based on the file size of the storage file. In the step of encrypting and storing the segment files based on the encryption strategy, the file size of each storage file is obtained again, and the storage location of the encrypted file is selected based on the file size of the storage file.
[0051] Using the above scheme, for a complete file, the storage locations of each fragment may be different. Even if one fragment is obtained, the complete data cannot be obtained, and therefore the entire file cannot be cracked. Furthermore, the storage of each fragment is random, making it difficult to predict based on patterns.
[0052] In some embodiments of the present invention, in the step of encrypting and storing the fragmented files based on the encryption strategy, in the step of re-obtaining the file size of each stored file and selecting the storage location of the encrypted file based on the file size of the stored file, a random UUID is assigned to the fragmented file, and a directory is generated for every two bits of the first eight bits of the UUID, and the files are stored in the corresponding storage locations.
[0053] Specifically, each segment of a complete file is assigned a random UUID (32 bits long). The first 8 bits are used to generate a directory for every 2 bits (e.g., if aabbccdd, the generated directory is aa / bb / cc / dd). The last 24 bits are the segment name.
[0054] In the specific implementation process, the above methods can avoid simple patterns that are easy to crack, and at the same time avoid different file fragments with the same name from overwriting each other, which would lead to file corruption.
[0055] By adopting the above scheme, the storage location is selected based on the file size of each storage file during both saving processes. Therefore, due to the change in the size of each storage file, the selected storage file may be different in the two saving processes. This scheme can further ensure the confidentiality of the files through the above method.
[0056] In some embodiments of the present invention, in the steps of obtaining a file read instruction and parsing the encrypted file corresponding to the file read instruction, the number of the next segment file of the current segment file is determined based on the number of the segment file corresponding to the encrypted file, the corresponding encrypted file is determined based on the number of the next segment file, and whether to activate the encrypted file corresponding to the next segment file is determined based on the reading progress of the current segment file.
[0057] In some embodiments of the present invention, in the steps of obtaining a file read instruction and parsing the encrypted file corresponding to the file read instruction, the number range of the file segments corresponding to the file read instruction is used to sequentially determine the corresponding encrypted files based on the numbers of the file segments in the number range, and then sequentially decrypt and read the encrypted files.
[0058] During the decryption and reading process, the index file corresponding to the file message is located according to the index file storage location rules, and the cached index information is obtained after decryption. The required segment information is then located based on usage needs; for video files, audio files, etc., loading does not always start from the first segment. Based on the storage location and encryption strategy of the segment in the index file, the data stream of that segment is decrypted to obtain its data stream. For video and audio files, the data stream of that segment is loaded into the player for playback. For other file types, the data stream of that segment is loaded into the online previewer for previewing, or all segments are sequentially integrated and saved as a different file.
[0059] This invention also provides a file security caching device for instant messaging. The device includes a computer device, which includes a processor and a memory. The memory stores computer instructions, and the processor executes the computer instructions stored in the memory. When the computer instructions are executed by the processor, the device implements the steps of the method described above.
[0060] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the aforementioned file security caching method for instant messaging. The computer-readable storage medium can be a tangible storage medium, such as random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, floppy disks, hard disks, removable storage disks, CD-ROMs, or any other form of storage medium known in the art.
[0061] Those skilled in the art will understand that the exemplary components, systems, and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Whether implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention. When implemented in hardware, it can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this invention are programs or code segments used to perform the desired tasks. The programs or code segments can be stored in a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried in a carrier wave.
[0062] It should be clarified that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of the present invention.
[0063] In this invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or in place of features of other embodiments.
[0064] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations can be made to the embodiments of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A file security caching method for instant messaging, characterized by, The steps of the method comprise: The file to be received in instant messaging is fragmented, an index file corresponding to each fragmented file is constructed, and the index file is stored; The fragmented file of the file to be received is downloaded based on the index file, an encryption strategy is selected in the encryption library, the fragmented file is encrypted based on the encryption strategy and stored; A file reading instruction is obtained, the encrypted file corresponding to the file reading instruction is parsed, the encrypted file is decrypted, and the index file is obtained; The file position of the fragmented file is determined based on the index file, and the fragmented file is read at the file position.
2. The file security caching method for instant messaging according to claim 1, wherein, The encryption library comprises a symmetric encryption algorithm library and a self-encryption algorithm library, and in the step of selecting an encryption strategy in the encryption library, encrypting the fragmented file based on the encryption strategy, and storing the fragmented file: A secret key factor is randomly generated, and an actual secret key is constructed based on the secret key factor and the file content of the fragmented file; The plaintext content of the index file corresponding to the fragmented file is encrypted based on the actual secret key and a symmetric encryption algorithm selected from the symmetric encryption algorithm library, and the ciphertext is outputted; The ciphertext, the actual secret key, and the number of the selected symmetric encryption algorithm are re-encrypted using a self-encryption algorithm selected from the self-encryption algorithm library, and re-encrypted ciphertext is obtained; The re-encrypted ciphertext and the number of the self-encryption algorithm are saved.
3. The file security caching method for instant messaging according to claim 1, wherein, In the step of randomly generating a secret key factor and constructing an actual secret key based on the secret key factor and the file content of the fragmented file, the secret key factor is randomly generated, and then combined with the number of the fragmented file, the MD5 of the fragmented file, and the file content of the fragmented file to generate the actual secret key.
4. The file security caching method for instant messaging according to claim 1, wherein, In the steps of selecting a self-encryption algorithm from the self-encryption algorithm library and selecting a symmetric encryption algorithm from the symmetric encryption algorithm library, random selection is adopted.
5. The file security caching method for instant messaging according to claim 2, wherein, In the step of obtaining a file reading instruction, parsing the encrypted file corresponding to the file reading instruction, decrypting the encrypted file, and obtaining the index file, the self-encryption algorithm is determined based on the number of the self-encryption algorithm in the encrypted file, the re-encrypted ciphertext is parsed based on the self-encryption algorithm, the ciphertext and the number of the symmetric encryption algorithm are obtained, and the plaintext content of the index file is determined by parsing the ciphertext based on the number of the symmetric encryption algorithm.
6. The file security caching method for instant messaging according to any one of claims 1 to 5, wherein, In the steps of fragmenting the file to be received in instant messaging and constructing an index file corresponding to each fragmented file, the file sizes of the storage files are obtained, and the storage positions of the index files are selected based on the file sizes of the storage files; in the step of encrypting the fragmented file based on the encryption strategy and storing the fragmented file, the file sizes of the storage files are re-obtained, and the storage positions of the encrypted files are selected based on the file sizes of the storage files.
7. The file security caching method for instant messaging according to claim 6, wherein, In the step of re-obtaining the file sizes of the storage files and selecting the storage positions of the encrypted files based on the file sizes of the storage files, a UUID is randomly generated for the fragmented file, a directory is generated every 2 bits in the first 8 bits of the UUID, and the corresponding storage positions are stored.
8. The file security caching method for instant messaging according to claim 6, wherein, In the step of acquiring a file reading instruction and parsing an encrypted file corresponding to the file reading instruction, the number of the next slice file of the current slice file is determined based on the number of the slice file corresponding to the encrypted file, the encrypted file corresponding to the next slice file is determined based on the number of the next slice file, and whether to activate the encrypted file corresponding to the next slice file is determined based on the reading progress of the current slice file.
9. The file security caching method for instant messaging according to claim 6, wherein, In the step of acquiring a file reading instruction and parsing an encrypted file corresponding to the file reading instruction, the number range of the slice file corresponding to the file reading instruction, the encrypted file corresponding to the slice file in the number range is sequentially determined based on the number of the slice file, and the encrypted file is sequentially decrypted and read.
10. A file security caching apparatus for instant messaging, characterized by, The device comprises a computer device, the computer device comprising a processor and a memory, the memory storing computer instructions, and the processor being configured to execute the computer instructions stored in the memory, and the device implements the steps of the method as claimed in any one of claims 1-9 when the computer instructions are executed by the processor.