File processing method and device based on offline device and electronic device

By automatically decrypting encrypted files using device information on offline devices, the problem of cumbersome file decryption processes is solved, achieving efficient and secure file processing.

CN114239014BActive Publication Date: 2025-12-26BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111537845.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-15
Publication Date
2025-12-26
Estimated Expiration
2041-12-15

AI Technical Summary

Technical Problem

In existing technologies, the decryption process for important documents is cumbersome, resulting in low processing efficiency, and the manual input of passwords by users increases the risk of leakage.

Method used

By using device information on an offline device to obtain the target private key corresponding to a preset public key, encrypted files can be automatically decrypted, achieving a decryption process that does not require the user to manually enter a password.

Benefits of technology

It simplifies the operation process, improves processing efficiency, reduces the risk of human-caused leakage, and enhances security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114239014B_ABST
    Figure CN114239014B_ABST
Patent Text Reader

Abstract

The present disclosure provides an offline device-based file processing method and device, electronic equipment and storage medium, relating to the technical field of computers, especially to the field of information security. The specific implementation scheme is: in response to an instruction to open an encrypted file through a target application program, an encryption password used by the encrypted file is obtained, wherein the encrypted file is obtained by encrypting an original file with an original password, and the encryption password is obtained by encrypting the original password with a preset public key; based on the device information of the offline device, a target private key corresponding to the preset public key is obtained; the target private key is used to decrypt the encryption password to obtain the original password; and the original password is used to decrypt the encrypted file to obtain the original file. The present disclosure does not require the user to manually input the password, solves the technical problem of complicated operation and low processing efficiency, and thus achieves the technical effect of improving the processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computers, in particular to the technical field of information security, and specifically to a file processing method and device based on an offline device, an electronic device, and a storage medium. BACKGROUND

[0002] In order to ensure data security, important files are usually encrypted, and when the encrypted files need to be used, the corresponding key needs to be used for decryption. In general, the encrypted files can be decrypted by manually inputting a password by the user. In order to prevent large-scale data leakage, a different password needs to be randomly generated for each file, which makes the use of the user very cumbersome. Therefore, the related art has the technical problem of complicated operation and low processing efficiency. SUMMARY

[0003] The present disclosure provides a file processing method and device based on an offline device, an electronic device, and a storage medium.

[0004] According to a first aspect of the present disclosure, a file processing method based on an offline device is provided, including: in response to an instruction to open an encrypted file through a target application program, obtaining an encryption password used by the encrypted file, wherein the encrypted file is obtained by encrypting an original file through an original password, and the encryption password is obtained by encrypting the original password through a preset public key; based on device information of the offline device, obtaining a target private key corresponding to the preset public key; decrypting the encryption password using the target private key to obtain the original password; and decrypting the encrypted file using the original password to obtain the original file.

[0005] According to a second aspect of the present disclosure, a file processing device based on an offline device is provided, including: a password obtaining module configured to, in response to an instruction to open an encrypted file through a target application program, obtain an encryption password used by the encrypted file, wherein the encrypted file is obtained by encrypting an original file through an original password, and the encryption password is obtained by encrypting the original password through a preset public key; a private key obtaining module configured to, based on device information of the offline device, determine a target private key corresponding to the preset public key; a password decryption module configured to decrypt the encryption password using the target private key to obtain the original password; and a file decryption module configured to decrypt the encrypted file using the original password to obtain the original file.

[0006] According to a third aspect of the present disclosure, an electronic device is provided, including: at least one processor; and a memory communicatively connected with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute any one of the methods in the file processing method based on an offline device in the first aspect.

[0007] According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute any one of the methods of the offline device based file processing method of the first aspect.

[0008] According to a fifth aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method of any one of the offline device based file processing method of the first aspect.

[0009] In the embodiments of the present disclosure, the operation steps can be simplified, and the technical effect of improving processing efficiency is achieved.

[0010] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0011] The accompanying drawings are used to better understand the present scheme and do not limit the present disclosure. Among them:

