CN109359471B - Encryption method, device, system, equipment and medium based on user identity - Google Patents

Encryption method, device, system, equipment and medium based on user identity Download PDF

Info

Publication number
CN109359471B
CN109359471B CN201810949815.2A CN201810949815A CN109359471B CN 109359471 B CN109359471 B CN 109359471B CN 201810949815 A CN201810949815 A CN 201810949815A CN 109359471 B CN109359471 B CN 109359471B
Authority
CN
China
Prior art keywords
user
ciphertext
encryption
offline
private key
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810949815.2A
Other languages
Chinese (zh)
Other versions
CN109359471A (en
Inventor
梁露露
常文娟
宋岩蔚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zhongce Anhua Technology Co ltd
Original Assignee
Beijing Zhongce Anhua Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zhongce Anhua Technology Co ltd filed Critical Beijing Zhongce Anhua Technology Co ltd
Priority to CN201810949815.2A priority Critical patent/CN109359471B/en
Publication of CN109359471A publication Critical patent/CN109359471A/en
Application granted granted Critical
Publication of CN109359471B publication Critical patent/CN109359471B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses an encryption method, device, system, equipment and medium based on user identity. The method comprises the following steps: generating a private key of the user according to the identity attribute information of the user, a preset bilinear mapping parameter and a preset encryption function; according to the bilinear mapping parameters and the encryption function, carrying out offline encryption on plaintext data of a user, and obtaining an offline ciphertext of the plaintext data; sending the offline ciphertext to a cloud server so that the cloud server can encrypt the offline ciphertext online and obtain a final ciphertext; and downloading the final ciphertext, and decrypting the final ciphertext according to the private key of the user to obtain a decryption result. The encryption method, device, system, equipment and medium based on the user identity provided by the embodiment of the invention ensure the security of user data and improve the utilization rate of storage resources of a cloud server.

Description

Encryption method, device, system, equipment and medium based on user identity
Technical Field
The present invention relates to the field of data services, and in particular, to a method, an apparatus, a system, a device, and a medium for encryption based on a user identity.
Background
With the rapid development of computer technology, the data transmission and calculation capabilities are greatly improved, and the data volume of users is increasing day by day, so that more and more users and enterprises tend to migrate a large amount of data to the cloud for storage.
Cloud storage brings great convenience to users and meanwhile creates some data safety hidden dangers. Such as cloud service providers or other molecules that are not hacked to steal, abuse the cloud data of the user. Security technologies such as data encryption, access control, digital authentication, and the like are widely applied to protecting cloud storage data.
For the existing data encryption and decryption technology, the encryption and decryption processes are more reasonable at the cloud server side from the calculation cost of a user; and from the viewpoint of data security, the process is more reliable at the user end. Therefore, how to improve the utilization rate of the storage resources of the cloud server on the basis of ensuring the data security becomes a problem to be solved urgently.
Disclosure of Invention
The embodiment of the invention discloses an encryption method, device, system, equipment and medium based on user identity, which can improve the utilization rate of storage resources of a cloud server while ensuring the security of user data.
According to an aspect of the embodiments of the present invention, there is provided a user identity-based encryption method, including:
generating a private key of the user according to the identity attribute information of the user, a preset bilinear mapping parameter and a preset encryption function;
according to the bilinear mapping parameters and the encryption function, carrying out offline encryption on plaintext data of a user, and obtaining an offline ciphertext of the plaintext data;
sending the offline ciphertext to a cloud server so that the cloud server can encrypt the offline ciphertext online and obtain a final ciphertext;
and downloading the final ciphertext, and decrypting the final ciphertext according to the private key of the user to obtain a decryption result.
In one embodiment, the bilinear mapping parameters include:
two multiplication cyclic groups G and G with prime number pTA generator G of the multiplication cycle group G and a bilinear mapping pair e: g mapping to GT
In one embodiment, generating a private key of a user according to identity attribute information of the user, a preset bilinear mapping parameter and a preset encryption function includes:
determining a set Z according to the order p of a multiplication cycle group in a bilinear mapping parameterp,ZpIs the set of all non-negative integers less than p;
from the set ZpDual space Z ofp *Randomly selecting a first numerical value alpha;
and generating a private key of the user according to the identity attribute information of the user, the generator of the multiplication cyclic group, alpha and an encryption function.
In one embodiment, the encryption function includes a first hash function, a second hash function, and a third hash function;
according to the bilinear mapping parameter and the encryption function, offline encryption is carried out on plaintext data of a user, and an offline ciphertext of the plaintext data is obtained, wherein the offline encryption comprises the following steps:
at Zp *Randomly selecting a second numerical value s and a third numerical value w, and calculating according to the generator, alpha, s and w of the multiplication cyclic groupFirst parameter C of offline ciphertext1
Obtaining a second parameter C of the offline ciphertext according to the identity attribute information ID, s, w and p of the user and the first hash function2
Calculating a third parameter C of the offline ciphertext according to the plaintext data m, the bilinear mapping parameter s and the second hash function3
By C1、C2M, bilinear mapping parameter and third hash function, and calculating fourth parameter C of offline ciphertext4
In one embodiment, the final ciphertext includes C1、C2、C3And a fifth parameter C5
Wherein the fifth parameter C5Is according to s, C4And p the calculated parameters.
In one embodiment, C is calculated using the following expression5
C5=(s+C4)modp
Where mod represents the remainder operation.
In one embodiment, the user identity based method further comprises:
and verifying whether the decryption result is correct or not according to the user private key and the final ciphertext.
According to another aspect of the embodiments of the present invention, there is provided a user identity-based encryption method, including:
receiving an offline ciphertext, wherein the offline ciphertext is a ciphertext obtained by performing offline encryption on plaintext data of a user according to a preset bilinear mapping parameter and a preset encryption function;
performing online encryption on the offline ciphertext and acquiring a final ciphertext;
and sending the final ciphertext to the client so that the client downloads the final ciphertext and decrypts the final ciphertext according to the private key of the user to obtain a decryption result, wherein the private key of the user is a private key generated according to the identity attribute information, the bilinear mapping parameter and the encryption function of the user.
According to another aspect of the embodiments of the present invention, there is provided an encryption apparatus based on a user identity, the apparatus including:
the private key generation module is used for calculating a private key of the user according to the identity attribute information of the user, a preset bilinear mapping parameter and a preset encryption function;
the off-line encryption module is used for off-line encrypting the plaintext data of the user according to the bilinear mapping parameter and the encryption function and obtaining an off-line ciphertext of the plaintext data;
the sending module is used for sending the offline ciphertext to the cloud server so that the cloud server can encrypt the offline ciphertext online and obtain a final ciphertext;
and the decryption module is used for downloading the final ciphertext and decrypting the final ciphertext according to the private key of the user to obtain a decryption result.
According to another aspect of the embodiments of the present invention, there is provided an encryption apparatus based on a user identity, the apparatus including:
the receiving module is used for receiving an offline ciphertext, and the offline ciphertext is a ciphertext obtained by performing offline encryption on plaintext data of a user according to a preset bilinear mapping parameter and a preset encryption function;
the online encryption module is used for encrypting the offline ciphertext online and acquiring a final ciphertext;
and the sending module is used for sending the final ciphertext to the client so that the client downloads the final ciphertext and decrypts the final ciphertext according to the private key of the user to obtain a decryption result, wherein the private key of the user is a private key generated according to the identity attribute information, the bilinear mapping parameter and the encryption function of the user.
According to still another aspect of the embodiments of the present invention, there is provided a user identity-based encryption system, including: a client and a cloud server;
the client is used for generating a private key of the user according to the identity attribute information of the user, a preset bilinear mapping parameter and a preset encryption function, performing offline encryption on plaintext data of the user according to the bilinear mapping parameter and the encryption function, obtaining an offline ciphertext of the plaintext data, sending the offline ciphertext to the cloud server, enabling the cloud server to perform online encryption on the offline ciphertext and obtain a final ciphertext, downloading the final ciphertext, and decrypting the final ciphertext according to the private key of the user to obtain a decryption result;
and the cloud server is used for receiving the offline ciphertext sent by the client, carrying out online encryption on the ciphertext, acquiring the final ciphertext and sending the final ciphertext to the client.
According to still another aspect of the embodiments of the present invention, there is provided an encryption apparatus based on a user identity, the apparatus including: a processor and a memory storing computer program instructions;
the processor, when executing the computer program instructions, implements the user identity based encryption method as provided by embodiments of the present invention.
According to yet another aspect of the embodiments of the present invention, there is provided a computer storage medium having computer program instructions stored thereon, the computer program instructions when executed by a processor implementing the user identity based encryption method as provided by the embodiments of the present invention.
According to the encryption method, device, system, equipment and medium based on the user identity in the embodiment of the invention, according to the preset bilinear mapping parameter and the preset encryption function, plaintext data input by a user is encrypted offline to obtain an offline ciphertext of the plaintext data, then the offline ciphertext is sent to the cloud server to enable the cloud server to encrypt the offline ciphertext online and obtain a final ciphertext, finally the final ciphertext is downloaded, the final ciphertext is decrypted by using a private key of the user generated according to the identity attribute information of the user, the bilinear mapping parameter and the encryption function to obtain a decryption result, and the online encryption and the offline encryption are combined to ensure the security of the user data and improve the utilization rate of storage resources of the cloud server.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the embodiments of the present invention will be briefly described below, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic diagram illustrating a system architecture for user identity-based encryption according to an embodiment of the present invention;
fig. 2 is a schematic flow chart illustrating a user identity-based encryption method according to an embodiment of the present invention;
fig. 3 is a schematic flow chart illustrating a decryption method based on a user identity according to an embodiment of the present invention;
fig. 4 is a schematic flow chart illustrating a user identity-based encryption method according to another embodiment of the present invention;
fig. 5 is a schematic structural diagram illustrating a user identity-based encryption apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram illustrating a user identity-based encryption apparatus according to another embodiment of the present invention;
fig. 7 is a schematic diagram illustrating a hardware structure of a user identity-based encryption device according to an embodiment of the present invention.
Detailed Description
Features and exemplary embodiments of various aspects of the present invention will be described in detail below, and in order to make objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It will be apparent to one skilled in the art that the present invention may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present invention by illustrating examples of the present invention.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
In order to ensure the security of user data and improve the utilization rate of storage resources of a cloud server, an embodiment of the present invention provides an encryption system based on a user identity, and fig. 1 shows a schematic system architecture diagram of an encryption system 100 based on a user identity, which is provided in an embodiment of the present invention and includes a client 110 and a cloud server 120.
In the embodiment of the present invention, if the user needs to perform cloud storage on data, the user needs to first perform initialization setting on parameters of the system by using the client 110. The client 110 initializes parameters of the encryption system according to the initialization application of the user, where the parameters of the system include bilinear mapping parameters and encryption functions.
As an example, the bilinear mapping parameter comprises two multiplication cyclic groups G and G with prime number p in order which are presetT. The order p of the multiplication loop group may depend on a specific application scenario, and the embodiment of the present invention is not particularly limited.
The client 110 selects a generator G of the multiplication cycle group G according to a preset multiplication cycle group G. Client 110 then loops groups G and G according to the multiplicationTGenerating a bilinear mapping pair e: g → GT. Wherein, bilinear mapping pair e: g → GTIs a map with the following properties:
(1) bilinear: for all P, Q ∈ G, a, b ∈ Zp *E (aP, bQ) ═ e (P, Q)ab
(2) Non-degradability: if there is P, Q ∈ G, and P ≠ Q, then e (P, Q) ≠ 1.
(3) Calculability: for any P, Q ∈ G, there is an efficient algorithm to compute e (P, Q) in polynomial time.
Wherein Z ispIs the set of all non-negative integers smaller than the order p of the multiplication loop group. Zp *Set of representations ZpThe dual space of (a).
As one example, the encryption function includes a first hash function H1A second hash function H2And a third hash function H3(ii) a The three hash functions can be expressed by the following expressions:
Figure BDA0001771203380000061
H2:GT→{0,1}n (2)
Figure BDA0001771203380000062
wherein "n" represents an exponentiation; "+" indicates dual space; "→" represents a mapping; "×" indicates a multiplication operation; "{ 0,1 }" indicates a bit string of an arbitrary length.
A hash function is a type of function that maps an arbitrary finite length bit string to a fixed length bit string. The specific form of the encryption function may depend on a specific application scenario, and the embodiment of the present invention is not particularly limited.
In one embodiment of the invention, the system assigns a private key to each user in order to ensure the security of the user's data. The private key of each user is independently kept by the user, so that the stealing and the abuse of user data by a cloud service provider are avoided.
In an embodiment of the present invention, the private key of the user is generated based on the identity attribute information of the user, so after the user initializes the parameters of the encryption system through the client 110, the user needs to input the identity attribute information ID of the user through the client 110.
In the embodiment of the present invention, the client 110 generates a private key of the user according to the identity attribute information of the user, the preset bilinear mapping parameter, and the preset encryption function.
As one example, client 110 first determines set Z based on the order p of the multiplicative cyclic group in the bilinear mapping parameterp,ZpIs the set of all non-negative integers less than p; the client 110 then proceeds from set ZpDual space Z ofp *Randomly selecting a first numerical value alpha; finally, the client 110 generates the private key of the user according to the identity attribute information of the user, the generator g of the multiplication cycle group, the first numerical value α and a preset encryption function.
In one particular example, the user private key may be calculated using the following expression:
Figure BDA0001771203380000071
wherein H1() In the first hash function, ID is identity attribute information of a user, α is the first value, and G is a generator of the multiplication loop group G.
In the embodiment of the present invention, after the user obtains the user private key returned by the client 110, the user inputs the plaintext data m to be stored through the client 110. After the client 110 receives the plaintext data input by the user, the client 110 performs offline encryption on the plaintext data of the user according to the bilinear mapping parameter and the encryption function, and obtains an offline ciphertext of the plaintext data.
In one example, client 110 is at Zp *Randomly selecting a second numerical value s and a third numerical value w, and calculating a first parameter C of the offline ciphertext according to a generator G of the multiplication cyclic group G, the first numerical value alpha, the second numerical value s and the third numerical value w1
Specifically, the first parameter C of the offline ciphertext1The calculation can be made using the following expression:
C1=(g1gw)s (5)
wherein, g1=gαS and w are each at Zp *The second value and the third value are randomly selected.
In one example, the client 110 is based on the identity attribute information ID of the user, the second value s, the third value w, the order p of the multiplication loop group, and a first hash function H included in the encryption function1Obtaining a second parameter C of the off-line ciphertext2
Specifically, the second parameter C of the offline ciphertext2The calculation can be made using the following expression:
C2=s(H1(ID)-w)modp (6)
where "mod" represents the remainder operation and p is the order of the multiplication cycle group G.
In one example, the client 110 calculates a third parameter C of the offline ciphertext from the plaintext data m, the bilinear mapping parameter, the second value s, and a second hash function included in the encryption function3
Specifically, the third parameter C of the offline ciphertext3The calculation can be made using the following expression:
Figure BDA0001771203380000081
wherein the content of the first and second substances,
Figure BDA0001771203380000082
representing an exclusive or operation. R ═ vsV is obtained from the bilinear map pair in the bilinear map parameters and the generator G of the multiplication cyclic group G, i.e., v is e (G, G). H2() Is the second hash function described above. And m is plaintext data input by a user.
In one example, the client 110 utilizes the first parameter C of the offline ciphertext1Second parameter C of off-line ciphertext2Plaintext data m required to be stored by a user, preset bilinear mapping parameters and a third hash function H included in an encryption function3Calculating the fourth parameter C of the off-line ciphertext4
Specifically, the fourth parameter C of the offline ciphertext4The calculation can be made using the following expression:
C4=H3(R,m,C1,C2) (8)
wherein H3() As a third hash function, C1First parameter being an off-line ciphertext, C2Is the second parameter of the offline ciphertext.
In the embodiment of the present invention, when the client 110 calculates the first parameter C of the offline ciphertext1A second parameter C2A third parameter C3And a fourth parameter C4Then, the off-line ciphertext C corresponding to the plaintext data of the user can be obtainedoff={C1,C2,C3,C4}. First parameter C for offline ciphertext1A second parameter C2A third parameter C3And a fourth parameter C4The specific operation manner of the present invention may be determined according to a specific application scenario, and the embodiment of the present invention is not particularly limited.
In the embodiment of the present invention, after obtaining the offline ciphertext, the client 110 sends the offline ciphertext to the cloud server 120. After receiving the offline ciphertext, the cloud server 120 encrypts the offline ciphertext online and obtains a final ciphertext Con
In one example, the final ciphertext ConFirst parameter C comprising offline ciphertext1A second parameter C2A third parameter C3And a fifth parameter C5. The cloud server 120 obtains the fourth parameter C of the offline ciphertext according to the second value s4Calculating a fifth parameter C of the final ciphertext by multiplying the order p of the cyclic group G5
Specifically, the fifth parameter C of the final ciphertext5The calculation can be made using the following expression:
C5=(s+C4)modp (9)
according to the encryption system provided by the embodiment of the invention, the final ciphertext with a smaller length is generated by performing remainder calculation on the fourth parameter in the offline ciphertext, so that the resource utilization rate of the cloud storage is improved.
In the embodiment of the present invention, the cloud server 120 performs online encryption on the offline ciphertext to obtain a final ciphertext, and stores the final ciphertext in the cloud server 120.
According to the encryption system provided by the embodiment of the invention, the encryption and decryption of the data are divided into an online stage and an offline stage, so that the consumption of network resources and cloud computing capacity is reduced. And the plaintext data input by the user does not need to be uploaded to the cloud server, and the private key is independently kept by the user, so that the cloud server is prevented from stealing and abusing data stored by the user, the safety of the user data is improved, and the burden of the client is reduced.
In an embodiment of the present invention, after the user stores the data in the cloud server 120, the plaintext data stored in the client 110 may be deleted. When the user needs to store the data in the cloud server 120, the cloud server 120 sends the final ciphertext to the client 110, and the client 110 downloads the final ciphertext and decrypts the final ciphertext to obtain corresponding plaintext data.
In the embodiment of the present invention, after downloading the final ciphertext, the client 110 receives a private key input by the user, and decrypts the final ciphertext by using the private key.
As an example, the client 110 obtains decrypted plaintext data m' corresponding to the final ciphertext by using a user private key, an encryption function, and a parameter in the final ciphertext.
Specifically, the decrypted plaintext data m' may be calculated using the following expression:
Figure BDA0001771203380000091
wherein the content of the first and second substances,
Figure BDA0001771203380000092
the key is the user private key.
In the embodiment of the present invention, in order to ensure the accuracy of the decrypted data, the client 110 verifies the decrypted plaintext data m'.
As an example, the client 110 first derives a decrypted value s' of the second value s using the decrypted plaintext data, which may be calculated using the following expression:
s’=[C5-H3(R’,m’,C1,C2)]modp (11)
wherein m' is the decrypted plaintext data.
Then, the client 110 obtains a decrypted value w ' of the third value w by using the above s ', the identity attribute information of the user, and the encryption function, and the decrypted value w ' may be calculated by using the following expression:
w’=(H1(ID)-C2s’-1)modp (12)
finally, the client 110 verifies the correctness of the decryption result according to s 'and w'. Specifically, a first parameter C of the offline ciphertext is calculated according to s ', w' and the bilinear mapping parameter1Corresponding decryption value C1’,C1' may be calculated using the following expression:
C1’=(g1gw’)s’ (13)
client 110 sends the result to C1And C1' comparison is performed to judge the correctness of the decryption result. If C1=C1'then, the decryption is successful, and the obtained decrypted plaintext data m' is equal to the plaintext data m input by the user. If C1≠C1'then, it represents a decryption failure, which represents that the user's data may be tampered with or that the decryption process is erroneous.
The encryption system provided by the embodiment of the invention ensures the correctness of the decryption result by verifying the decrypted plaintext data.
Based on the above process, the user identity-based encryption method applied to the client side provided by the embodiment of the present invention can be summarized as the steps shown in fig. 2. Fig. 2 is a flowchart illustrating a user identity-based encryption method 200 applied to a client side according to an embodiment of the present invention. As shown in fig. 2, the encryption method based on user identity in the embodiment of the present invention includes the following steps:
step S210, generating a private key of the user according to the identity attribute information of the user, the preset bilinear mapping parameter, and the preset encryption function.
Step S220, the plaintext data of the user is encrypted offline according to the bilinear mapping parameters and the encryption function, and an offline ciphertext of the plaintext data is obtained.
Step S230, sending the offline ciphertext to the cloud server, so that the cloud server performs online encryption on the offline ciphertext and obtains a final ciphertext.
And S240, downloading the final ciphertext, and decrypting the final ciphertext according to the private key of the user to obtain a decryption result.
In the embodiment of the invention, online encryption and offline encryption are combined, namely, in an offline stage, a user private key is calculated according to user attributes, offline encryption operation is carried out on plaintext data, then generated offline ciphertext is uploaded, so that a cloud server carries out online encryption calculation on the offline ciphertext to generate final ciphertext, and the final ciphertext is stored at a cloud server. The plaintext data of the user does not need to be stored in the cloud server, and the key is kept independently by the user, so that the stealing and the abuse of the user data by a cloud service provider are avoided, the data security is improved, and the consumption of network resources and computing capacity in the encryption process is reduced.
In one embodiment of the invention, the bilinear mapping parameters comprise two multiplication cyclic groups G and G of order prime pTA generator G of the multiplication cycle group G and a bilinear mapping pair e: g mapping to GT
In an embodiment of the present invention, generating a private key of a user according to identity attribute information of the user, a preset bilinear mapping parameter, and a preset encryption function includes:
determining a set Z according to the order p of a multiplication cycle group in a bilinear mapping parameterp,ZpIs the set of all non-negative integers less than p;
from the set ZpDual space Z ofp *Randomly selecting a first numerical value alpha;
and generating a private key of the user according to the identity attribute information of the user, the generator of the multiplication cyclic group, alpha and an encryption function.
In one embodiment of the invention, the encryption function comprises a first hash function, a second hash function and a third hash function;
according to the bilinear mapping parameter and the encryption function, offline encryption is carried out on plaintext data of a user, and an offline ciphertext of the plaintext data is obtained, wherein the offline encryption comprises the following steps:
at Zp *Randomly selecting a second numerical value s and a third numerical value w, and calculating a first parameter C of the offline ciphertext according to the generator, alpha, s and w of the multiplication cyclic group1
Obtaining a second parameter C of the offline ciphertext according to the identity attribute information ID, s, w and p of the user and the first hash function2
Calculating a third parameter C of the offline ciphertext according to the plaintext data m, the bilinear mapping parameter s and the second hash function3
By C1、C2M, bilinear mapping parameter and third hash function, and calculating fourth parameter C of offline ciphertext4
In one embodiment of the invention, the final ciphertext includes C1、C2、C3And a fifth parameter C5
Wherein the fifth parameter C5Is according to s, C4And p the calculated parameters.
In one embodiment of the invention, the fifth parameter C5The calculation is performed using equation (9).
In an embodiment of the present invention, the encryption method based on the user identity further includes:
and verifying whether the decryption result is correct or not according to the user private key and the offline ciphertext.
Fig. 3 is a schematic flowchart illustrating a process of decrypting a final ciphertext by a client according to an embodiment of the present invention. The decryption method 300 based on the user identity specifically includes the following steps:
and S310, downloading the final ciphertext.
In the embodiment of the invention, when the user needs the data stored in the cloud server, the user downloads the final ciphertext from the cloud server through the client.
S320, receiving the private key of the user.
In the embodiment of the invention, the user's private key is input by the user to be used for decryption and verification of the final ciphertext.
And S330, decrypting the final ciphertext.
In one example, the decrypted plaintext data m' may be calculated using equation (10).
And S340, verifying the decryption result.
In one example, the decrypted plaintext data, that is, the decryption result, may be verified by using equation (11), equation (12) and equation (13), and the decrypted plaintext data may be received if the decryption result is correct, that is, m is m'. Otherwise, the data representing the user is tampered or the decryption is wrong, and the decrypted plaintext is rejected.
According to the encryption method based on the user identity, the decrypted plaintext data are decrypted and verified by using the user private key and the final ciphertext, and the accuracy of the decrypted user data is guaranteed.
Based on the above process, the encryption method based on the user identity applied to the cloud server side provided by the embodiment of the present invention can be summarized as the steps shown in fig. 4. Fig. 4 is a flowchart illustrating a user identity-based encryption method 400 applied to a cloud server side according to an embodiment of the present invention. As shown in fig. 4, the encryption method based on user identity in the embodiment of the present invention includes the following steps:
s410, receiving an offline ciphertext, wherein the offline ciphertext is a ciphertext obtained by performing offline encryption on plaintext data of a user according to a preset bilinear mapping parameter and a preset encryption function.
And S420, performing online encryption on the offline ciphertext and acquiring a final ciphertext.
And S430, sending the final ciphertext to the client so that the client downloads the final ciphertext and decrypts the final ciphertext according to the private key of the user to obtain a decryption result, wherein the private key of the user is a private key generated according to the identity attribute information of the user, the bilinear mapping parameter and the encryption function.
According to the encryption method based on the user identity, the offline ciphertext is encrypted on line at the cloud server side, so that the length of the ciphertext is shortened, and the utilization rate of the cloud server storage resources is improved.
Fig. 5 is a schematic structural diagram illustrating a user identity-based encryption apparatus 500 according to an embodiment of the present invention. The device includes:
the private key generating module 510 is configured to calculate a private key of the user according to the identity attribute information of the user, a preset bilinear mapping parameter, and a preset encryption function.
The offline encryption module 520 is configured to perform offline encryption on the plaintext data of the user according to the bilinear mapping parameter and the encryption function, and obtain an offline ciphertext of the plaintext data.
The sending module 530 is configured to send the offline ciphertext to the cloud server, so that the cloud server performs online encryption on the offline ciphertext and obtains a final ciphertext.
And the decryption module 540 is configured to download the final ciphertext, and decrypt the final ciphertext according to the private key of the user to obtain a decryption result.
In an embodiment of the present invention, the bilinear mapping parameters include:
two multiplication cyclic groups G and G with prime number pTA generator G of the multiplication cycle group G and a bilinear mapping pair e: g mapping to GT
In an embodiment of the present invention, the private key generating module 510 is specifically configured to:
determining a set Z according to the order p of a multiplication cycle group in a bilinear mapping parameterp,ZpIs the set of all non-negative integers less than p;
from the set ZpDual space Z ofp *Randomly selecting a first numerical value alpha;
and generating a private key of the user according to the identity attribute information of the user, the generator of the multiplication cyclic group, alpha and an encryption function.
In an embodiment of the present invention, the encryption function includes a first hash function, a second hash function, and a third hash function; the offline encryption module 520 may be specifically configured to:
at Zp *Randomly selecting a second numerical value s and a third numerical value w, and calculating a first parameter C of the offline ciphertext according to the generator, alpha, s and w of the multiplication cyclic group1
Obtaining a second parameter C of the offline ciphertext according to the identity attribute information ID, s, w and p of the user and the first hash function2
Calculating a third parameter C of the offline ciphertext according to the plaintext data m, the bilinear mapping parameter s and the second hash function3
By C1、C2M, bilinear mapping parameter and third hash function, and calculating fourth parameter C of offline ciphertext4
In an embodiment of the invention, the final ciphertext comprises C1、C2、C3And a fifth parameter C5(ii) a Wherein the fifth parameter C5Is according to s, C4And p the calculated parameters.
In an embodiment of the invention, the fifth parameter C5The calculation can be performed using equation (10).
The encryption device provided by the embodiment of the invention combines offline encryption and online encryption, and generates a ciphertext with a short length on the cloud server side, so that the utilization rate of the storage resources of the cloud server is improved while the data security is ensured.
Fig. 6 is a schematic structural diagram illustrating a user identity-based encryption apparatus 600 according to another embodiment of the present invention. The device includes:
the receiving module 610 is configured to receive an offline ciphertext, where the offline ciphertext is a ciphertext obtained by performing offline encryption on plaintext data of a user according to a preset bilinear mapping parameter and a preset encryption function.
And the online encryption module 620 is configured to perform online encryption on the offline ciphertext and obtain a final ciphertext.
The sending module 630 is configured to send the final ciphertext to the client, so that the client downloads the final ciphertext and decrypts the final ciphertext according to a private key of the user to obtain a decryption result, where the private key of the user is a private key generated according to the identity attribute information of the user, the bilinear mapping parameter, and the encryption function.
The encryption device based on the user identity provided by the embodiment of the invention reduces the consumption of computing energy and resources of the cloud server, and the private key is held in the hand of the user, thereby ensuring the security of user data.
Other details of the encryption apparatus based on user identity according to the embodiment of the present invention are similar to those of the encryption method based on user identity according to the embodiment of the present invention described above with reference to fig. 2 to 4, and are not described herein again.
The user identity based encryption method and apparatus according to the embodiments of the present invention described in conjunction with fig. 2 to 6 may be implemented by a user identity based encryption device. Fig. 7 is a diagram illustrating a hardware structure 700 of a user identity based encryption device according to an embodiment of the present invention.
As shown in fig. 7, the user identity-based encryption device 700 in the present embodiment includes: a processor 701, a memory 702, a communication interface 703 and a bus 710, wherein the processor 701, the memory 702 and the communication interface 703 are connected by the bus 710 and communicate with each other.
In particular, the processor 701 may include a Central Processing Unit (CPU), or A Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement an embodiment of the present invention.
Memory 702 may include a mass storage for data or instructions. By way of example, and not limitation, memory 702 may include an HDD, floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Memory 702 may include removable or non-removable (or fixed) media, where appropriate. The memory 702 may be internal or external to the user identity based encryption device 700, where appropriate. In a particular embodiment, the memory 702 is non-volatile solid-state memory. In a particular embodiment, the memory 702 includes Read Only Memory (ROM). Where appropriate, the ROM may be mask-programmed ROM, Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), electrically rewritable ROM (EAROM), or flash memory or a combination of two or more of these.
The communication interface 703 is mainly used for implementing communication between modules, apparatuses, units and/or devices in the embodiment of the present invention.
Bus 710 comprises hardware, software, or both to couple the components of user identity based encryption device 700 to each other. By way of example, and not limitation, a bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hypertransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an infiniband interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a video electronics standards association local (VLB) bus, or other suitable bus or a combination of two or more of these. Bus 710 may include one or more buses, where appropriate. Although specific buses have been described and shown in the embodiments of the invention, any suitable buses or interconnects are contemplated by the invention.
That is, the user identity based encryption device 700 shown in fig. 7 may be implemented to include: a processor 701, a memory 702, a communication interface 703, and a bus 710. The processor 701, the memory 702, and the communication interface 703 are coupled via a bus 710 and communicate with each other. The memory 702 is used to store program code; the processor 701 executes a program corresponding to the executable program code by reading the executable program code stored in the memory 702 for executing the user identity based encryption method in any embodiment of the present invention, thereby implementing the user identity based encryption method and apparatus described in conjunction with fig. 2 to 6.
The embodiment of the invention also provides a computer storage medium, wherein the computer storage medium is stored with computer program instructions; the computer program instructions, when executed by a processor, implement a user identity based encryption method provided by embodiments of the present invention.
It is to be understood that the invention is not limited to the specific arrangements and instrumentality described above and shown in the drawings. A detailed description of known methods is omitted herein for the sake of brevity. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present invention are not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications and additions or change the order between the steps after comprehending the spirit of the present invention.
The functional blocks shown in the above-described structural block diagrams may be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, plug-in, function card, or the like. When implemented in software, the elements of the invention are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine-readable medium or transmitted by a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" may include any medium that can store or transfer information. Examples of a machine-readable medium include electronic circuits, semiconductor memory devices, ROM, flash memory, Erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, Radio Frequency (RF) links, and so forth. The code segments may be downloaded via computer networks such as the internet, intranet, etc.
It should also be noted that the exemplary embodiments mentioned in this patent describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, may be performed in an order different from the order in the embodiments, or may be performed simultaneously.
As described above, only the specific embodiments of the present invention are provided, and it can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system, the module and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. It should be understood that the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present invention, and these modifications or substitutions should be covered within the scope of the present invention.

