Data encryption method and encryption system

By utilizing multiple key entities to jointly generate and verify keys in the encryption system, the problem of low encryption security under the management of a single authoritative body is solved, achieving both security and flexibility in data encryption, avoiding the risk of single points of failure, and ensuring the reliability and privacy protection of data sharing.

CN121333641APending Publication Date: 2026-01-13INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511365706.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-23
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

In existing technologies, attribute-based encryption schemes rely on a single authoritative body to manage keys, which results in low encryption security, inflexible data sharing, and poor system reliability. Especially in cloud computing environments, when a single authoritative body is attacked or becomes unavailable, it can lead to data leakage and service interruption.

Method used

By obtaining the attribute parameters of all entities in the encryption system, determining the master private key and system parameters, generating the initial decryption key and re-key, and using multiple key entities to jointly generate and verify the key, data encryption and re-encryption are achieved, ensuring the security and flexibility of the encryption environment.

Benefits of technology

It improves the security and flexibility of data encryption, avoids the risk of single points of failure, and ensures the reliability and privacy protection of the data sharing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121333641A_ABST
    Figure CN121333641A_ABST
Patent Text Reader

Abstract

The invention discloses a data encryption method and encryption system. The method comprises the steps that attribute parameters of all entities contained in an encryption system are acquired, and a main private key and system parameters are determined according to the attribute parameters; the encryption environment of the encryption system is verified based on the main private key, and under the condition that a verification result that the encryption environment is not abnormal is obtained, M key entities of the encryption system generate a key based on the attribute parameters and the system parameters; receiving plaintext data, encrypting the plaintext data based on the system parameters to obtain an original ciphertext, and re-encrypting the original ciphertext according to the re-key and the system parameters to obtain a re-ciphertext of the plaintext data; and under the condition that the re-ciphertext is correct, sending the re-ciphertext and the original ciphertext to a user entity of the encryption system. Through application of the method and the device, the technical problem of low encryption security when the encrypted data is processed by depending on a single key entity in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of financial technology, and more specifically, to a data encryption method and encryption system. Background Technology

[0002] With the acceleration of digital transformation in the financial industry, financial institutions are using the computing resources of cloud service providers for business deployment and data processing. Attribute-Based Encryption (ABE) technology provides a solution for this need with its flexible access control features, but it has limitations in the efficient sharing of encrypted data.

[0003] First, ABE allows data owners to set access policies, but only users whose attribute sets match the policy can decrypt the data. It lacks a mechanism to directly support the dynamic sharing of encrypted data, especially when the data access policy needs to be changed. For example, when data needs to be shared from users in one department to users in another department, simple key exchange or redistribution can easily leak data access permissions or key management.

[0004] To overcome the shortcomings of ABE (Abstract Encryption Based on Data) in data sharing, related technologies introduce proxy re-encryption, which allows a third party (i.e., a proxy) to convert a user's encrypted data into re-ciphertext that another user can decrypt, without the proxy itself accessing the plaintext information during the conversion process. Building upon this, the concept of proxy re-encryption is extended to the field of attribute-based encryption, resulting in the Attribute-Based Proxy Re-Encryption (AB-PRE) scheme. In AB-PRE, depending on the ciphertext policy or key policy, users can delegate data access permissions to other users based on their attributes without directly sharing the key, thus enhancing security and privacy protection during data sharing.

[0005] However, the above scheme relies on a single authoritative body to manage system attributes and distribute user keys. If this authoritative body is attacked or compromised, attackers can obtain the master key and generate decryption keys for arbitrary attribute sets, leading to a sharp increase in the risk of data leakage. In addition, the collapse or unavailability of a single authoritative body will directly interrupt system services. Especially in a cloud computing environment, this will affect the efficiency and reliability of data sharing and access control, thus having a significant impact on data collaboration and sharing in the financial sector.

[0006] There is currently no effective solution to the technical problem of low encryption security when relying on a single key entity to process encrypted data in related technologies. Summary of the Invention

[0007] The main purpose of this application is to provide a data encryption method and encryption system to solve the technical problem of low encryption security when relying on a single key entity to process encrypted data in related technologies.

[0008] To achieve the above objectives, according to one aspect of this application, a data encryption method is provided. The method includes: obtaining attribute parameters of all entities included in the encryption system; determining a master private key and system parameters based on the attribute parameters, wherein the master private key is used to verify the encryption environment of the encryption system, and the system parameters refer to the system parameters followed by all entities included in the encryption system; if the encryption environment of the encryption system is verified based on the master private key and a verification result indicating no anomalies is obtained, M key entities of the encryption system generate a key based on the attribute parameters and system parameters, wherein the key includes an initial decryption key and a re-key, and M is a positive integer; receiving plaintext data; encrypting the plaintext data based on the system parameters to obtain original ciphertext; and re-encrypting the original ciphertext based on the re-key and system parameters to obtain re-ciphertext of the plaintext data; if the re-ciphertext is correct, sending the re-ciphertext and the original ciphertext to a user entity of the encryption system, wherein the user entity decrypts the re-ciphertext and the original ciphertext based on the initial decryption key.

[0009] Further, determining the master private key and system parameters based on attribute parameters includes: determining the total number of M key entities in the encryption system and obtaining the security parameters of the encryption system; receiving the random parameters selected by each key entity and obtaining the master private key based on the sum of the M random parameters; constructing the private key parameters of each key entity based on the attribute parameters from the M key entities, obtaining M private key parameters, and determining the public key parameters of each key entity based on the M private key parameters, obtaining M public key parameters; obtaining a key entity threshold, and obtaining T key entities from the M key entities through the key entity threshold, where the key entity threshold refers to the minimum number of key entities to run during the encryption process, T is less than or equal to M, and T is a positive integer; calculating the global public key based on the private key parameters and public key parameters of the T key entities, and obtaining the system parameters based on the global public key.

[0010] Furthermore, when the key is the initial decryption key, the key generation process by the M key entities of the encryption system based on attribute parameters and system parameters includes: obtaining the attribute parameters of the first user entity from the user entities to obtain the first attribute parameter; obtaining the M private key parameters associated with the M key entities; calculating the M private key parameters, system parameters, and first attribute parameter using a key generation algorithm to obtain the M key shares of the M key entities; and calculating the M key shares using a key algorithm to obtain the initial decryption key.

[0011] Furthermore, when the key is a heavy key, the key generation process by the M key entities of the encryption system based on attribute parameters and system parameters includes: obtaining first encryption access permission data and obtaining an initial decryption key, wherein the first encryption access permission data is used to filter user entities with different attributes; calculating the initial decryption key, system parameters, and encryption access permission data using a heavy key generation algorithm to obtain M heavy key shares of the M key entities; determining N sub-heavy keys based on the M heavy key shares using a key algorithm, and combining the N sub-heavy keys to obtain the heavy key.

[0012] Furthermore, encrypting plaintext data based on system parameters to obtain the original ciphertext includes: obtaining the second encrypted access permission data associated with the plaintext data; performing vector transformation on the second encrypted access permission data to obtain the access matrix; obtaining the element calculation rules; determining random elements by the second user entity in the user entity; calculating the random elements, access matrix, and system parameters according to the element calculation rules to obtain ciphertext elements, wherein the element calculation rules include calculation formulas for multiple ciphertext elements; and combining the second encrypted access permission data and the ciphertext elements to obtain the original ciphertext.

[0013] Furthermore, the re-encryption of the original ciphertext based on the re-key and system parameters to obtain the re-ciphertext of the plaintext data includes: obtaining the second attribute parameter of the third user entity in the user entity, obtaining the second encryption access permission data, and determining whether the second encryption access permission data contains the second attribute parameter; if the second encryption access permission data contains the second attribute parameter, the step of re-encrypting the original ciphertext based on the re-key and system parameters ends; if the second encryption access permission data contains the second attribute parameter, the re-encryption algorithm calculates based on the re-key, system parameters, and original ciphertext to obtain the re-ciphertext.