[0012] Figure 1 is a flowchart of an offline device based file processing method according to an embodiment of the present disclosure;

[0013] Figure 2 is a flowchart of an offline device based file processing method according to a preferred embodiment of the present disclosure;

[0014] Figure 3 is a structural schematic diagram of an offline device based file processing device according to an embodiment of the present disclosure;

[0015] Figure 4 shows a schematic block diagram of an example electronic device 400 that can be used to implement embodiments of the present disclosure. DETAILED DESCRIPTION

[0016] Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which include various details of the embodiments of the present disclosure to help in understanding, and should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Also, in order to be clear and concise, descriptions of well-known functions and structures are omitted in the following description.

[0017] Figure 1 is a flowchart of an offline device based file processing method according to an embodiment of the present disclosure, as Figure 1 shown, the method comprises the following steps:

[0018] In step S101, in response to an instruction of opening the encrypted file by the target application program, an encryption password used by the encrypted file is obtained, wherein the encrypted file is obtained by encrypting an original file by an original password, and the encryption password is obtained by encrypting the original password by a preset public key.

[0019] Specifically, the target application program can be a specific application program for opening an encrypted file when working on a designated offline device. The original password can be a plaintext password for decrypting the encrypted file. The encryption password can be ciphertext obtained by encrypting the original password by the preset public key. The encryption password can be attached in the encrypted file and sent together with the file, that is, the encryption password is bound with the encrypted file. When a user needs to use the encrypted file in the offline device, the encrypted file can be opened by the target application program. At this time, the target application program can obtain an instruction of opening the encrypted file. In response to the instruction, the encryption password attached in the encrypted file is read first. In addition, the information attached in the encrypted file is not limited to the encryption password, but can also include, but is not limited to, password validity information, so that the encrypted file cannot be decrypted after the validity period limited in the validity information is exceeded.

[0020] In an optional embodiment, any mature encryption algorithm can be used to encrypt the original file by the original password to obtain the encrypted file. For example, the original file can be a single file, and then binary data or text can be directly encrypted. The encrypted file can be a compressed file, and then an encryption algorithm after a compression protocol can be used for encryption.

[0021] In an optional embodiment, the binding manner of the encryption password and the encrypted file can include, but is not limited to, the following manners:

[0022] Manner one: for a new technology file system (NTFS), the encryption password can be written into a backup data stream of the file. Manner two: the encryption password can be directly written in binary form to the end of the file. Manner three: if the file is a compressed package, the encryption password can be added to the compressed package in the form of a file, but the file of the encryption password is not encrypted.

[0023] In step S102, based on device information of the offline device, a target private key corresponding to the preset public key is obtained.

[0024] Specifically, the device information of the offline device can include, but is not limited to, a motherboard number, a system installation time, a hard disk number, and the like. The preset public key and the target private key can be an asymmetric key pair determined in combination with the device information of the offline device, and thus, after reading the authorization certificate in the offline device, a feature code can be determined based on the device information of the offline device, and then the authorization certificate is decrypted using the feature code to obtain the target private key corresponding to the preset public key. The feature code includes, but is not limited to, a board number, a system installation time, a hard disk number, and the like, and a result obtained by operating them through a certain function. The target private key can be a key for decrypting a file encrypted by the preset public key.

[0025] In an optional embodiment, the target application program on the offline device includes a feature code extraction module for extracting the feature code on the offline device, and the feature code extraction module must be issued with the target program. In order to prevent it from being at risk of leakage, the module is generally implemented in C++ or Rust and the like, so that it is directly compiled into machine code to increase the cracking cost. At the same time, the feature code extraction module will contain the Hash value of the target program, and when the feature code extraction module is called, the calling program is Hash calculated and compared with the built-in Hash. If the Hash values do not match, the call fails; if the Hash values match, the call can be made. The Hash calculation can include, but is not limited to, for example, Message-Digest Algorithm (MD5) or SHA256 (Secure Hash Algorithm 256), which is an information digest algorithm with a length of 256.

[0026] Step S103, decrypt the encrypted password using the target private key to obtain the original password.