Claims (12)

1. A user identity based encryption method, the method comprising:
generating a private key of a user according to identity attribute information of the user, a preset bilinear mapping parameter and a preset encryption function;
according to the bilinear mapping parameters and the encryption function, carrying out offline encryption on plaintext data of the user, and obtaining an offline ciphertext of the plaintext data;
sending the offline ciphertext to a cloud server so that the cloud server can encrypt the offline ciphertext online and obtain a final ciphertext;
downloading the final ciphertext, and decrypting the final ciphertext according to the private key of the user to obtain a decryption result;
the generating a private key of the user according to the identity attribute information of the user, a preset bilinear mapping parameter and a preset encryption function includes:
determining a set Z according to the order p of a multiplication cycle group in a bilinear mapping parameterpZ is the same aspIs the set of all non-negative integers less than p;
from the set ZpDual space Z ofp *Randomly selecting a first numerical value alpha;
and generating a private key of the user according to the identity attribute information of the user, the generator of the multiplication cycle group, the alpha and the encryption function.
2. The method of claim 1, wherein the bilinear mapping parameters comprise:
multiplication of two orders by a prime number pProcess cycle groups G and GTThe generator G of the multiplication cycle group G and the bilinear mapping pair e: g mapping to GT
3. The method of claim 1, wherein the encryption function comprises a first hash function, a second hash function, and a third hash function;
the off-line encryption of the plaintext data of the user according to the bilinear mapping parameter and the encryption function to obtain an off-line ciphertext of the plaintext data includes:
at the Zp *Randomly selecting a second numerical value s and a third numerical value w, and calculating a first parameter C of the offline ciphertext according to a generator of the multiplication cyclic group, the alpha, the s and the w1
Obtaining a second parameter C of the offline ciphertext according to the identity attribute information ID of the user, the s, the w, the p and the first hash function2
Calculating a third parameter C of the offline ciphertext according to the plaintext data m, the bilinear mapping parameter, the s and the second hash function3
Using said C1The C is2The m, the bilinear mapping parameter and the third hash function are used for calculating a fourth parameter C of the offline ciphertext4
4. The method of claim 3, wherein the final ciphertext comprises the C1The C is2The C is3And a fifth parameter C5
Wherein the fifth parameter C5Is according to said s, said C4And the parameters obtained by the calculation of p.
5. The method of claim 4, wherein C is calculated using the following expression5
C5=(s+C4)modp
Where mod represents the remainder operation.
6. The method of claim 1, further comprising:
and verifying whether the decryption result is correct or not according to the user private key and the final ciphertext.
7. A user identity based encryption method, the method comprising:
receiving an offline ciphertext, wherein the offline ciphertext is a ciphertext obtained by performing offline encryption on plaintext data of a user according to a preset bilinear mapping parameter and a preset encryption function;
performing online encryption on the offline ciphertext and acquiring a final ciphertext;
sending the final ciphertext to a client, so that the client downloads the final ciphertext and decrypts the final ciphertext according to a private key of the user to obtain a decryption result, wherein the private key of the user is a private key generated according to identity attribute information of the user, the bilinear mapping parameter and the encryption function;
the private key of the user is generated according to the identity attribute information of the user, the bilinear mapping parameter and the encryption function, and comprises the following steps:
the user private key determines a set Z according to the order p of a multiplication cycle group in a bilinear mapping parameterpZ is the same aspIs the set of all non-negative integers less than p;
from the set ZpDual space Z ofp *Randomly selecting a first numerical value alpha;
and generating a private key according to the identity attribute information of the user, the generator of the multiplication cycle group, the alpha and the encryption function.
8. An apparatus for encryption based on a user identity, the apparatus comprising:
the private key generation module is used for calculating a private key of the user according to the identity attribute information of the user, a preset bilinear mapping parameter and a preset encryption function;
the offline encryption module is used for performing offline encryption on the plaintext data of the user according to the bilinear mapping parameter and the encryption function, and obtaining an offline ciphertext of the plaintext data;
the sending module is used for sending the offline ciphertext to a cloud server so that the cloud server can encrypt the offline ciphertext online and obtain a final ciphertext;
the decryption module is used for downloading the final ciphertext and decrypting the final ciphertext according to the private key of the user to obtain a decryption result;
the private key generating module is further configured to generate a private key of the user according to the identity attribute information of the user, a preset bilinear mapping parameter, and a preset encryption function, and includes:
determining a set Z according to the order p of a multiplication cycle group in a bilinear mapping parameterpZ is the same aspIs the set of all non-negative integers less than p;
from the set ZpDual space Z ofp *Randomly selecting a first numerical value alpha;
and generating a private key of the user according to the identity attribute information of the user, the generator of the multiplication cycle group, the alpha and the encryption function.
9. An apparatus for encryption based on a user identity, the apparatus comprising:
the receiving module is used for receiving an offline ciphertext, wherein the offline ciphertext is a ciphertext obtained by performing offline encryption on plaintext data of a user according to a preset bilinear mapping parameter and a preset encryption function;
the online encryption module is used for performing online encryption on the offline ciphertext and acquiring a final ciphertext;
a sending module, configured to send the final ciphertext to a client, so that the client downloads the final ciphertext and decrypts the final ciphertext according to a private key of the user to obtain a decryption result, where the private key of the user is a private key generated according to identity attribute information of the user, the bilinear mapping parameter, and the encryption function;
the private key of the user is generated according to the identity attribute information of the user, the bilinear mapping parameter and the encryption function, and comprises the following steps:
the user private key determines a set Z according to the order p of a multiplication cycle group in a bilinear mapping parameterpZ is the same aspIs the set of all non-negative integers less than p;
from the set ZpDual space Z ofp *Randomly selecting a first numerical value alpha;
and generating a private key according to the identity attribute information of the user, the generator of the multiplication cycle group, the alpha and the encryption function.
10. A user identity based encryption system, the system comprising: a client and a cloud server;
the client is used for generating a private key of a user according to identity attribute information of the user, a preset bilinear mapping parameter and a preset encryption function, performing offline encryption on plaintext data of the user according to the bilinear mapping parameter and the encryption function, obtaining an offline ciphertext of the plaintext data, sending the offline ciphertext to a cloud server, enabling the cloud server to perform online encryption on the offline ciphertext and obtain a final ciphertext, downloading the final ciphertext, and decrypting the final ciphertext according to the private key of the user to obtain a decryption result;
the cloud server is used for receiving the offline ciphertext sent by the client, carrying out online encryption on the ciphertext, obtaining a final ciphertext and sending the final ciphertext to the client;
the generating a private key of the user according to the identity attribute information of the user, a preset bilinear mapping parameter and a preset encryption function includes:
determining a set Z according to the order p of a multiplication cycle group in a bilinear mapping parameterpZ is the same aspIs the set of all non-negative integers less than p;
from the set ZpDual space Z ofp *Randomly selecting a first numerical value alpha;
and generating a private key of the user according to the identity attribute information of the user, the generator of the multiplication cycle group, the alpha and the encryption function.
11. An encryption device based on a user identity, the device comprising: a processor and a memory storing computer program instructions;
the processor, when executing the computer program instructions, implements the user identity based encryption method of any one of claims 1-7.
12. A computer storage medium having computer program instructions stored thereon which, when executed by a processor, implement a user identity based encryption method according to any one of claims 1 to 7.
CN201810949815.2A 2018-08-20 2018-08-20 Encryption method, device, system, equipment and medium based on user identity Active CN109359471B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810949815.2A CN109359471B (en) 2018-08-20 2018-08-20 Encryption method, device, system, equipment and medium based on user identity

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810949815.2A CN109359471B (en) 2018-08-20 2018-08-20 Encryption method, device, system, equipment and medium based on user identity

