File encryption method and system

By receiving and verifying the signature file of the target device, generating and encrypting the signature key, it solves the problem of low device key update efficiency and achieves efficient key update and file encryption security.

CN118764231AActive Publication Date: 2024-10-11INDUSTRIAL AND COMMERCIAL BANK OF CHINA

Patent Information

Application Number
CN202410803860.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-10-11
Estimated Expiration
2044-06-20

AI Technical Summary

Technical Problem

In existing encryption technology, the device key update efficiency is low and cannot effectively solve this problem.

Method used

By receiving the signature file sent by the target device, verifying it using the public key, obtaining the device verification information and key, generating the signature key, encrypting it and transmitting it to the target device, the target device uses the private key to decrypt and use it to encrypt the file. , ensure the update frequency and uniqueness of the key.

Benefits of technology

It improves the efficiency and security of key updates, ensures that the signature key can be safely sent from the server to the target device, and enhances the security of file encryption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118764231A_ABST
    Figure CN118764231A_ABST
Patent Text Reader

Abstract

The invention discloses a file encryption method and system. Relates to the field of information security. The method comprises the following steps: receiving a first signature file sent by target equipment, and verifying the first signature file by using a first public key in a first key pair to obtain a verification result; under the condition that the verification result represents that the first signature file is not abnormal, obtaining a second public key in a second key pair and equipment verification information from the first signature file; generating a signature key according to the equipment verification information, and encrypting the signature key by using a second public key to obtain an initial encrypted file; and sending the initial encrypted file to a target device, and encrypting the target file through the target device to obtain a target encrypted file. Through application of the method and the device, the problem of relatively low efficiency of updating the key in the equipment in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information security, and in particular to a file encryption method and system. Background Art

[0002] Currently, in financial institutions, users are usually required to sign when handling some businesses. After receiving the user's signature, the signature screen of the financial institution needs to encrypt the customer's signature track to ensure the security of the user's signature.

[0003] Currently, when encrypting the signature track, the method usually adopted is to set a key for the signature screen device, and the device then encrypts the signature track through an encryption algorithm combined with the key. However, the key used in the existing encryption technology is often located in each signature screen device. When the key is changed regularly, the key in each signature screen device needs to be changed in turn, resulting in low efficiency of key update.

[0004] With regard to the problem of low efficiency in updating keys in devices in the related art, no effective solution has been proposed yet. Summary of the invention

[0005] The present application provides a file encryption method and system to solve the problem of low efficiency in updating keys in a device in the related art.

[0006] According to one aspect of the present application, a file encryption method is provided. The method includes: receiving a first signature file sent by a target device, and verifying the first signature file using the first public key in the first key pair to obtain a verification result, wherein the first signature file is obtained by the target device using the first private key in the first key pair to sign the device verification information and the second public key; when the verification result indicates that there is no abnormality in the first signature file, obtaining the second public key and the device verification information in the second key pair from the first signature file; generating a signature key according to the device verification information, and encrypting the signature key using the second public key to obtain an initial encrypted file; sending the initial encrypted file to the target device, encrypting the target file by the target device to obtain a target encrypted file, wherein the target device uses the second private key in the second key pair to decrypt the initial encrypted file to obtain a signature key, and encrypting the target file using the signature key to obtain a target encrypted file.

[0007] Optionally, generating a signature key based on device verification information includes: obtaining identification information of the target device from the device verification information, and obtaining the receiving time of the received device verification information; reading a root key from a storage space, and combining the root key, identification information and receiving time to obtain a signature key.

[0008] Optionally, before receiving the first signature file sent by the target device, the method also includes: generating a third key pair, and issuing a third public key in the third key pair to the target device; determining whether the first public key sent by the target device is received within a preset time interval; if the first public key is received, sending a file sending instruction to the target device, wherein the file sending instruction is used to instruct the target device to send the first signature file; and if the first public key is not received, issuing an alarm message.

[0009] Optionally, the second key pair includes a second public key and a second private key, the third key pair includes a third public key and a third private key, and the second public key is used to encrypt the signature key to obtain an initial encrypted file, including: generating a master key plaintext, and encrypting the master key plaintext using the second public key to obtain a first sub-file; encrypting the signature key using the master key plaintext to obtain a second sub-file; combining the first sub-file and the second sub-file to obtain a combined file, and using the third private key in the third key pair to sign and encrypt the combined file to obtain an initial encrypted file, wherein the target device verifies the initial encrypted file through the third public key, and if the verification passes, uses the second private key to decrypt the first sub-file to obtain the master key plaintext, and uses the master key plaintext to decrypt the second sub-file to obtain the signature key.

[0010] Optionally, before generating the third key pair, the method also includes: obtaining the time when the signature key was last generated to obtain the historical generation time; obtaining the update cycle of the signature key, and calculating the target time based on the update cycle and the historical generation time; judging whether the target time has been reached, and when the target time has been reached, executing the step of generating the third key pair.

[0011] According to another aspect of the present application, a file encryption method is provided. The method includes: generating device verification information and a second public key in a second key pair, using a first private key in a first key pair to sign the device verification information and the second public key to obtain a first signature file, and sending the first public key and the first signature file to a server in sequence, wherein the server verifies the first signature file using the first public key in the first key pair to obtain a verification result, and generates a signature key according to the device verification information, encrypts the signature key using the second public key to obtain an initial encrypted file; after receiving the initial encrypted file sent by the server, decrypts the initial encrypted file using the second private key in the second key pair to obtain a signature key, and uses the signature key to encrypt a target file to obtain a target encrypted file.

[0012] Optionally, before generating device verification information and the second public key in the second key pair, the method also includes: determining whether a third public key sent by the server is received, and executing the step of generating device verification information and the second public key in the second key pair when the third public key is received; sending the first public key and the first signature file to the server in sequence includes: sending the first public key to the server when the third public key sent by the server is received, and sending the first signature file to the server when the file sending instruction sent by the server is received.

[0013] Optionally, the initial encrypted file is decrypted using the second private key in the second key pair to obtain a signature key, and the target file is encrypted using the signature key to obtain the target encrypted file, including: using the third public key to verify the initial encrypted file, wherein the initial encrypted file includes a first sub-file and a second sub-file; when the initial encrypted file passes the verification, the first sub-file is decrypted using the second private key to obtain a master key plaintext, and the second sub-file is decrypted using the master key plaintext to obtain the signature key; characteristic information in the target file is obtained, and the target file is encrypting the target file using the characteristic information and the signature key to obtain the target encrypted file.

[0014] Optionally, the target file is a trajectory signature file, and characteristic information in the target file is obtained, and the target file is encrypted using the characteristic information and a signature key to obtain the target encrypted file, including: identifying characteristic information of the target signature in the trajectory signature file, wherein the characteristic information includes at least one of the following: shape feature, stroke feature, texture feature; encoding the characteristic information to obtain characteristic data, and generating a characteristic key through a root key and the characteristic data; encrypting the target file using the signature key to obtain a candidate encrypted file, and encrypting the candidate encrypted file using the characteristic key to obtain a target encrypted file.

[0015] According to another aspect of the present application, a file encryption system is provided. The system includes: a server, which is used to verify the first signature file using the first public key when receiving the first public key and the first signature file sent by the target device, and obtain the second public key and device verification information in the second key pair from the first signature file, generate a signature key according to the device verification information, encrypt the signature key using the second public key, obtain an initial encrypted file, and send the initial encrypted file to the target device; the target device is used to generate the device verification information and the second public key in the second key pair, sign the device verification information and the second public key using the first private key in the first key pair, obtain the first signature file, and send the first public key and the first signature file to the server, after receiving the initial encrypted file sent by the server, decrypt the initial encrypted file using the second private key to obtain the signature key, and obtain the characteristic information in the target file, encrypt the target file using the characteristic information and the signature key, and obtain the target encrypted file.

[0016] Through this application, the following steps are adopted: receiving the first signature file sent by the target device, and verifying the first signature file using the first public key in the first key pair to obtain a verification result, wherein the first signature file is obtained by the target device using the first private key in the first key pair to sign the device verification information and the second public key; when the verification result indicates that there is no abnormality in the first signature file, obtaining the second public key and device verification information in the second key pair from the first signature file; generating a signature key according to the device verification information, and encrypting the signature key using the second public key to obtain an initial encrypted file; sending the initial encrypted file to the target device, encrypting the target file through the target device to obtain a target encrypted file, wherein the target device uses the second private key in the second key pair to decrypt the initial encrypted file to obtain a signature key, and encrypting the target file using the signature key to obtain a target encrypted file. The problem of low efficiency in updating keys in devices in the related art is solved. By generating a signature key based on the device verification information of the target device, the key update frequency and uniqueness are guaranteed, and multiple key pairs are set between the server and the target device to encrypt and transmit the signature key, so that the signature key can be securely sent from the server to the target device, thereby achieving the technical effect of improving the efficiency of sending keys to the target device. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0018] Figure 1 is a flowchart of a file encryption method provided according to an embodiment of the present application;

[0019] Figure 2 is a flowchart of another file encryption method provided according to an embodiment of the present application;

[0020] Figure 3 is a schematic diagram of a file encryption system provided according to an embodiment of the present application;

[0021] Figure 4 is a flowchart of an optional file encryption method provided according to an embodiment of the present application;

[0022] Figure 5 is a schematic diagram of a file encryption device provided according to an embodiment of the present application;

[0023] Figure 6 is a schematic diagram of another file encryption device provided according to an embodiment of the present application;

[0024] Figure 7 It is a schematic diagram of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0025] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0028] It should be noted that the file encryption method and system determined in the present disclosure can be used in the field of information security, and can also be used in any field other than the field of information security. The application field of the file encryption method and system determined in the present disclosure is not limited.

[0029] It should be noted that the collected information, user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) used in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with the relevant laws, regulations and standards of the relevant regions, necessary confidentiality measures are taken, and public order and good customs are not violated. Corresponding operation portals are provided for users to choose to authorize or refuse to use. For example, an interface is set up between this system and relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.

[0030] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:

[0031] Public-private key pair for signature verification: a pair of keys used for digital signature verification, including a public key (for verification) and a private key (for signing).

[0032] Encryption public-private key pair: a key pair obtained through an encryption algorithm, including a public key (public) and a private key (non-public), used for data encryption and decryption.

[0033] Master key plaintext: It is an initial key used to generate other keys in an encryption algorithm, usually a randomly generated string or number sequence.

[0034] According to an embodiment of the present application, a file encryption method is provided.

[0035] Figure 1 1 is a flowchart of a file encryption method provided according to an embodiment of the present application. Figure 1 As shown, the method comprises the following steps:

[0036] Step S101, receiving a first signature file sent by a target device, and verifying the first signature file using a first public key in a first key pair to obtain a verification result, wherein the first signature file is obtained by the target device signing device verification information and a second public key using a first private key in the first key pair.

[0037] It should be noted that the target device can be any signature screen device in a financial institution. The signature screen device is configured with a screen for users to perform signing operations. After receiving the user's signature, the device can encrypt and store the signature through the stored signature key to ensure the security of the signature. The signature key is a key corresponding to the user's signature. The function of the signature key is to encrypt the user's signature file (that is, the target file) to ensure the security of the signature file.

[0038] It should be noted that the first key pair may be composed of a first public key and a first private key. The first key pair may be a verification public-private key pair, which is used to determine whether the transmitted file has been modified, thereby ensuring the accuracy of the file content.

[0039] Specifically, the executor of this embodiment is a server. After the server receives the first signature file sent by the target device, since the first signature file is a file obtained after the target device uses the first private key to perform signature authentication, it is necessary to use the first public key in the first key pair to verify the first signature file to obtain a verification result, and then determine whether the file content in the first signature file has been tampered with based on the verification result. For example, the verification result can be: "The first signature file has not been tampered with."

[0040] It should be noted that since the first signature file is signed by the target device using the first private key in the first key pair, the target device needs to first send the first public key to the server. When the server receives the first signature file, it can normally use the first public key to verify the first signature file.

[0041] It should be noted that the first signature file includes the second public key and device verification information, wherein the device verification information may be relevant information of the target device, such as the device number, device name, etc., and may also include relevant information of the device verification information, such as the time when the device verification information is generated and sent, etc. The second public key may be used to encrypt the signature key generated by the server, thereby ensuring the security of the signature key when it is sent from the server to the target device.

[0042] Step S102: when the verification result indicates that there is no abnormality in the first signature file, obtain the second public key and device verification information in the second key pair from the first signature file.

[0043] The second key pair may be an encrypted public-private key pair, which is used to encrypt the signature key.

[0044] Specifically, when the first signature file is verified to be normal through the first public key, the second public key and device verification information in the second key pair can be obtained from the first signature file, so that when the server generates a signature key, it can generate a signature key associated with the target device according to the device verification information, and use the second public key to encrypt the signature key, thereby ensuring the randomness and security of the signature key.

[0045] Step S103: Generate a signature key according to the device verification information, and encrypt the signature key using the second public key to obtain an initial encrypted file.

[0046] Specifically, after obtaining the device verification information, since the device verification information may contain relevant information of the device, as well as other random information such as time elements, a signature key may be generated through the device verification information, thereby ensuring that the signature key has a correlation with the target device while still maintaining the randomness of the signature key, thereby improving the security of the signature key.

[0047] Furthermore, after the signature key is generated, since the signature key needs to be sent from the server to the target device, the signature key can be encrypted using the second public key to obtain an initial encrypted file, so that after the target device receives the initial encrypted file, it can use the second private key in the target device to decrypt the initial encrypted file to obtain the signature key, thereby ensuring the security of the signature key during transmission.

[0048] Step S104, sending the initial encrypted file to the target device, encrypting the target file through the target device to obtain a target encrypted file, wherein the target device uses the second private key in the second key pair to decrypt the initial encrypted file to obtain a signature key, and uses the signature key to encrypt the target file to obtain a target encrypted file.

[0049] Specifically, after obtaining the initial encrypted file, the initial encrypted file can be sent to the target device. After the target device decrypts the initial encrypted file, the signature key can be used to encrypt the user signature (that is, the target file) to obtain the target encrypted file, so that the target encrypted file can be stored and other subsequent operations can be performed, thereby ensuring the security of the target file stored in the target device. Alternatively, the target encrypted file can be sent to a database for storage, and the target file and the target encrypted file in the target device can be deleted, so that the signature key and the target file are stored in different devices, thereby ensuring the security of the target file.

[0050] The file encryption method provided by the embodiment of the present application receives a first signature file sent by a target device, and verifies the first signature file using the first public key in the first key pair to obtain a verification result, wherein the first signature file is obtained by the target device using the first private key in the first key pair to sign the device verification information and the second public key; when the verification result indicates that there is no abnormality in the first signature file, the second public key in the second key pair and the device verification information are obtained from the first signature file; a signature key is generated according to the device verification information, and the signature key is encrypted using the second public key to obtain an initial encrypted file; the initial encrypted file is sent to the target device, and the target file is encrypted by the target device to obtain a target encrypted file, wherein the target device uses the second private key in the second key pair to decrypt the initial encrypted file to obtain a signature key, and the signature key is used to encrypt the target file to obtain a target encrypted file. The problem of low efficiency in updating keys in devices in the related art is solved. By generating a signature key based on the device verification information of the target device, the key update frequency and uniqueness are guaranteed, and multiple key pairs are set between the server and the target device to encrypt and transmit the signature key, so that the signature key can be securely sent from the server to the target device, thereby achieving the technical effect of improving the efficiency of sending keys to the target device.

[0051] In order to improve the security of the signature key, optionally, in the file encryption method provided in the embodiment of the present application, generating a signature key based on the device verification information includes: obtaining identification information of the target device from the device verification information, and obtaining the receiving time of the receiving device verification information; reading the root key from the storage space, and combining the root key, identification information and receiving time to obtain the signature key.

[0052] It should be noted that the root key is the initial key used to generate the signature key. It can be a randomly generated string of characters or a key generated by a specific algorithm. After obtaining the device verification information, the unique identification information of the target device can be obtained from the device verification information. The identification information is information used to uniquely identify the target device, which can be a combination of relevant information such as the device number, device name, and device deployment location.

[0053] Furthermore, in order to ensure the randomness of the key, the receiving time of the receiving device verification information can also be obtained in the device verification information, and the receiving time can be used as a random feature in the generation process of the signature key, where the receiving time is the timestamp when the signature key is generated, which can ensure the randomness and uniqueness of the signature key.

[0054] Furthermore, after obtaining the identification information, time information and root key, the root key, identification information and receiving time may be combined according to certain rules, for example, by combining them by concatenation, calculation, encryption and the like to generate a signature key.

[0055] This embodiment obtains a signature key by combining the root key, identification information and receiving time according to certain rules, thereby achieving the technical effect of generating a signature key that is secure, random and associated with the device, thereby ensuring the security of encrypting the target file.

[0056] In order to improve the security of the signature key during the transmission process, optionally, in the file encryption method provided in the embodiment of the present application, before receiving the first signature file sent by the target device, the method also includes: generating a third key pair, and issuing a third public key in the third key pair to the target device; determining whether the first public key sent by the target device is received within a preset time interval; if the first public key is received, sending a file sending instruction to the target device, wherein the file sending instruction is used to instruct the target device to send the first signature file; and if the first public key is not received, issuing an alarm message.

[0057] Specifically, the third key pair can be a public-private key pair for signature verification. Before receiving the first signed file sent by the target device, the server can send the third public key in the third key pair to the target device. The role of sending the third public key can be divided into two points. The first point can be used as a prompt message to inform the target device that the first public key can be sent to the server. The second point is to send the third public key to the target device, so that when the server sends the initial encrypted file to the target device, it can use the third private key to further encrypt the file content in the initial encrypted file, and the target device can use the third public key to decrypt it, thereby further improving the security of the signature key in the initial encrypted file.