[0027] Specifically, the target private key is stored in the memory of the offline device, and after obtaining the private key, the encrypted password encrypted by the preset public key can be decrypted using the private key to obtain the original password. It should be noted that the original password is a plaintext password.

[0028] Step S104, decrypt the encrypted file using the original password to obtain the original file.

[0029] Specifically, the encrypted file is decrypted by the original password. It should be noted that since the encryption methods are different, the corresponding decryption methods can also be different. The decryption method used for decryption here depends on the encryption method of the encrypted file.

[0030] It should be noted that the above-mentioned encrypted password, target private key and original password all belong to sensitive information, and can only exist in the memory of the offline device throughout the process, and cannot be transmitted or persisted in any form.

[0031] In the above embodiment, the application can obtain the encryption password from the encrypted file through the target application, and obtain the target private key based on the offline device information, and then decrypt the encryption password using the target private key to obtain the original password, and decrypt the encrypted file using the original password to obtain the original file. It is easy to note that the application can respond to the instruction of opening the encrypted file by using the target application to decrypt the encrypted file, without the need for the user to manually input the password, thereby solving the technical problem of complicated operation and low processing efficiency, and achieving the technical effect of improving the processing efficiency. In addition, in the method provided by the application, the user does not need to know the original password, thereby reducing the risk of human disclosure and achieving the technical effect of improving the security.

[0032] Optionally, based on the device information of the offline device, the target private key corresponding to the preset public key is obtained by: extracting the feature code of the offline device based on the device information of the offline device; reading the target certificate stored in the offline device, wherein the target certificate is obtained by encrypting the target private key using the feature code; and decrypting the target certificate using the feature code to obtain the target private key.

[0033] Specifically, the device information can include but is not limited to the motherboard number, system installation time, hard disk number and the like of the offline device. The feature code can include but is not limited to the motherboard number, system installation time, hard disk number and the like, and the results obtained by operating them through a certain function. The target certificate can be obtained by encrypting the feature code using the target private key on the server, and then transmitting the certificate to the offline device in any form, and the transmission process does not need to use encrypted transmission. Then, the target private key is obtained by decrypting the target certificate using the feature code.

[0034] In the above optional embodiment, the private key is obtained from the authorization certificate encrypted from the feature code, so that only in the case of having the target application, the encrypted file and the offline device, the original file can be obtained. Therefore, if the target certificate is leaked during transmission, it is difficult for others to obtain the original file since the encrypted file is stored in the offline device, thereby achieving the technical effect of improving the security.

[0035] Optionally, before responding to the instruction of opening the encrypted file through the target application, it further includes: extracting the feature code of the offline device through the target device; uploading the feature code to the target server through the target device, wherein the target server is used to encrypt the target private key based on the feature code to generate the target certificate; receiving the target certificate returned by the target server through the target device; and storing the target certificate to the offline device through the target device.

[0036] Specifically, the target device can be a device for extracting the feature code of the offline device, and can be connected with the offline device and the target server. After the target device acquires the device information of the offline device, and generates the feature code based on the device information, the target device encrypts the feature code by using an asymmetric encryption algorithm, and transmits the ciphertext obtained to the target server. After the target server decrypts the ciphertext by using a corresponding private key, the target server obtains the feature code, and then encrypts the target private key by using the feature code to generate a target certificate. Then, the target certificate is transmitted to the offline device in any transmission form. In an optional embodiment, the target device can receive the target certificate returned by the target server, and then the target device transmits the authorization certificate to the offline device.

[0037] It should be noted that after the offline device obtains the target certificate, the connection with the target device is disconnected.

[0038] In the above optional embodiment, after the offline device obtains the target certificate, the connection with the target device is disconnected, so that the feature code of the offline device cannot be extracted by using the target device in the case that the target device is obtained by others, thereby reducing the possibility of feature code leakage, and further achieving the technical effect of improving security.

[0039] Optionally, in the case that the target device includes a first device and a second device, the first device is used to extract the feature code, the second device is used to upload the feature code to the target server, receive the target certificate returned by the target server, and store the target certificate to the offline device.