Publications (2)

Publication Number Publication Date
CN109359471A CN109359471A (en) 2019-02-19
CN109359471B true CN109359471B (en) 2021-02-26

Family

ID=65350137

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810949815.2A Active CN109359471B (en) 2018-08-20 2018-08-20 Encryption method, device, system, equipment and medium based on user identity

Country Status (1)

Country Link
CN (1) CN109359471B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110166423B (en) * 2019-04-02 2021-09-10 创新先进技术有限公司 User credit determination method, device and system and data processing method
CN112367169B (en) * 2020-11-11 2022-11-29 平安科技(深圳)有限公司 Data encryption and decryption method, device, equipment and storage medium
CN113141348B (en) * 2021-03-17 2023-04-28 重庆扬成大数据科技有限公司 Four-network-based data government affair security guarantee working method
CN115396150A (en) * 2022-07-25 2022-11-25 支付宝(杭州)信息技术有限公司 Data preprocessing method, data encryption method, device and equipment
CN116579005B (en) * 2023-07-10 2023-09-19 西安银信博锐信息科技有限公司 User data safety storage management method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101867472A (en) * 2009-04-14 2010-10-20 航天信息股份有限公司 Asymmetrical group encryption/decryption method based on user identity identification
CN103618609A (en) * 2013-09-09 2014-03-05 南京邮电大学 User timely revocation method based on attribute-based encryption in cloud environment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5391043B2 (en) * 2009-05-22 2014-01-15 日本放送協会 Encrypted information generating device and program thereof, secret key generating device and program thereof, distribution content generating device and program thereof, content decrypting device and program thereof, and user specifying device and program thereof
CN106549753B (en) * 2016-10-18 2019-07-09 电子科技大学 A kind of encryption method that the support ciphertext of identity-based compares
CN107086911B (en) * 2017-03-31 2020-04-07 西安电子科技大学 CCA (clear channel assessment) safe proxy re-encryption method capable of delegating verification

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101867472A (en) * 2009-04-14 2010-10-20 航天信息股份有限公司 Asymmetrical group encryption/decryption method based on user identity identification
CN103618609A (en) * 2013-09-09 2014-03-05 南京邮电大学 User timely revocation method based on attribute-based encryption in cloud environment