[0058] Furthermore, after sending the third public key to the target device, it is necessary to determine whether the first public key sent by the target device is received within a preset time interval. If the first public key is not received, it indicates that an abnormality may occur in the data transmission line between the server and the target device, resulting in the target device being unable to receive the third public key sent by the server, or the target device being unable to send information to the server. At this time, an alarm message needs to be issued to timely maintain the target device, server and data transmission line to ensure timely transmission and update of the signature key.

[0059] This embodiment transmits the third public key so that the target device can use the third public key to confirm the file content of the initial encrypted file, and can determine the status of the data transmission line through the transmission result of the third public key, thereby improving the security of the transmission signature key while ensuring the stability of data transmission.

[0060] In order to improve the security of the signature key, optionally, in the file encryption method provided in the embodiment of the present application, the second key pair includes a second public key and a second private key, the third key pair includes a third public key and a third private key, and the signature key is encrypted using the second public key to obtain an initial encrypted file, including: generating a master key plaintext, and encrypting the master key plaintext using the second public key to obtain a first sub-file; encrypting the signature key using the master key plaintext to obtain a second sub-file; combining the first sub-file and the second sub-file to obtain a combined file, and signing and encrypting the combined file using the third private key in the third key pair to obtain an initial encrypted file, wherein the target device verifies the initial encrypted file through the third public key, and if the verification passes, decrypts the first sub-file using the second private key to obtain the master key plaintext, and decrypts the second sub-file using the master key plaintext to obtain the signature key.

[0061] Specifically, when encrypting the signature key, a master key plaintext may be generated first, and the master key plaintext may be encrypted using the second public key to obtain a first sub-file, thereby encrypting the master key plaintext through the first sub-file to ensure the security of the master key plaintext.

[0062] Furthermore, the signature key is encrypted using the master key plaintext to obtain a second sub-file, and the signature key is encrypted using the second sub-file to ensure the security of the signature key.

[0063] Furthermore, after obtaining the first sub-file and the second sub-file, the first sub-file and the second sub-file can be combined to obtain a combined file, and the combined file can be signed and encrypted using a third private key to obtain an initial encrypted file, thereby encrypting the file content of the combined file using the third private key to ensure that the combined file cannot be tampered with.

[0064] It should be noted that the styles of the first subfile and the second subfile can be further disguised so that when the first subfile and the second subfile are identified from the outside, the identification result is that the first subfile and the second subfile are exactly the same, so that the first subfile and the second subfile cannot be distinguished without using the second private key for decryption, thereby improving the security of the signature key in the second subfile.

[0065] Furthermore, after the target device receives the initial encrypted file, the second private key can be used to decrypt the first sub-file and the second sub-file. At this time, only the first sub-file can be decrypted to obtain the master key plaintext, and the master key plaintext can be used to decrypt the second sub-file to obtain the signature key, thereby improving the security of the target device obtaining the signature key.

[0066] This embodiment uses the second public key to encrypt the master key plaintext to obtain the first sub-file, uses the master key plaintext to encrypt the signature key to obtain the second sub-file, and uses the third private key to encrypt the first sub-file and the second sub-file, thereby increasing the complexity of obtaining the signature key and ensuring the secure transmission of the signature key.

[0067] Optionally, in the file encryption method provided in the embodiment of the present application, before generating the third key pair, the method also includes: obtaining the time when the signature key was last generated to obtain the historical generation time; obtaining the update cycle of the signature key, and calculating the target time based on the update cycle and the historical generation time; judging whether the target time has been reached, and when the target time has been reached, executing the step of generating the third key pair.

[0068] It should be noted that in order to ensure that the signature key is automatically updated according to a certain period, the historical moment when the signature key was last generated can be obtained, and the time difference between the current moment and the historical moment can be determined, and the update period can be obtained. When the time difference reaches the update period, it indicates that the signature key needs to be updated at the current moment. At this time, the step of generating a third key pair can be executed, thereby enabling the interactive operation between the above-mentioned server and the target device, so that the target device can obtain the updated signature key and use the updated signature key to replace the signature key at the historical moment, thereby ensuring the timeliness of the signature key and the security of the target file.

[0069] According to an embodiment of the present application, another file encryption method is provided. Figure 2 is a flowchart of another file encryption method provided according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:

[0070] Step S201, generate device verification information and the second public key in the second key pair, use the first private key in the first key pair to sign the device verification information and the second public key to obtain a first signature file, and send the first public key and the first signature file to the server in sequence, wherein the server uses the first public key in the first key pair to verify the first signature file to obtain a verification result, and generates a signature key based on the device verification information, and uses the second public key to encrypt the signature key to obtain an initial encrypted file.

[0071] Specifically, the target device can obtain device verification information, generate a second key pair and a first key pair, and use the first private key in the first key pair to sign the device verification information and the second public key to obtain a first signature file. Upon receiving the third public key sent by the server, the target device sends the first public key to the server. Upon receiving the file sending instruction, the target device sends the first signature file to the server, so that the server can generate a signature key based on the device verification information in the first signature file, and use the second public key to encrypt it to obtain an initial encrypted file.

[0072] Step S202, after receiving the initial encrypted file sent by the server, use the second private key in the second key pair to decrypt the initial encrypted file to obtain the signature key, and use the signature key to encrypt the target file to obtain the target encrypted file.

[0073] Specifically, after the target device receives the initial encrypted file sent by the server, it can decrypt the initial encrypted file to obtain the signature file, and use the signature key to encrypt the target file to obtain the target encrypted file, thereby ensuring the security of the target file.

[0074] Furthermore, the target encrypted file can be stored and other subsequent operations can be performed, or the target encrypted file can be sent to a database for storage, and the target file and the target encrypted file in the target device can be deleted, so that the signature key and the target file are stored in different devices, thereby ensuring the security of the target file.

[0075] The file encryption method provided by the embodiment of the present application generates device verification information and the second public key in the second key pair, uses the first private key in the first key pair to sign the device verification information and the second public key, obtains the first signature file, and sends the first public key and the first signature file to the server in sequence, wherein the server verifies the first signature file using the first public key in the first key pair to obtain a verification result, generates a signature key according to the device verification information, encrypts the signature key using the second public key, and obtains an initial encrypted file; after receiving the initial encrypted file sent by the server, decrypts the initial encrypted file using the second private key in the second key pair to obtain a signature key, and uses the signature key to encrypt the target file to obtain a target encrypted file. The problem of low efficiency in updating the key in the device in the related art is solved. By generating the signature key according to the device verification information of the target device, the update frequency and uniqueness of the key are guaranteed, and multiple key pairs are set between the server and the target device to encrypt and transmit the signature key, so that the signature key can be safely sent from the server to the target device, thereby achieving the technical effect of improving the efficiency of sending the key to the target device.

[0076] Optionally, in the file encryption method provided in the embodiment of the present application, before generating device verification information and the second public key in the second key pair, the method also includes: determining whether a third public key sent by the server is received, and if the third public key is received, executing the step of generating device verification information and the second public key in the second key pair; sending the first public key and the first signature file to the server in sequence includes: sending the first public key to the server if the third public key sent by the server is received, and sending the first signature file to the server if the file sending instruction sent by the server is received.

[0077] Specifically, when the target device receives the third public key, it indicates that it needs to generate device verification information and the second public key in the second key pair, and generate a first signature file. At this time, it is necessary to perform the above operation of generating the first signature file and send the first public key to the server.

[0078] Furthermore, when receiving a file sending instruction sent by the server, it indicates that the server requires the target device to send a first signature file. At this time, the first signature file is sent to the server, thereby ensuring that the server can generate a signature key based on the device verification information in the first signature file.

[0079] Optionally, in the file encryption method provided in the embodiment of the present application, the second private key in the second key pair is used to decrypt the initial encrypted file to obtain a signature key, and the signature key is used to encrypt the target file to obtain the target encrypted file, which includes: using the third public key to verify the initial encrypted file, wherein the initial encrypted file includes a first sub-file and a second sub-file; when the initial encrypted file passes the verification, the second private key is used to decrypt the first sub-file to obtain a master key plaintext, and the master key plaintext is used to decrypt the second sub-file to obtain the signature key; characteristic information in the target file is obtained, and the target file is encrypting the target file using the characteristic information and the signature key to obtain the target encrypted file.

[0080] Specifically, since the server uses the third private key to sign the initial encrypted file, after the target device receives the initial encrypted file, it is necessary to use the third public key to verify the initial encrypted file, and if the verification is correct, determine the accuracy of the first sub-file and the second sub-file in the initial encrypted file.

[0081] Furthermore, after obtaining the first sub-file and the second sub-file, the second private key needs to be used to decrypt the first sub-file and the second sub-file. At this time, only the first sub-file can be decrypted to obtain the master key plaintext, and the master key plaintext is used to decrypt the second sub-file to obtain the signature key, thereby improving the security of the target device obtaining the signature key.

[0082] Furthermore, when the target file is encrypted using the signature key, characteristic information in the target file can also be obtained, and the target file is encrypted using the characteristic information and the signature key to obtain a target encrypted file, thereby improving the security of the target file.

[0083] In order to improve the security of the target file, optionally, in the file encryption method provided in the embodiment of the present application, the target file is a trajectory signature file, characteristic information in the target file is obtained, and the target file is encrypted using the characteristic information and the signature key to obtain the target encrypted file, including: identifying the characteristic information of the target signature in the trajectory signature file, wherein the characteristic information includes at least one of the following: shape feature, stroke feature, texture feature; encoding the characteristic information to obtain characteristic data, and generating a characteristic key through the root key and the characteristic data; encrypting the target file using the signature key to obtain a candidate encrypted file, and encrypting the candidate encrypted file using the characteristic key to obtain the target encrypted file.

[0084] Specifically, when obtaining the characteristic information of the target file, since the target file is the user's trajectory signature file, the characteristic information can be obtained from the trajectory information in the signature. For example, based on the binary image of the signature, the shape characteristics of the signature are analyzed, for example, the number of connected pieces (that is, the number of handwriting pieces connected to each other), the number of meshes, the aspect ratio of the signature, the effective aspect ratio of the signature, the ratio of the black dot area to the overall area and other characteristic information are obtained. The above characteristic information can be extracted through an image processing algorithm. At the same time, the texture characteristics of the signature handwriting can be analyzed, such as the thickness, depth, density, etc. of the strokes to obtain texture characteristics, or the dynamic characteristics such as the stroke order, speed, acceleration, etc. in the signing process can be extracted to obtain stroke characteristics, so as to use the above characteristics as the characteristic information of the trajectory signature file.

[0085] Furthermore, after obtaining the feature information, the extracted feature information needs to be converted into digital codes for subsequent processing, for example, by using a feature coding algorithm (such as a hash algorithm) to convert complex feature information into a fixed-length code to obtain feature data.

[0086] Furthermore, a characteristic key can be generated through the root key and characteristic data, and the target file can be encrypted using the signature key to obtain a candidate encrypted file, and the candidate encrypted file can be encrypted using the characteristic key to obtain a target encrypted file, thereby doubly encrypting the signature key through a two-layer encryption method, thereby ensuring the security of the signature key.

[0087] According to an embodiment of the present application, a file encryption system is provided. Figure 3 is a schematic diagram of a file encryption system provided according to an embodiment of the present application, such as Figure 3 As shown, the system includes:

[0088] The server 31 is used to, upon receiving the first public key and the first signature file sent by the target device 32, verify the first signature file using the first public key, obtain the second public key and device verification information in the second key pair from the first signature file, generate a signature key according to the device verification information, encrypt the signature key using the second public key, obtain an initial encrypted file, and send the initial encrypted file to the target device 32.

[0089] The target device 32 is used to generate device verification information and the second public key in the second key pair, use the first private key in the first key pair to sign the device verification information and the second public key to obtain a first signature file, and send the first public key and the first signature file to the server 31. After receiving the initial encrypted file sent by the server 31, use the second private key to decrypt the initial encrypted file to obtain the signature key, and obtain the characteristic information in the target file, use the characteristic information and the signature key to encrypt the target file to obtain the target encrypted file.

