A data controllable usage method
By introducing TPMs in the system of data use, managing asymmetric keys and encrypted and decrypting operations in the preset security domain solve the problem of the data of the data used by evil, which causes the original data leakage. And privacy protection.
Patent Information
- Application Number
- CN202311241074.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-25
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2043-09-25
AI Technical Summary
In the prior art, the problem of data users that may commit evil actions and lead to original data leakage has not been effectively resolved.
By introducing TPM (trustworthy platform module) in the data use party system, generating and managing asymmetric keys to ensure that the data is encrypted and decrypted in the preset security domain to prevent data leakage. Specific steps include sending the first public key to the data provider, receiving and decrypting the encryption data sent by the data provider, importing in the preset security domain, and performing controllable read and writing operations in the security domain.
Effectively prevent the possibility of leaking data when processing the original data, ensuring that the data can only be processed in the preset security domain, avoiding the data of the data from being written, and then realizing the controllable use and privacy protection of the data. Essence
Smart Images

Figure CN117648703B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software engineering, and in particular to a method for controlling the use of data. Background Art
[0002] TPM is the abbreviation of Trusted Platform Module, and its core is to provide hardware-based security-related functions. The TPM chip is a secure cryptographic processor designed to perform cryptographic-related operations. The TPM chip contains multiple physical security mechanisms to make it tamper-proof, and malware cannot tamper with the security functions of the TPM.
[0003] TPM can generate a secret key, for example, the secret key is called A key, and A key is composed of A public key and A private key. The A private key is generated by TPM in combination with the measurement value of the system, and no one can obtain it. The measurement value is an integrity measurement value generated when the system starts and stored in TPM. When the hardware, firmware and any functional module are tampered with, the measurement value will change, and then will not match the A key, resulting in the inability to decrypt the file encrypted with the A key. TPM ensures that the A key can only be used when the various system components on which the present invention relies are started in the correct manner. At the same time, TPM includes the function of decrypting and restoring the ciphertext encrypted by the A key.
[0004] Full disk encryption technology (LUKS): All data in a disk partition is encrypted with the B key, which consists of the B public key and the B private key.
[0005] A security domain refers to one or more disk partitions encrypted with the same set of B keys. For processes that have B private key devices, the security domain is completely transparent to the process. Even if an attacker without B private key cracks the disk, he will only get the encrypted data, which cannot be decrypted without B private key, ensuring data security.
[0006] LSM stands for Linux Security Modules. LSM supports the function of checking whether user operations meet the defined security policies, including dozens of operations such as file opening and closing. If the user operation does not comply with the security policy, such as opening a file outside the security domain, LSM can prohibit the operation.
[0007] A privacy computing scenario: Assuming that the data provider has the original data, the data provider needs to send the original data to the data user for processing and processing to obtain the result file. However, the original data cannot be leaked during the entire process.
[0008] As for the problem of how to prevent data users from committing malicious acts and causing leakage of original data in related technologies, no effective solution has been proposed so far. Summary of the invention
[0009] In view of the technical defects in the prior art, the purpose of the embodiments of the present invention is to provide a method for controllable use of data to prevent the problem of leakage of original data caused by malicious acts by data users.
[0010] To achieve the above-mentioned purpose, an embodiment of the present invention provides a method for controllable use of data, which is run on a data user and includes:
[0011] Sending a first public key to a data provider, wherein the first public key and a first private key form a pair of first asymmetric keys, the first asymmetric key is generated by a TPM according to a measurement value of the system, and the first private key is stored in the TPM;
[0012] Receiving first encrypted data sent by the data provider, where the first encrypted data is a result of encrypting a second private key with the first public key, where the second private key and the second public key form a pair of second asymmetric keys, and the second asymmetric key is provided by the data provider;
[0013] Calling the TPM to use the first private key to decrypt the first encryption result, obtaining a second private key, and using the second asymmetric key as a security domain key of a preset security domain;
[0014] Receiving second encrypted data delivered by the data provider, and importing the second encrypted data into the preset security domain; wherein the second encrypted data is a result obtained by encrypting the original data using the second public key;
[0015] receiving a process's operation request for the second encrypted data in the preset security domain;
[0016] In response to the operation request, the second private key is called to decrypt the second encrypted data to obtain the original data, and according to the operation request, the process is allowed to controllably use the original data in the preset security domain.
[0017] Furthermore, the operation request is a read request or a write request.
[0018] Further, allowing the process to controllably use the original data in the preset security domain according to the operation request includes:
[0019] When the process performs a read operation or a write operation on the original data in the preset security domain, the process is not allowed to open a file outside the preset security domain in a write operation mode.
[0020] Furthermore, before sending the first public key to the data provider, the method further includes:
[0021] After the system is initialized, the system's measurement values are stored in the TPM.
[0022] Furthermore, the method further comprises:
[0023] Verify whether the measurement value of the system is legal. If not, return an error.
[0024] Furthermore, the data provider delivers the second encrypted data by means of hardware copying or network transmission.
[0025] Furthermore, the method further comprises:
[0026] After obtaining the second private key, the second private key is stored in a memory file of the daemon process.
[0027] Furthermore, the method further comprises:
[0028] If the second private key is reused after the system is restarted, the first encrypted data is stored in the file system.
[0029] Furthermore, the method further comprises:
[0030] The TPM generates a first asymmetric key certificate according to the measurement value of the system, where the first asymmetric key certificate is a signature given by the TPM and includes the measurement value of the system;
[0031] The first asymmetric key certificate is sent to the data provider, so that the data provider can verify the legitimacy of the first public key based on the first asymmetric key certificate.
[0032] Furthermore, the metric values of the system include hardware, firmware, and various functional modules.
[0033] Furthermore, the method further comprises:
[0034] Adding the preset category data in the preset security domain to the whitelist;
[0035] When the process performs a read operation or a write operation on the preset category data in the whitelist in the preset security domain, the process is allowed to open the file outside the preset security domain in a write operation mode.
[0036] By implementing the method provided in the embodiment of the present invention, the data user can only process the asymmetrically encrypted data delivered by the data provider in the preset security domain. Although the data is visible, it cannot be written out of the security domain, that is, the data in the security domain can only be read by the process but cannot be written to the file outside the security domain, thereby avoiding the possibility of the original data being leaked by the data user.
[0037] In addition, the data controllable use method of the present application is based on the existing TPM, LSM and asymmetric encryption technology, which ensures the high efficiency and high compatibility of the method. Traditional data processing applications can achieve the effect of privacy protection without changing any source code. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the specific implementation of the present invention or the technical solution in the prior art, the drawings required for use in the specific implementation or the description of the prior art will be briefly introduced below.
[0039] Figure 1 It is a schematic diagram of data interaction between a data provider and a data user in an actual environment provided by an embodiment of the present invention;
[0040] Figure 2 It is a flowchart of a data controllable use method provided by an embodiment of the present invention;
[0041] Figure 3 It is a structural diagram of a data provider and a data user provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0044] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0045] It should be further understood that the term "and / or" used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0046] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0047] It should be noted that, unless otherwise specified, the technical terms or scientific terms used in this application should have the common meanings understood by those skilled in the art to which the present invention belongs.
[0048] like Figure 1 As shown, the actual environment described in this embodiment includes two parties, data provider and data user, both of which are corresponding system terminals. The data provider provides data, and the data user processes and handles the data in the set security domain. Although the data is visible, it cannot be written out of the security domain, and it is not allowed to write data outside the security domain, that is, the data in the security domain can only be read by the application process but cannot be written to files outside the security domain.
[0049] A security domain is a logical concept, which refers to a storage and computing unit protected by corresponding keys and encryption algorithms. It can include one or more disk partitions encrypted with the same set of keys. The security domain can be specified by the data user or by the data provider. For example, a disk partition or the entire disk can be used as a security domain. After the security domain is configured, all data in the security domain is encrypted with a second asymmetric key using full disk encryption technology (LUKS). The second asymmetric key is generated and imported by the data provider.
[0050] 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.
[0051] like Figure 2 As shown, this embodiment provides a flow chart of a method for controllable use of data, which is run on the data user. Specifically, the method includes the following steps:
[0052] Step S110: Sending a first public key to a data provider, wherein the first public key and a first private key form a pair of first asymmetric keys, the first asymmetric key is generated by the TPM according to the measurement value of the system, and the first private key is stored in the TPM.
[0053] like Figure 3 As shown, the data user includes a utility module, a guard module and a kernel module. Among them, the utility module is a tool for users to operate and configure, which provides operations such as initializing a security domain, extending a security domain, deleting a security domain, and exporting data from a security domain.
[0054] The daemon module is a daemon process running in the system. Its functions include initializing the system, handling related operations for utility modules, providing security domain configuration to the kernel, and communicating with data providers.
[0055] The kernel module is the LSM module that runs in the Linux kernel after the kernel is modified. The kernel module checks the read and write operations of the process on the file according to the configuration given by the daemon module. The LSM module will not change the process, but only judge the process operation. A process that reads data in the security domain can only perform write operations in the security domain.
[0056] The implementation of this method relies on the measurement startup of TPM. After the system initialization of the data user is completed, including after the system restarts, the guardian module will store the system's measurement value in TPM. The content measured by the measurement value of the system includes hardware, firmware, and various functional modules. TPM generates a pair of first asymmetric keys based on the measurement value of the system. The first asymmetric key includes a first public key and a first private key. The first private key is stored in TPM, and any third party except TPM cannot obtain the first private key.
[0057] Furthermore, in order to enable the data provider to verify that the first public key is generated by the TPM and the system measurement value is legal and cannot be forged by anyone else, the TPM will generate a first asymmetric key certificate based on the system measurement value. The first asymmetric key certificate is a signature given by the TPM containing the system measurement value.
[0058] The guard module will synchronously send the first asymmetric key certificate and the first public key to the data provider. The data provider can verify the first public key based on the first asymmetric key certificate to ensure the authenticity of the first public key.
[0059] After the system is started, the guard module verifies whether the system's measurement value is legal. If it is illegal, it returns an error. If the system hardware, operating system and / or functional modules have been tampered with, the system's measurement value will be different from the measurement value after the system is initialized.
[0060] Step S120: Receive first encrypted data sent by the data provider, where the first encrypted data is a result of encrypting a second private key with the first public key, where the second private key and the second public key constitute a pair of second asymmetric keys, and where the second asymmetric key is provided by the data provider.
[0061] The data provider generates or imports a pair of second asymmetric keys through the setting module and transmits them to the server module. The second asymmetric keys include a second public key and a second private key. The server module encrypts the second private key with the first public key to obtain the first encrypted data and sends the first encrypted data to the guard module.
[0062] Step S130: calling the TPM to use the first private key to decrypt the first encryption result, obtaining a second private key, and using the second asymmetric key as the security domain key of the preset security domain.
[0063] After receiving the first encrypted data, the daemon module calls the decryption function of the TPM to decrypt the first encrypted data using the first private key to obtain the second private key, and stores the second private key in the memory file of the daemon process. During the startup and operation of the daemon process, the system will allocate virtual memory to the daemon process. When the daemon process is shut down, the virtual memory will be cleared by the system, and the data user cannot directly obtain data from the virtual memory. Therefore, storing the second private key obtained by decryption in the memory file of the daemon process can prevent the data user from stealing the second private key, thereby preventing the second private key from being leaked.
[0064] Optionally, if the second asymmetric key needs to be reused after the data user system is restarted, the first encrypted data can be stored in the file system.
[0065] Then, the data user initiates a request to the utility module, which specifies the security domain range through the guardian module and uses the second asymmetric key as the security domain key of the security domain. The guardian module also configures the security domain information to the kernel module to complete the initialization of the security domain.
[0066] Step S140: receiving the second encrypted data delivered by the data provider, and importing the second encrypted data into the preset security domain; wherein the second encrypted data is a result obtained by encrypting the original data with a second public key.
[0067] The data provider delivers the second encrypted data encrypted by the second public key to the data user, wherein the delivery method includes but is not limited to hardware copying, network transmission, etc., which is not limited in this embodiment.
[0068] After receiving the second encrypted data, the data user calls the utility module, which will import the second encrypted data into the security domain corresponding to the second asymmetric key through the guardian module.
[0069] Step S150: receiving a process's operation request for the second encrypted data in the preset security domain.
[0070] Step S160: In response to the operation request, calling the second private key to decrypt the second encrypted data to obtain the original data, and allowing the process to controllably use the original data in the preset security domain according to the operation request.
[0071] Specifically, the operation request is a read request or a write request.
[0072] After receiving an operation request from a process for the second encrypted data in the preset security domain, the kernel module will perform controllable usage supervision on the operation of the process. Specifically, when the process performs a read operation or a write operation on the original data in the preset security domain, the process is not allowed to open files outside the preset security domain in write operation mode.
[0073] Furthermore, the method further comprises:
[0074] Step S170: adding the preset category data in the preset security domain to the whitelist.
[0075] It should be noted that the intermediate data and result data processed by the process in the security domain should also be in the same security domain.
[0076] After the data in the security domain is analyzed and processed, the generated result file needs to be delivered to the data provider. In order to prevent the result file from leaking privacy and violating the data provider's security policy, its migration needs to obtain the authorization of the data provider. At this time, the whitelist configuration function in the kernel module needs to be applied. For example, the result file can be added to the whitelist.
[0077] Step S180: When the process performs a read operation or a write operation on the preset category data in the whitelist in the preset security domain, the process is allowed to open the file outside the preset security domain in a write operation mode.
[0078] For example, a result file is added to the whitelist. After a process opens the result file in the whitelist, the kernel module no longer tracks the process, that is, the process is allowed to open the file outside the security domain in write mode, thereby allowing the result data to be written to the file outside the global domain.
[0079] In summary, by implementing the method provided in the embodiment of the present invention, the data user can only process the asymmetrically encrypted data delivered by the data provider in the preset security domain. Although the data is visible, it cannot be written out of the security domain, that is, the data in the security domain can only be read by the process but cannot be written to the file outside the security domain, thereby avoiding the possibility of the original data being leaked by the data user.
[0080] In addition, the data controllable use method of the present application is based on the existing TPM, LSM and asymmetric encryption technology, which ensures the high efficiency and high compatibility of the method. Traditional data processing applications can achieve the effect of privacy protection without changing any source code.
[0081] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for controllable use of data, characterized in that: The method is run on a data user, and includes: Sending a first public key to a data provider, wherein the first public key and a first private key form a pair of first asymmetric keys, the first asymmetric key is generated by a TPM according to a measurement value of the system, and the first private key is stored in the TPM; Receiving first encrypted data sent by the data provider, where the first encrypted data is a result of encrypting a second private key with the first public key, where the second private key and the second public key form a pair of second asymmetric keys, and the second asymmetric key is provided by the data provider; Calling the TPM to use the first private key to decrypt the first encryption result, obtaining a second private key, and using the second asymmetric key as a security domain key of a preset security domain; Receiving second encrypted data delivered by the data provider, and importing the second encrypted data into the preset security domain; wherein the second encrypted data is a result obtained by encrypting the original data using the second public key; receiving a process's operation request for the second encrypted data in the preset security domain; In response to the operation request, the second private key is called to decrypt the second encrypted data to obtain the original data, and according to the operation request, the process is allowed to controllably use the original data in the preset security domain.
2. A method for controllable use of data as claimed in claim 1, characterized in that: The operation request is a read request or a write request.
3. A method for controllable use of data as claimed in claim 2, characterized in that: Allowing the process to controllably use the original data in the preset security domain according to the operation request includes: When the process performs a read operation or a write operation on the original data in the preset security domain, the process is not allowed to open a file outside the preset security domain in a write operation mode.
4. A method for controllable use of data as claimed in claim 1, characterized in that: Before sending the first public key to the data provider, the method further includes: After the system is initialized, the system's measurement values are stored in the TPM.
5. A method for controlling the use of data as claimed in claim 1, characterized in that: The data provider delivers the second encrypted data by means of hardware copying or network transmission.
6. A method for controllable use of data as claimed in claim 1, characterized in that: The method further comprises: After obtaining the second private key, the second private key is stored in a memory file of the daemon process.
7. A method for controlling the use of data as claimed in claim 1, characterized in that: The method further comprises: If the second private key is reused after the system is restarted, the first encrypted data is stored in the file system.
8. A method for controllable use of data as claimed in claim 1, characterized in that: The method further comprises: The TPM generates a first asymmetric key certificate according to the measurement value of the system, where the first asymmetric key certificate is a signature given by the TPM and includes the measurement value of the system; The first asymmetric key certificate is sent to the data provider, so that the data provider can verify the legitimacy of the first public key based on the first asymmetric key certificate.
9. A method for controllable use of data as claimed in claim 1, characterized in that: The metric values of the system include hardware, firmware, and various functional modules.
10. The method for controllable use of data as claimed in claim 1, characterized in that: The method further comprises: Adding the preset category data in the preset security domain to the whitelist; When the process performs a read operation or a write operation on the preset category data in the whitelist in the preset security domain, the process is allowed to open the file outside the preset security domain in a write operation mode.
Citation Information
Patent Citations
Cloud storage data encryption method based on TPM
CN106027503A
Electronic data safekeeping system and method based on double and asymmetric encryption technology
CN106713336A