Also Published As

Publication number Publication date
CN109359471A (en) 2019-02-19

Similar Documents

Publication Publication Date Title
CN109359471B (en) Encryption method, device, system, equipment and medium based on user identity
CN112822014B (en) Data processing method and device, electronic equipment and storage medium
US11374975B2 (en) TLS integration of post quantum cryptographic algorithms
CN111512590B (en) Homomorphic encryption for password authentication
CN109413084B (en) Password updating method, device and system
US11496290B2 (en) Blockchain network and finalization method therefor
EP3496331A1 (en) Two-party signature device and method
CN108880807A (en) Private key signature process method, apparatus, equipment and medium
CN107332833B (en) Verification method and device
JP6294882B2 (en) Key storage device, key storage method, and program thereof
CN111314080B (en) SM9 algorithm-based collaborative signature method, device and medium
CN114640463B (en) Digital signature method, computer equipment and medium
CN110796446A (en) Key injection method, key injection device, electronic equipment and computer-readable storage medium
CN115412246A (en) Method, device, equipment and storage medium for inadvertent transmission
CN114398658A (en) Data processing method and device
CN111711524A (en) Certificate-based lightweight outsourcing data auditing method
CN112612499A (en) Application program upgrading method and device, electronic equipment and storage medium
CN115134093B (en) Digital signature method and computing device
CN112887097A (en) Signature method based on SM2 elliptic curve, related device and storage medium
CN113742680B (en) Traceable data encryption transmission method and system based on commercial password
CN116305300B (en) Fair privacy set intersection method
KR101763443B1 (en) Determination of pairings on a curve using aggregated inversions
CN110417703B (en) Proxy re-signing method, server and terminal equipment
CN116415265A (en) Encryption, encryption signature processing and decryption methods and related equipment
CN115967574A (en) Data encryption method and management method, device, system, equipment and medium thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant