A method, device, computing equipment and storage medium for obtaining encrypted files
By adopting on-demand acquisition and hybrid decryption technologies in electronic literature dissemination, long decryption time and copyright protection issues are solved, and data confidentiality and user experience are improved.
Patent Information
- Application Number
- CN202411659918.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-20
AI Technical Summary
In the process of electronic document dissemination, it is difficult for the prior art to improve the user's reading experience while ensuring the security of content. Especially in large-scale data processing and storage, the decryption time is long and the computing resources are consumed, which can easily lead to illegal content dissemination.
By obtaining and decrypting the file content on demand and performing mixed decryption during transmission, the content block is dynamically decrypted by using a hybrid encryption mode of symmetric keys and asymmetric keys, and supporting flexible on-demand data access.
It realizes data confidentiality protection, reduces storage space requirements, improves user reading experience, and reduces waiting time and computing resource consumption through on-demand access and caching mechanisms.
Smart Images

Figure CN119150334B_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 popularization of electronic documents and the enhancement of copyright protection awareness, electronic documents need to be protected during the distribution and dissemination process. At present, the decryption of files is performed as a whole. When the content of the document is huge, the time required to decrypt the entire document increases significantly, resulting in a long wait time for users to open the document, affecting the user's reading experience. In addition, decrypting the entire document requires more computing resources. The decrypted document data is stored in the memory and is easily obtained by malware, resulting in illegal dissemination of the content. Traditional encryption algorithms often cannot effectively prevent data from being intercepted or copied after decryption. Therefore, how to improve the user's reading experience while ensuring content security has become an urgent problem to be solved. 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 scheme proposes an encrypted file acquisition method, device, computing device and storage medium. By acquiring and decrypting file contents on demand and performing mixed decryption during transmission, it can not only increase the confidentiality of the content, but also save storage space and enhance the user reading experience.
[0004] According to a first aspect of the present invention, there is provided a method for obtaining an encrypted file, comprising: receiving a content request sent by a user, the content request including user identity information and requested content information; after verifying the user identity information, obtaining a content block according to the requested content information and loading it into a memory; retrieving a symmetric key and an 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 a client.
[0005] By adopting the above technical solution, the corresponding content blocks are obtained and decrypted according to the specific content information requested by the user, supporting flexible on-demand data access and suitable for large-scale data processing and storage. The required content blocks are decrypted based on the hybrid encryption and decryption algorithm. Even if the data is intercepted during transmission, unauthorized third parties cannot read the content, thereby 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, 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.
[0007] By adopting the above technical solution, by decrypting specific file structure information, such as header and tail information and cross-reference tables, access to file content can be more accurately controlled, allowing the system to access and process partial content without completely 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, thereby reducing data retrieval time and improving 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 the symmetric encryption is used to encrypt the content block itself and the asymmetric encryption is used to encrypt the symmetric key.
[0013] By adopting the above technical solution, the symmetric key is securely transmitted through asymmetric encryption. The security of the key is guaranteed even in an insecure communication channel. This hybrid encryption method allows the system to flexibly update and manage the key.
[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 realize the use of short-term keys and reduce the risk of keys being used by attackers for a long time.
[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 to load 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 the content request sent by the user, and the content request includes the user identity information and the requested content information; the content loading module is used to obtain the content block according to the requested content information after the user identity information is verified 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 the asymmetric key, and output the decrypted content block to the client.
[0020] According to a third aspect of the present invention, there is provided a computing device, 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 at least achieve the following technical effects:
[0023] 1. Obtain and decrypt the corresponding content blocks according to the specific content information requested by the user, realize on-demand access to data, reduce memory overhead, and provide users with faster response time;
[0024] 2. Dynamically decrypt the required content blocks based on the 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.
[0025] 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 according to 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 listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 A block diagram of a computing device 100 according to an embodiment of the present invention is shown;
[0027] Figure 2 A schematic diagram showing a flow chart of an encrypted file acquisition method 200 according to an embodiment of the present invention;
[0028] 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
[0029] When processing large encrypted files and electronic documents, multiple steps are involved, including file indexing, content extraction, decryption, encoding, and display. This solution proposes an encrypted file acquisition method, device, computing device, and storage medium, which can increase the confidentiality of the content, save storage space, and improve the user reading experience by acquiring and decrypting the file content on demand and performing mixed decryption during the transmission process.
[0030] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the 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. On the contrary, 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.
[0031] Figure 1 FIG. 1 is a schematic diagram showing 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.
[0032] The 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. The 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 the processor 104, or in some implementations, the memory controller 118 may be an internal part of the processor 104.
[0033] The system memory 106 may be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.) or any combination thereof. The physical memory in the computing device generally refers to the volatile memory RAM, and the data in the disk needs to be loaded into the physical memory before it can be read by the processor 104. The system memory 106 may include an operating system 120, one or more applications 122, and program data 124. In some embodiments, the application 122 may be arranged to execute instructions on the operating system by one or more processors 104 using the program data 124. The operating system 120 may be, for example, Linux, Windows, etc., which includes program instructions for processing basic system services and performing hardware-dependent tasks. The application 122 includes program instructions for implementing various user-desired functions, and the application 122 may be, for example, a browser, instant messaging software, a software development tool (such as an integrated development environment IDE, a compiler, etc.), etc., but is not limited thereto. When the application 122 is installed in the computing device 100, a driver module may be added to the operating system 120.
[0034] When the computing device 100 starts running, the processor 104 reads and executes the program instructions of the operating system 120 from the memory 106. The application 122 runs on the operating system 120 and uses the interfaces provided by the operating system 120 and the underlying hardware to implement various functions desired by the user. When the user starts the 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.
[0035] Computing device 100 also includes a storage device 132 including a removable storage 136 and a non-removable storage 138 , both of which are connected to storage interface bus 134 .
[0036] The 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 the basic configuration 102 via the bus / interface controller 130. Example output devices 142 include a graphics processing unit 148 and an audio processing unit 150. They 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 may be configured to facilitate communication with external devices such as input devices (e.g., keyboards, mice, pens, voice input devices, touch input devices) or other peripherals (e.g., printers, scanners, etc.) via one or more I / O ports 158. Example communication devices 146 may include a network controller 160, which may 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.
[0037] A network communication link may be an example of a communication medium. Communication media may generally be embodied as computer-readable instructions, data structures, program modules in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium. A "modulated data signal" may be a signal in which one or more of its data sets or its changes may be performed in a manner that encodes information in the signal. As non-limiting examples, communication media may include wired media such as a wired network or a dedicated line network, and various wireless media such as sound, radio frequency (RF), microwave, infrared (IR) or other wireless media. The term computer-readable medium used herein may include both storage media and communication media. In a computing device 100 according to the present invention, an application 122 includes instructions for executing the encrypted file acquisition method 200 of the present invention.
[0038] Figure 2 FIG. 2 is a flow chart of 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, receiving a content request sent by a user, wherein the content request includes user identity information and requested content information.
[0039] It should be noted that before receiving the user's content request, the header and tail information and the cross-reference table are first read from the encrypted file, loaded into the memory, and the header and tail information and the cross-reference table are decrypted. For example, the file operation API can be used to read the 1024 bytes before and after 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 contains encrypted information. After decrypting the cross-reference table, the position and size of the content in the physical file can be obtained, so that it can be quickly located when reading the user's requested content. The information read into the memory can be stored in a byte array or buffer.
[0040] Extract identity information such as user ID and required content information from user requests, such as the requested content type and specific content identifiers (file ID, page number, etc.). Log each user request, including user information, request time, request content, etc.
[0041] 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.
[0042] 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.
[0043] According to an embodiment of the present invention, in order to improve the response speed and processing efficiency, the user request information (request frequency and access status of content blocks) can be recorded through the log system, and the content blocks whose request times exceed the preset threshold can be cached; when the same content block is requested multiple times, the content block is directly obtained from the cache. By caching frequently used content blocks, the system response time and processing efficiency can be improved. An expiration mechanism can also be designed to regularly clean up cached content that is no longer frequently used to ensure the effective use of cache space.
[0044] Finally, step S230 is executed 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.
[0045] 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.
[0046] When decryption is required, the symmetric key decrypted by the corresponding asymmetric key is obtained from the key management system, and the required content block is decrypted using the obtained symmetric key. After decryption, the decrypted content block is sent to the user using a network transmission protocol (such as HTTP / HTTPS). By separating data encryption and key encryption, even if the symmetric key is leaked, as long as the asymmetric key is secure, the attacker cannot decrypt the data.
[0047] When a user is reading content, the current reading progress (such as the current page, reading 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, time series prediction, etc.) 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 the user's waiting time.
[0048] Figure 3 FIG. 3 is a schematic diagram showing 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.
[0049] The request receiving module 310 may receive a content request sent by a user, wherein the content request includes user identity information and requested content information.
[0050] After the user identity information is verified, the content loading module 320 can obtain the content block according to the requested content information and load it into the memory. Referring to the description of method 200, the content loading module 320 can determine the physical location and size information of the required content block by retrieving the cross-reference table, and extract the corresponding content block into the memory according to the physical location and size of the content block. In order to improve the response speed and processing efficiency, the user request information (request frequency and access to the content block) can be recorded through the log system, and the content blocks whose request times exceed the preset threshold can be cached; when the same content block is requested multiple times, the content block is directly obtained from the cache. By caching frequently used content blocks, the system response time and processing efficiency can be improved. An expiration mechanism can also be designed to regularly clean up cached content that is no longer frequently used to ensure the effective use of cache space.
[0051] The decryption module 330 can retrieve the symmetric key and 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. Specifically, when decryption is required, the decryption module 330 can obtain the symmetric key decrypted by the corresponding asymmetric key from the key management system, and use 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 and key encryption, even if the symmetric key is leaked, as long as the asymmetric key is secure, the attacker cannot decrypt the data.
[0052] In summary, the encrypted file acquisition method and device provided by the present invention can at least achieve the following technical effects:
[0053] 1. Obtain and decrypt the corresponding content blocks according to the specific content information requested by the user, realize on-demand access to data, reduce memory overhead, and provide users with faster response time;
[0054] 2. Dynamically decrypt the required content blocks based on the 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.
[0055] 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.
[0056] Although the present invention has been described according to a limited number of embodiments, it will be apparent to those skilled in the art, with the benefit of the above description, that other embodiments may be envisioned within the scope of the invention thus described. In addition, it should be noted that the language used in this specification is selected primarily for readability and teaching purposes, rather than for explaining or defining the subject matter of the present invention. Therefore, 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 illustrative and not restrictive with respect to the scope of the present invention, and the scope of the present invention is defined by the appended claims.
Claims
1. A method for obtaining an encrypted file, characterized in that: include: Reading the header and tail information and the cross-reference table of the encrypted file, loading the header and tail information and the cross-reference table into the memory, and first decrypting the header and tail information and the cross-reference table, wherein the encrypted file includes the header and tail information, the cross-reference table, and the content block, the header and tail information, the cross-reference table, and the content block are encrypted by encryption algorithms respectively, and the cross-reference table records the position and size of the content in the physical file; Receiving a content request sent by a user, the content request including user identity information and requested content information; After the user identity information is verified, the physical location and size of the content block in the cross-reference table are determined according to the user's request content information; Then, the corresponding content block is loaded into the memory according to the physical location and size of the content block, wherein the user request information is recorded and the content block whose request times exceed the preset threshold is cached; when the same content block is requested multiple times, the content block is directly obtained from the cache; Then, the symmetric key and the asymmetric key of the content block are retrieved from the memory, the symmetric key is decrypted based on the asymmetric key to obtain a decrypted symmetric key; the required content block is decrypted using the decrypted symmetric key to obtain a decrypted content block, and the decrypted content block is output to the client; 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.
2. An encrypted file acquisition device, characterized in that: include: A request receiving module receives a content request sent by a user, wherein the content request includes user identity information and requested content information; The content loading module determines the physical location and size of the content block in the cross-reference table according to the user's requested content information after verifying the user's identity information; loads the corresponding content block into the memory according to the physical location and size of the content block, wherein the user's request information is recorded, and the content block whose request times exceed a preset threshold is cached; when the same content block is requested multiple times, the content block is directly obtained from the cache; A decryption module is used to retrieve the symmetric key and the asymmetric key of the content block in the memory, decrypt the symmetric key based on the asymmetric key to obtain the decrypted symmetric key; use the decrypted symmetric key to decrypt the required content block to obtain the decrypted content block, and output the decrypted content block to the client; Before receiving the content request sent by the user, the encrypted file acquisition device further performs the following processing: reading the header and tail information and the cross-reference table of the encrypted file, loading the header and tail information and the cross-reference table into the memory, and first decrypting the header and tail information and the cross-reference table, wherein the encrypted file includes the header and tail information, the cross-reference table, and the content block, the header and tail information, the cross-reference table, and the content block are encrypted by encryption algorithms respectively, and the cross-reference table records the position and size of the content in the physical file; The encrypted file acquisition device is also used for: 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.
3. A computing device, 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 claim 1.
4. A readable storage medium storing program instructions, 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 claimed in claim 1.
Citation Information
Patent Citations
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