[0014] Furthermore, after obtaining the re-ciphertext of the plaintext data, the method further includes: when the encryption system and the verifier are in a communication connection, sending the re-ciphertext to the verifier, wherein the verifier verifies the re-ciphertext according to a first verification rule and sends a first verification result to the encryption system; if the first verification result indicates that at least one sub-re-ciphertext in the re-ciphertext is different from the first verification rule, ending the step of sending the re-ciphertext and the original ciphertext to the encryption system by the user entity; if the first verification result indicates that all sub-re-ciphertexts in the re-ciphertext are the same as the first verification rule, obtaining a second verification rule, and verifying the re-ciphertext according to the second verification rule to obtain a second verification result; if the second verification result indicates that all sub-re-ciphertexts in the re-ciphertext are the same as the second verification rule, performing the step of sending the re-ciphertext and the original ciphertext to the encryption system by the user entity.

[0015] To achieve the above objectives, according to another aspect of this application, an encryption system is provided. The system includes: an encryption system comprising M key entities and user entities, configured to determine a master private key and system parameters based on attribute parameters of all entities; verify the encryption environment of the encryption system based on the master private key, and if a verification result indicating no anomalies in the encryption environment is obtained, generate a key by the M key entities based on the attribute parameters and system parameters; further configured to encrypt plaintext data based on the system parameters to obtain original ciphertext; re-encrypt the original ciphertext based on a re-key in the key and the system parameters to obtain re-ciphertext of the plaintext data; and send the re-ciphertext to a verifier; and further configured to send the re-ciphertext and the original ciphertext to the user entities if a first verification result indicates that the re-ciphertext is correct, wherein M is a positive integer; and a verifier configured to verify the re-ciphertext according to a first verification rule and send a first verification result.

[0016] To achieve the above objectives, according to another aspect of this application, a data encryption apparatus is provided. The apparatus includes: a first acquisition unit, configured to acquire attribute parameters of all entities included in the encryption system, and determine a master private key and system parameters based on the attribute parameters, wherein the master private key is used to verify the encryption environment of the encryption system, and the system parameters refer to the system parameters followed by all entities included in the encryption system; a generation unit, configured to, after verifying the encryption environment of the encryption system based on the master private key and obtaining a verification result indicating no anomalies in the encryption environment, generate a key by M key entities of the encryption system based on the attribute parameters and system parameters, wherein the key includes an initial decryption key and a re-key, and M is a positive integer; a receiving unit, configured to receive plaintext data, encrypt the plaintext data based on the system parameters to obtain original ciphertext, and re-encrypt the original ciphertext based on the re-key and system parameters to obtain re-ciphertext of the plaintext data; and a first sending unit, configured to, if the re-ciphertext is correct, send the re-ciphertext and the original ciphertext to a user entity of the encryption system, wherein the user entity decrypts the re-ciphertext and the original ciphertext based on the initial decryption key.

[0017] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein, when the executable program is running, it controls the device where the computer-readable storage medium is located to execute the encryption method for any of the above-mentioned data.

[0018] According to another aspect of the present invention, an electronic device is also provided, including one or more processors and a memory, the memory storing an executable program, and the processor for running the program, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the encryption method for any of the above-mentioned data.

[0019] According to another aspect of the present invention, a computer program product is also provided, the computer program product including a computer program, wherein the computer program, when executed by a processor, implements the encryption method for any of the above-mentioned data.

[0020] In this embodiment, data encryption is employed. Attribute parameters of all entities within the encryption system are obtained, and a master private key and system parameters are determined based on these parameters. The master private key is used to verify the encryption environment of the encryption system, and the system parameters refer to the system parameters followed by all entities within the encryption system. After verifying the encryption environment based on the master private key and obtaining a verification result indicating no anomalies, M key entities of the encryption system generate keys based on the attribute parameters and system parameters. These keys include an initial decryption key and a re-key, where M is a positive integer. Plaintext data is received, encrypted based on the system parameters to obtain the original ciphertext, and then re-encrypted based on the re-key and system parameters to obtain the plaintext. The data is re-encrypted; if the re-encrypted text is correct, both the re-encrypted text and the original ciphertext are sent to the user entity of the encryption system. The user entity decrypts the re-encrypted text and the original ciphertext based on the initial decryption key. This solves the technical problem of low encryption security when relying on a single key entity to process encrypted data in related technologies. By determining the master private key and system parameters based on attribute parameters, the key entity of the encryption system generates a key based on the attribute parameters and system parameters, encrypts the plaintext data based on the system parameters to obtain the original ciphertext, and then re-encrypts the original ciphertext based on the re-key and system parameters to obtain the re-encrypted text of the plaintext data. The re-encrypted text and the original ciphertext are then sent to the user entity of the encryption system, thereby achieving the technical effect of improving the flexibility and security of data encryption. Attached Figure Description

[0021] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0022] Figure 1 It is a hardware structure block diagram of a computer terminal (or mobile device) used to implement a data encryption method;

[0023] Figure 2 This is a flowchart of a data encryption method provided according to an embodiment of this application;

[0024] Figure 3 This is a schematic diagram of an encryption system provided according to an embodiment of this application;

[0025] Figure 4 This is a system architecture diagram of the encryption system provided according to the embodiments of this application;

[0026] Figure 5 This is a schematic diagram of a data encryption device provided according to an embodiment of this application;

[0027] Figure 6 This is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0028] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0029] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0030] It should be noted that all information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties. For example, this system has interfaces with relevant users or organizations to provide users with corresponding operation data for them to choose to agree to or refuse automated decision results. Before obtaining relevant information, a request for obtaining the information needs to be sent to the aforementioned user or organization through the interface, and the relevant information is obtained after receiving consent from the aforementioned user or organization; if the user chooses to refuse, the expert decision-making process is initiated. Users can view the purpose of data use in real time through authorization decoding and have the right to withdraw authorization or delete data at any time. After the authorization is withdrawn, the system will terminate the relevant data processing within 24 hours.

[0031] It should be noted that the information collected in this application is 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 the relevant data all comply with the relevant laws, regulations and standards of the relevant regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation access points for users to choose to authorize use or refuse use.

[0032] Example 1

[0033] According to an embodiment of this application, a method embodiment for encrypting data is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0034] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 This is a hardware structure block diagram of a computer terminal (or mobile device) used to implement a data encryption method, such as... Figure 1 As shown, computer terminal 10 (or mobile device) may include one or more ( Figure 1 (Illustrated as 102a, 102b, ..., 102n) Processor 102 (processor 102 may include, but is not limited to, a microprocessor MCU (Microcontroller Unit) or a programmable gate array (FPGA), etc.), memory 104 for storing data, and transmission device 106 for communication functions. In addition, it may include: a display, input / output interface (I / O interface), Universal Serial Bus (USB) port (which may be included as one of the ports of a BUS bus), network interface, keyboard, cursor control device, power supply and / or camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0035] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0036] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the data encryption method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the aforementioned data encryption method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0037] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network interface controller (NIC) and a network interface, which can be connected to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a radio frequency (RF) module, used for wireless communication with the Internet.

[0038] The display can be, for example, a touchscreen liquid crystal display (LCD), which allows the user to interact with the user interface of the computer terminal 10 (or mobile device).

[0039] Under the aforementioned operating environment, this application provides the following: Figure 2 The encryption method shown. Figure 2 This is a flowchart of a data encryption method provided according to an embodiment of this application, such as... Figure 2 As shown, the method includes the following steps:

[0040] Step S201: Obtain the attribute parameters of all entities included in the encryption system, and determine the master private key and system parameters based on the attribute parameters. The master private key is used to verify the encryption environment of the encryption system, and the system parameters refer to the system parameters followed by all entities included in the encryption system.

[0041] It should be noted that the encryption system may refer to an AB-PRE (Based Proxy Re-encryption) system. This encryption system includes multiple user entities, multiple key entities, a Central Authority (CA), and a cloud proxy server. User entities may include a first user entity (i.e., a Data User (DU)), a second user entity (i.e., a Data Owner (DO)), and a third user entity (i.e., a Delegated Re-encryption User (DRU)). Key entities may refer to an Attribute Authority (AA). The Central Authority generates the system's basic parameters and master private key, which form the basis for encryption and decryption operations. Furthermore, the CA collaborates with the Attribute Authority to distribute public and private key shares, ensuring the secure startup and operation of the system. The Attribute Authority manages and allocates encryption key shares related to user attributes, ensuring not only the decentralized generation of keys, thus improving system security and reliability, but also collaboratively generating user decryption keys. Each AA (Access Entity) holds a share of the master private key. Only when more than a threshold of AAs participate can users synthesize a valid decryption key, thus distributing the responsibility for key management and avoiding single points of failure. The data owner, as the owner of the original data, can use encryption algorithms to encrypt plaintext data into ciphertext according to the access policy, and then upload it to be shared with the cloud proxy server. They can also control the user entities that can access the data by setting access policies. Data users are entities with a certain set of attributes. They can receive ciphertext from the DO (Data Entity) or DRU (Data Root Entity) and interact with the AA to obtain the decryption key. They use the decryption key to decrypt the data and obtain the ciphertext that matches their attributes. Data re-users are new user entities delegated by the data owner or data user. They can use a re-key to re-encrypt the original ciphertext to change their access control policy, thereby allowing other users to decrypt it. This process allows data access permissions to be securely transferred between user entities with different attributes without the direct involvement of the data owner or the original data user.

[0042] Furthermore, the attribute parameters of all entities can refer to system parameters and the global attribute set; the master private key is not only used to verify the integrity of the encryption environment, but also serves as the basis for generating decryption and re-encryption keys. Before data encryption, an initialization operation is required, whereby the central authority runs an initialization algorithm, taking security parameters as input and outputting the master private key (MSK) and public parameters (PP). The system parameters are the guidelines and standards followed by all entities, along with other necessary mathematical structures and parameters. By obtaining the attribute parameters of all entities and determining the system parameters, a unified operating environment is created for the encryption system, enabling all participants to perform encryption, decryption, and re-encryption operations according to the same standards, enhancing the system's interoperability and standardization. Moreover, the master private key ensures the core security of the system.

[0043] Step S202: After verifying the encryption environment of the encryption system based on the master private key and obtaining a verification result that the encryption environment is normal, the M key entities of the encryption system generate a key based on the attribute parameters and system parameters. The key includes an initial decryption key and a re-key, and M is a positive integer.

[0044] Specifically, to ensure that subsequent operations (such as key generation, data encryption and decryption) can be carried out in a secure and reliable environment, after confirming that the initialization and parameter settings of the encryption system have not been tampered with or attacked based on the master private key, that is, under the condition that the encryption environment is normal, the key entity of the encryption system can generate a key based on attribute parameters and system parameters. Each key entity can run a key generation algorithm according to the private key share and the user's attribute parameters to generate key shares, and synthesize these shares into a complete decryption key or re-key.

[0045] It should be noted that the initial decryption key is generated interactively by multiple key entities, each calculating it based on its own private key share and the user's attribute set. The re-key is jointly generated by a third-party user entity and the key entities. The re-key can convert the original ciphertext into new ciphertext that the third-party user entity can decrypt. In other words, the re-key contains the conversion information between the original access policy and the new access policy, allowing the original ciphertext to be converted into re-ciphertext that can only be decrypted by a third-party user entity without knowing the original plaintext data. This ensures the correctness and security of the re-encryption operation, while maintaining the confidentiality of the data, preventing intermediate proxy servers from obtaining sensitive information, and avoiding the risk of a single point of failure of a single authority.

[0046] Step S203: Receive plaintext data, encrypt the plaintext data based on system parameters to obtain the original ciphertext, and re-encrypt the original ciphertext according to the re-key and system parameters to obtain the re-ciphertext of the plaintext data.

[0047] It should be noted that plaintext data refers to the original data or information that exists in a readable format before encryption. The entity receiving the plaintext data and determining its encryption strategy can be a user entity. After obtaining the plaintext data, the aforementioned system parameters, combined with a preset access strategy, can be used to encrypt the plaintext data using an encryption algorithm to generate the original ciphertext. Then, the original ciphertext is re-encrypted using a re-key to obtain the re-ciphertext of the plaintext data. Here, the re-key is the key that can transfer access permissions for the original ciphertext from one user entity to another, such as a data re-user. The re-ciphertext refers to the ciphertext generated after transforming the original ciphertext using the re-key, allowing the data re-user to decrypt the data according to the new access strategy without having to obtain the original ciphertext content.

[0048] Step S204: If the recipient is correct, send the recipient and the original ciphertext to the user entity of the encryption system, wherein the user entity decrypts the recipient and the original ciphertext based on the initial decryption key.

[0049] It should be noted that after verifying the generated re-ciphertext and confirming its correctness—that is, if both the generation and verification of the re-ciphertext are error-free—both ciphertexts can be sent to the first user entity and the data user within the user entity. Upon receiving the original ciphertext, the first user entity, possessing the initial decryption key generated based on its own attribute set, can then... The original ciphertext can be decrypted based on this initial decryption key; and the data re-user possesses the initial decryption key. At this point, the re-ciphertext can be decrypted based on the initial decryption key to obtain the original ciphertext.

[0050] Specifically, when the original ciphertext is Only those with the initial decryption key The first user entity can perform decryption operations on it, where the attribute set corresponding to the initial decryption key... Satisfy access policy That is, data that meets the second encryption access permission requirement is returned; if data that does not meet the second encryption access permission requirement is returned, a “⊥” termination message is returned. Specifically, let… turn up satisfy calculate: And extract If If true, then the decrypted plaintext data m can be obtained.

[0051] For encrypted text Only those with the initial decryption key A third user entity can perform decryption operations on it, wherein the attribute set corresponding to the initial decryption key. Access policies must be met. That is, if the data satisfies the first encryption access permission, and the data does not satisfy the second encryption access permission, then a "⊥" end message is returned. Specifically, let... turn up satisfy calculate: Recalculate extract If If true, the original ciphertext m can be obtained.

[0052] The data encryption method provided in this application involves obtaining attribute parameters of all entities included in the encryption system, determining a master private key and system parameters based on these attribute parameters, where the master private key is used to verify the encryption environment of the encryption system, and the system parameters refer to the system parameters followed by all entities included in the encryption system; after verifying the encryption environment of the encryption system based on the master private key and obtaining a verification result indicating no anomalies in the encryption environment, M key entities of the encryption system generate keys based on the attribute parameters and system parameters, where the keys include an initial decryption key and a re-key, and M is a positive integer; receiving plaintext data, encrypting the plaintext data based on the system parameters to obtain the original ciphertext, and re-encrypting the original ciphertext based on the re-key and system parameters to obtain the plaintext data. The encryption system generates a new ciphertext. If the new ciphertext is correct, it sends the new ciphertext and the original ciphertext to the user entity of the encryption system. The user entity decrypts the new ciphertext and the original ciphertext based on the initial decryption key. This solves the technical problem of low encryption security when relying on a single key entity to process encrypted data in related technologies. By determining the master private key and system parameters based on attribute parameters, the key entity of the encryption system generates a key based on the attribute parameters and system parameters. The plaintext data is then encrypted based on the system parameters to obtain the original ciphertext. The original ciphertext is then re-encrypted based on the new key and system parameters to obtain the new ciphertext of the plaintext data. The new ciphertext and the original ciphertext are then sent to the user entity of the encryption system, thereby improving the flexibility and security of data encryption.

[0053] Optionally, in the data encryption method provided in this application embodiment, determining the master private key and system parameters based on attribute parameters includes: determining the total number of M key entities in the encryption system and obtaining the security parameters of the encryption system; receiving random parameters selected by each key entity and obtaining the master private key based on the sum of the M random parameters; constructing private key parameters for each key entity based on the attribute parameters from the M key entities to obtain M private key parameters, and determining public key parameters for each key entity based on the M private key parameters to obtain M public key parameters; obtaining a key entity threshold, and obtaining T key entities from the M key entities through the key entity threshold, wherein the key entity threshold refers to the minimum number of key entities to run when performing the encryption process, T is less than or equal to M, and T is a positive integer; calculating the global public key based on the private key parameters and public key parameters of the T key entities, and obtaining the system parameters based on the global public key.

[0054] Specifically, to achieve data encryption, it is first necessary to determine the system parameters and master / private key of the encryption system. This involves determining the total number of key entities in the encryption system and obtaining the security parameters, which may include bit length, parameters required by the encryption algorithm, etc. Then, a central authority executes the initialization algorithm, which includes the CAInit, AASetup, and CASetup steps, by inputting the security parameter λ, the number of AAs n, and attribute parameters. Generate system parameters PP and master private key MSK.