[0040] Specifically, the first device can be used to extract the feature code of the offline device, but does not connect with the target server. After the first device extracts the feature code and encrypts the feature code by using an asymmetric encryption algorithm to obtain ciphertext, the ciphertext is transmitted to the second device. The second device transmits the ciphertext to the target server, receives the target certificate returned by the server, and stores the certificate to the offline device.

[0041] In the above optional embodiment, the first device used for extracting the feature code does not connect with the server, which further reduces the possibility of feature code leakage, and further achieves the technical effect of improving security.

[0042] Optionally, the target device is used to encrypt and transmit the feature code.

[0043] Specifically, the feature code can be encrypted by using an asymmetric encryption algorithm, and the ciphertext obtained by the encryption can be used for transmission.

[0044] In the above optional embodiment, the encryption transmission is used, and further achieves the technical effect of improving security.

[0045] Optionally, the feature code of the offline device is extracted by: performing hash calculation on the target application to obtain a target hash value of the target application; matching the target hash value with a preset hash value of the target application, wherein the preset hash value is stored in the offline device; and in response to successful matching of the target hash value with the preset hash value, extracting the feature code of the offline device.

[0046] Specifically, the preset hash value is built in the target application, and in the decryption process, the target application obtains the hash value built in the feature extraction module of the application, performs operation based on the hash value, for example, MD5 or SHA256, to obtain a target hash value, and matches the hash value with the preset hash value, if the matching is successful, the extraction of the feature code of the offline device can be continued.

[0047] In the optional embodiment, the target application is verified by using the algorithm, which reduces the possibility that the feature extraction module is leaked and other personnel also obtain the original data, and thus the technical effect of improving security is achieved.

[0048] Optionally, before the feature code of the offline device is extracted, the following steps are further included: obtaining a valid time corresponding to the encrypted file; verifying the valid time to obtain a verification result of the valid time, wherein the verification result is used to represent whether the valid time exceeds a preset time; and in response to the verification result being that the valid time does not exceed the preset time, extracting the feature code.

[0049] Specifically, the valid time can be information attached to the original file when the original file is encrypted, representing the valid time of the encrypted file, and after the valid time is exceeded, the encrypted file cannot be decrypted. Real-time time is obtained, if the real-time time does not exceed the valid time, the verification is passed, if the real-time time exceeds the valid time, the verification is failed, and the encrypted file cannot be decrypted.

[0050] In the optional embodiment, the encrypted file is verified in combination with the valid time, and after the valid time is exceeded, the encrypted file cannot be decrypted, and thus the technical effect of improving security is achieved.

[0051] Optionally, the encryption password, the target private key and the original password are stored in the memory of the offline device.

[0052] Specifically, since the encryption password, the target private key and the original password all belong to sensitive information, in order to prevent them from being leaked, they cannot be transmitted or persisted in any form.

[0053] In the optional embodiment, by storing the sensitive information in the memory, the possibility of leakage of the sensitive information is further reduced, and thus the technical effect of improving security is achieved.

[0054] Optionally, the encryption password used for obtaining the encrypted file comprises at least one of the following: the encryption password is extracted from a preset data stream of the encrypted file; the encryption password is extracted from a tail of the encrypted file; and the encryption password is extracted from a compressed package in which the encrypted file is located.

[0055] Specifically, for a new technology file system, the encryption password can be written into a spare data stream of the file. The encryption password can be directly written in binary form to the end of the file. If the file is a compressed package, the encryption password can be added to the compressed package in the form of a file, but the file of the encryption password is not encrypted.

[0056] In the optional embodiment, multiple encryption modes are provided, thereby achieving the technical effect of improving applicability.

