Secure sharing method for data encryption and tracking
By generating dedicated temporary keys for each terminal and using a hash algorithm to generate user attribute private keys, the problem of lag caused by a single authorizing authority in multi-terminal collaboration scenarios is solved, and secure sharing of data encryption and tracking is achieved, ensuring data security and flexibility.
Patent Information
- Application Number
- CN202511380645.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-25
- Publication Date
- 2025-11-11
AI Technical Summary
Under the existing data encryption model, the key management rules of a single authorized institution cause delays in multi-terminal collaboration scenarios and cannot flexibly adapt to diverse application scenarios.
By generating dedicated temporary keys for each terminal, and encrypting and decrypting based on attribute recognition tags, data access permission verification and management are realized in multi-terminal collaborative scenarios. User attribute private keys are generated using hash algorithms to ensure that encrypted file packages are only decrypted when authorized conditions are met.
It reduces response delays in multi-terminal collaboration scenarios, enables secure data sharing and flexible access control, and allows for timely updates to encryption methods to prevent unauthorized file leaks.
Smart Images

Figure CN120934897A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data security sharing technology, and in particular to a secure sharing method for data encryption and tracking. Background Technology
[0002] Existing data encryption models typically involve a single authorized authority distributing keys to various users and attribute units. However, data scenarios often face the need for access and collaboration from multiple endpoints. In such cases, the key management rules of a single authorized authority often experience significant delays in multi-endpoint collaboration scenarios and cannot flexibly adapt to diverse application scenarios. Summary of the Invention
[0003] Purpose of the invention: To address the problem that existing key management rules of a single authorizing authority often cause significant delays in multi-terminal collaboration scenarios and cannot flexibly adapt to diverse data scenarios, this invention proposes a secure sharing method for data encryption and tracking. By generating dedicated temporary keys for each terminal with collaboration needs, the verification and management of these dedicated temporary keys enables the verification and management of data access permissions in multi-terminal collaboration scenarios, reducing response delays.
[0004] Technical solution: A secure data sharing method for encryption and tracking, comprising:
[0005] Based on the user's sharing request, an encrypted file package is sent to the user. The encrypted file package is obtained by the sharer encrypting a digest file based on their own private key. The digest file includes identification information of the shared file package, as well as an attribute identification mark that the authorized user needs to verify in an encrypted manner.
[0006] After receiving the encrypted file packet, the user terminal decrypts it using the private key assigned to it by the system to obtain the attribute identification tag that the user terminal needs to verify.
[0007] The user terminal retrieves its assigned corresponding encrypted attribute identifier based on the attribute identification mark and converts the encrypted attribute identifier into a user attribute private key.
[0008] The encrypted file package is decrypted based on the user's private key to obtain the contents of the shared file package.
[0009] Furthermore, the system will only respond to the user's sharing request and send a download file package to the user if the encrypted attribute identifier of the requesting user matches the various attributes required for verification by an authorized user as indicated in the digest file.
[0010] Furthermore, each user and sharer pre-uploads its identification tags and various attribute information to the system, which then assigns it a corresponding private key and an encrypted attribute identifier that matches its various attribute information.
[0011] Furthermore, the conversion of the encrypted attribute identifier into a user attribute private key specifically includes:
[0012] Based on the attribute type and order of the attribute identification markers required for verification by the authorized user, the encrypted attribute identifiers of the corresponding type corresponding to the authorized user are sequentially combined into a string;
[0013] The string is converted into a user attribute private key using a hash algorithm.
[0014] Furthermore, the encrypted file package is obtained by the sharer encrypting a digest file using their own private key, specifically including:
[0015] Request the system to obtain the encryption attribute identifiers for each attribute type corresponding to the authorized user terminal;
[0016] The encrypted attribute identifiers of the corresponding attribute types are combined into a string in a fixed order;
[0017] Use a hash algorithm to convert the string into a private key;
[0018] The digest file containing the shared file package is encrypted using the private key to obtain the encrypted file package.
[0019] Furthermore, the same attribute content is assigned the same encrypted attribute identifier among the sharers.
[0020] Furthermore, the aforementioned encryption attribute identifier specifically includes:
[0021] Receive the attribute set U containing all attributes, hierarchically classify it, select a bilinear composite group G of order N, and select a generator g, thereby generating the common parameters PK and the master key MSK; where N is the product of three distinct prime numbers; the generator g is a subgroup of the composite group G whose order is one of the prime factors of the order of G.
[0022] Based on the public parameter PK and the pre-generated hierarchical threshold access structure, the attribute content M of the attribute to be assigned encrypted attribute identifier is encrypted one by one into the corresponding ciphertext; the ciphertext is used as the encrypted attribute identifier corresponding to the attribute content M.
[0023] Furthermore, the common parameter PK is a set of elements of any group in the attribute set U, consisting of order N, generator g, bilinear pairs of generator g, and the group of elements N, g, and g. It is represented as PK = {N, g, e(g, g)}. i ,h |i|}, where i is the i attribute elements in the attribute set U, h |i| One of the prime factors of the order of a number in G is a subgroup of the order;
[0024] The master key MSK = {α, h} |i| Let α be a random number from 1 to N and a subgroup of the composite group G whose order is one of the prime factors of the order of G.
[0025] Furthermore, the hierarchical threshold access structure (Mv,ρ) is generated as follows:
[0026] Set the threshold ks of each layer in monotonically decreasing integer order, and assign each attribute element in the attribute set U to the corresponding layer, so that the set of attribute contents of each layer in the hierarchical threshold access structure satisfies: the size of the intersection of the subset S of the layer and the union of the previous s+1 layers is greater than or equal to the threshold value ks of the layer, where s is the layer number.
[0027] Furthermore, the attribute content M of the identifier to be assigned is encrypted one by one into corresponding ciphertext, represented as ct={Me(g,g)}. T ,(Mv,ρ),};where, h ρ (j) represents the group element corresponding to the ρ(j)th attribute element in the attribute set U, and ρ(j) represents the mapping from the attribute of the jth level in the attribute set U to the jth row of the access structure Mv.
[0028] Beneficial effects: Compared with the prior art, the present invention has the following advantages:
[0029] (1) This invention, when a sharer uploads an encrypted file package to be shared, simultaneously encrypts the attribute identification mark of the user end authorized to use the file package in the digest file using the system public key. Thus, when the file sharing server verifies that the user end meets the authorization standard, it sends the encrypted file package and the corresponding digest file to the user end. Therefore, the user end of this invention can decrypt the attribute identification mark used for authorization verification in the digest file according to the key assigned to it by the system, and determine its user attribute private key accordingly, thereby decrypting the encrypted file package based on the user attribute private key. In this invention, the sharer and the user encrypt and decrypt according to the encryption attribute identifier determined by the management center. When either party changes its encryption attribute identifier or the key generation rule corresponding to the encryption attribute identifier, the sharing of ciphertext can be effectively cut off, thereby achieving data security protection for shared files from multiple ends.
[0030] (2) This invention uses a temporary key based on attribute information to verify and manage authorization permissions. It can flexibly realize the verification and management of data acquisition permissions in multi-terminal collaborative scenarios by adjusting the attributes of any end, thereby reducing response delays. Attached Figure Description
[0031] Figure 1This is a schematic diagram of a secure data encryption and tracking sharing system provided in an embodiment of the present invention. Detailed Implementation
[0032] The technical solution of this embodiment will now be further described in conjunction with the accompanying drawings and examples.
[0033] Example 1
[0034] like Figure 1 As shown in the figure, this invention proposes a secure data encryption and tracking system, comprising: a file sharing server, which receives a digest file encrypted by a sharer based on their private key and the corresponding encrypted file package, and sends a download file package to the user in response to a sharing request from the user; a management center, which receives attribute content sent by sharers and users, encodes and hierarchically layers each attribute content, generates a public parameter PK and a master key MSK, periodically issues a system public key and a corresponding private key to each sharer and user, and sends the corresponding encrypted attribute identifier to the sharer according to the sharer's sharing request; and an attribute authority, which, based on the public parameter PK and a pre-generated hierarchical threshold access structure, encrypts the attribute content M to be assigned an encrypted attribute identifier into corresponding ciphertext, and sends the ciphertext as the encrypted attribute identifier corresponding to the attribute content M to the corresponding sharer and user.
[0035] The following provides further explanation of file sharing servers, management centers, and attribute authorities.
[0036] The management center receives attribute content sent by sharers and users during the initialization phase, encodes and layers each attribute content, generates a public parameter PK and a master key MSK, and periodically or upon request from the terminal to issue the system public key and corresponding private key to the corresponding sharer and user. During the file sharing phase, it sends encrypted attribute identifiers of the corresponding user area as the sharing target to the sharer according to the sharer's sharing request. The combination of encrypted attribute identifiers of the corresponding user area as the sharing target sent to the sharer must meet the following requirements: the sum of the various encrypted attribute identifiers in the combination can uniquely identify the attribute set corresponding to the user as the sharing target, and exclude other users without sharing permissions. This requirement can be determined by calculating the common items of attributes among authorized sharing terminals to filter out the corresponding attributes, and by verifying whether the set of attributes is sufficient to exclude other users and whether it includes other users who do not meet the authorization target. This requirement can also be reconstructed by re-encoding and layering the attribute content.
[0037] The attribute authority, during the initialization phase or during the process of reconstructing the encoding and hierarchical structure of attributes according to sharing requirements, encrypts the attribute content M to be assigned encrypted attribute identifiers to the sharer and the user end one by one into corresponding ciphertext according to the public parameter PK and the pre-generated hierarchical threshold access structure, and sends the ciphertext as the encrypted attribute identifier corresponding to the attribute content M to the corresponding sharer and user end.
[0038] Therefore, during the file sharing phase, after receiving the digest file encrypted by the sharer using their private key and the corresponding encrypted file package, the file-sharing server stores the encrypted file package and its corresponding digest file. Then, in response to a user's sharing request, the server only sends a download file package to the user if the encrypted attribute identifier of the requesting user matches the various attributes required for verification by the authorized user as indicated in the digest file. The download file package contains the encrypted file package and attribute identification markers encrypted using the system public key, which are required for verification by the authorized user. Furthermore, the attribute identification markers record the various attributes required for verification by the authorized user according to the instructions in the decrypted digest file.
[0039] In this system, after receiving the downloaded file package, each user terminal can decrypt it using the private key assigned to it by the system to obtain the attribute identification mark required for verification. That is, the attribute category corresponding to the encrypted attribute identifier required for verifying the authorized identity. Based on the attribute identification mark, it retrieves its own assigned corresponding encrypted attribute identifier, converts it into a user attribute private key in the following way, and decrypts the encrypted file package in the downloaded file package based on the user attribute private key to obtain the shared file content:
[0040] Based on the attribute type and order of the attribute identification tags required for verification by the authorized user, the corresponding encrypted attribute identifiers of this device are sequentially combined into a string, and this string is input into MD5 or other hash algorithms to obtain the user attribute private key.
[0041] Correspondingly, the encrypted file package shared between terminals in this application is obtained in the following manner:
[0042] Request the encryption attribute identifiers for each attribute type corresponding to the authorized user terminal from the system's management center;
[0043] The corresponding type of encryption attribute identifiers are combined into a string in a fixed order, and the string is input into MD5 or other corresponding hash algorithms to obtain the file encryption key;
[0044] The file package to be shared is encrypted using the file encryption key to obtain the encrypted file package to be shared.
[0045] Therefore, any change in the attributes of one end will be directly reflected in the encryption key, thus affecting the encryption and decryption of the file content and preventing unauthorized file leakage. Furthermore, since the terminal needs to send its attribute information to the file-sharing server for verification before downloading the encrypted file package, the server can use this attribute information to trace unauthorized requesting ends, thereby achieving secure data tracking.
[0046] In this embodiment of the invention, a mapping relationship between the shared file package and the encrypted file package is established by using the identification information of the shared file package in the digest file and the attribute identification mark required for verification by the authorized user terminal formed in the digest file in an encrypted manner. The filtering conditions of various attributes corresponding to the user terminal for the encrypted file are confirmed. When the various attributes of the current user terminal meet the conditions, the user attribute private key required to decrypt the file is directly generated by the encrypted attribute identifier corresponding to the current user terminal's own attributes, thereby realizing the decryption of the encrypted file.
[0047] The key required to obtain or generate a file digest can be updated periodically throughout the system using traditional asymmetric encryption techniques. Encrypting the digest does not affect the security of the encrypted file content. Furthermore, the encrypted file itself, because its key is modified according to changes in sharing permissions, can have its encryption methods updated promptly, reducing the likelihood of a successful attack.
[0048] This invention, through the aforementioned method, ensures that whenever the attributes of either end change, a private key generation method based on attributes prevents the user-generated private key from matching the decryption requirements, thus blocking the user's decryption operation and preventing the leakage of encrypted file content. Furthermore, since each encrypted file transmission requires verification of the user's attribute information by the file-sharing server, a corresponding request list can be formed on the file-sharing server, enabling the tracking of data leakage risks.
[0049] To achieve the above effects, this embodiment of the invention can trigger each user terminal and each sharer to upload their identification marker (PID or UID) and corresponding attribute information to the management center during the system initialization phase. After receiving the attribute information of all terminals, the management center assigns each terminal a system public key or a corresponding private key, as well as an encrypted attribute identifier matching the terminal's own attribute information. Specifically, the same encrypted attribute identifier is assigned to the same attribute content among the sharing terminals.
[0050] The encryption attribute identifier can be determined in the following way:
[0051] Receive an attribute set U containing all attributes (e.g., ID number PID, name, department and position, office, confidentiality level, age, address, etc.), hierarchically classify it, select a bilinear composite group G of order N, and select a generator g, thereby generating the public parameter PK and the master key MSK. Here, N is the product of three distinct prime numbers, and the generator g is a subgroup of the composite group G whose order is a prime factor of G. The public parameter PK is the set of any group elements in the attribute set U, consisting of order N, generator g, bilinear pairs of generator g, and the group of attributes N, i.e., PK = {N, g, e(g, g)}. i ,h |i|}, where i is the i attribute elements in the attribute set U, h |i| One of the prime factors of the order of ∈G is a subgroup of the order; the master key MSK = {α, h} |i| Let α be a random number from 1 to N and a subgroup of the composite group G whose order is one of the prime factors of the order of G.
[0052] Based on the public parameter PK and the pre-generated hierarchical threshold access structure, the attribute content M of the attribute to be assigned encrypted attribute identifier is encrypted one by one into the corresponding ciphertext, and the ciphertext is sent as the encrypted attribute identifier corresponding to the attribute content M to the corresponding sharer and user.
[0053] The hierarchical threshold access structure (Mv,ρ) is generated as follows:
[0054] Set the threshold ks of each layer in monotonically decreasing integer order, and assign each attribute element in the attribute set U to the corresponding layer, so that the set of attribute contents of each layer in the hierarchical threshold access structure satisfies: the size of the intersection of the subset S of the layer and the union of the previous s+1 layers is greater than or equal to the threshold value ks of the layer, where s is the layer number.
[0055] The ciphertext ct = {Me(g,g)} serves as the identifier for the encryption attribute. T ,(Mv,ρ),}。 Where, h ρ (j) represents the group element corresponding to the ρ(j)-th attribute element in the attribute set U, where ρ(j) represents the mapping from the attribute at the j-th level in the attribute set U to the j-th row of the access structure Mv. In other methods, the encryption method of the ciphertext is not limited, as long as symmetric encryption technology is used and the hierarchical information of the attributes can be restored after decryption. Therefore, this application can increase the dimensional information of attribute features through the hierarchy of attributes, thereby ensuring that different terminals can be distinguished based on attributes after decryption.
[0056] Example 2
[0057] This invention provides a secure data sharing method for encryption and tracking, the steps of which include:
[0058] The recipient encrypts the digest file using their own private key, thus obtaining the encrypted file package corresponding to the digest file;
[0059] Based on the user's sharing request, a download file package is sent to it. This download file package contains an encrypted file package and attribute identification tags that the authorized user needs to verify, which are encrypted using the system's public key. The attribute identification tags record various attributes that the authorized user needs to verify, according to the instructions in the decrypted digest file.
[0060] After receiving the downloaded file package, the user terminal decrypts it using the private key assigned to it by the system to obtain the attribute identification mark required for verification. Based on the attribute identification mark, it retrieves the corresponding encrypted attribute identifier assigned to it, converts it into a user attribute private key, and decrypts the encrypted file package in the downloaded file package based on the user attribute private key to obtain the shared file content.
[0061] In this embodiment of the invention, the sharing request is only responded to when the encrypted attribute identifier corresponding to the requesting user matches the various attributes required for verification by the authorized user as indicated in the digest file, and a download file package is sent to the user.
[0062] In this embodiment of the invention, the digest file contains identification information of the shared file package, as well as an attribute identification mark that is encrypted and required for verification by an authorized user.
[0063] In this embodiment of the invention, each user and each sharer uploads its identification mark and various types of attribute information to the system in advance, and the system assigns it a corresponding private key and an encrypted attribute identifier that matches its various types of attribute information.
[0064] In this embodiment of the invention, the process of converting encrypted attribute identifiers into user attribute private keys includes: according to the attribute type and order of the attribute identification tags to be verified by the authorized user, the encrypted attribute identifiers of the corresponding type of this device are sequentially combined into a string, and the string is input into MD5 or other hash algorithms to obtain the user attribute private key.
[0065] In this embodiment of the invention, the encrypted file package is obtained as follows: requesting the system's management center to obtain the encryption attribute identifiers of each attribute type corresponding to the authorized user terminal; combining the encryption attribute identifiers of the corresponding types into a string in a fixed order, and inputting the string into MD5 or other hash algorithms to obtain the file encryption key; encrypting the file package to be shared according to the file encryption key to obtain the encrypted file package to be shared.
[0066] In this embodiment of the invention, the same attribute content between each sharing terminal is assigned the same encrypted attribute identifier.
[0067] In this embodiment of the invention, the encrypted attribute identifier is determined as follows: An attribute set U containing all attributes is received, and the set is hierarchically divided. A bilinear composite group G of order N is selected, and a generator g is selected, thereby generating a public parameter PK and a master key MSK. Based on the public parameter PK and the pre-generated hierarchical threshold access structure, the attribute content M to be assigned an encrypted attribute identifier is encrypted one by one into corresponding ciphertext, and the ciphertext is sent as the encrypted attribute identifier corresponding to the attribute content M to the corresponding sharer and user.
Claims
1. A secure data sharing method for encryption and tracking, characterized in that: include: Based on the user's sharing request, an encrypted file package is sent to the user. The encrypted file package is obtained by the sharer encrypting a digest file based on their own private key. The digest file includes identification information of the shared file package, as well as an attribute identification mark that the authorized user needs to verify in an encrypted manner. After receiving the encrypted file packet, the user terminal decrypts it using the private key assigned to it by the system to obtain the attribute identification tag that the user terminal needs to verify. The user terminal retrieves its assigned corresponding encrypted attribute identifier based on the attribute identification mark and converts the encrypted attribute identifier into a user attribute private key. The encrypted file package is decrypted based on the user's private key to obtain the contents of the shared file package.
2. The secure sharing method for data encryption and tracking according to claim 1, characterized in that: The system will only respond to the user's sharing request and send the download file package to the user if the encrypted attribute identifier of the requesting user matches the various attributes required for verification by an authorized user as indicated in the digest file.
3. The secure sharing method for data encryption and tracking according to claim 1, characterized in that: Each user and sharer pre-uploads its identification tag and various attribute information to the system, which then assigns it a corresponding private key and an encrypted attribute identifier that matches its various attribute information.
4. The secure sharing method for data encryption and tracking according to claim 1, characterized in that: The conversion of the encrypted attribute identifier into a user attribute private key specifically includes: Based on the attribute type and order of the attribute identification markers required for verification by the authorized user, the encrypted attribute identifiers of the corresponding type corresponding to the authorized user are sequentially combined into a string; The string is converted into a user attribute private key using a hash algorithm.
5. The secure sharing method for data encryption and tracking according to claim 1, characterized in that: The encrypted file package is obtained by the sharer encrypting a digest file using their own private key, and specifically includes: Request the system to obtain the encryption attribute identifiers for each attribute type corresponding to the authorized user terminal; The encrypted attribute identifiers of the corresponding attribute types are combined into a string in a fixed order; Use a hash algorithm to convert the string into a private key; The digest file containing the shared file package is encrypted using the private key to obtain the encrypted file package.
6. The secure sharing method for data encryption and tracking according to claim 1, characterized in that: The same attribute content is assigned to the same encrypted attribute identifier among the sharers.
7. A secure data encryption and tracking method for data sharing according to claim 2, characterized in that: The aforementioned encryption attribute identifier specifically includes: Receive the attribute set U containing all attributes, hierarchically classify it, select a bilinear composite group G of order N, and select a generator g, thereby generating the common parameters PK and the master key MSK; where N is the product of three distinct prime numbers; the generator g is a subgroup of the composite group G whose order is one of the prime factors of the order of G. Based on the public parameter PK and the pre-generated hierarchical threshold access structure, the attribute content M of the attribute to be assigned encrypted attribute identifier is encrypted one by one into the corresponding ciphertext; the ciphertext is used as the encrypted attribute identifier corresponding to the attribute content M.
8. A secure data encryption and tracking method for sharing according to claim 7, characterized in that: The common parameter PK is a set of elements of any group in the attribute set U, consisting of order N, generator g, bilinear pairs of generator g, and the group of elements N. It is represented as PK = {N, g, e(g, g)}. i ,h |i| }, where i is the i attribute elements in the attribute set U, h |i| One of the prime factors of the order of a number in G is a subgroup of the order; The master key MSK = {α, h} |i| Let α be a random number from 1 to N and a subgroup of the composite group G whose order is one of the prime factors of the order of G.
9. A secure data encryption and tracking method for sharing according to claim 8, characterized in that: The hierarchical threshold access structure (Mv,ρ) is generated as follows: Set the threshold ks of each layer in monotonically decreasing integer order, and assign each attribute element in the attribute set U to the corresponding layer, so that the set of attribute contents of each layer in the hierarchical threshold access structure satisfies: the size of the intersection of the subset S of the layer and the union of the previous s+1 layers is greater than or equal to the threshold value ks of the layer, where s is the layer number.
10. A secure data encryption and tracking method for sharing according to claim 9, characterized in that: The process of encrypting the attribute content M of the identifier to be assigned into corresponding ciphertext, denoted as ct={Me(g,g)}, is described. T ,(Mv,ρ),};where, h ρ (j) represents the group element corresponding to the ρ(j)th attribute element in the attribute set U, and ρ(j) represents the mapping from the attribute of the jth level in the attribute set U to the jth row of the access structure Mv.