[0055] Specifically, the CAInit sub-algorithm is run by a central authority, taking into account the security parameter λ, the number of key entities AA n, and attribute parameters. First, run the swarm generator. And obtained Let the message space be {0, 1} k Then select randomly. Where g is a generator of group G, randomly selected. Additionally, two hash functions H1 and G are randomly selected. T →{0,1} 2k and And a message-locking encryption algorithm. For each AA i (i∈M), the central authority can choose an independent identity for it. In addition, the central authority can also determine the minimum value t of the AA (i.e., the key entity threshold) that needs to be involved in each key generation algorithm.

[0056] The AASetup sub-algorithm is run by M key entities AA. Each AA i Choose a random one and a random polynomial f of degree t-1 i(x), and satisfy f i (0)=α i Calculate s ij =f i (aid j ), where j∈[1,M]. AA i Will send s ij Give AA j Save it yourself ii The master private key α can be implicitly set to: (That is, the master private key is obtained based on the sum of random parameters). When AA i Received s sent by other key entities ji Then, the private key parameters for each key entity can be constructed based on the attribute parameters, and the public key parameters for each key entity can be determined based on the private key parameters, i.e., AA. i Private key parameters (private key share): The corresponding public key parameters (public key share):

[0057] The CASetup sub-algorithm is run by a central authority. It first selects the public key parameters of t key entities, denoted as {Apk}. i} i∈[1,t] The global public key can then be calculated using the following formula:

[0058]

[0059] When the master private key MSK = α, the system parameter PP can be calculated using the following formula:

[0060]

[0061] This embodiment ensures normal operation even when some key entities are unavailable by calculating system parameters and public and private keys. It provides highly secure, reliable and flexible data access control, and provides a unified framework for encryption, re-encryption and decryption operations, eliminating the risk of single points of failure.

[0062] Optionally, in the data encryption method provided in this application embodiment, when the key is the initial decryption key, the generation of the key by the M key entities of the encryption system based on attribute parameters and system parameters includes: obtaining the attribute parameters of the first user entity in the user entity from the attribute parameters to obtain the first attribute parameter; obtaining the M private key parameters associated with the M key entities, and calculating the M private key parameters, system parameters and the first attribute parameter through a key generation algorithm to obtain the M key shares of the M key entities; and calculating the M key shares through a key algorithm to obtain the initial decryption key.

[0063] Specifically, when calculating the initial decryption key, the attribute parameters of the first user entity (i.e., data user DU) are first obtained from the attribute parameters to obtain its attribute set, i.e., the first attribute parameters. Then, the private key parameters associated with the calculated key entity are obtained. Then, the private key parameters, system parameters, and first attribute parameters are calculated using a key generation algorithm. The key generation algorithm is executed by the first user entity and any t key entities AA. The first user entity selects t AAs to interact with and obtains a key share, i.e., based on the system parameters PP and the first attribute parameters. and private key parameter Ask i As input, each AA i Random selection The key share is calculated using the following formula:

[0064]

[0065] Furthermore, after obtaining the key shares from t different key entities, the initial decryption key can be calculated using the following formula.

[0066]

[0067]

[0068] If let The initial decryption key SK can be constructed using the following formula:

[0069]

[0070] This embodiment effectively implements a secure and decentralized decryption key generation mechanism by calculating the initial decryption key. This not only improves the security of the key generation process and prevents a single authoritative institution from becoming a security bottleneck for the system, but also ensures that the generation of decryption keys is entirely based on user attributes and the system's access control policies. This greatly enhances the flexibility and security of data access and can effectively prevent data leakage.

[0071] Optionally, in the data encryption method provided in this application embodiment, when the key is a multiple key, the generation of the key by M key entities of the encryption system based on attribute parameters and system parameters includes: obtaining first encryption access permission data and obtaining an initial decryption key, wherein the first encryption access permission data is used to filter user entities with different attributes; calculating the initial decryption key, system parameters and encryption access permission data through a multiple key generation algorithm to obtain M multiple key shares of the M key entities; determining N sub-multiple keys based on the M multiple key shares by a key algorithm, and combining the N sub-multiple keys to obtain the multiple key.

[0072] Specifically, when calculating the duplicate key, it is first necessary to obtain the first encryption access permission data. And obtain the initial decryption key SK, where the first encryption access permission data is used to define which user entities with which attributes can decrypt data, so as to achieve fine-grained control over data access; the initial decryption key is used as the key to decrypt the original ciphertext.

[0073] Furthermore, a re-key is calculated by using a re-key generation algorithm on the initial decryption key, system parameters, and encryption access permission data. This re-key is jointly executed by the first user entity and t key entities, with the first user entity selecting the same t key entities to interact and obtain the re-key share, which is calculated using the system parameters PP and the initial decryption key. And the first encrypted access permission data (i.e., the new access policy). As input, where It is The matrix, when the attributes Data that satisfies the first encrypted access permission At that time, each AA i Random selection And calculate the heavy key share using the following formula:

[0074]

[0075] Furthermore, after calculating the heavy key share of t key entities, a portion of the heavy key can be calculated using the following formula:

[0076]

[0077]

[0078] If let make At this point, RK0, RK′1, and RK2 in the above formula can be expressed as: RK0 = e(g, g) αZ RK′1=Q δ RK2 = g δ .

[0079] Furthermore, RK1, RK3, and RK4 can be calculated using the following formula:

[0080] In randomly selecting vectors for Each line calculate Then, randomly select At this point, calculations can be performed. Based on the above characters, the rekey RK can then be obtained:

[0081]

[0082] This embodiment effectively enhances the security of permission transfer by calculating the distributed heavy key share and then determining the heavy key based on the heavy key share. It not only ensures the flexibility and fine-grained control of data access authorization, but also improves the overall security and reliability, and further protects the privacy of data.

[0083] Optionally, in the data encryption method provided in this application embodiment, encrypting plaintext data based on system parameters to obtain the original ciphertext includes: obtaining second encryption access permission data associated with the plaintext data; performing vector conversion on the second encryption access permission data to obtain an access matrix; obtaining element calculation rules; determining random elements by the second user entity in the user entity; calculating the random elements, access matrix, and system parameters according to the element calculation rules to obtain ciphertext elements, wherein the element calculation rules include calculation formulas for multiple ciphertext elements; and combining the second encryption access permission data and the ciphertext elements to obtain the original ciphertext.

[0084] Specifically, after obtaining the plaintext data that needs to be encrypted, to encrypt the plaintext data, it is first necessary to obtain the access policy set by the user entity when it wants to encrypt the data, that is, to obtain the second encryption access permission data. Then, the second encryption access permission data is vectorized to obtain an access matrix, where each element of the access matrix corresponds to an attribute, namely the system parameter PP, the message m, and the second encryption access permission data. As input, let It is an l×w matrix, ρ will be the matrix Each line and The attributes in the file are mapped one-to-one.

[0085] Furthermore, an encryption algorithm is needed to compute ciphertext elements. This involves the second user entity (the data owner) selecting a set of random elements, which are then embedded into the ciphertext to increase the uncertainty of the encryption process and improve its security. Finally, the access matrix and all generated ciphertext elements are combined to obtain the original ciphertext. In other words, the encryption algorithm first needs to randomly select R∈{0,1}. k sum vector Where r = H2(MLE(m||R)), y2, ..., y w Used for sharing r. Each line calculate Random selection Finally, the original ciphertext can be constructed from the second encrypted access data and the ciphertext elements:

[0086]

[0087] Among them, the ciphertext elements C0, C1, C2, C 3,j C 4,j C5 can be calculated using the formulas included in the element calculation rules, that is:

[0088] This embodiment transforms the access policy into an access matrix, and combines the selection of random elements and the calculation of ciphertext elements to achieve precise control over data encryption and decryption permissions. This not only improves the security and flexibility of data sharing, but also effectively addresses the complex needs of data sharing and access control, ensuring business continuity and data privacy.