[0090] Specifically, Figure 4 is a flowchart of an optional file encryption method provided according to an embodiment of the present application, such as Figure 4 As shown, the following implementation process is described Figure 3 Data interaction operations between the server and the target device in the file encryption system.

[0091] First, the server obtains the time when the signature key was last generated, obtains the historical generation time, obtains the update cycle of the signature key, calculates the target time based on the update cycle and the historical generation time, and determines whether the target time is reached. When the target time is reached, the server generates a third key pair and sends the third public key to the target device.

[0092] Furthermore, upon receiving the third public key, the target device generates a first key pair and sends the first public key to the server.

[0093] Furthermore, when the server receives the first public key, the server sends a file sending instruction to the target device. After receiving the file sending instruction, the target device generates device verification information and the second public key in the second key pair, uses the first private key in the first key pair to sign the device verification information and the second public key, obtains a first signature file, and sends the first signature file to the server.

[0094] Furthermore, after receiving the first signature file, the server uses the first public key to verify the first signature file, obtains the device verification information and the second public key, generates a signature key based on the device verification information, further generates a master key plaintext, and uses the second public key to encrypt the master key plaintext to obtain a first sub-file; uses the master key plaintext to encrypt the signature key to obtain a second sub-file, uses the third private key to encrypt the first sub-file and the second sub-file to obtain an initial encrypted file, and sends the initial encrypted file to the target device.

[0095] Furthermore, the target device verifies the initial encrypted file using the third public key, and decrypts the initial encrypted file using the second private key in the second key pair to obtain the signature key, and obtains the characteristic information in the target file, and encrypts the target file using the characteristic information and the signature key to obtain the target encrypted file, thereby completing the encryption operation of the target file. By generating the signature key according to the device verification information of the target device, the update frequency and uniqueness of the key are guaranteed, and multiple key pairs are set between the server and the target device to encrypt and transmit the signature key, so that the signature key can be safely sent from the server to the target device, thereby achieving the technical effect of improving the efficiency of sending keys to the target device.

[0096] The file encryption method provided by the embodiment of the present application is used by the server 31 to verify the first signature file using the first public key when receiving the first public key and the first signature file sent by the target device 32, and obtain the second public key and device verification information in the second key pair from the first signature file, generate a signature key according to the device verification information, encrypt the signature key using the second public key, obtain the initial encrypted file, and send the initial encrypted file to the target device 32; the target device 32 is used to generate the device verification information and the second public key in the second key pair, use the first private key in the first key pair to sign the device verification information and the second public key, obtain the first signature file, and send the first public key and the first signature file to the server 31, after receiving the initial encrypted file sent by the server 31, use the second private key to decrypt the initial encrypted file, obtain the signature key, and obtain the characteristic information in the target file, use the characteristic information and the signature key to encrypt the target file, and obtain the target encrypted file. The problem of low efficiency in updating the key in the device in the related art is solved. By generating a signature key based on the device verification information of the target device, the key update frequency and uniqueness are guaranteed, and multiple key pairs are set between the server and the target device to encrypt and transmit the signature key, so that the signature key can be securely sent from the server to the target device, thereby achieving the technical effect of improving the efficiency of sending keys to the target device.

[0097] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0098] The present application also provides a file encryption device. It should be noted that the file encryption device of the present application can be used to execute the file encryption method provided by the present application. The file encryption device provided by the present application is introduced below.

[0099] Figure 5 Schematic diagram of a file encryption device provided according to an embodiment of the present application. Figure 5 As shown, the device includes: a receiving unit 51, a first acquiring unit 52, a first encryption unit 53, and a second encryption unit 54.

[0100] The receiving unit 51 is used to receive a first signature file sent by a target device, and verify the first signature file using a first public key in a first key pair to obtain a verification result, wherein the first signature file is obtained by the target device using a first private key in the first key pair to sign device verification information and a second public key.

[0101] The first acquisition unit 52 is configured to acquire the second public key in the second key pair and the device verification information from the first signature file when the verification result indicates that there is no abnormality in the first signature file.

[0102] The first encryption unit 53 is used to generate a signature key according to the device verification information, and encrypt the signature key using the second public key to obtain an initial encrypted file.

[0103] The second encryption unit 54 is used to send the initial encrypted file to the target device, encrypt the target file through the target device, and obtain the target encrypted file, wherein the target device uses the second private key in the second key pair to decrypt the initial encrypted file to obtain the signature key, and uses the signature key to encrypt the target file to obtain the target encrypted file.

[0104] The file encryption device provided by the embodiment of the present application receives a first signature file sent by a target device through a receiving unit 51, and verifies the first signature file using the first public key in the first key pair to obtain a verification result, wherein the first signature file is obtained by the target device using the first private key in the first key pair to sign the device verification information and the second public key; the first acquisition unit 52 obtains the second public key and the device verification information in the second key pair from the first signature file when the verification result indicates that there is no abnormality in the first signature file; the first encryption unit 53 generates a signature key according to the device verification information, and encrypts the signature key using the second public key to obtain an initial encrypted file; the second encryption unit 54 sends the initial encrypted file to the target device, encrypts the target file through the target device to obtain a target encrypted file, wherein the target device decrypts the initial encrypted file using the second private key in the second key pair to obtain the signature key, and encrypts the target file using the signature key to obtain the target encrypted file. The problem of low efficiency in updating keys in devices in related technologies is solved. A signature key is generated according to the device verification information of the target device, thereby ensuring the update frequency and uniqueness of the key. Multiple key pairs are set between the server and the target device to encrypt and transmit the signature key, so that the signature key can be securely sent from the server to the target device, thereby achieving the technical effect of improving the efficiency of sending keys to the target device.

[0105] Optionally, in the file encryption device provided in the embodiment of the present application, the first encryption unit includes: an acquisition module, used to obtain the identification information of the target device from the device verification information, and obtain the receiving time of the receiving device verification information; a combination module, used to read the root key from the storage space, and combine the root key, identification information and receiving time to obtain a signature key.

