Proxy re-encryption method and proxy re-encryption device
Through the proxy re-encryption method, one-to-many data sharing between data users and data owners is realized, the limitations of one-to-one data sharing in the existing technology are solved, and certificate management is simplified, which is suitable for the dynamics of smart grids. Membership, ensure the security and privacy of data.
Patent Information
- Application Number
- CN202411374803.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2024-12-31
AI Technical Summary
In the prior art, data sharing between data users and data owners is mainly one-to-one, making it difficult to realize one-to-many data sharing. The public key encryption method requires complex certificate management to adapt to the smart grid of dynamic members. There are challenges in data encryption.
Using the proxy re-encryption method, the global public parameters, main private key and decryption key are generated through the key generation center. The data owner encrypts the plain text message and generates the re-encryption key. The cloud server converts the original ciphertext into a re-encryption password. Data users use decryption keys to realize data sharing from one identity set to another identity set, avoiding complex certificate management.
It realizes one-to-many data sharing between data users and data owners, simplifies certificate management, is suitable for dynamic members' smart grids, ensuring secure communication and privacy of data.
Smart Images

Figure CN119232373A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cryptography, and in particular, to a proxy re-encryption method and a proxy re-encryption device. Background Art
[0002] With the informatization and intelligence of power systems, more and more power data are stored and shared on the Internet, and the online transmission of power data affects the security of the power system. Therefore, it is necessary to encrypt and protect power data. However, in the prior art, data sharing between data users and data owners is generally one-to-one transmission. Summary of the invention
[0003] The main purpose of the present application is to provide a proxy re-encryption method and a proxy re-encryption device to at least solve the problem of how to achieve one-to-many data sharing between data users and data owners in the prior art.
[0004] According to one aspect of the present application, a proxy re-encryption method is provided, which is applied to a smart grid, wherein the smart grid includes a data owner, a data user, a key generation center and a cloud server, wherein the method includes: the key generation center generates global public parameters, a master private key and a decryption key, wherein the global public parameters include the initialization parameters of the smart grid, the master private key is used to generate the decryption key corresponding to the data user, and the decryption key is used for the data user to decrypt; the data owner encrypts the plaintext message to obtain the original ciphertext, and generates a re-encryption key, and sends the original ciphertext and the re-encryption key to the cloud server; the cloud server converts the original ciphertext into the re-encrypted ciphertext according to the re-encryption key; the data user obtains the original ciphertext or the re-encrypted ciphertext, and uses the decryption key to decrypt the original ciphertext or the re-encrypted ciphertext to obtain the plaintext message.
[0005] Optionally, the key generation center generates global public parameters, a master private key and a decryption key, including: the key generation center obtains security parameters and the maximum number of broadcasters of the smart grid; the key generation center determines the global public parameters and the master private key based on the security parameters and the maximum number of broadcasters; the key generation center obtains a unique identity identifier, and generates a decryption key based on the unique identity identifier, the global public parameters and the master private key, wherein the unique identity identifier is used to uniquely identify the identity of the data user.
[0006] Optionally, the key generation center determines the global public parameter and the master private key according to the security parameter and the maximum number of broadcasters, including: the key generation center determines a target prime number according to the security parameter; the key generation center obtains a first elliptic curve group and a second elliptic curve group whose orders are the target prime numbers, wherein the first elliptic curve group and the second elliptic curve group are different, the first elliptic curve group includes a plurality of first target elements, and the second elliptic curve group includes a plurality of second target elements; the key generation center calculates a bilinear mapping function of the first elliptic curve group and the second elliptic curve group to obtain a third elliptic curve group; the key generation center maps points in the third elliptic curve group to an integer group to obtain a target integer group, wherein the target integer group includes a plurality of target integers greater than 0; the key generation center obtains a first target integer, any one of the first target elements, and any two different second target elements, and calculates the first target integer, any one of the first target elements, and calculates the second target elements according to formula P pub =(s*P1,s 2 *P1,s 3 *P1,...,s m *P1), calculate the first common parameter P pub , where s m is the mth power of the first target integer, m is the maximum number of broadcasters, P1 is the first target element, * is used to represent scalar multiplication, and the first target integer is any one of the target integers; the key generation center generates the key according to the formula u=s 2 *P2, calculate the second public parameter u, where P2 is a second target element, and calculate the image of the bilinear mapping function of s*P1 and P2 to obtain the third public parameter; the key generation center calculates the global public parameter according to the first elliptic curve group, the second elliptic curve group, the third elliptic curve group, the bilinear mapping function, the first public parameter, the second public parameter, another second target element, the third public parameter, the first hash function, the second hash function and the key generation function identifier, where the first hash function is used to represent {0,1} * The second Hash function is used to characterize the mapping relationship between the third elliptic curve group and the target integer group; the key generation center calculates the master private key according to the first target integer and one of the second target elements.
[0007] Optionally, the key generation center generates a decryption key according to the unique identity identifier, the global public parameter and the master private key, including: the key generation center performs character concatenation processing on the unique identity identifier and the key generation function identifier to obtain a target string; the key generation center brings the target string and the target prime number into the first Hash function to obtain a first value; the key generation center calculates the sum of the first value and the first target integer to obtain a second value; the key generation center determines whether the second value is 0, and if the second value is not 0, calculates the sum of the first value and the first target integer according to the formula Calculate the decryption key sk i , where h i is the ith first value.
[0008] Optionally, the data owner encrypts the plaintext message to obtain the original ciphertext, including: the data owner encrypts the plaintext message according to the formula Calculate the first part of the original ciphertext Wherein, μ is the plaintext message, g is the third public parameter, α is the second target integer, and the second target integer is any target integer that is not the first target integer; the data owner obtains the target integer according to the formula Calculate the second part of the original ciphertext The data owner according to the formula Calculate the third part of the original ciphertext The data owner according to the formula Calculate the fourth part of the original ciphertext Among them, P3 is another second target element; the data owner determines the original ciphertext based on the first part of the original ciphertext, the second part of the original ciphertext, the third part of the original ciphertext and the fourth part of the original ciphertext.
[0009] Optionally, the data user uses the decryption key to decrypt the original ciphertext to obtain a plaintext message, including: the data user uses the formula Calculate the objective function f i (s), where h j is the jth first value; the data user uses the formula The plaintext message μ is calculated, where is the original ciphertext, is the second part of the original ciphertext, is the original ciphertext of the third part.
[0010] Optionally, the data owner generates a re-encryption key, including: the data owner obtains a third target integer and a fourth target integer, the third target integer and the fourth target integer are any one of the target integers, and any two of the first target integer, the second target integer, the third target integer, and the fourth target integer are different; the data owner generates a re-encryption key according to the formula Calculate the first part of the key Wherein, γ is the third target integer, h i ' is the i-th first value, and h i ′ and h i The corresponding data users are different; the data owners are based on the formula Calculate the second part of the key The data owner according to the formula Calculate the third key Wherein, β is the fourth target integer; the data owner according to the formula Calculate the fourth key The data owner generates the re-encryption key according to the first partial key, the second partial key, the third partial key and the fourth partial key.
[0011] Optionally, the cloud server converts the original ciphertext into the re-encrypted ciphertext according to the re-encryption key, including: the cloud server converts the original ciphertext into the re-encrypted ciphertext according to the formula Calculate the first part of the re-encrypted ciphertext; the cloud server uses the formula Calculate the second part of the re-encrypted ciphertext The cloud server determines that the second part of the key is the third part of the re-encrypted ciphertext, and determines that the first part of the key is to calculate the fourth part of the re-encrypted ciphertext; the cloud server generates the re-encrypted ciphertext based on the first part of the re-encrypted ciphertext, the second part of the re-encrypted ciphertext, the third part of the re-encrypted ciphertext and the fourth part of the re-encrypted ciphertext.
[0012] Optionally, the data user uses the decryption key to decrypt the re-encrypted ciphertext to obtain the plaintext message, including: the data user uses the formula Calculate target coefficient The data user is based on the formula The plaintext message μ is obtained by calculation.
[0013] According to another aspect of the present application, a proxy re-encryption device is provided, which is applied to a smart grid, wherein the smart grid includes a data owner, a data user, a key generation center and a cloud server, wherein the device includes: a generation unit, which is used by the key generation center to generate global public parameters, a master private key and a decryption key, wherein the global public parameters include the initialization parameters of the smart grid, and the master private key is used to generate the decryption key corresponding to the data user, and the decryption key is used by the data user for decryption; an encryption unit, which is used by the data owner to encrypt a plaintext message to obtain an original ciphertext, and generate a re-encryption key, and send the original ciphertext and the re-encryption key to the cloud server; a conversion unit, which is used by the cloud server to convert the original ciphertext into a re-encrypted ciphertext according to the re-encryption key; a decryption unit, which is used by the data user to obtain the original ciphertext or the re-encrypted ciphertext, and use the decryption key to decrypt the original ciphertext or the re-encrypted ciphertext to obtain the plaintext message.
[0014] Applying the technical solution of the present application, a proxy re-encryption method is provided, which is applied to smart grids. The smart grids include data owners, data users, key generation centers and cloud servers. First, the key generation center generates global public parameters, master private keys and decryption keys. The master private key is used to generate the decryption key corresponding to the data user, and the decryption key is used for decryption by the data user; then, the data owner encrypts the plaintext message to obtain the original ciphertext, and generates a re-encryption key, and sends the original ciphertext and the re-encryption key to the cloud server; the cloud server then converts the original ciphertext into a re-encrypted ciphertext according to the re-encryption key; finally, the data user obtains the original ciphertext or the re-encrypted ciphertext, and uses the decryption key to decrypt the original ciphertext or the re-encrypted ciphertext to obtain the plaintext message. In the encryption stage, compared with the public key encryption method in the prior art, complex public key certificate management is required. The encryption method in the present application can avoid complex certificate management, and therefore is more suitable for data encryption of smart grids with dynamic members. In the re-encryption stage, compared with the one-to-one data sharing in the prior art, this method can not only realize one-to-many secure communication, that is, one encryption can not only broadcast to multiple users at the same time, each user can use his own decryption key to decrypt the ciphertext to obtain the plaintext, but also realize data sharing from one identity set to another identity set, that is, the data owner can generate a re-encryption key from one identity set to another identity set, and the cloud server can convert the ciphertext of one identity set into the re-encrypted ciphertext of another identity set without decrypting the ciphertext. It solves the technical problem of how to realize one-to-many data sharing between data users and data owners in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0016] Figure 1 A hardware structure block diagram of a mobile terminal for executing a proxy re-encryption method provided in an embodiment of the present application is shown;
[0017] Figure 2 A schematic diagram of a process of a proxy re-encryption method provided according to an embodiment of the present application is shown;
[0018] Figure 3 A specific flow chart of a proxy re-encryption method provided according to an embodiment of the present application is shown;
[0019] Figure 4 A structural block diagram of a proxy re-encryption device provided according to an embodiment of the present application is shown;
[0020] The above drawings include the following reference numerals:
[0021] 102, processor; 104, memory; 106, transmission device; 108, input and output devices. DETAILED DESCRIPTION
[0022] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] As introduced in the background technology, in the prior art, data users and data owners generally share data one-to-one. To solve the above problem, the embodiments of the present application provide a proxy re-encryption method and a proxy re-encryption device.
[0026] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0027] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a proxy re-encryption method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0028] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the proxy re-encryption method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a 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 a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The above-mentioned specific network examples may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0029] In this embodiment, a proxy re-encryption method running on a mobile terminal, a computer terminal or a similar computing device is provided. It should be noted that the steps shown in the flowchart of 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 shown or described can be executed in an order different from that shown here.
[0030] Figure 2 is a flow chart of a proxy re-encryption method according to an embodiment of the present application. Figure 2 As shown, it is applied to a smart grid, the smart grid includes a data owner, a data user, a key generation center and a cloud server, wherein the method includes the following steps:
[0031] Step S201, the key generation center generates global public parameters, a master private key and a decryption key, wherein the global public parameters include the initialization parameters of the smart grid, the master private key is used to generate the decryption key corresponding to the data user, and the decryption key is used for the data user to decrypt;
[0032] Specifically, the above encryption method involves four parties: data owner, data user, key generation center and cloud server. The key generation center (KGC) is responsible for generating the public-private key pair of the system globally, and the user's private key is also generated by KGC based on the user's identity. The process of the key generation center generating global public parameters, master private key and decryption key is equivalent to initializing the system and generating decryption keys for all users in the system (i.e. data owner and data user). The global public parameters are generated by KGC, including parameters, base points, orders, etc. of the elliptic curve. These parameters are public, accessible to all users, and used for the initialization process of the algorithm. The master private key is a pair of private key and public key generated by KGC. The private key is confidential and only known by KGC, while the public key is public. The master private key is used to generate the user's private key. The generation of the master private key includes selecting a random number as the private key and then calculating the corresponding public key. For example, the encrypted master private key may be multiplied by a base point on the elliptic curve to obtain the encrypted master public key. The decryption key is unique to the user and is used by the user to decrypt messages sent to them. Decryption key generation involves using the user ID, a cryptographic function, and the master private key to calculate a unique private key for the user.
[0033] Step S202, the data owner encrypts the plaintext message to obtain the original ciphertext, generates a re-encryption key, and sends the original ciphertext and the re-encryption key to the cloud server;
[0034] Specifically, the data owner (DO) is the entity that owns the data, responsible for the encryption and storage of the data, and controls the access rights to the data. The data owner encrypts the plaintext message, obtains the original ciphertext, and uploads the original ciphertext to the cloud server; at the same time, the data owner generates a re-encryption key and uploads the re-encryption key to the cloud server. The above two steps can be performed simultaneously or in sequence. The re-encryption key is a key used in proxy re-encryption technology. In the scenario of proxy re-encryption, the proxy re-encryption key allows an authorized agent to convert the ciphertext from one user's encryption domain to another user's encryption domain without decrypting the existing ciphertext. This means that the owner of the original data can generate a special key, namely the re-encryption key, and provide it to the proxy server. The proxy server uses this re-encryption key to convert the ciphertext so that another user can decrypt the data using his own private key.
[0035] Step S203, the cloud server converts the original ciphertext into a re-encrypted ciphertext according to the re-encryption key;
[0036] Specifically, a cloud service provider (CSP) provides cloud computing resources, including servers, storage, databases, networks, software, etc. In fact, the above steps are a proxy re-encryption process, which generates a new ciphertext, namely the re-encrypted ciphertext.
[0037] In step S204, the data user obtains the original ciphertext or the re-encrypted ciphertext, and uses the decryption key to decrypt the original ciphertext or the re-encrypted ciphertext to obtain the plaintext message.
[0038] Specifically, the data user (DU for short) is an entity that needs to access or use the data and must be authorized to operate the data. The data user can use the decryption key to decrypt the original ciphertext to obtain the plaintext message. The decryption key can also be used to decrypt the re-encrypted ciphertext to obtain the plaintext message.
[0039] Through this embodiment, a proxy re-encryption method is provided, which is applied to the smart grid. The smart grid includes a data owner, a data user, a key generation center and a cloud server. First, the key generation center generates global public parameters, a master private key and a decryption key. The master private key is used to generate a decryption key corresponding to the data user, and the decryption key is used for the data user to decrypt; then, the data owner encrypts the plaintext message to obtain the original ciphertext, and generates a re-encryption key, and sends the original ciphertext and the re-encryption key to the cloud server; then the cloud server converts the original ciphertext into a re-encrypted ciphertext according to the re-encryption key; finally, the data user obtains the original ciphertext or the re-encrypted ciphertext, and uses the decryption key to decrypt the original ciphertext or the re-encrypted ciphertext to obtain the plaintext message. In the encryption stage, compared with the public key encryption method in the prior art, complex public key certificate management is required. The encryption method in this application can avoid complex certificate management, and therefore is more suitable for data encryption of smart grids with dynamic members. In the re-encryption stage, compared with the one-to-one data sharing in the prior art, this method can not only realize one-to-many secure communication, that is, one encryption can not only broadcast to multiple users at the same time, each user can use his own decryption key to decrypt the ciphertext to obtain the plaintext, but also realize data sharing from one identity set to another identity set, that is, the data owner can generate a re-encryption key from one identity set to another identity set, and the cloud server can convert the ciphertext of one identity set into the re-encrypted ciphertext of another identity set without decrypting the ciphertext. It solves the technical problem of how to realize one-to-many data sharing between data users and data owners in the prior art.
[0040] In the specific implementation process, the above step S201 can be implemented through the following steps: Step S2011, the above key generation center obtains the security parameters and the maximum number of broadcasters of the above smart grid; Step S2012, the above key generation center determines the above global public parameters and the above master private key according to the above security parameters and the above maximum number of broadcasters; Step S2013, the above key generation center obtains a unique identity identifier, and generates a decryption key according to the above unique identity identifier, the above global public parameters and the above master private key, wherein the above unique identity identifier is used to uniquely identify the identity of the data user. This method can further generate accurate global public parameters, master private keys and decryption keys.
[0041] Specifically, there may be multiple data users, and the data user identity set may be S = (ID1, ID2, ... ID n ) and S′=(ID1′,ID′2,…ID′ n ), where S and S' represent two different sets of data users, each set includes multiple data users. In fact, the above encryption and decryption method is implemented based on SM9, which is an identification cryptographic algorithm based on bilinear pairings. The SM9 algorithm can use the user's identity to generate the user's public-private key pair, and is widely used in digital signatures, data encryption, key exchange, and identity authentication. The key length of the SM9 algorithm is 256 bits. Its application and management do not require digital certificates, certificate libraries, or key libraries, and has high security and low management costs. The proxy broadcast re-encryption method based on SM9 allows an agent to convert encrypted data from the encryption format of one user to the encryption format of another user while ensuring the security and privacy of the data.
[0042] In order to further obtain accurate global public parameters and master private keys, step S2012 can be implemented by the following steps: step S20121, the key generation center determines the target prime number according to the security parameter; step S20122, the key generation center obtains the first elliptic curve group and the second elliptic curve group whose orders are the target prime number, wherein the first elliptic curve group and the second elliptic curve group are different, the first elliptic curve group includes a plurality of first target elements, and the second elliptic curve group includes a plurality of second target elements; step S20123, the key generation center calculates the bilinear mapping function of the first elliptic curve group and the second elliptic curve group to obtain a third elliptic curve group; step S20124, the key generation center maps the points in the third elliptic curve group to the integer group to obtain the target integer group, wherein the target integer group includes a plurality of target integers greater than 0; step S20125, the key generation center obtains the first target integer, any one of the first target elements and any two different second target elements, and calculates the first target integer according to formula P pub =(s*P1,s 2 *P1,s 3 *P1,...,s m *P1), calculate the first common parameter P pub , where s m is the mth power of the first target integer, m is the maximum number of broadcasters, P1 is the first target element, * is used to represent scalar multiplication, and the first target integer is any one of the target integers; Step S20126, the key generation center generates the key according to the formula u=s 2 *P2, calculate the second public parameter u, where P2 is the second target element, and calculate the image of the bilinear mapping function of s*P1 and P2 to obtain the third public parameter; step S20127, the key generation center calculates the global public parameter according to the first elliptic curve group, the second elliptic curve group, the third elliptic curve group, the bilinear mapping function, the first public parameter, the second public parameter, another second target element, the third public parameter, the first hash function, the second hash function and the key generation function identifier, where the first hash function is used to represent {0,1} * The mapping relationship between the above-mentioned third elliptic curve group and the above-mentioned target integer group, the above-mentioned second hash function is used to characterize the mapping relationship between the above-mentioned third elliptic curve group and the above-mentioned target integer group; step S20128, the above-mentioned key generation center calculates the above-mentioned master private key according to the above-mentioned first target integer and one of the above-mentioned second target elements.
[0043] Specifically, the above initialization algorithm Setup(λ, m)→(msk, pp) is run by KGC. By inputting the security parameter λ and the maximum number of broadcasters supported by the system, m, the global public parameter pp and the master private key msk are output. The security parameter λ is generally used to determine the size of the prime number N, and the elliptic curve group G1, G2, G T The selection of these parameters determines the difficulty of cracking the algorithm) and the maximum number of broadcast encryption receivers m. KGC performs the following operations. ① Select groups G1, G2, G with order N as prime number T , bilinear mapping e:G1×G2→G T ② Randomly select the generators P1∈G1 and P2∈G2 of G1 and G2. Select two hash functions that is, the non-zero element in the smallest non-negative complete residue class modulo N) and (The elliptic curve group G T The points on the map to the integer group ③ Randomly select a non-zero number in the smallest non-negative complete remainder class modulo N. Randomly select element P3←G2 in group G2. Calculate the public parameter P pub =(s*P1,s 2 *P1,s 3 *P1,...,s m *P1) and u=s 2 *P2. Where sP1 is the scalar multiplication of points on the elliptic curve, representing the addition of s P1s, that is Similarly, s m *P stands for s m Let g be the image of the elements sP1, P2 in G1 and G2 after the bilinear mapping e, that is, g = e(sP1, P2). ④ Output global public parameters: pp = (G1, G2, G T ,e,P pub ,u,P3,g,H1,H2,hid) and the master private key msk=(s,P2).
[0044] The above step S2013 can also be implemented in other ways, for example: step S20131, the above key generation center performs character concatenation processing on the above unique identity identifier and the above key generation function identifier to obtain a target string; step S20132, the above key generation center brings the above target string and the above target prime number into the above first hash function to obtain a first value; step S20133, the above key generation center calculates the sum of the above first value and the above first target integer to obtain a second value; step S20134, the above key generation center determines whether the above second value is 0, and if the above second value is not 0, according to the formula Calculate the above decryption key sk i , where h i The method can further quickly generate the decryption key.
[0045] Specifically, enter the user ID i , KGC sets t1 equal to D i ,hid,N hash value h under hash function H1 i =H1(ID i ||hid,N) and s, that is, t1=H1(ID i ||hid,N)+s, if t1=0, the master key needs to be regenerated; otherwise KGC calculates and outputs the decryption key of user i ( and P2), where h i =H1(ID i ||hid,N)(|| is a concatenation operation, which concatenates the two inputs to form a new string).
[0046] In some embodiments, the above step S202 can be implemented by the following steps: Step S2021, the data owner according to the formula Calculate the first part of the original ciphertext Wherein, μ is the plaintext message, g is the third public parameter, α is the second target integer, and the second target integer is any target integer that is not the first target integer; Step S2022, the data owner calculates the value of the target integer according to the formula Calculate the second part of the original ciphertext Step S2023: The data owner uses the formula Calculate the third part of the original ciphertext Step S2024: the data owner uses the formula Calculate the fourth part of the original ciphertext Wherein, P3 is another second target element; Step S2025, the data owner determines the original ciphertext according to the first original ciphertext, the second original ciphertext, the third original ciphertext and the fourth original ciphertext. This method can further generate accurate original ciphertext.
[0047] Specifically, the global public parameter pp is input, and the identity set S of the data user is (ID1, ID2, ..., ID n ), where the data owner DO is identified by ID1 and the message is m. The data owner DO randomly selects a non-zero number in the smallest non-negative complete remainder class modulo N. calculate where h i =H1(ID i ||hid,N), output the original ciphertext
[0048] In the specific implementation process, the above step S204 can be implemented by the following steps: Step S2041, the data user according to the formula Calculate the objective function f i (s), where h j is the jth first value; Step S2042, the data user uses the formula The above plaintext message μ is calculated, where is the original ciphertext above, is the original ciphertext of the second part above, This method can further quickly obtain the accurate plaintext message above.
[0049] Specifically, the global public parameter pp is input, and the identity set S of the data user is (ID1, ID2, ..., ID n ), original ciphertext User's ID i and its decryption key User ID i make where h j =H1(ID j ||hid,N). Calculate (ω′ is equal to the two bilinear mapping images and The product of Thus we get the message μ.
[0050] In another embodiment, the step S202 can also be implemented by the following steps: step S2026, the data owner obtains a third target integer and a fourth target integer, the third target integer and the fourth target integer are any of the target integers, and any two of the first target integer, the second target integer, the third target integer and the fourth target integer are not the same; step S2027, the data owner obtains a third target integer and a fourth target integer according to the formula Calculate the first part of the key Where γ is the third target integer mentioned above, h i ' is the i-th first value mentioned above, and h i ′ and h iThe corresponding data users are different; Step S2028, the data owner uses the formula Calculate the second part of the key Step S2029: The data owner uses the formula Calculate the third key Where β is the fourth target integer; Step S20210, the data owner calculates the value of Calculate the fourth key In step S20211, the data owner generates the re-encryption key according to the first part of the key, the second part of the key, the third part of the key and the fourth part of the key. This method can further quickly generate the re-encryption key.
[0051] Specifically, the global public parameter pp is input, and another set of data user identity identification set S′=(ID1′, ID2′, ..., ID n ′), according to the decryption key sk1 of the owner DO. The data owner DO randomly selects a non-zero number in the smallest non-negative complete residue class modulo N. calculate where h i ′=H1(ID i ′||hid,N), Output re-encryption key
[0052] The above step S203 can also be implemented by the following steps, for example: Step S2031, the above cloud server according to the formula Calculate the first part of the re-encrypted ciphertext; Step S2032, the cloud server uses the formula Calculate the second part of the re-encrypted ciphertext In step S2033, the cloud server determines that the second part of the key is the third part of the re-encrypted ciphertext, and determines that the first part of the key is used to calculate the fourth part of the re-encrypted ciphertext; in step S2034, the cloud server generates the re-encrypted ciphertext according to the first part of the re-encrypted ciphertext, the second part of the re-encrypted ciphertext, the third part of the re-encrypted ciphertext and the fourth part of the re-encrypted ciphertext. This method can further quickly generate the re-encrypted ciphertext.
[0053] Specifically, input the global public parameter pp, the re-encryption key and the original ciphertext Cloud Server Computing in Output re-encrypted ciphertext
[0054] The above step S204 can also be implemented by the following steps: Step S2043, the data user according to the formula Calculate target coefficient Step S2044: The data user uses the formula The above plain text message μ is calculated. This method can further accurately calculate the above plain text message.
[0055] Specifically, the global public parameter pp is input, the identification set S′ of the data user is (ID1′, ID2′, ..., ID n ′), re-encrypt the ciphertext User ID i ′ and its decryption key where h′ i =H1(ID i ||hid,N). User ID i 'make calculate: Thus we get the message μ.
[0056] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the proxy re-encryption method of the present application will be described in detail below in combination with specific embodiments.
[0057] This embodiment relates to a specific proxy re-encryption method, such as Figure 3 As shown, the following steps are included:
[0058] Step S1: KGC generates global public parameters and master private key;
[0059] Step S2: KGC generates a decryption key for the user;
[0060] Step S3: DO encrypts the data to generate ciphertext and uploads it to cloud storage;
[0061] Step S4: DU downloads the original ciphertext and decrypts it to obtain the message;
[0062] Step S5: DO generates a re-encryption key and sends it to the cloud server;
[0063] Step S6: The cloud server generates a re-encrypted ciphertext;
[0064] Step S7: DU downloads the re-encrypted ciphertext and decrypts it to obtain the message.
[0065] The embodiment of the present application also provides a proxy re-encryption device. It should be noted that the proxy re-encryption device of the embodiment of the present application can be used to execute the proxy re-encryption method provided by the embodiment of the present application. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0066] The following is an introduction to the proxy re-encryption device provided in an embodiment of the present application.
[0067] Figure 4 Schematic diagram of a proxy re-encryption device according to an embodiment of the present application. Figure 4 As shown, it is applied to a smart grid, which includes a data owner, a data user, a key generation center and a cloud server. The device includes:
[0068] A generating unit 10 is used for the key generation center to generate global public parameters, a master private key and a decryption key, wherein the global public parameters include the initialization parameters of the smart grid, the master private key is used to generate the decryption key corresponding to the data user, and the decryption key is used for the data user to decrypt;
[0069] Specifically, the above encryption method involves four parties: data owner, data user, key generation center and cloud server. The key generation center (KGC) is responsible for generating the public-private key pair of the system globally, and the user's private key is also generated by KGC based on the user's identity. The process of the key generation center generating global public parameters, master private key and decryption key is equivalent to initializing the system and generating decryption keys for all users in the system (i.e. data owner and data user). The global public parameters are generated by KGC, including parameters, base points, orders, etc. of the elliptic curve. These parameters are public, accessible to all users, and used for the initialization process of the algorithm. The master private key is a pair of private key and public key generated by KGC. The private key is confidential and only known by KGC, while the public key is public. The master private key is used to generate the user's private key. The generation of the master private key includes selecting a random number as the private key and then calculating the corresponding public key. For example, the encrypted master private key may be multiplied by a base point on the elliptic curve to obtain the encrypted master public key. The decryption key is unique to the user and is used by the user to decrypt messages sent to them. Decryption key generation involves using the user ID, a cryptographic function, and the master private key to calculate a unique private key for the user.
[0070] The encryption unit 20 is used for the data owner to encrypt the plaintext message to obtain the original ciphertext, generate a re-encryption key, and send the original ciphertext and the re-encryption key to the cloud server;
[0071] Specifically, the data owner (DO) is the entity that owns the data, responsible for the encryption and storage of the data, and controls the access rights to the data. The data owner encrypts the plaintext message, obtains the original ciphertext, and uploads the original ciphertext to the cloud server; at the same time, the data owner generates a re-encryption key and uploads the re-encryption key to the cloud server. The above two steps can be performed simultaneously or in sequence. The re-encryption key is a key used in proxy re-encryption technology. In the scenario of proxy re-encryption, the proxy re-encryption key allows an authorized agent to convert the ciphertext from one user's encryption domain to another user's encryption domain without decrypting the existing ciphertext. This means that the owner of the original data can generate a special key, namely the re-encryption key, and provide it to the proxy server. The proxy server uses this re-encryption key to convert the ciphertext so that another user can decrypt the data using his own private key.
[0072] A conversion unit 30, configured for the cloud server to convert the original ciphertext into the re-encrypted ciphertext according to the re-encryption key;
[0073] Specifically, a cloud service provider (CSP) provides cloud computing resources, including servers, storage, databases, networks, software, etc. In fact, the above steps are a proxy re-encryption process, which generates a new ciphertext, namely the re-encrypted ciphertext.
[0074] The decryption unit 40 is used for the data user to obtain the original ciphertext or the re-encrypted ciphertext, and use the decryption key to decrypt the original ciphertext or the re-encrypted ciphertext to obtain the plaintext message.
[0075] Specifically, the data user (DU for short) is an entity that needs to access or use the data and must be authorized to operate the data. The data user can use the decryption key to decrypt the original ciphertext to obtain the plaintext message. The decryption key can also be used to decrypt the re-encrypted ciphertext to obtain the plaintext message.
[0076] Through this embodiment, a proxy re-encryption device is provided, which is applied to a smart grid. The smart grid includes a data owner, a data user, a key generation center and a cloud server. The generation unit is used by the key generation center to generate global public parameters, a master private key and a decryption key. The master private key is used to generate a decryption key corresponding to the data user, and the decryption key is used by the data user for decryption; the encryption unit is used by the data owner to encrypt the plaintext message to obtain the original ciphertext, and generate a re-encryption key, and send the original ciphertext and the re-encryption key to the cloud server; the encryption unit is used by the cloud server to convert the original ciphertext into the re-encrypted ciphertext according to the re-encryption key; the conversion unit is used by the data user to obtain the original ciphertext or the re-encrypted ciphertext, and use the decryption key to decrypt the original ciphertext or the re-encrypted ciphertext to obtain the plaintext message. In the encryption stage, compared with the public key encryption method in the prior art, complex public key certificate management is required. The encryption device in this application can avoid complex certificate management, and is therefore more suitable for data encryption of smart grids with dynamic members. In the re-encryption stage, compared with the one-to-one data sharing in the prior art, this device can not only realize one-to-many secure communication, that is, one encryption can not only broadcast to multiple users at the same time, each user can use his own decryption key to decrypt the ciphertext to obtain the plaintext, but also realize data sharing from one identity set to another identity set, that is, the data owner can generate a re-encryption key from one identity set to another identity set, and the cloud server can convert the ciphertext of one identity set into the re-encrypted ciphertext of another identity set without decrypting the ciphertext. It solves the technical problem of how to realize one-to-many data sharing between data users and data owners in the prior art.
[0077] In the specific implementation process, the generation unit includes a first acquisition module, a first determination module and a generation module, wherein the first acquisition module is used for the key generation center to obtain security parameters and the maximum number of broadcasters of the smart grid; the first determination module is used for the key generation center to determine the global public parameters and the master private key according to the security parameters and the maximum number of broadcasters; the generation module is used for the key generation center to obtain a unique identity identifier, and generate a decryption key according to the unique identity identifier, the global public parameters and the master private key, wherein the unique identity identifier is used to uniquely identify the identity of the data user. The device can further generate accurate global public parameters, master private keys and decryption keys.
[0078] Specifically, there may be multiple data users, and the data user identity set may be S = (ID1, ID2, ... ID n ) and S′=(ID1′,ID′2,…ID n′), where S and S' represent two different sets of data users, each set includes multiple data users. In fact, the above encryption and decryption method is implemented based on SM9, which is an identification cryptographic algorithm based on bilinear pairings. The SM9 algorithm can use the user's identity to generate the user's public-private key pair, and is widely used in digital signatures, data encryption, key exchange, and identity authentication. The key length of the SM9 algorithm is 256 bits. Its application and management do not require digital certificates, certificate libraries, or key libraries, and has high security and low management costs. The proxy broadcast re-encryption method based on SM9 allows an agent to convert encrypted data from the encryption format of one user to the encryption format of another user while ensuring the security and privacy of the data.
[0079] In order to further obtain accurate global public parameters and master private keys, the first determination module of the present application includes a determination submodule, an acquisition submodule, a first calculation submodule, a mapping submodule, a second calculation submodule, a third calculation submodule, a fourth calculation submodule and a fifth calculation submodule, wherein the determination submodule is used for the key generation center to determine the target prime number according to the security parameter; the acquisition submodule is used for the key generation center to obtain the first elliptic curve group and the second elliptic curve group whose order is the target prime number, wherein the first elliptic curve group is different from the second elliptic curve group, the first elliptic curve group includes multiple first target elements, and the second elliptic curve group includes multiple second target elements; the first calculation submodule is used for the key generation center to calculate the bilinear mapping function of the first elliptic curve group and the second elliptic curve group to obtain the third elliptic curve group; the mapping submodule is used for the key generation center to map the points in the third elliptic curve group to the integer group to obtain the target integer group, wherein the target integer group includes multiple target integers greater than 0; the second calculation submodule is used for the key generation center to obtain the first target integer, any one of the first target elements and any two different second target elements, and according to formula P pub =(s*P1,s 2 *P1,s 3 *P1,...,s m *P1), calculate the first common parameter P pub , where s m is the mth power of the first target integer, m is the maximum number of broadcasters, P1 is the first target element, * is used to represent scalar multiplication, and the first target integer is any one of the target integers; the third calculation submodule is used for the key generation center to calculate the value according to the formula u=s 2P2, calculate the second public parameter u, where P2 is the second target element, and calculate the image of the bilinear mapping function of s*P1 and P2 to obtain the third public parameter; the fourth calculation submodule is used for the key generation center to calculate the global public parameter according to the first elliptic curve group, the second elliptic curve group, the third elliptic curve group, the bilinear mapping function, the first public parameter, the second public parameter, another second target element, the third public parameter, the first Hash function, the second Hash function and the key generation function identifier, where the first Hash function is used to represent {0,1} * The mapping relationship between the above-mentioned target integer group and the above-mentioned second hash function is used to characterize the mapping relationship between the above-mentioned third elliptic curve group and the above-mentioned target integer group; the fifth calculation submodule, the above-mentioned key generation center, calculates the above-mentioned master private key according to the above-mentioned first target integer and the above-mentioned second target element.
[0080] Specifically, the above initialization algorithm Setup(λ, m)→(msk, pp) is run by KGC. By inputting the security parameter λ and the maximum number of broadcasters supported by the system, m, the global public parameter pp and the master private key msk are output. The security parameter λ is generally used to determine the size of the prime number N, and the elliptic curve group G1, G2, G T The selection of these parameters determines the difficulty of cracking the algorithm) and the maximum number of broadcast encryption receivers m. KGC performs the following operations. ① Select groups G1, G2, G with order N as prime number T , bilinear mapping e:G1×G2→G T ② Randomly select the generators P1∈G1 and P2∈G2 of G1 and G2. Select two hash functions that is, the non-zero element in the smallest non-negative complete residue class modulo N) and (The elliptic curve group G T The points on the map to the integer group ③ Randomly select a non-zero number in the smallest non-negative complete remainder class modulo N. Randomly select element P3←G2 in group G2. Calculate the public parameter P pub =(s*P1,s 2 *P1,s 3 *P1,...,s m *P1) and u=s 2 *P2. Where sP1 is the scalar multiplication of points on the elliptic curve, representing the addition of s P1s, that is Similarly, s m *P stands for s mLet g be the image of the elements sP1, P2 in G1 and G2 after the bilinear mapping e, that is, g = e(sP1, P2). ④ Output global public parameters: pp = (G1, G2, G T ,e,P pub ,u,P3,g,H1,H2,hid) and the master private key msk=(s,P2).
[0081] The generation module includes a connection submodule, an input submodule, a sixth calculation submodule and a seventh calculation submodule, wherein the connection submodule is used by the key generation center to perform character connection processing on the unique identity identifier and the key generation function identifier to obtain a target string; the input submodule is used by the key generation center to input the target string and the target prime number into the first hash function to obtain a first value; the sixth calculation submodule is used by the key generation center to calculate the sum of the first value and the first target integer to obtain a second value; the seventh calculation submodule is used by the key generation center to determine whether the second value is 0, and if the second value is not 0, according to the formula Calculate the above decryption key sk i , where h i is the i-th first value. The device can further quickly generate the decryption key.
[0082] Specifically, enter the user ID i , KGC sets t1 equal to D i ,hid,N hash value h under hash function H1 i =H1(ID i ||hid,N) and s, that is, t1=H1(ID i ||hid,N)+s, if t1=0, the master key needs to be regenerated; otherwise KGC calculates and outputs the decryption key of user i ( and P2), where h i =H1(ID i ||hid,N)(|| is a concatenation operation, which concatenates the two inputs to form a new string).
[0083] In some embodiments, the encryption unit includes a first calculation module, a second calculation module, a third calculation module, a fourth calculation module and a second determination module, wherein the first calculation module is used for the data owner to determine the value of the encryption unit according to the formula Calculate the first part of the original ciphertext Wherein, μ is the plaintext message, g is the third public parameter, α is the second target integer, and the second target integer is any target integer that is not the first target integer; the second calculation module is used for the data owner to calculate the value of the target integer according to the formula Calculate the second part of the original ciphertext The third calculation module is used by the data owner to calculate the formula Calculate the third part of the original ciphertext The fourth calculation module is used by the data owner to calculate the Calculate the fourth part of the original ciphertext Wherein, P3 is another second target element; the second determination module is used by the data owner to determine the original ciphertext according to the first part of the original ciphertext, the second part of the original ciphertext, the third part of the original ciphertext and the fourth part of the original ciphertext. The device can further generate accurate original ciphertext.
[0084] Specifically, the global public parameter pp is input, and the identity set S of the data user is (ID1, ID2, ..., ID n ), where the data owner DO is identified by ID1 and the message is m. The data owner DO randomly selects a non-zero number in the smallest non-negative complete remainder class modulo N. calculate where h i =H1(ID i ||hid,N), output the original ciphertext
[0085] In the specific implementation process, the decryption unit includes a fifth calculation module and a sixth calculation module, wherein the fifth calculation module is used by the data user according to the formula Calculate the objective function f i (s), where h j is the jth first value; the sixth calculation module is used by the user of the above data according to the formula The above plaintext message μ is calculated, where is the original ciphertext above, is the original ciphertext of the second part above, The device can further quickly obtain the accurate plaintext message.
[0086] Specifically, the global public parameter pp is input, and the identity set S of the data user is (ID1, ID2, ..., ID n ), original ciphertext User's IDi and its decryption key User ID i make where h j =H1(ID j ||hid,N). Calculate (ω′ is equal to the two bilinear mapping images and The product of Thus we get the message μ.
[0087] In another embodiment, the encryption unit further includes a second acquisition module, a seventh calculation module, an eighth calculation module, a ninth calculation module, a tenth calculation module and a first generation module, wherein the second acquisition module is used by the data owner to obtain a third target integer and a fourth target integer, the third target integer and the fourth target integer are any one of the target integers, and any two of the first target integer, the second target integer, the third target integer and the fourth target integer are not the same; the seventh calculation module is used by the data owner to generate the first target integer according to the formula Calculate the first part of the key Where γ is the third target integer, h′ i is the i-th first value mentioned above, and h i ′ and h i The corresponding data users are different; the eighth calculation module is used by the data owner according to the formula Calculate the second part of the key The ninth calculation module is used by the data owner to calculate the above data according to the formula Calculate the third key Wherein, β is the fourth target integer; the tenth calculation module is used by the data owner to calculate the value of the fourth target integer according to the formula Calculate the fourth key The first generation module is used for the data owner to generate the re-encryption key according to the first part of the key, the second part of the key, the third part of the key and the fourth part of the key. The device can further quickly generate the re-encryption key.
[0088] Specifically, the global public parameter pp is input, and another set of data user identity identification set S′=(ID1′, ID2′, ..., ID n ′), according to the decryption key sk1 of the owner DO. The data owner DO randomly selects a non-zero number in the smallest non-negative complete residue class modulo N. calculate where h′ i =H1(ID i ′||hid,N), Output re-encryption key
[0089] The conversion unit includes an eleventh calculation module, a twelfth calculation module, a third determination module and a second generation module, wherein the eleventh calculation module is used for the cloud server to calculate the value of Calculate the first part of the re-encrypted ciphertext; the twelfth calculation module is used for the above cloud server according to the formula Calculate the second part of the re-encrypted ciphertext The third determination module is used for the cloud server to determine that the second part of the key is the third part of the re-encrypted ciphertext, and to determine that the first part of the key is used to calculate the fourth part of the re-encrypted ciphertext; the second generation module is used for the cloud server to generate the re-encrypted ciphertext according to the first part of the re-encrypted ciphertext, the second part of the re-encrypted ciphertext, the third part of the re-encrypted ciphertext and the fourth part of the re-encrypted ciphertext. The device can further quickly generate the re-encrypted ciphertext.
[0090] Specifically, input the global public parameter pp, the re-encryption key and the original ciphertext Cloud Server Computing in, Output re-encrypted ciphertext
[0091] The decryption unit includes a thirteenth calculation module and a fourteenth calculation module, wherein the thirteenth calculation module is used by the data user according to the formula Calculate target coefficient The fourteenth calculation module is used by the above data users according to the formula The above plain text message μ is calculated. The device can further accurately calculate the above plain text message.
[0092] Specifically, the global public parameter pp is input, the identification set S′ of the data user is (ID1′, ID2′, ..., ID n ′), re-encrypt the ciphertext User ID i ′ and its decryption key where h′ i =H1(ID i ||hid,N). User ID i 'make calculate: Thus we get the message μ.
[0093] The proxy re-encryption device includes a processor and a memory. The generation unit, encryption unit, conversion unit, and decryption unit are stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions. The modules are all located in the same processor; or, the modules are located in different processors in any combination.
[0094] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set to perform proxy re-encryption by adjusting kernel parameters.
[0095] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0096] An embodiment of the present invention provides a computer-readable storage medium, which includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the proxy re-encryption method.
[0097] An embodiment of the present invention provides a processor, which is used to run a program, wherein the proxy re-encryption method is executed when the program is running.
[0098] The embodiment of the present invention provides a device, the device includes a processor, a memory, and a program stored in the memory and executable on the processor, and the processor implements at least the steps of the above-mentioned proxy re-encryption method when executing the program. The device in this article can be a server, a PC, a PAD, a mobile phone, etc.
[0099] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that initializes at least the steps of the above-mentioned proxy re-encryption method.
[0100] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0101] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0102] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0103] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0104] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0105] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0106] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0107] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0108] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
Claims
1. A proxy re-encryption method, characterized in that: Applied in a smart grid, the smart grid includes a data owner, a data user, a key generation center and a cloud server, wherein the method includes: The key generation center generates global public parameters, a master private key and a decryption key, wherein the global public parameters include the initialization parameters of the smart grid, the master private key is used to generate the decryption key corresponding to the data user, and the decryption key is used by the data user to decrypt; The data owner encrypts the plaintext message to obtain the original ciphertext, generates a re-encryption key, and sends the original ciphertext and the re-encryption key to the cloud server; The cloud server converts the original ciphertext into the re-encrypted ciphertext according to the re-encryption key; The data user obtains the original ciphertext or the re-encrypted ciphertext, and uses the decryption key to decrypt the original ciphertext or the re-encrypted ciphertext to obtain the plaintext message.
2. The method according to claim 1, characterized in that The key generation center generates global public parameters, master private keys and decryption keys, including: The key generation center obtains security parameters and the maximum number of broadcasters of the smart grid; The key generation center determines the global public parameter and the master private key according to the security parameter and the maximum number of broadcasters; The key generation center obtains a unique identity identifier, and generates a decryption key according to the unique identity identifier, the global public parameter and the master private key, wherein the unique identity identifier is used to uniquely identify the identity of the data user.
3. The method according to claim 2, characterized in that The key generation center determines the global public parameter and the master private key according to the security parameter and the maximum number of broadcasters, including: The key generation center determines a target prime number according to the security parameter; The key generation center obtains a first elliptic curve group and a second elliptic curve group whose orders are the target prime number, wherein the first elliptic curve group and the second elliptic curve group are different, the first elliptic curve group includes a plurality of first target elements, and the second elliptic curve group includes a plurality of second target elements; The key generation center calculates a bilinear mapping function of the first elliptic curve group and the second elliptic curve group to obtain a third elliptic curve group; The key generation center maps points in the third elliptic curve group to an integer group to obtain a target integer group, wherein the target integer group includes a plurality of target integers greater than 0; The key generation center obtains a first target integer, any one of the first target elements and any two different second target elements, and generates a key according to formula P pub =(s*P1,s 2 *P1,s 3 *P1,...,s m *P1), calculate the first common parameter P pub , where s m is the mth power of the first target integer, m is the maximum number of broadcasters, P1 is the first target element, * is used to represent scalar multiplication, and the first target integer is any one of the target integers; The key generation center is based on the formula u=s 2 *P2, calculate the second common parameter u, where P2 is the second target element, and calculate the image of the bilinear mapping function of s*P1 and P2 to obtain the third common parameter; The key generation center calculates the global public parameter according to the first elliptic curve group, the second elliptic curve group, the third elliptic curve group, the bilinear mapping function, the first public parameter, the second public parameter, another second target element, the third public parameter, the first Hash function, the second Hash function and the key generation function identifier, wherein the first Hash function is used to represent {0,1} * A mapping relationship between the third elliptic curve group and the target integer group, wherein the second hash function is used to characterize the mapping relationship between the third elliptic curve group and the target integer group; The key generation center calculates the master private key according to the first target integer and a second target element.
4. The method according to claim 3, characterized in that The key generation center generates a decryption key according to the unique identity, the global public parameter and the master private key, including: The key generation center performs character concatenation processing on the unique identity identifier and the key generation function identifier to obtain a target character string; The key generation center brings the target character string and the target prime number into the first hash function to obtain a first value; The key generation center calculates the sum of the first value and the first target integer to obtain a second value; The key generation center determines whether the second value is 0, and if the second value is not 0, according to the formula Calculate the decryption key sk i , where h i is the ith first value.
5. The method according to claim 4, characterized in that The data owner encrypts the plaintext message to obtain the original ciphertext, including: The data owner according to the formula Calculate the first part of the original ciphertext Wherein, μ is the plaintext message, g is the third public parameter, α is a second target integer, and the second target integer is any target integer that is not the first target integer; The data owner according to the formula Calculate the second part of the original ciphertext The data owner according to the formula Calculate the third part of the original ciphertext The data owner according to the formula Calculate the fourth part of the original ciphertext Wherein, P3 is another said second target element; The data owner determines the original ciphertext according to the first part of the original ciphertext, the second part of the original ciphertext, the third part of the original ciphertext and the fourth part of the original ciphertext.
6. The method according to claim 5, characterized in that The data user uses the decryption key to decrypt the original ciphertext to obtain a plaintext message, including: The data user is based on the formula Calculate the objective function f i (s), where h j is the jth first value; The data user is based on the formula The plaintext message μ is calculated, where is the original ciphertext, is the second part of the original ciphertext, is the original ciphertext of the third part.
7. The method according to claim 5, characterized in that The data owner generates a re-encryption key, including: The data owner obtains a third target integer and a fourth target integer, where the third target integer and the fourth target integer are any one of the target integers, and any two of the first target integer, the second target integer, the third target integer, and the fourth target integer are different; The data owner according to the formula Calculate the first part of the key Wherein, γ is the third target integer, h i ' is the i-th first value, and h i ′ and h i The corresponding data users are different; The data owner according to the formula Calculate the second part of the key The data owner according to the formula Calculate the third key Wherein, β is the fourth target integer; The data owner according to the formula Calculate the fourth key The data owner generates the re-encryption key according to the first partial key, the second partial key, the third partial key and the fourth partial key.
8. The method according to claim 7, characterized in that The cloud server converts the original ciphertext into the re-encrypted ciphertext according to the re-encryption key, including: The cloud server is based on the formula Calculate the first part of the re-encrypted ciphertext; The cloud server is based on the formula Calculate the second part of the re-encrypted ciphertext The cloud server determines that the second part of the key is the third part of the re-encrypted ciphertext, and determines that the first part of the key is used to calculate the fourth part of the re-encrypted ciphertext; The cloud server generates the re-encrypted ciphertext according to the first part of the re-encrypted ciphertext, the second part of the re-encrypted ciphertext, the third part of the re-encrypted ciphertext and the fourth part of the re-encrypted ciphertext.
9. The method according to claim 8, characterized in that The data user uses the decryption key to decrypt the re-encrypted ciphertext to obtain the plaintext message, including: The data user is based on the formula Calculate target coefficient The data user is based on the formula The plaintext message μ is obtained by calculation.
10. A proxy re-encryption device, characterized in that: Applied in a smart grid, the smart grid includes a data owner, a data user, a key generation center and a cloud server, wherein the device includes: A generating unit, used for the key generation center to generate global public parameters, a master private key and a decryption key, wherein the global public parameters include the initialization parameters of the smart grid, the master private key is used to generate the decryption key corresponding to the data user, and the decryption key is used for the data user to decrypt; An encryption unit, used for the data owner to encrypt the plaintext message to obtain the original ciphertext, generate a re-encryption key, and send the original ciphertext and the re-encryption key to the cloud server; A conversion unit, configured for the cloud server to convert the original ciphertext into the re-encrypted ciphertext according to the re-encryption key; A decryption unit is used for the data user to obtain the original ciphertext or the re-encrypted ciphertext, and use the decryption key to decrypt the original ciphertext or the re-encrypted ciphertext to obtain the plaintext message.