[0089] Optionally, in the data encryption method provided in this application embodiment, re-encrypting the original ciphertext according to the re-key and system parameters to obtain the re-ciphertext of the plaintext data includes: obtaining the second attribute parameter of the third user entity in the user entity, obtaining the second encryption access permission data, and determining whether the second encryption access permission data contains the second attribute parameter; if the second encryption access permission data contains the second attribute parameter, ending the step of re-encrypting the original ciphertext according to the re-key and system parameters; if the second encryption access permission data contains the second attribute parameter, the re-encryption algorithm calculates based on the re-key, system parameters and the original ciphertext to obtain the re-ciphertext.

[0090] Specifically, after obtaining the original ciphertext, in order to re-encrypt it, it is first necessary to obtain the attribute set of the third user entity, i.e., obtain the second attribute parameter, and simultaneously obtain the second encryption access permission data. It is then determined whether the second encryption access permission data contains the second attribute parameter, i.e., whether the access policy of the third user entity contains the attribute decryption data of the first user entity. If the second encryption access permission data contains the second attribute parameter, it indicates that the DRU's access policy does not need to be adjusted to override the decryption permission of the third user entity. In this case, there is no need to perform re-encryption based on the re-key and system parameters; the existing access state of the data can be maintained unchanged. That is, if the second attribute parameter... Access policy not satisfied (That is, the second encrypted access data), at this time the "⊥" stop symbol is output, so this method simplifies the data processing flow and improves the system's response speed and efficiency.

[0091] Conversely, if the second encrypted access permission data does not contain the second attribute parameter, indicating that the access strategy of the third user entity needs to be extended through the use of a re-encryption key, a new re-encryption algorithm can be generated using the re-encryption key, system parameters, and the original ciphertext as inputs. The input to the re-encryption algorithm is the original ciphertext. Re-key and order get satisfy Then calculate using the following formula:

[0092]

[0093] Let C′0 = C0, C′1 = RK5, C′2 = RK6. When C′5=C5 and C′6=RK0, the re-encrypted text CT′ can be determined by the following formula:

[0094]

[0095] This embodiment achieves dynamic adjustment of data access permissions through permission judgment and conditional re-encryption process. Under the premise of ensuring compliance with the established access policy, it reduces unnecessary re-encryption operations, optimizes the system's operating efficiency, and further enhances data security, privacy protection and efficient sharing through re-key.

[0096] Optionally, in the data encryption method provided in this application embodiment, after obtaining the re-ciphertext of the plaintext data, the method further includes: when the encryption system and the verifier are in a communication connection, sending the re-ciphertext to the verifier, wherein the verifier verifies the re-ciphertext according to a first verification rule and sends a first verification result to the encryption system; if the first verification result indicates that at least one sub-re-ciphertext in the re-ciphertext is different from the first verification rule, ending the step of sending the re-ciphertext and the original ciphertext to the encryption system by the user entity; if the first verification result indicates that all sub-re-ciphertexts in the re-ciphertext are the same as the first verification rule, obtaining a second verification rule, and verifying the re-ciphertext according to the second verification rule to obtain a second verification result; if the second verification result indicates that all sub-re-ciphertexts in the re-ciphertext are the same as the second verification rule, performing the step of sending the re-ciphertext and the original ciphertext to the encryption system by the user entity.

[0097] To verify the re-encrypted text, a verifier can be used to implement the verification algorithm. Specifically, after the re-encrypted text generated by the third user entity using the re-encryption algorithm is sent to the verifier, the verifier verifies the re-encrypted text. The verifier can answer the user's verification request to ensure the verifiability and fairness of the re-encrypted text. At this time, the verifier verifies the re-encrypted text according to the first verification rule, that is, it verifies whether each component (i.e., sub-re-encrypted text) in the re-encrypted text is consistent with the first verification rule. Based on the verification result, the verifier sends the first verification result to the encryption system.

[0098] It should be noted that when using the verification algorithm for verification, the original ciphertext is first... Re-key

[0099] Confidential documents Given a proof π = (m, R) as input, the verifier then verifies, using the following first verification rule, whether each sub-ciphertext in the re-ciphertext is correctly generated: whether C′0 is equal to C0, whether C′1 is equal to RK5, whether C′2 is equal to RK6, and whether C′... 3,j Is it related to RK? 7,j Equal, C′ 4,j Is it related to RK? 8,j Check if C′5 is equal to C5, and if C′6 is equal to RK0. If at least one sub-encryption differs from the first verification rule, the subsequent steps end; otherwise, if all sub-encryptions in the encrypted text are equal to the first verification rule, further verification using the second verification rule is required, i.e., calculating r = H2(MLE(m||R)) and determining if... If the second verification result obtained by verifying the re-ciphertext through the second verification rule indicates that all sub-re-ciphertexts in the re-ciphertext are the same as the second verification rule, then the subsequent steps can continue to be executed. That is, only when the re-ciphertext successfully passes the dual verification of the first verification rule and the second verification rule will the verifier send a signal to the encryption system allowing the third user entity to perform the next operation, thereby maintaining the overall security of the system and the controllability of data sharing.

[0100] In addition, the verifier can also test the verifiability of duplicate ciphertext. When decrypting the original ciphertext CT, the original ciphertext can be verified using the following formula:

[0101]

[0102] At this time, it can be determined according to Then extract m||R from it, and then obtain the plaintext data m based on the commitment verification.

[0103] This embodiment employs a two-stage verification mechanism. The first verification rule ensures that there are no technical errors in the process of generating the re-encrypted text, while the second verification rule further verifies whether the access control policy for the re-encrypted text is compliant. This not only strengthens the security of the data encryption and decryption process but also ensures precise control over the transfer of data access permissions.

[0104] This application also provides an encryption system. It should be noted that the encryption system of this application can be used to execute the encryption method provided in this application. The encryption system provided in this application is described below.

[0105] According to embodiments of this application, a system for implementing the above-described encryption method is also provided. Figure 3 This is a schematic diagram of an encryption system provided according to an embodiment of this application, such as... Figure 3 As shown, the system includes:

[0106] The encryption system 301 includes M key entities and user entities. It is used to determine the master private key and system parameters based on the attribute parameters of all entities. After verifying the encryption environment of the encryption system 301 based on the master private key and obtaining a verification result that the encryption environment is not abnormal, the M key entities generate a key based on the attribute parameters and system parameters. It is also used to encrypt plaintext data based on the system parameters to obtain the original ciphertext. The original ciphertext is then re-encrypted based on the key and the system parameters to obtain the re-ciphertext of the plaintext data. The re-ciphertext is sent to the verifier 302. It is also used to send the re-ciphertext and the original ciphertext to the user entity if the first verification result indicates that the re-ciphertext is correct. Here, M is a positive integer.

[0107] Figure 4 This is a system architecture diagram of the encryption system provided according to the embodiments of this application, such as... Figure 4As shown, the entities involved in the encryption system 301 include: all entities that can refer to multiple user entities, multiple key entities, a central authority (CA), and a cloud proxy server. User entities include the first user entity (i.e., the data user (DU)), the second user entity (i.e., the data owner (DO)), and the third user entity (i.e., the delegated re-encryption user). User (DRU) and key entity can refer to Attribute Authority (AA). The central authority (CA) generates system parameters and collaborates with the AA to generate the system's public and private keys. The Attribute Authority (AA) generates decryption keys for the DU and DRU. The data owner (DO) encrypts plaintext data according to the access policy and uploads the ciphertext to the cloud proxy server. The data user (DU) can download the ciphertext, decrypt it using the decryption key to obtain the plaintext data, generate a re-key based on the user attributes to be delegated, and send it to the cloud proxy server. The cloud proxy server can store the ciphertext, re-encrypt it using the re-key, and send it to the data re-user. The data re-user (DRU) can download the re-ciphertext, decrypt it using the decryption key to obtain the plaintext data, and also verify the correctness of the re-ciphertext.

[0108] Specifically, the encryption system 301 may include the following steps: initializing the algorithm. It includes three sub-algorithms: CAInit, AASetup, and CASetup, which combine the security parameter λ, the number of AAs n, and attribute parameters. Generate system parameters PP and master private key MSK; key generation algorithm With system parameter PP and first attribute parameter Ask the private key share of the attribute authority i As input, the output is the user's initial decryption key SK; the encryption algorithm. The system parameters PP, plaintext data m, and second encrypted access permission data are used. Input is the original ciphertext CT; output is the re-key generation algorithm. With system parameter PP and first attribute parameter The initial decryption key SK and the first encrypted access data are bound together. As input, the output is the re-key RK; the re-encryption algorithm ReEnc(CT, RK) takes the original ciphertext CT and the re-key RK as input and outputs the re-ciphertext CT′.