[0106] Optionally, in the file encryption device provided in the embodiment of the present application, before receiving the first signature file sent by the target device, the device also includes: a first generation unit, used to generate a third key pair, and issue a third public key in the third key pair to the target device; a first judgment unit, used to judge whether the first public key sent by the target device is received within a preset time interval; a sending unit, used to send a file sending instruction to the target device when the first public key is received, wherein the file sending instruction is used to instruct the target device to send the first signature file; an alarm unit, used to issue an alarm message when the first public key is not received.

[0107] Optionally, in the file encryption device provided in the embodiment of the present application, the second key pair includes a second public key and a second private key, the third key pair includes a third public key and a third private key, and the first encryption unit includes: a first encryption module, used to generate a master key plaintext, and use the second public key to encrypt the master key plaintext to obtain a first sub-file; a second encryption module, used to encrypt the signature key using the master key plaintext to obtain a second sub-file; a third encryption module, used to combine the first sub-file and the second sub-file to obtain a combined file, and use the third private key in the third key pair to sign and encrypt the combined file to obtain an initial encrypted file, wherein the target device verifies the initial encrypted file through the third public key, and if the verification passes, uses the second private key to decrypt the first sub-file to obtain the master key plaintext, and uses the master key plaintext to decrypt the second sub-file to obtain the signature key.

[0108] Optionally, in the file encryption device provided in the embodiment of the present application, before generating the third key pair, the device also includes: a second acquisition unit, used to obtain the time when the signature key was last generated to obtain the historical generation time; a third acquisition unit, used to obtain the update cycle of the signature key, and calculate the target time based on the update cycle and the historical generation time; a second judgment unit, used to judge whether the target time has been reached, and when the target time has been reached, execute the step of generating the third key pair.

[0109] Figure 6 Schematic diagram of another file encryption device provided according to an embodiment of the present application. Figure 6 As shown, the device includes: a second generating unit 61 and a third encryption unit 62.

[0110] The second generation unit 61 is used to generate device verification information and a second public key in a second key pair, use the first private key in the first key pair to sign the device verification information and the second public key to obtain a first signature file, and send the first public key and the first signature file to the server in sequence, wherein the server uses the first public key in the first key pair to verify the first signature file to obtain a verification result, and generates a signature key according to the device verification information, and uses the second public key to encrypt the signature key to obtain an initial encrypted file.

[0111] The third encryption unit 62 is used to, after receiving the initial encrypted file sent by the server, use the second private key in the second key pair to decrypt the initial encrypted file to obtain the signature key, and use the signature key to encrypt the target file to obtain the target encrypted file.

[0112] The file encryption device provided by the embodiment of the present application generates device verification information and the second public key in the second key pair through the second generation unit 61, signs the device verification information and the second public key using the first private key in the first key pair to obtain a first signature file, and sends the first public key and the first signature file to the server in sequence, wherein the server verifies the first signature file using the first public key in the first key pair to obtain a verification result, generates a signature key according to the device verification information, encrypts the signature key using the second public key to obtain an initial encrypted file; after receiving the initial encrypted file sent by the server, the third encryption unit 62 uses the second private key in the second key pair to decrypt the initial encrypted file to obtain a signature key, and uses the signature key to encrypt the target file to obtain a target encrypted file. The problem of low efficiency in updating the key in the device in the related art is solved, and the signature key is generated according to the device verification information of the target device, thereby ensuring the update frequency and uniqueness of the key, and multiple key pairs are set between the server and the target device to encrypt and transmit the signature key, so that the signature key can be safely sent from the server to the target device, thereby achieving the technical effect of improving the efficiency of sending the key to the target device.

[0113] Optionally, in the file encryption device provided in the embodiment of the present application, before generating device verification information and the second public key in the second key pair, the device also includes: a third judgment unit, used to determine whether the third public key sent by the server is received, and if the third public key is received, execute the step of generating device verification information and the second public key in the second key pair; the second generation unit includes: a sending module, used to send the first public key to the server if the third public key sent by the server is received, and send the first signature file to the server if the file sending instruction sent by the server is received.

[0114] Optionally, in the file encryption device provided in the embodiment of the present application, the third encryption unit includes: a verification module, used to use a third public key to verify the initial encrypted file, wherein the initial encrypted file includes a first sub-file and a second sub-file; a decryption module, used to decrypt the first sub-file using the second private key to obtain a master key plaintext when the initial encrypted file passes the verification, and to decrypt the second sub-file using the master key plaintext to obtain a signature key; a fourth encryption module, used to obtain characteristic information in the target file, and to encrypt the target file using the characteristic information and the signature key to obtain a target encrypted file.

[0115] Optionally, in the file encryption device provided in the embodiment of the present application, the target file is a trajectory signature file, and the fourth encryption module includes: an identification submodule, used to identify feature information of the target signature in the trajectory signature file, wherein the feature information includes at least one of the following: shape feature, stroke feature, texture feature; an encoding submodule, used to encode the feature information to obtain feature data, and generate a feature key through the root key and the feature data; an encryption submodule, used to encrypt the target file using the signature key to obtain a candidate encrypted file, and use the feature key to encrypt the candidate encrypted file to obtain a target encrypted file.

[0116] The above-mentioned file encryption device includes a processor and a memory. The above-mentioned receiving unit 51, the first acquisition unit 52, the first encryption unit 53, the second encryption unit 54, the second generation unit 61, the third encryption unit 62, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.

[0117] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the problem of low efficiency in updating the key in the device in the related art is solved by adjusting the kernel parameters.

[0118] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0119] An embodiment of the present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the file encryption method is implemented.

[0120] An embodiment of the present invention provides a processor, which is used to run a program, wherein the file encryption method is executed when the program is running.

[0121] Figure 7 is a schematic diagram of an electronic device provided according to an embodiment of the present application, such as Figure 7 As shown, an embodiment of the present invention provides an electronic device, the electronic device 70 includes a processor, a memory, and a program stored in the memory and executable on the processor, and the processor implements the steps of the above-mentioned file encryption method when executing the program. The device in this article can be a server, a PC, a PAD, a mobile phone, etc.

[0122] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that initializes the steps of the above-mentioned file encryption method.

[0123] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0124] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0125] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0126] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0127] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0128] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0129] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0130] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0131] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A file encryption method, characterized in that: include: Receiving a first signature file sent by a target device, and verifying the first signature file using a first public key in a first key pair to obtain a verification result, wherein the first signature file is obtained by the target device signing device verification information and a second public key using a first private key in the first key pair; When the verification result indicates that there is no abnormality in the first signature file, obtaining a second public key and device verification information in a second key pair from the first signature file; Generate a signature key according to the device verification information, and encrypt the signature key using the second public key to obtain an initial encrypted file; The initial encrypted file is sent to a target device, and the target file is encrypted by the target device to obtain a target encrypted file, wherein the target device uses the second private key in the second key pair to decrypt the initial encrypted file to obtain the signature key, and uses the signature key to encrypt the target file to obtain the target encrypted file.

2. The method according to claim 1, characterized in that: Generating a signature key according to the device verification information includes: Acquire identification information of the target device from the device verification information, and acquire a receiving time of receiving the device verification information; The root key is read from the storage space, and the root key, the identification information and the receiving time are combined to obtain the signature key.

3. The method according to claim 1, characterized in that Before receiving the first signature file sent by the target device, the method further includes: Generate a third key pair, and issue a third public key in the third key pair to the target device; Determining whether the first public key sent by the target device is received within a preset time interval; When the first public key is received, sending a file sending instruction to the target device, wherein the file sending instruction is used to instruct the target device to send the first signature file; If the first public key is not received, an alarm message is issued.

4. The method according to claim 3, characterized in that The second key pair includes the second public key and the second private key, the third key pair includes the third public key and the third private key, and the signing key is encrypted using the second public key to obtain an initial encrypted file including: Generate a master key plaintext, and use the second public key to encrypt the master key plaintext to obtain a first sub-file; The signature key is encrypted using the master key plaintext to obtain a second sub-file; The first subfile and the second subfile are combined to obtain a combined file, and the combined file is signed and encrypted using the third private key in the third key pair to obtain the initial encrypted file, wherein the target device verifies the initial encrypted file by using the third public key, and if the verification passes, decrypts the first subfile using the second private key to obtain the master key plaintext, and decrypts the second subfile using the master key plaintext to obtain the signature key.

5. The method according to claim 3, characterized in that: Before generating the third key pair, the method further includes: Obtain the time when the signature key was last generated to obtain the historical generation time; Obtaining an update period of the signature key, and calculating a target time according to the update period and the historical generation time; Determine whether the target time has been reached, and if the target time has been reached, execute the step of generating the third key pair.

6. A file encryption method, characterized in that: include: Generate device verification information and a second public key in a second key pair, use a first private key in a first key pair to sign the device verification information and the second public key to obtain a first signature file, and send the first public key and the first signature file to a server in sequence, wherein the server uses the first public key in the first key pair to verify the first signature file to obtain a verification result, and generates a signature key according to the device verification information, and uses the second public key to encrypt the signature key to obtain an initial encrypted file; After receiving the initial encrypted file sent by the server, the initial encrypted file is decrypted using the second private key in the second key pair to obtain the signature key, and the target file is encrypted using the signature key to obtain the target encrypted file.

7. The method according to claim 6, characterized in that Before generating the device authentication information and the second public key in the second key pair, the method further includes: Determine whether the third public key sent by the server is received, and if the third public key is received, execute the step of generating device verification information and the second public key in the second key pair; Sending the first public key and the first signature file to the server in sequence includes: When the third public key sent by the server is received, the first public key is sent to the server; when the file sending instruction is received from the server, the first signature file is sent to the server.

8. The method according to claim 7, characterized in that Decrypting the initial encrypted file using the second private key in the second key pair to obtain the signature key, and encrypting the target file using the signature key to obtain the target encrypted file includes: Using the third public key to verify the initial encrypted file, wherein the initial encrypted file includes a first subfile and a second subfile; In the case where the initially encrypted file passes the verification, the first sub-file is decrypted using the second private key to obtain the master key plaintext, and the second sub-file is decrypted using the master key plaintext to obtain the signature key; Acquire characteristic information in the target file, and use the characteristic information and the signature key to encrypt the target file to obtain the target encrypted file.

9. The method according to claim 8, characterized in that The target file is a track signature file, characteristic information in the target file is obtained, and the target file is encrypted using the characteristic information and the signature key to obtain the target encrypted file, including: Identify feature information of the target signature in the trajectory signature file, wherein the feature information includes at least one of the following: shape feature, stroke feature, and texture feature; Encoding the characteristic information to obtain characteristic data, and generating a characteristic key through a root key and the characteristic data; The target file is encrypted using the signature key to obtain a candidate encrypted file, and the candidate encrypted file is encrypted using the feature key to obtain the target encrypted file.

10. A file encryption system, characterized in that: include: The server is configured to, upon receiving the first public key and the first signature file sent by the target device, verify the first signature file using the first public key, obtain the second public key and device verification information in the second key pair from the first signature file, generate a signature key according to the device verification information, encrypt the signature key using the second public key to obtain an initial encrypted file, and send the initial encrypted file to the target device; The target device is used to generate device verification information and a second public key in a second key pair, use the first private key in the first key pair to sign the device verification information and the second public key to obtain a first signature file, and send the first public key and the first signature file to the server. After receiving the initial encrypted file sent by the server, use the second private key to decrypt the initial encrypted file to obtain a signature key, and obtain characteristic information in the target file, and use the characteristic information and the signature key to encrypt the target file to obtain a target encrypted file.

Citation Information

Patent Citations

  • Encrypted hard disk key management method and device, and medium

    CN111046441A

  • Data transmission method and device and electronic equipment

    CN114490552A

  • Data transmission method and device, electronic equipment and storage medium

    CN114697122A

  • Key distribution method and device, electronic equipment and storage medium

    CN115834053A

  • Key management method and device, storage medium, equipment and computing power service system

    CN117879819A

Cited By

  • File processing method and device and electronic equipment

    CN119830316A

  • File processing method, device and electronic equipment

    CN119830316B