[0057] In a preferred embodiment, as shown in Figure 2 , a device containing a feature code extraction module is connected to an offline job device, or the feature code extraction module is installed on the offline job device to extract the device feature code. If the feature code extraction module and the certificate granting module are the same program on the same device, the extracted feature code can be directly encrypted and uploaded to the server; if the two modules are separated on different devices, the feature code needs to be encrypted for transmission to prevent the feature code from being leaked. The encrypted transmission can use asymmetric encryption, that is, the feature code extraction module uses a public key to encrypt the feature code, and then outputs the encrypted result to the certificate granting module. After the server for authorization receives the feature code, the authorization private key is symmetrically encrypted using the feature code, and the encrypted data is the authorization certificate. The encrypted authorization private key will be used for decryption of the encrypted file encryption password. After receiving the authorization certificate returned by the server, the certificate granting module can place it in the offline job device in any transmission form, that is, the deployment of the certificate is completed. The transmission process does not need to be encrypted, because the authorization certificate has been bound to the specified offline job device, and even if it is leaked, it will not have adverse effects.

[0058] According to the embodiments of the present disclosure, an embodiment of a file processing device based on an offline device is also provided. The specific implementation manners and optional embodiments in the embodiment are similar or identical to those in the above embodiments, and are not described herein.

[0059] Figure 3 is a structural schematic diagram of a file processing device based on an offline device according to an embodiment of the present disclosure, as shown in Figure 3 , the device comprises:

[0060] The password obtaining module 31 is configured to obtain an encryption password used for an encrypted file in response to an instruction of opening the encrypted file through a target application program, wherein the encrypted file is obtained by encrypting an original file through an original password, and the encryption password is obtained by encrypting the original password through a preset public key.

[0061] The private key acquisition module 32 is configured to determine a target private key corresponding to a preset public key based on the device information of the offline device.

[0062] The password decryption module 33 is configured to decrypt the encrypted password by using the target private key to obtain an original password.

[0063] The file decryption module 34 is configured to decrypt the encrypted file by using the original password to obtain an original file.

[0064] In the above embodiment, the application can obtain the encrypted password from the encrypted file by using the target application, and determine the target private key based on the device information of the offline device, and then decrypt the encrypted password by using the target private key to obtain the original password, and decrypt the encrypted file by using the original password to obtain the original file. It is easy to note that the application can respond to the instruction of opening the encrypted file by using the target application to decrypt the encrypted file, without the need for the user to manually input the password, thereby solving the technical problem of complicated operation and low processing efficiency, and achieving the technical effect of improving the processing efficiency. In addition, in the device provided by the application, the user does not need to know the original password, thereby reducing the risk of human disclosure and achieving the technical effect of improving the security.

[0065] Optionally, the private key acquisition module comprises: a feature code extraction unit configured to extract a feature code of the offline device based on the device information of the offline device; a certificate reading unit configured to read a target certificate stored in the offline device, wherein the target certificate is obtained by encrypting the target private key by using the feature code; and a key decryption unit configured to decrypt the target certificate by using the feature code to obtain the target private key.

[0066] Optionally, the device further comprises: the feature code extraction module is further configured to extract the feature code of the offline device by using the target device; a feature code uploading module configured to upload the feature code to a target server by using the target device, wherein the target server is configured to encrypt the target private key based on the feature code to generate the target certificate; a certificate receiving module configured to receive the target certificate returned by the target server by using the target device; and a certificate storage module configured to store the target certificate to the offline device by using the target device.

[0067] Optionally, in the case where the target device comprises a first device and a second device, the first device is configured to extract the feature code, the second device is configured to upload the feature code to the target server, receive the target certificate returned by the target server, and store the target certificate to the offline device.

[0068] Optionally, the feature code is encrypted and transmitted by using the target device.

[0069] Optionally, the feature code extraction unit comprises: a hash calculation subunit, configured to perform hash calculation on the target application program to obtain a target hash value of the target application program; a hash matching subunit, configured to match the target hash value with a preset hash value of the target application program, wherein the preset hash value is stored in the offline device; and a feature code extraction subunit, configured to extract the feature code of the offline device in response to successful matching of the target hash value and the preset hash value.