[0109] Specifically, the process begins with the Central Authority (CA) leading the determination of the master private key and system parameters by combining the attribute parameters of all Attribute Authorities (AAs) and user entities (DOs, DUs, DRUs). Attribute parameters define the specific attributes held by each entity, such as department or job level. The master private key is used to generate key shares for the attribute authorities, ensuring the controllability and security of key generation. System parameters define the operating environment for encryption and re-encryption algorithms, including specific parameters such as mathematical groups, hash functions, and encryption algorithms. After the master private key and system parameters are determined, the CA further runs a verification process to assess the security status of the encryption environment and ensure it is free of anomalies. If the environment verification result shows no anomalies (i.e., the encryption environment is verified to be anomaly-free), then the attribute authority (AA) can act as the key entity and run the key generation algorithm based on the attribute parameters and system parameters to generate keys for each user entity.

[0110] Furthermore, the data owner (DO) uses system parameters and custom encrypted access permission data to run an encryption algorithm to encrypt the plaintext data, obtaining the original ciphertext. The encrypted access permission data defines which users with specific attributes can decrypt the ciphertext, and is a key element in achieving fine-grained access control. When data needs to be granted to a new user entity (DRU), the data owner or user (DO or DU) generates a re-key and, together with the system parameters, runs a re-encryption algorithm to convert the original ciphertext into re-ciphertext that matches the new encrypted access permission data. Finally, the re-ciphertext is sent to verifier 302 for verification. Verifier 302 checks whether the format, content, and access policy of the re-ciphertext match the expected output of the re-encryption algorithm according to preset verification rules, thereby verifying the correctness of the re-ciphertext. If the re-ciphertext is correct, both the re-ciphertext and the original ciphertext are sent to the user entity.

[0111] Verifier 302 is used to verify the duplicate ciphertext according to the first verification rule and send the first verification result.

[0112] It should be noted that the first verification rule refers to a set of predefined mathematical rules or algorithms used to check whether the re-ciphertext was correctly generated and whether it matches the system parameters and the re-key used in the re-encryption process. Through the first verification rule, the verifier 302 can confirm the technical correctness of the re-ciphertext, preventing data inconsistencies caused by technical errors or malicious operations. After the verifier 302 applies the first verification rule to check the re-ciphertext, it will obtain the first verification result. If the re-ciphertext meets all the conditions of the first verification rule, the verifier 302 will return a result indicating that the re-ciphertext is correct, such as the logical value true; conversely, if the re-ciphertext fails the verification, the verifier 302 will return a result indicating that the re-ciphertext is incorrect, i.e., false.

[0113] The encryption system 301 provided in this application embodiment obtains attribute parameters of all entities included in the encryption system 301, and determines a master private key and system parameters based on the attribute parameters. The master private key is used to verify the encryption environment of the encryption system 301, and the system parameters refer to the system parameters followed by all entities included in the encryption system 301. If the encryption environment of the encryption system 301 is verified based on the master private key and a verification result indicating no anomalies is obtained, M key entities of the encryption system 301 generate keys based on the attribute parameters and system parameters. These keys include an initial decryption key and a re-key, where M is a positive integer. Plaintext data is received, encrypted based on the system parameters to obtain the original ciphertext, and then re-encrypted based on the re-key and system parameters to obtain the re-ciphertext of the plaintext data. If the re-ciphertext is correct, it is then... The original ciphertext is sent to the user entity of the encryption system 301. The user entity decrypts the re-ciphertext and the original ciphertext based on the initial decryption key. This solves the technical problem of low encryption security when relying on a single key entity to process encrypted data in related technologies. By utilizing the collaborative operation of the encryption system 301 and the verifier 302, the encryption system 301 determines the master private key and system parameters based on attribute parameters. The key entity of the encryption system 301 generates a key based on the attribute parameters and system parameters. The plaintext data is encrypted based on the system parameters to obtain the original ciphertext. The original ciphertext is then re-encrypted based on the re-key and system parameters to obtain the re-ciphertext of the plaintext data. After the verifier 302 verifies the re-ciphertext, it sends the re-ciphertext and the original ciphertext to the user entity of the encryption system 301. This achieves the technical effect of improving the flexibility and security of data encryption.

[0114] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps may be executed in a different order than that described here.

[0115] Example 2

[0116] This application also provides a data encryption device. It should be noted that the data encryption device of this application can be used to execute the data encryption method provided in this application. The data encryption device provided in this application is described below.

[0117] According to an embodiment of this application, an apparatus for implementing the above-described data encryption method is also provided. Figure 5 This is a schematic diagram of a data encryption device provided according to an embodiment of this application, such as... Figure 5 The device includes: a first acquisition unit 50, a generation unit 51, a receiving unit 52, and a first transmission unit 53.

[0118] The first acquisition unit 50 is used to acquire the attribute parameters of all entities included in the encryption system, and determine the master private key and system parameters based on the attribute parameters. The master private key is used to verify the encryption environment of the encryption system, and the system parameters refer to the system parameters followed by all entities included in the encryption system.

[0119] The generation unit 51 is used to generate a key based on attribute parameters and system parameters by M key entities of the encryption system when the encryption environment of the encryption system is verified based on the master private key and the verification result shows that there is no abnormality in the encryption environment. The key includes an initial decryption key and a re-key, and M is a positive integer.

[0120] The receiving unit 52 is used to receive plaintext data, encrypt the plaintext data based on system parameters to obtain the original ciphertext, and re-encrypt the original ciphertext according to the re-key and system parameters to obtain the re-ciphertext of the plaintext data.

[0121] The first sending unit 53 is used to send the re-ciphertext and the original ciphertext to the user entity of the encryption system if the re-ciphertext is correct, wherein the user entity decrypts the re-ciphertext and the original ciphertext based on the initial decryption key.

[0122] The data encryption device provided in this application embodiment acquires attribute parameters of all entities included in the encryption system through a first acquisition unit 50, and determines a master private key and system parameters based on the attribute parameters. The master private key is used to verify the encryption environment of the encryption system, and the system parameters refer to the system parameters followed by all entities included in the encryption system. The generation unit 51, after verifying the encryption environment of the encryption system based on the master private key and obtaining a verification result indicating no anomalies in the encryption environment, generates keys from M key entities of the encryption system based on the attribute parameters and system parameters. The keys include an initial decryption key and a re-key, where M is a positive integer. The receiving unit 52 receives plaintext data, encrypts the plaintext data based on the system parameters to obtain the original ciphertext, and re-encrypts the original ciphertext based on the re-key and system parameters. The first sending unit 53, if the re-ciphertext is correct, sends the re-ciphertext and the original ciphertext to the user entity of the encryption system. The user entity decrypts the re-ciphertext and the original ciphertext based on the initial decryption key. This solves the technical problem of low encryption security when relying on a single key entity to process encrypted data in related technologies. By determining the master private key and system parameters according to attribute parameters, the key entity of the encryption system generates a key based on the attribute parameters and system parameters, encrypts the plaintext data based on the system parameters to obtain the original ciphertext, and re-encrypts the original ciphertext according to the re-key and system parameters to obtain the re-ciphertext of the plaintext data. The re-ciphertext and the original ciphertext are then sent to the user entity of the encryption system, thereby achieving the technical effect of improving the flexibility and security of data encryption.

[0123] Optionally, in the data encryption device provided in this application embodiment, the first acquisition unit 50 includes: a first determining module, used to determine the total number of M key entities in the encryption system and acquire the security parameters of the encryption system; a receiving module, used to receive random parameters selected by each key entity and obtain the master private key based on the sum of the M random parameters; a construction module, used to construct the private key parameters of each key entity based on the attribute parameters of the M key entities to obtain M private key parameters, and determine the public key parameters of each key entity based on the M private key parameters to obtain M public key parameters; a first acquisition module, used to acquire a key entity threshold and acquire T key entities from the M key entities through the key entity threshold, wherein the key entity threshold refers to the minimum number of key entities to run when performing the encryption process, T is less than or equal to M, and T is a positive integer; and a first calculation module, used to calculate the global public key based on the private key parameters of the T key entities and the public key parameters of the T key entities, and obtain the system parameters based on the global public key.

