Encrypted file acquisition method and device, computing equipment and storage medium
By obtaining and mixing encryption and decrypting algorithms on demand, decrypting file contents, combined with cache and prediction mechanisms, the problems of long decryption time and copyright protection in electronic documents are solved, and the dual effects of fast response and data confidentiality are achieved.
Patent Information
- Application Number
- CN202411659918.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-11-20
AI Technical Summary
In the dissemination of electronic documents, the traditional encrypted file decryption process takes a long time, affecting the user's reading experience, and the decrypted file data is easily acquired by malware, which cannot effectively prevent the data from being intercepted or copied after decryption.
The file content is obtained and decrypted on demand, and decrypted during transmission through a hybrid encryption and decryption algorithm. Combined with the use of symmetric and asymmetric keys, data confidentiality is ensured, and file access is optimized through cache and prediction mechanisms to reduce waiting time.
It realizes on-demand access to data, reduces memory overhead, improves user response time, and prevents unauthorized third parties from reading content during data transmission, protecting the confidentiality of data.
Smart Images

Figure CN119150334A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of copyright protection technology, and in particular to an encrypted file acquisition method, device, computing equipment and storage medium. Background Art
[0002] With the increasing prevalence of electronic documents and growing awareness of copyright protection, copyright protection is required during the distribution and dissemination of electronic documents. Currently, decryption of files is performed in its entirety. When the document content is large, the time required to decrypt the entire document increases significantly, resulting in a long wait time for users to open the document, which affects the user's reading experience. Decrypting the entire document also requires significant computing resources, and the decrypted document data is stored in memory, making it easily accessible to malware and leading to the illegal dissemination of the content. Traditional encryption algorithms often fail to effectively prevent data from being intercepted or copied after decryption. Therefore, how to ensure content security while improving the user's reading experience has become a pressing issue. Summary of the Invention
[0003] In order to solve the problems of long decryption time and copyright protection faced in the dissemination of electronic documents, this solution proposes an encrypted file acquisition method, device, computing device and storage medium. By acquiring and decrypting file content on demand and performing hybrid decryption during transmission, it can not only increase the confidentiality of the content, but also save storage space and improve the user reading experience.
[0004] According to a first aspect of the present invention, a method for obtaining an encrypted file is provided, comprising: receiving a content request sent by a user, the content request including user identity information and requested content information; after successfully verifying the user identity information, obtaining a content block based on the requested content information and loading it into a memory; retrieving a symmetric key and an asymmetric key of the content block from the memory, decrypting the content block based on the symmetric key and the asymmetric key, and outputting the decrypted content block to a client.
[0005] This technical solution retrieves and decrypts the corresponding content blocks based on the specific content information requested by the user, enabling flexible on-demand data access and suitable for large-scale data processing and storage. Decrypting the required content blocks using a hybrid encryption and decryption algorithm prevents unauthorized third parties from reading the content, even if the data is intercepted during transmission, thus protecting the confidentiality of the data.
[0006] Optionally, in the encrypted file acquisition method provided by the present invention, the header and tail information and the cross-reference table of the encrypted file are read, loaded into the memory, and decrypted.
[0007] By adopting the above technical solution, by decrypting specific file structure information, such as header and footer information and cross-reference tables, access to file content can be more accurately controlled, allowing the system to access and process partial content without fully decrypting the entire file.
[0008] Optionally, in the encrypted file acquisition method provided by the present invention, the physical position and size of the content block in the cross-reference table are determined according to the user's request content information; and the corresponding content block is loaded into the memory according to the physical position and size.
[0009] By adopting the above technical solution, the location of the content block is determined according to user needs, unnecessary data loading is avoided, the waiting time for file access is reduced, and a quick response to user requests is achieved.
[0010] Optionally, in the encrypted file acquisition method provided by the present invention, user request information is recorded, and content blocks whose request times exceed a preset threshold are cached; when the same content block is requested multiple times, the content block is directly acquired from the cache.
[0011] By adopting the above technical solution, by caching content blocks whose request times exceed a certain threshold, the system can quickly provide data directly from the cache instead of performing a complete file retrieval and reading each time, which reduces the time for data retrieval and improves the system's response speed.
[0012] Optionally, in the encrypted file acquisition method provided by the present invention, the content block uses a hybrid encryption mode of symmetric encryption and asymmetric encryption, where symmetric encryption is used to encrypt the content block itself and asymmetric encryption is used to encrypt the symmetric key.
[0013] By adopting the above technical solution, symmetric keys are securely transmitted through asymmetric encryption. The security of the keys is guaranteed even in insecure communication channels. This hybrid encryption method allows the system to flexibly update and manage keys.
[0014] Optionally, in the encrypted file acquisition method provided by the present invention, the symmetric key is decrypted based on the asymmetric key to obtain a decrypted symmetric key; the decrypted symmetric key is used to decrypt the required content block to obtain a decrypted content block, and the decrypted content block is sent to the client.
[0015] By adopting the above technical solution, symmetric keys are dynamically generated and exchanged through asymmetric encryption, which can achieve the use of short-term keys and reduce the risk of keys being exploited by attackers in the long term.
[0016] Optionally, in the encrypted file acquisition method provided by the present invention, the user's reading progress is acquired; the content requested by the user is predicted based on the user's reading progress, and the predicted user-requested content is decrypted and stored in a cache.
[0017] By adopting the above technical solution, by predicting the content that the user may need to access and decrypting it in advance, the time the user waits for content loading can be reduced, thereby improving the user's reading experience.
[0018] According to a second aspect of the present invention, there is provided an encrypted file acquisition device, comprising: a request receiving module, a content loading module, and a decryption module.
[0019] Among them, the request receiving module is used to receive content requests sent by users, and the content requests include user identity information and requested content information; the content loading module is used to obtain the content block according to the requested content information after verifying the user identity information and load it into the memory; the decryption module is used to retrieve the symmetric key and asymmetric key of the content block in the memory, decrypt the content block based on the symmetric key and asymmetric key, and output the decrypted content block to the client.
[0020] According to a third aspect of the present invention, a computing device is provided, comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be suitable for execution by the at least one processor, and the program instructions include instructions for executing the above-mentioned encrypted file acquisition method.
[0021] According to a fourth aspect of the present invention, a readable storage medium storing program instructions is provided. When the program instructions are read and executed by a computing device, the computing device executes the above-mentioned encrypted file acquisition method.
[0022] In summary, the encrypted file acquisition method and device provided by the present invention can achieve at least the following technical effects: 1. Obtain and decrypt the corresponding content blocks based on the specific content information requested by the user, enabling on-demand access to data, reducing memory overhead, and providing users with faster response times; 2. Dynamically decrypt the required content blocks based on a hybrid encryption and decryption algorithm. Even if the data is intercepted during transmission, unauthorized third parties cannot read the content, thus protecting the confidentiality of the data.
[0023] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 shows a structural diagram of a computing device 100 according to one embodiment of the present invention; Figure 2A schematic flow chart of a method 200 for obtaining an encrypted file according to an embodiment of the present invention is shown; Figure 3 A schematic structural diagram of an encrypted file obtaining device 300 according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0025] Processing large encrypted files and electronic documents involves multiple steps, including file indexing, content extraction, decryption, encoding, and display. This solution proposes an encrypted file acquisition method, apparatus, computing device, and storage medium. By acquiring and decrypting file content on demand and performing hybrid decryption during transmission, it can enhance content confidentiality, save storage space, and improve the user reading experience.
[0026] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0027] Figure 1 FIG. 1 shows a schematic diagram of the structure of a computing device 100 according to an embodiment of the present invention. Figure 1 As shown, in a basic configuration 102, computing device 100 includes system memory 106 and one or more processors 104. A memory bus 108 may be used for communication between processor 104 and system memory 106.
[0028] Processor 104 may be any type of processor, including, but not limited to, a microprocessor (µP), a microcontroller (µC), a digital signal processor (DSP), or any combination thereof. Processor 104 may include one or more levels of cache, such as a level 1 cache 110 and a level 2 cache 112, a processor core 114, and registers 116. An example processor core 114 may include an arithmetic logic unit (ALU), a floating point unit (FPU), a digital signal processing core (DSP core), or any combination thereof. An example memory controller 118 may be used with processor 104, or in some implementations, may be an internal component of processor 104.
[0029] System memory 106 can be any type of memory, including but not limited to volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory), or any combination thereof. Physical memory in a computing device typically refers to volatile RAM. Data stored on disk must be loaded into physical memory before it can be read by processor 104. System memory 106 may include an operating system 120, one or more applications 122, and program data 124. In some embodiments, applications 122 may be arranged so that one or more processors 104 execute instructions on the operating system using program data 124. Operating system 120, for example, may be Linux or Windows, and includes program instructions for handling basic system services and performing hardware-dependent tasks. Applications 122 include program instructions for implementing various user-desired functions. Applications 122 may include, but are not limited to, browsers, instant messaging software, software development tools (e.g., integrated development environments (IDEs) and compilers), etc. When applications 122 are installed in computing device 100, driver modules may be added to operating system 120.
[0030] When the computing device 100 is started, the processor 104 reads and executes the program instructions of the operating system 120 from the memory 106. Applications 122 run on top of the operating system 120, utilizing the interfaces provided by the operating system 120 and the underlying hardware to implement various user-desired functions. When a user launches an application 122, the application 122 is loaded into the memory 106, and the processor 104 reads and executes the program instructions of the application 122 from the memory 106.
[0031] Computing device 100 also includes a storage device 132 including removable storage 136 and non-removable storage 138 , both of which are connected to storage interface bus 134 .
[0032] Computing device 100 may also include an interface bus 140 that facilitates communication from various interface devices (e.g., output devices 142, peripheral interfaces 144, and communication devices 146) to basic configuration 102 via bus / interface controller 130. Example output devices 142 include a graphics processing unit 148 and an audio processing unit 150. These can be configured to facilitate communication with various external devices, such as a display or speakers, via one or more A / V ports 152. Example peripheral interfaces 144 may include a serial interface controller 154 and a parallel interface controller 156, which can be configured to facilitate communication with external devices, such as input devices (e.g., a keyboard, mouse, pen, voice input device, touch input device) or other peripherals (e.g., a printer, scanner, etc.), via one or more I / O ports 158. Example communication devices 146 may include a network controller 160, which can be arranged to facilitate communication with one or more other computing devices 162 via a network communication link via one or more communication ports 164.
[0033] A network communication link can be an example of a communication medium. Communication media can generally be embodied as computer-readable instructions, data structures, program modules in a modulated data signal such as a carrier wave or other transport mechanism, and can include any information delivery medium. A "modulated data signal" can be a signal in which one or more of a data set or a change thereof can be made in a manner that encodes information in the signal. As non-limiting examples, communication media can include wired media such as a wired network or a dedicated network, and various wireless media such as sound, radio frequency (RF), microwave, infrared (IR) or other wireless media. The term computer-readable media as used herein can include both storage media and communication media. In a computing device 100 according to the present invention, the application 122 includes instructions for executing the encrypted file acquisition method 200 of the present invention.
[0034] Figure 2 FIG. 2 is a flow chart showing a method 200 for obtaining an encrypted file according to an embodiment of the present invention. Figure 2 As shown, the method 200 begins at step S210 , where a content request sent by a user is received. The content request includes user identity information and requested content information.
[0035] It should be noted that before receiving a user's content request, the header and tail information and cross-reference table are first read from the encrypted file, loaded into memory, and then decrypted. For example, the file operation API can be used to read the first and last 1024 bytes of the encrypted file. The first 1024 bytes are usually used to store the file's metadata, file header information, etc., and the last 1024 bytes usually contain the file's tail information or end mark. The header and tail information contain encrypted information. After decrypting the cross-reference table, the location and size of the content in the physical file can be obtained, allowing for quick positioning when reading the user's requested content. The information read into memory can be stored in a byte array or buffer.
[0036] Extract identity information such as the user ID and the required content information from the user request, such as the requested content type and specific content identifiers (file ID, page number, etc.). Log each user request, including user information, request time, and request content.
[0037] Then in step S220, after the user identity information is verified, the relevant content is obtained according to the requested content information and loaded into the memory.
[0038] After comparing the user identity information with the permission data in the database, the physical location and size information of the required content block can be determined by retrieving the cross-reference table, and the corresponding content block can be extracted into the memory according to the physical location and size of the content block.
[0039] According to one embodiment of the present invention, to improve response speed and processing efficiency, a logging system can be used to record user request information (request frequency and content block access status). Content blocks whose request counts exceed a preset threshold can be cached. When the same content block is requested multiple times, the content block is retrieved directly from the cache. Caching frequently used content blocks can improve system response time and processing efficiency. An expiration mechanism can also be designed to regularly clear cached content that is no longer frequently used, ensuring efficient use of cache space.
[0040] Finally, step S230 is executed to retrieve the symmetric key and the asymmetric key of the content block from the memory, decrypt the content block based on the symmetric key and the asymmetric key, and output the decrypted content block to the client.
[0041] The content blocks in the memory use a hybrid mode of symmetric encryption and asymmetric keys, where the symmetric key is used to encrypt the content block itself, and the asymmetric encryption is used to encrypt the symmetric key. The encrypted symmetric key is distributed to authorized users or stored in a key management system.
[0042] When decryption is required, the symmetric key, decrypted from the corresponding asymmetric key, is retrieved from the key management system. The symmetric key is then used to decrypt the desired content block. After decryption, the decrypted content block is sent to the user using a network transmission protocol (such as HTTP / HTTPS). By separating data encryption from key encryption, even if the symmetric key is compromised, as long as the asymmetric key is secure, an attacker cannot decrypt the data.
[0043] As users read content, their current reading progress (e.g., current page, elapsed time, etc.) is recorded. For example, the user's reading progress can be obtained through user interface interaction or timed recording. Based on the user's reading progress, the content requested by the user is predicted, and the predicted content is decrypted and cached. For example, machine learning algorithms (such as collaborative filtering and time series prediction) can be applied to predict the next content block that the user may be interested in. Based on the prediction results, the predicted content block is decrypted in advance using a symmetric key to reduce user waiting time.
[0044] Figure 3 FIG. 3 shows a schematic diagram of the structure of an encrypted file acquisition device 300 according to an embodiment of the present invention. Figure 3 As shown, the device 300 includes: a request receiving module 310, a content loading module 320 and a decryption module 330.
[0045] The request receiving module 310 may receive a content request sent by a user, where the content request includes user identity information and requested content information.
[0046] After verifying the user's identity, the content loading module 320 retrieves the content block based on the requested content information and loads it into memory. Referring to the description of method 200, the content loading module 320 can determine the physical location and size of the required content block by searching a cross-reference table. Based on the physical location and size of the content block, the module extracts the corresponding content block into memory. To improve response speed and processing efficiency, a logging system can be used to record user request information (request frequency and content block access status). Content blocks with a request count exceeding a preset threshold can be cached. When the same content block is requested multiple times, the content block is retrieved directly from the cache. Caching frequently used content blocks can improve system response time and processing efficiency. An expiration mechanism can also be designed to periodically clear cached content that is no longer frequently used, ensuring efficient use of cache space.
[0047] The decryption module 330 retrieves the symmetric and asymmetric keys for the content block from memory, decrypts the content block based on the symmetric and asymmetric keys, and outputs the decrypted content block to the client. Specifically, when decryption is required, the decryption module 330 obtains the symmetric key decrypted from the corresponding asymmetric key from the key management system and uses the obtained symmetric key to decrypt the required content block. After decryption, the decrypted content block is sent to the user using a network transmission protocol (such as HTTP / HTTPS). By separating data encryption from key encryption, even if the symmetric key is compromised, as long as the asymmetric key is secure, an attacker cannot decrypt the data.
[0048] In summary, the encrypted file acquisition method and device provided by the present invention can achieve at least the following technical effects: 1. Obtain and decrypt the corresponding content blocks based on the specific content information requested by the user, enabling on-demand access to data, reducing memory overhead, and providing users with faster response times; 2. Dynamically decrypt the required content blocks based on a hybrid encryption and decryption algorithm. Even if the data is intercepted during transmission, unauthorized third parties cannot read the content, thus protecting the confidentiality of the data.
[0049] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of this description.
[0050] Although the present invention has been described with respect to a limited number of embodiments, it will be apparent to those skilled in the art, having benefit of the foregoing description, that other embodiments are contemplated within the scope of the invention thus described. Furthermore, it should be noted that the language used in this specification has been selected primarily for readability and didactic purposes, rather than for the purpose of explaining or limiting the subject matter of the present invention. Consequently, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is intended to be illustrative and not restrictive of the scope of the invention, which is defined by the appended claims.
Claims
1. A method for obtaining an encrypted file, It is characterized in that include: Receiving a content request sent by a user, wherein the content request includes user identity information and requested content information; After the user identity information is verified, the content block is obtained according to the requested content information and loaded into the memory; The symmetric key and the asymmetric key of the content block are retrieved from the memory, the content block is decrypted based on the symmetric key and the asymmetric key, and the decrypted content block is output to the client.
2. The method for obtaining an encrypted file according to claim 1, It is characterized in that Before the step of receiving a content request sent by a user, the method includes: The header and tail information and the cross-reference table of the encrypted file are read, the header and tail information and the cross-reference table are loaded into the memory, and the header and tail information and the cross-reference table are decrypted.
3. The method for obtaining an encrypted file according to claim 2, It is characterized in that After the user identity information is verified, the step of obtaining relevant content according to the requested content information and loading it into the memory includes: Determine the physical location and size of the content block in the cross-reference table according to the user's request content information; The corresponding content block is loaded into the memory according to the physical location and size.
4. The method for obtaining an encrypted file according to claim 3, It is characterized in that After the user identity information is verified, the step of obtaining the content block according to the requested content information and loading it into the memory also includes: Record user request information and cache content blocks whose request times exceed a preset threshold; When the same content block is requested multiple times, the content block is directly obtained from the cache.
5. The method for obtaining an encrypted file according to claim 3, It is characterized in that The symmetric encryption is used to encrypt the content block itself, and the asymmetric encryption is used to encrypt the symmetric key.
6. The method for obtaining an encrypted file according to claim 5, It is characterized in that The steps of retrieving the symmetric key and the asymmetric key of the content block in the memory, decrypting the content block based on the symmetric key and the asymmetric key, and outputting the decrypted content block to the client include: Decrypting the symmetric key based on the asymmetric key to obtain a decrypted symmetric key; The decrypted symmetric key is used to decrypt the required content block to obtain the decrypted content block, and the decrypted content block is sent to the client.
7. The method for obtaining an encrypted file according to claim 6, It is characterized in that The method further comprises: Get the user's reading progress; The content requested by the user is predicted based on the user's reading progress, and the predicted user requested content is decrypted and stored in the cache.
8. An encrypted file acquisition device, It is characterized in that include: A request receiving module, used to receive a content request sent by a user, wherein the content request includes user identity information and requested content information; A content loading module, configured to obtain a content block according to the requested content information and load it into a memory after the user identity information is verified; The decryption module is used to retrieve the symmetric key and the asymmetric key of the content block in the memory, decrypt the content block based on the symmetric key and the asymmetric key, and output the decrypted content block to the client.
9. A computing device, It is characterized in that include: At least one processor and a memory storing program instructions, wherein the program instructions are configured to be suitable for being executed by the at least one processor, and the program instructions include instructions for executing the encrypted file acquisition method according to any one of claims 1-7.
10. A readable storage medium storing program instructions, It is characterized in that When the program instructions are read and executed by a computing device, the computing device executes the encrypted file acquisition method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Safety data repetition removing method and system applicable to backup system
CN103530201A
Data encrypted transmission method and device
CN109495522A
File storage method and apparatus, and storage medium
CN112088376A
Damaged PDF document repairing method and device, equipment and storage medium
CN118012656A
Distributed data set encryption and decryption
US20180011867A1