[0070] Optionally, the apparatus further comprises: a time acquisition module, configured to acquire an effective time corresponding to the encrypted file; and a time verification module, configured to verify the effective time to obtain a verification result of the effective time, wherein the verification result is used to represent whether the effective time exceeds a preset time; and the feature code extraction unit is further configured to extract the feature code in response to the verification result being that the effective time does not exceed the preset time.

[0071] Optionally, the encryption password, the target private key and the original password are stored in a memory of the offline device.

[0072] Optionally, the encryption password used to acquire the encrypted file comprises at least one of: extracting the encryption password from a preset data stream of the encrypted file; extracting the encryption password from a tail of the encrypted file; and extracting the encryption password from a compressed package in which the encrypted file is located.

[0073] According to embodiments of the present disclosure, the present disclosure further provides an electronic device, a readable storage medium and a computer program product.

[0074] Figure 4 A schematic block diagram of an example electronic device 400 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present disclosure described and / or claimed in this document.

[0075] As Figure 4As shown, the device 400 includes a computing unit 401 that can perform various appropriate actions and processes in accordance with a computer program stored in a read-only memory (ROM) 402 or a computer program loaded into a random access memory (RAM) 403 from a storage unit 408. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other through a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0076] A plurality of components in the device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a magnetic disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0077] The computing unit 401 can be various general and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 401 performs various methods and processes described above, such as an offline device-based file processing method. For example, in some embodiments, an offline device-based file processing method can be implemented as a computer software program that is tangibly embodied in a machine-readable medium, such as the storage unit 408. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 400 via the ROM 402 and / or the communication unit 409. When the computer program is loaded into the RAM 403 and executed by the computing unit 401, one or more steps of an offline device-based file processing method described above can be performed. Alternatively, in other embodiments, the computing unit 401 can be configured to perform an offline device-based file processing method by any other appropriate means, such as by means of firmware.

[0078] The various embodiments of the systems and techniques described above can be implemented in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a load programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0079] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces the functions / operations specified in the flowcharts and / or the block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, or entirely on a remote machine or server.

[0080] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of electrical conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0081] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0082] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0083] The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server can arise by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0084] It should be understood that various forms of flow shown above can be used, with steps reordered, added, or removed. For example, the steps recited in the present disclosure can be performed in parallel, in series, or in a different order, without limitation, as long as the desired results of the technology disclosed in the present disclosure are achieved.

[0085] The specific embodiments described above are not intended to limit the scope of the present disclosure. Those skilled in the art will understand that various modifications, combinations, sub-combinations, and alternatives can be made to the specific embodiments without departing from the spirit and principles of the present disclosure. Any further modifications, changes, improvements, and the like that come within the spirit and principles of the present disclosure should be considered within the scope of the present disclosure.

Claims

1. A file processing method based on an offline device, comprising: in response to an instruction of opening an encrypted file by a target application program, obtaining an encryption password adopted by the encrypted file, wherein the encrypted file is obtained by encrypting an original file by an original password, the encryption password is obtained by encrypting the original password by a preset public key, and the encryption password is attached in the encrypted file; based on device information of the offline device, extracting a feature code of the offline device by using a feature extraction module in the target application program, decrypting a target certificate by using the feature code to obtain a target private key corresponding to the preset public key, wherein the feature extraction module is issued together with the target application program, the target certificate is obtained by encrypting the target private key by using the feature code, and the encryption password, the target private key, and the original password are only stored in a memory of the offline device and are not allowed to be transmitted or persisted; decrypting the encryption password by using the target private key to obtain the original password; decrypting the encrypted file by using the original password to obtain the original file.

2. The method of claim 1, wherein, decrypting the target certificate by using the feature code to obtain the target private key corresponding to the preset public key comprises: reading the target certificate stored in the offline device; decrypting the target certificate by using the feature code to obtain the target private key.

3. The method of claim 2, before responding to the instruction of opening the encrypted file by the target application program, further comprising: extracting the feature code of the offline device by a target device; uploading the feature code to a target server by the target device, wherein the target server is configured to encrypt the target private key based on the feature code to generate the target certificate; receiving the target certificate returned by the target server by the target device; storing the target certificate to the offline device by the target device.