[0124] Optionally, in the data encryption device provided in this application embodiment, the generation unit 51 includes: a second acquisition module, used to acquire attribute parameters of the first user entity in the user entity from the attribute parameters, to obtain the first attribute parameters; a third acquisition module, used to acquire M private key parameters associated with M key entities, and calculate the M private key parameters, system parameters and the first attribute parameters through a key generation algorithm to obtain M key shares of the M key entities; and a second calculation module, used to calculate the M key shares through a key algorithm to obtain the initial decryption key.

[0125] Optionally, in the data encryption device provided in this application embodiment, the generation unit 51 includes: a fourth acquisition module, used to acquire first encryption access permission data and acquire an initial decryption key, wherein the first encryption access permission data is used to filter user entities with different attributes; a third calculation module, used to calculate the initial decryption key, system parameters and encryption access permission data through a heavy key generation algorithm to obtain M heavy key shares of M key entities; and a second determination module, used to determine N sub-heavy keys based on the M heavy key shares by a key algorithm, and combine the N sub-heavy keys to obtain a heavy key.

[0126] Optionally, in the data encryption device provided in this application embodiment, the receiving unit 52 includes: a fifth acquisition module, used to acquire second encrypted access permission data associated with plaintext data, and perform vector conversion on the second encrypted access permission data to obtain an access matrix; a sixth acquisition module, used to acquire element calculation rules, determine random elements by the second user entity in the user entity, and calculate the random elements, access matrix and system parameters according to the element calculation rules to obtain ciphertext elements, wherein the element calculation rules include calculation formulas for multiple ciphertext elements; and a combination module, used to combine the second encrypted access permission data and ciphertext elements to obtain the original ciphertext.

[0127] Optionally, in the data encryption device provided in this application embodiment, the receiving unit 52 includes: a seventh acquisition module, used to acquire the second attribute parameter of the third user entity in the user entity, acquire the second encryption access permission data, and determine whether the second encryption access permission data contains the second attribute parameter; an end module, used to end the step of re-encrypting the original ciphertext based on the re-key and system parameters when the second encryption access permission data contains the second attribute parameter; and a fourth calculation module, used to calculate the re-ciphertext by the re-encryption algorithm based on the re-key, system parameters, and the original ciphertext when the second encryption access permission data contains the second attribute parameter.

[0128] Optionally, in the data encryption apparatus provided in the embodiments of this application, the apparatus further includes: a second sending unit, configured to send the re-ciphertext to the verifier after obtaining the re-ciphertext of the plaintext data, provided that the encryption system and the verifier are in a communication connection, wherein the verifier verifies the re-ciphertext according to a first verification rule and sends a first verification result to the encryption system; a termination unit, configured to terminate the step of sending the re-ciphertext and the original ciphertext to the encryption system by the user entity when the first verification result indicates that at least one sub-re-ciphertext in the re-ciphertext is different from the first verification rule; a second obtaining unit, configured to obtain a second verification rule when the first verification result indicates that all sub-re-ciphertexts in the re-ciphertext are the same as the first verification rule, and verify the re-ciphertext according to the second verification rule to obtain a second verification result; and an execution unit, configured to execute the step of sending the re-ciphertext and the original ciphertext to the encryption system by the user entity when the second verification result indicates that all sub-re-ciphertexts in the re-ciphertext are the same as the second verification rule.

[0129] It should be noted that the first acquisition unit 50, generation unit 51, receiving unit 52, and first sending unit 53 mentioned above correspond to steps S201 to S204 in Embodiment 1. The instances and application scenarios implemented by the above units and corresponding steps are the same, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules or units can be hardware or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above units can also be part of a device and can run in the computer terminal 10 provided in Embodiment 1.

[0130] Example 3

[0131] Embodiments of this application may provide a computer terminal, which may be any computer terminal device in a group of computer terminals. Optionally, in this embodiment, the aforementioned computer terminal may also be replaced with a mobile terminal or an electronic device, etc.

[0132] Optionally, in this embodiment, the computer terminal may be located in at least one of a plurality of network devices in a computer network.

[0133] In this embodiment, the computer terminal described above can execute the following steps of the data encryption method: obtaining attribute parameters of all entities included in the encryption system, determining the master private key and system parameters based on the attribute parameters, wherein the master private key is used to verify the encryption environment of the encryption system, and the system parameters refer to the system parameters followed by all entities included in the encryption system; after verifying the encryption environment of the encryption system based on the master private key and obtaining a verification result that the encryption environment is without anomalies, generating a key by M key entities of the encryption system based on the attribute parameters and system parameters, wherein the key includes an initial decryption key and a re-key, and M is a positive integer; receiving plaintext data, encrypting the plaintext data based on the system parameters to obtain the original ciphertext, and re-encrypting the original ciphertext based on the re-key and system parameters to obtain the re-ciphertext of the plaintext data; if the re-ciphertext is correct, sending the re-ciphertext and the original ciphertext to the user entity of the encryption system, wherein the user entity decrypts the re-ciphertext and the original ciphertext based on the initial decryption key.

[0134] Optionally, the aforementioned computer terminal may execute the following steps in the data encryption method: determine the total number of M key entities in the encryption system and obtain the security parameters of the encryption system; receive the random parameters selected by each key entity, and obtain the master private key based on the sum of the M random parameters; construct the private key parameters of each key entity based on the attribute parameters of the M key entities, obtain M private key parameters, and determine the public key parameters of each key entity based on the M private key parameters, obtain M public key parameters; obtain a key entity threshold, and obtain T key entities from the M key entities through the key entity threshold, where the key entity threshold refers to the minimum number of key entities to run when performing the encryption process, T is less than or equal to M, and T is a positive integer; calculate the global public key based on the private key parameters and public key parameters of the T key entities, and obtain the system parameters based on the global public key.

[0135] Optionally, the computer terminal described above can execute the following steps in the data encryption method: obtain the attribute parameters of the first user entity in the user entity from the attribute parameters to obtain the first attribute parameter; obtain the M private key parameters associated with the M key entities, and calculate the M private key parameters, system parameters, and first attribute parameters using a key generation algorithm to obtain the M key shares of the M key entities; calculate the M key shares using a key algorithm to obtain the initial decryption key.

[0136] Optionally, the computer terminal described above can execute the following steps in the data encryption method: obtaining first encryption access permission data and obtaining an initial decryption key, wherein the first encryption access permission data is used to filter user entities with different attributes; calculating the initial decryption key, system parameters, and encryption access permission data using a heavy key generation algorithm to obtain M heavy key shares for M key entities; determining N sub-heavy keys based on the M heavy key shares using a key algorithm, and combining the N sub-heavy keys to obtain a heavy key.

[0137] Optionally, the computer terminal described above can execute the following steps in the data encryption method: obtaining second encrypted access permission data associated with plaintext data; performing vector conversion on the second encrypted access permission data to obtain an access matrix; obtaining element calculation rules; determining random elements by the second user entity in the user entity; calculating ciphertext elements based on the random elements, access matrix, and system parameters according to the element calculation rules; wherein the element calculation rules include calculation formulas for multiple ciphertext elements; and combining the second encrypted access permission data and the ciphertext elements to obtain the original ciphertext.

[0138] Optionally, the computer terminal described above can execute the following steps in the data encryption method: obtaining the second attribute parameter of the third user entity in the user entity, obtaining the second encryption access permission data, and determining whether the second encryption access permission data contains the second attribute parameter; if the second encryption access permission data contains the second attribute parameter, ending the step of re-encrypting the original ciphertext based on the re-key and system parameters; if the second encryption access permission data contains the second attribute parameter, the re-encryption algorithm calculates based on the re-key, system parameters, and the original ciphertext to obtain the re-ciphertext.

