Disclosure of Invention
The invention aims to overcome the defects in the prior art, and provides a reasonably designed block chain-based publicly verifiable outsource attribute-based encryption method, which not only tracks the secret key of a malicious user, but also cancels the malicious user, meanwhile, can update the ciphertext in time, can publicly verify the decryption of the outsource, and provides the forward security of the mechanism.
The technical scheme adopted by the invention for solving the problems is as follows:
a block chain-based publicly verifiable outsourcing attribute-based encryption method is characterized by comprising the following steps: the method comprises the following steps:
A. initializing a system: the trusted authority generates a global public key and a master key according to the security parameters and the whole attribute set, and publishes the global public key and the unfamiliar master key;
B. encryption: the data owner encrypts the message and generates a ciphertext according to the global public key, the access structure and the overlay list;
C. and (3) key generation: the trusted authority generates a decryption key according to the global public key, the identity information of the user and the user attribute set, and sends the decryption key to the data user;
D. and (3) decryption: the user decrypts the ciphertext into a message by using the decryption key;
E. and (3) outsourcing key generation: the user converts the decryption key into a conversion key and a retrieval key according to the decryption key, sends the conversion key to the fog node and stores the retrieval key by the user;
F. and (3) outsourcing conversion: the fog node outsourcing the ciphertext into a conversion ciphertext according to the global public key, the ciphertext and the conversion key, and then sending the conversion ciphertext to a data user;
G. and (3) outsourcing decryption: the user generates a message according to the retrieval key, the ciphertext and the conversion ciphertext;
H. tracing the identity of the user: the trusted authority outputs user identity information or error information according to the global public key, the minimum coverage list and the decryption key;
I. and (3) ciphertext updating: the trusted authority generates an updated ciphertext according to the global public key, the ciphertext and the minimum coverage list; and the trusted authority sends the updated ciphertext to the fog node.
The step A of the invention specifically comprises the following steps:
a1, firstly, the trusted authority receives a whole attribute set U, and selects the order according to an implicit security parameter lambdaTwo multiplication cycle groups with prime number p and generator g
And
and a bilinear map
The trusted authority then initializes an empty user revocation list L and a full binary tree
After initialization, the trusted authority assigns the user's identity to the full binary tree
On leaf nodes of the binary tree
Numbering each node according to a breadth-first search method, wherein the numbering of the root node is 0, and d is used to represent a binary tree
So that the maximum number of users is | Num | ═ 2
dThe number of nodes of the binary tree is 2| Num | -2, so the number of the last leaf node of the binary tree is 2| Num | -2;
a2, the trusted authority selects two random numbers alpha,
wherein
Is a p-order integer ring; the trusted authority then likewise selects five random numbers g, u, v, d,
a3, for each attribute value i epsilon U, the trusted authority selects a random number
Wherein
Is a positive integer ring of order p and computes an attribute public key component associated with the attribute value
A4, the trusted authority randomly selects an anti-collision hash function
The hash function can map a message m or a random message m' to one
An element of (a);
a5 for binary tree
In each node, the trusted authority randomly selects a random number
Then generating a master key component
Also concurrently generating a binary tree public key component associated with the user identity
A6, selecting a probability encryption scheme (Enc, Dec) by the trusted authority, wherein Enc is an encryption function, and Dec is a decryption function;
a7, the trusted authority publishes the public key PK, and does not publish the master key MSK.
The step B of the invention specifically comprises the following steps:
b1 data owner selects an access structure
Where M is an access matrix of order l n, and p is an access matrix capable of converting M into M
iMapping algorithm to an attribute, where M
iIs the ith row of the access matrix M; the data owner then selects two random secret indices s,
and sets two random column vectors v ═ s, v
2,...,v
n) And v ═ s ', v'
2,...,v′
n) Wherein
Finally, for each M
iThe data owner calculates the effective share λ associated with the secret exponents s and s
i=M
iX v and λ'
i=M
i×v′;
B2, data owner selects information m to be encrypted and randomly selected information m', and calculates and accesses structure
Associated ciphertext component
C
1=m·e(g,g)
αs,C′
1=g
s,C″
1=g
as,
C
2=m′·e(g,g)
αs′,C′
2=g
s′And C ″)
2=g
as′,
B3、Upon receipt of the latest overlay list cover (L) sent by the trusted authority, the data owner generates the ciphertext component associated with the overlay list cover (L)
B4, and finally, the generated ciphertext CT is:
b5, once the fog node receives the data owner's ciphertext, the fog node will call an intelligent contract, and after the intelligent contract is generated, the fog node broadcasts the transaction to other fog nodes for consensus verification.
The step C of the invention specifically comprises the following steps:
c1, selecting a random number by credible organization
And generating a random number f ═ Enc using a probabilistic encryption scheme with a symmetric key of k
k(l
x) Wherein l is
xIs a leaf node associated with the user identity;
c2, the trusted authority first generates a key component associated with the user property set S: k
1=f,
K
3=g
bAnd K
4=g
ab,
C3, selecting a random number by the trusted authority
And generating a key element associated with the user identity uid
And
where x ∈ path (uid) andgate (l), and path (uid) is the path number between the binary tree from the root node to the leaf node of the associated user uid, then the trusted authority generates the key component associated with the user identity uid:
K
6=g
w,
c4, the trusted authority generates a key SK and sends the key SK to the data user, wherein:
SK={K1,K2,K3,K4,Ki,K5,K6,K7,K8}。
the step D of the invention specifically comprises the following steps:
d1, find two constants c
iAnd c'
iCan make two equations
The method comprises the following steps that (1) the attribute mapping set I is { I | rho (I) ∈ S };
d2, the data consumer first computes two decryption components:
d3, the data user then calculates two plaintext blocks m ═ C
1/Y′
1And m ═ C
2/Y′
2And determining the ciphertext component
And ciphertext verification parameter component u
H(m)v
H(m′)And d is equal or not, if equal, the message m is returned, and if not, the operation is interrupted.
Step E of the invention specifically comprises the following steps:
e1, selecting a random number z by a user, and generating a conversion key component K'
1=K
1,
And
K′
7=K
7,K′
8=K
8;
e2, the user sends the generated transformation key TK to the cloud node, and the user saves the retrieval key RK, wherein:
TK={K′1,K′2,K′3,K′4,K′i,K′5,K′6,K′7,K′8},RK={z}。
in step F of the present invention, the fog node calculates two converted ciphertext components as follows:
the step G of the invention specifically comprises the following steps:
g1, the user first verifies the information received, if
Or W
1≠C
1Or W
2≠C
2If the verification is successful, the operation is interrupted, otherwise, the verification is passed;
g2, if the verification is passed, the user computes two plaintext messages:
g3, user calculating two verification plaintext components V
1=u
H(m),V
2=v
H(m′)And will V
1And V
2Sending to the fog node, then the fog node calls the intelligent contract, and the intelligent contract is verified
And plaintext verification parameter component V
1V
2d are equal.
Step H of the present invention specifically comprises the following steps:
h1, firstly, the trusted authority firstly judges whether the format of the inputted public key SK is correct, if so, the operation is interrupted;
h2, if the format of the public key SK is correct, the trusted authority searches for lxWhether the user identity uid exists in the minimal coverage list cover (L) or not is judged, if so, the user identity uid is returned, otherwise, a false user identity uid is returned;
h3, the trusted authority updates the latest revocation list L' ═ L utou { uid }.
The steps of the invention specifically comprise the following steps:
i1, selecting a random number by the trusted authority
And computing an updated binary tree public key component associated with the user identity
I2, the trusted authority calculates the updated ciphertext component:
and computes two ciphertext components associated with the overlay list (L) after updating
And
then an updated ciphertext is generated:
i3, the trusted authority then sends the updated ciphertext and the revocation list L' to the fog node, which recalls the intelligent contract to store the latest ciphertext hash.
Compared with the prior art, the invention has the following advantages and effects: 1. the invention combines outsourcing decryption with the block chain, realizes the public verifiability of the outsourcing decryption result on the premise of ensuring that the fog node can not obtain any information about the plaintext, and simultaneously can effectively prevent the cloud server from tampering the ciphertext and the user maliciousness of 35820; 2. the method has the advantages that the malicious users are tracked, revoked and updated in time, the identity information of the users is distributed to leaf nodes in the binary tree, and once the malicious users are tracked, the malicious users are added into a revocation list, so that the malicious users are tracked and revoked; 3. the outer package decryption information is disclosed through a block chain technology, so that the public verifiability of the outer package decryption attribute-based encryption is realized; 4. the delay problem of a traditional centralized cloud server architecture is solved based on a three-layer system architecture of 'Internet of things equipment-fog nodes-cloud servers'; 5. the method can provide higher privacy protection requirements for users, has higher efficiency, and is convenient for the use of mobile equipment with limited bandwidth and resources.
Detailed Description
The present invention will be described in further detail below by way of examples with reference to the accompanying drawings, which are illustrative of the present invention and are not to be construed as limiting the present invention.
In this embodiment, a block chain-based encryption method for publicly verifiable outsourcing attribute bases specifically includes the following steps:
A. initializing a system: the trusted authority generates a global public key PK and a master key MSK according to the implicit security parameter lambda and the overall attribute set U; the method specifically comprises the following steps:
a1, firstly, the trusted authority receives a whole attribute set U, and selects two multiplication cycle groups with the order of prime number p and generation element g according to an implicit safety parameter lambda
And
and a bilinear map
The trusted authority then initializes an empty user revocation list L and a full binary tree
After initialization, the trusted authority assigns the user's identity to the full binary tree
On leaf nodes of the binary tree
Numbering each node according to a breadth-first search method, wherein the numbering of the root node is 0, and d is used to represent a binary tree
So that the maximum number of users is | Num | ═ 2
dNode of binary treeThe number of points is 2| Num | -2, so the number of the last leaf node of the binary tree is 2| Num | -2;
a2, the trusted authority selects two random numbers alpha,
wherein
Is a p-order integer ring. The trusted authority then likewise selects five random numbers g, u, v, d,
a3, for each attribute value i epsilon U, the trusted authority selects a random number
Wherein
Is a positive integer ring of order p and computes an attribute public key component associated with the attribute value
A4, the trusted authority randomly selects an anti-collision hash function
The hash function can map a message m or a random message m' to one
An element of (a);
a5 for binary tree
In each node, the trusted authority randomly selects a random number
Then generating a master key component
Also concurrently generating a binary tree public key component associated with the user identity
A6, selecting a probability encryption scheme (Enc, Dec) by the trusted authority, wherein Enc is an encryption function and Dec is a decryption function. The scheme is a symmetric encryption scheme, which can map the user identity uid to
And returns a different result each time encrypted using the symmetric key k;
a7, trusted authority publishes public key PK, and does not publish master key MSK:
B. encryption: the data owner accesses the structure according to the global public key PK, message m
And an overlay list cover (L), wherein overlay list cover (L) is a set of node numbers of a minimum overlay set associated with user revocation list L, and then encrypts message m and generates ciphertext CT; the method specifically comprises the following steps:
b1 data owner selects an access structure
Where M is an access matrix of order l n, and p is an access matrix capable of converting M into M
iMapping to a map of attributesRay algorithm, in which M
iIs the ith row of the access matrix M; the data owner then selects two random secret indices s,
and sets two random column vectors v ═ s, v
2,...,v
n) And v ═ s ', v'
2,...,v′
n) Wherein
And
the part is a selected random number; finally, for each M
iThe data owner calculates the effective share λ associated with the secret exponents s and s
i=M
iX v and λ'
i=M
i×v′;
B2, data owner selects information m to be encrypted and randomly selected information m', and calculates and accesses structure
Associated ciphertext component
C
1=m·e(g,g)
αs,C′
1=g
s,C″
1=g
as,
C
2=m′·e(g,g)
αs′,C′2=g
s′And are and
b3, when the data owner receives the latest overlay list cover (L) sent by the trusted authority, the data owner generates the ciphertext component associated with the overlay list cover (L)
B4, and finally, the generated ciphertext CT is:
b5, once the fog node receives the data owner's ciphertext, the fog node will call an intelligent contract, and after the contract is generated, the fog node broadcasts the transaction to other fog nodes for consensus verification.
C. And (3) key generation: the trusted authority generates a decryption key SK according to the global public key PK, the identity information uid of the user and the user attribute set S; the method specifically comprises the following steps:
c1, selecting a random number by credible organization
And generating a random number f ═ Enc using a probabilistic encryption scheme with a symmetric key of k
k(l
x) Wherein l is
xIs a leaf node associated with the user identity;
c2, the trusted authority first generates a key component associated with the property set S: k
1=f,
K
3=g
bAnd K
4=g
ab,
C3, selecting a random number by the trusted authority
And generating a key element associated with the user identity uid
And
where x ∈ path (uid) andgate (l), and path (uid) is the path number between the binary tree from the root node to the leaf node of the associated user uid, then the trusted authority generates the key component associated with the user identity uid:
K
6=g
w,
c4, the trusted authority generates a key SK and sends the key SK to the data user:
SK={K1,K2,K3,K4,Ki,K5,K6,K7,K8}。
D. and (3) decryption: the user decrypts the ciphertext CT into a message m by using the decryption key SK; the method specifically comprises the following steps:
d1, find two constants c
iAnd c'
iCan make two equations
The method comprises the following steps that (1) the attribute mapping set I is { I | rho (I) ∈ S };
d2, the data consumer first computes two decryption components:
d3, the data user then calculates two plaintext blocks m ═ C
1/Y′
1And m ═ C
2/Y′
2And determining the ciphertext component
And ciphertext verification parameter component u
H(m)v
H(m′)And d is equal or not, if equal, the message m is returned, and if not, the operation is interrupted.
E. And (3) outsourcing key generation: the user converts the decryption key SK into a conversion key TK and a retrieval key RK according to the decryption key SK; the method specifically comprises the following steps:
e1, selecting a random number z by a user, and generating a conversion key component K'
1=K
1,
And
K′
7=K
7,K′
8=K
8;
e2, the user sends the generated transformation key TK to the cloud node and the user saves the retrieval key RK:
TK={K′1,K′2,K′3,K′4,K′i,K′5,K′6,K′7,K′8},
RK={z}。
F. and (3) outsourcing conversion: the fog node converts the ciphertext CT outsourced into a conversion ciphertext CT' according to the public key PK, the ciphertext CT and the conversion key TK, and
the fog node then sends the converted ciphertext CT' to the data user.
Wherein the fog node computes two transformed ciphertext components:
G. and (3) outsourcing decryption: the user generates a message m according to the retrieval key RK, the ciphertext CT and the conversion ciphertext CT'; the method specifically comprises the following steps:
g1, the user first verifies the information received, if
Or W
1≠C
1Or W
2≠C
2If the verification is successful, the operation is interrupted, otherwise, the verification is passed;
g2, if the verification is passed, the user computes two plaintext messages:
g3, user calculating two verification plaintext components V
1=u
H(m),V
2=v
H(m′)And will V
1And V
2Sending the information to a fog node, then calling an intelligent contract by the fog node, and verifying the intelligent contract
And plaintext verification parameter component V
1V
2d are equal to achieve public verifiability of the algorithm.
H. Tracing the identity of the user: the trusted authority outputs user identity information uid or error information according to the global public key PK, the minimum coverage list cover (L) and the decryption key SK; the method specifically comprises the following steps:
h1, firstly, the trusted authority firstly judges whether the format of the input key SK is correct, and if the format is wrong, the operation is interrupted;
h2, if SK format is correct, trusted authority searches for lxWhether it is in the minimum coverage list cover (l), if it is, returning the user identity uid, otherwise, returning a false user identity uid, wherein the false user identity uid can never be returnedPresent in the system;
h3, the trusted authority updates the latest revocation list L' ═ L utou { uid }.
I. And (3) ciphertext updating: the trusted authority generates an updated ciphertext CT 'according to the global public key PK, the ciphertext CT and the minimum overlay list cover (L'); the method specifically comprises the following steps:
i1, selecting a random number by the trusted authority
And computing an updated binary tree public key component associated with the user identity
I2, the trusted authority calculates the updated ciphertext component:
and computes two ciphertext components associated with the overlay list (L) after updating
And
then an updated ciphertext is generated:
i3, the trusted authority then sends the updated ciphertext and the revocation list L' to the fog node, which recalls the intelligent contract to store the latest ciphertext hash.
The entities involved in the invention comprise a trusted authority, a data owner, a fog node, a cloud storage provider, a data user and a block chain.
A trusted authority, considered to be fully trusted, for generating a global public key PK and a master key MSK for a system, which also has a revocation list L of users and a binary tree
Meanwhile, the trusted authority only sends the revocation list L and the minimum coverage list cover (L') to the cloud node and the data owner respectively, but does not disclose the whole binary tree, which is beneficial to protecting the privacy of the data user.
And the data user sets an access structure for encrypting the message by himself, encrypts the message by using the system, and uploads the encrypted ciphertext to the fog node.
And the fog node is considered as semi-trusted, maintains a revocation list L of users, when a data user requests to access data, the data user sends the request to the fog node, and after receiving the request, if the data user is not in the revocation list L and the attribute set S is matched with the access structure, the fog node forwards the request to a trusted authority, and finally, the fog node also plays a role in packaging and sending some key information to the block chain.
The cloud storage provider, which is also considered semi-trusted, is responsible for storing the ciphertext from the fog node, and then also stores the ciphertext in the location AdressCTAnd returning to the fog node.
And the data users, each of which has an identity mark uid, communicate data requests and data verification of the data users by sending data description information to the fog node.
And the block chain, wherein the fog node stores information on the block chain through an intelligent contract, such as: hash of the ciphertext, hash of the updated ciphertext, public key, etc.
In addition, it should be noted that the specific embodiments described in the present specification may be different in the components, the shapes of the components, the names of the components, and the like, and the above description is only an illustration of the structure of the present invention. Equivalent or simple changes in the structure, characteristics and principles of the invention are included in the protection scope of the patent. Various modifications, additions and substitutions for the specific embodiments described may be made by those skilled in the art without departing from the scope of the invention as defined in the accompanying claims.