4. The method of claim 3, wherein, in a case where the target device comprises a first device and a second device, the first device is configured to extract the feature code, the second device is configured to upload the feature code to the target server, receive the target certificate returned by the target server, and store the target certificate to the offline device.

5. The method of claim 3 or 4, wherein, encrypting and transmitting the feature code by the target device.

6. The method of claim 2, wherein, extracting the feature code of the offline device comprises: performing a hash calculation on the target application program to obtain a target hash value of the target application program; matching the target hash value with a preset hash value of the target application program, wherein the preset hash value is stored in the offline device; in response to a successful matching of the target hash value with the preset hash value, extracting the feature code of the offline device.

7. The method of claim 2, before extracting the feature code of the offline device, further comprising: obtaining a valid time corresponding to the encrypted file; verifying the valid time to obtain a verification result of the valid time, wherein the verification result is used to represent whether the valid time exceeds a preset time. In response to the verification result being that the valid time has not exceeded the preset time, extracting the feature code.

8. The method of claim 1, wherein, The encryption password used by the encrypted file comprises at least one of: extracting the encryption password from a preset data stream of the encrypted file; extracting the encryption password from a tail of the encrypted file; extracting the encryption password from a compressed package in which the encrypted file is located.

9. An offline device-based file processing apparatus, comprising: a password acquisition module configured to, in response to an instruction of opening an encrypted file by a target application program, acquire an encryption password used by the encrypted file, wherein the encrypted file is obtained by encrypting an original file by an original password, the encryption password is obtained by encrypting the original password by a preset public key, and the encryption password is attached to the encrypted file; a private key acquisition module configured to, based on device information of the offline device, extract a feature code of the offline device by using a feature extraction module in the target application program, decrypt a target certificate by using the feature code, and determine a target private key corresponding to the preset public key, wherein the feature extraction module is issued together with the target application program, the target certificate is obtained by encrypting the target private key by using the feature code, and the encryption password, the target private key, and the original password are only stored in a memory of the offline device and are not allowed to be transmitted or persisted; a password decryption module configured to decrypt the encryption password by using the target private key to obtain the original password; a file decryption module configured to decrypt the encrypted file by using the original password to obtain the original file.

10. The apparatus of claim 9, wherein, The private key acquisition module comprises: a certificate reading unit configured to read the target certificate stored in the offline device; a key decryption unit configured to decrypt the target certificate by using the feature code to obtain the target private key.

11. The apparatus of claim 10, further comprising: the feature code extraction module is further configured to extract the feature code of the offline device by using a target device; a feature code uploading module configured to upload the feature code to a target server by using the target device, wherein the target server is configured to encrypt the target private key based on the feature code to generate the target certificate; a certificate receiving module configured to receive the target certificate returned by the target server by using the target device; a certificate storage module configured to store the target certificate to the offline device by using the target device.

12. The apparatus of claim 10, wherein, The feature code extraction unit comprises: a hash calculation subunit configured to perform hash calculation on the target application program to obtain a target hash value of the target application program; a hash matching subunit configured to match the target hash value with a preset hash value of the target application program, wherein the preset hash value is stored in the offline device; a feature code extraction subunit configured to extract the feature code of the offline device in response to successful matching of the target hash value with the preset hash value.

13. The apparatus of claim 10, further comprising: a time obtaining module, configured to obtain a valid time corresponding to the encrypted file; a time verifying module, configured to verify the valid time to obtain a verifying result of the valid time, wherein the verifying result is used to represent whether the valid time exceeds a preset time; the feature code extracting unit is further configured to extract the feature code in response to the verifying result being that the valid time does not exceed the preset time.

14. An electronic device, comprising: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.

15. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, the computer instructions are used to enable the computer to perform the method of any one of claims 1-7.

16. A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1-7.

Citation Information

Patent Citations

  • Method and system for offline playback of multimedia files protected with digital rights management scheme

    US20180212935A1

  • Certificate application operations

    US20210006418A1