[0139] Optionally, the aforementioned computer terminal can execute program code for the following steps in the data encryption method: when the encryption system and the verifier are in communication connection, the re-ciphertext is sent to the verifier, wherein the verifier verifies the re-ciphertext according to a first verification rule and sends a first verification result to the encryption system; if the first verification result indicates that at least one sub-re-ciphertext in the re-ciphertext is different from the first verification rule, the step of sending the re-ciphertext and the original ciphertext to the encryption system by the user entity ends; if the first verification result indicates that all sub-re-ciphertexts in the re-ciphertext are the same as the first verification rule, a second verification rule is obtained, and the re-ciphertext is verified according to the second verification rule to obtain a second verification result; if the second verification result indicates that all sub-re-ciphertexts in the re-ciphertext are the same as the second verification rule, the step of sending the re-ciphertext and the original ciphertext to the encryption system by the user entity is executed.

[0140] Optionally, Figure 6 This is a structural block diagram of an electronic device according to an embodiment of this application. Figure 6 As shown, the electronic device may include: one or more ( Figure 6 (Only one is shown) processor 602, memory 604, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.

[0141] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the data encryption method and apparatus in this application embodiment. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the aforementioned data encryption method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0142] The processor can access the information and application programs stored in the memory via the transmission device to execute the steps described above in the data encryption method.

[0143] Those skilled in the art will understand that Figure 6 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones, tablets, handheld computers, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 6 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 6 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 6 The different configurations shown.

[0144] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0145] Example 4

[0146] Embodiments of this application also provide a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the data encryption method provided in Embodiment 1.

[0147] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0148] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: obtaining attribute parameters of all entities included in the encryption system, determining the master private key and system parameters based on the attribute parameters, wherein the master private key is used to verify the encryption environment of the encryption system, and the system parameters refer to the system parameters followed by all entities included in the encryption system; if the encryption environment of the encryption system is verified based on the master private key and a verification result indicating no anomalies is obtained, M key entities of the encryption system generate keys based on the attribute parameters and system parameters, wherein the keys include an initial decryption key and a re-key, and M is a positive integer; receiving plaintext data, encrypting the plaintext data based on the system parameters to obtain the original ciphertext, and re-encrypting the original ciphertext based on the re-key and system parameters to obtain the re-ciphertext of the plaintext data; if the re-ciphertext is correct, sending the re-ciphertext and the original ciphertext to the user entity of the encryption system, wherein the user entity decrypts the re-ciphertext and the original ciphertext based on the initial decryption key.

[0149] This application also provides a computer program product that, when executed on a data processing device, is suitable for performing data encryption method steps.

[0150] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0151] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0152] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of units or modules may be electrical or other forms.

[0153] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0154] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0155] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0156] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for encrypting data, characterized in that, Applied to encryption systems, including: Obtain the attribute parameters of all entities included in the encryption system, and determine the master private key and system parameters based on the attribute parameters. The master private key is used to verify the encryption environment of the encryption system, and the system parameters refer to the system parameters followed by all entities included in the encryption system. If the encryption environment of the encryption system is verified based on the master private key and the verification result shows that the encryption environment is normal, the M key entities of the encryption system generate a key based on the attribute parameters and the system parameters, wherein the key includes an initial decryption key and a re-key, and M is a positive integer; Receive plaintext data, encrypt the plaintext data based on the system parameters to obtain the original ciphertext, and re-encrypt the original ciphertext according to the re-key and the system parameters to obtain the re-ciphertext of the plaintext data; If the re-ciphertext is correct, the re-ciphertext and the original ciphertext are sent to the user entity of the encryption system, wherein the user entity decrypts the re-ciphertext and the original ciphertext based on the initial decryption key.

2. The method according to claim 1, characterized in that, Determining the master private key and system parameters based on the aforementioned attribute parameters includes: Determine the total number of entities among the M key entities in the encryption system, and obtain the security parameters of the encryption system; Receive random parameters selected by each key entity, and obtain the master private key based on the sum of M random parameters; The private key parameters of each of the M key entities are constructed based on the attribute parameters to obtain M private key parameters, and the public key parameters of each key entity are determined based on the M private key parameters to obtain M public key parameters; Obtain a key entity threshold, and obtain T key entities from the M key entities through the key entity threshold, wherein the key entity threshold refers to the minimum number of key entities to be run when performing the encryption process, T is less than or equal to M, and T is a positive integer; The global public key is calculated based on the private key parameters of the T key entities and the public key parameters of the T key entities, and the system parameters are obtained based on the global public key.

3. The method according to claim 1, characterized in that, When the key is the initial decryption key, the generation of a key by the M key entities of the encryption system based on the attribute parameters and the system parameters includes: Obtain the attribute parameters of the first user entity in the user entity from the attribute parameters, and obtain the first attribute parameter; Obtain the M private key parameters associated with the M key entities, and calculate the M key shares of the M key entities by using a key generation algorithm on the M private key parameters, the system parameters, and the first attribute parameters. The initial decryption key is obtained by calculating the M key shares using a key algorithm.

4. The method according to claim 1, characterized in that, When the key is the heavy key, the generation of the key by the M key entities of the encryption system based on the attribute parameters and the system parameters includes: Obtain first encrypted access permission data and obtain the initial decryption key, wherein the first encrypted access permission data is used to filter user entities with different attributes; The initial decryption key, the system parameters, and the encryption access permission data are calculated using a rekey generation algorithm to obtain the M rekey shares of the M key entities; The key algorithm determines N sub-keys based on the M heavy key shares, and the heavy key is obtained by combining the N sub-keys.

5. The method according to claim 1, characterized in that, The plaintext data is encrypted based on the system parameters to obtain the original ciphertext, which includes: Obtain the second encrypted access permission data associated with the plaintext data, and perform vector transformation on the second encrypted access permission data to obtain the access matrix; Obtain the element calculation rule, determine the random element by the second user entity in the user entity, and calculate the ciphertext element by the random element, the access matrix and the system parameters according to the element calculation rule. The element calculation rule includes calculation formulas for multiple ciphertext elements. The original ciphertext is obtained by combining the second encrypted access permission data and the ciphertext element.

6. The method according to claim 1, characterized in that, The original ciphertext is re-encrypted based on the re-key and the system parameters to obtain the re-ciphertext of the plaintext data, including: Obtain the second attribute parameter of the third user entity in the user entity, obtain the second encrypted access permission data, and determine whether the second encrypted access permission data contains the second attribute parameter; If the second encrypted access permission data contains the second attribute parameter, the step of re-encrypting the original ciphertext according to the re-key and the system parameters ends. When the second encrypted access permission data contains the second attribute parameter, the re-encryption algorithm calculates the re-ciphertext based on the re-key, the system parameters, and the original ciphertext.

7. The method according to claim 1, characterized in that, After obtaining the re-encrypted plaintext data, the method further includes: When the encryption system and the verifier are in communication connection, the re-ciphertext is sent to the verifier, wherein the verifier verifies the re-ciphertext according to the first verification rule and sends the first verification result to the encryption system; If the first verification result indicates that at least one sub-encryption in the reencryption is different from the first verification rule, the step of sending the reencryption and the original encryption to the user entity of the encryption system ends. If the first verification result indicates that all sub-encrypted texts in the encrypted text are the same as the first verification rule, then the second verification rule is obtained, and the encrypted text is verified by the second verification rule to obtain the second verification result. If the second verification result indicates that all sub-encryptions in the encrypted ciphertext are identical to the second verification rule, then the step of sending the encrypted ciphertext and the original ciphertext to the user entity of the encryption system is performed.

8. An encryption system, characterized in that, include: An encryption system includes M key entities and user entities. It is used to determine a master private key and system parameters based on attribute parameters of all entities. After verifying the encryption environment of the encryption system based on the master private key and obtaining a verification result indicating no anomalies in the encryption environment, the M key entities generate a key based on the attribute parameters and the system parameters. The system entities are also used to encrypt plaintext data based on the system parameters to obtain original ciphertext, re-encrypt the original ciphertext based on a re-key in the key and the system parameters to obtain re-ciphertext of the plaintext data, and send the re-ciphertext to a verifier. Furthermore, if a first verification result indicates that the re-ciphertext is correct, the system entities send the re-ciphertext and the original ciphertext to the user entity. Here, M is a positive integer. The verifier is used to verify the encrypted text according to the first verification rule and send the first verification result.

9. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program, when running, executes the data encryption method according to any one of claims 1 to 7.

10. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the data encryption method according to any one of claims 1 to 7.