That supports inner product operation can search for public key encryption method
Technical field
The invention belongs to data encryption technology fields, and in particular to reach adaptability safety and support that inner product is transported in ciphertext
That calculates can search for encryption method.
Background technique
With the extensive use of cloud computing, more and more personal or enterprise customers are stored data on Cloud Server,
To reduce local storage overhead.However, cloud storage service provider is a kind of untrusted object, deposits not by user management
In potential security risk.When the sensitive data of user uploads to this kind of untrusted system, the information privacy of user cannot get
Guarantee.A kind of effective method is the first data encryption by user, then is uploaded to Cloud Server storage, this make no permission or
The people of decruption key is unable to get relevant information.Traditional data ciphering method needs are downloaded and solve to whole encryption information
It is handled again after close, computing cost and communication overhead are all very big, impracticable.Can search for encryption is the one kind to solve the above problems
Practical technique, the data for allowing user to upload after encryption carry out calculating and search abundant, user's downloading data are avoided to search again
The expense of rope.
Article " the Two-Input Functional Encryption for of Kwangsu Lee and Dong Hoon Lee
Inner Products from Bilinear Maps》(IEICE Transactions on Fundamentals of
Electronics, Communications and Computer Sciences, in January, 2018) in propose it is a kind of based on double
Linear Mapping, the function encrypting scheme for supporting inner product operation, and demonstrate the selection safety of scheme.Although the technical solution is same
Sample construction is in closing number rank Bilinear Groups, but the common parameter of its technical solution is that (d is ciphertext attribute and close to 3+2d group element
The length of key attribute, similarly hereinafter), ciphertext length is 2d group element, and key length is 1+d group element, and scale is all larger;At the beginning of it
Beginningization algorithm needs to be implemented 2d exponent arithmetic, 2d multiplying, and key schedule needs to be implemented 2d multiplying, adds
Close algorithm needs to be implemented 2d+3 exponent arithmetic, 2d+1 multiplying, and decipherment algorithm needs to be implemented 2d+1 exponent arithmetic, 2d
+ 2 multiplyings, 2d+1 pairing operation, encryption and decryption operation efficiency are low.
Summary of the invention
Technical problem to be solved by the present invention lies in above-mentioned function encrypting scheme is overcome, a kind of adaptability is provided
Safety, common parameter and ciphertext length and key length is short, encryption and decryption is high-efficient support inner product operation can search for public key
Encryption method.
Technical solution used by above-mentioned technical problem is solved to be made of following step:
1, system initialization
Security parameter 1 is arranged in trusted authorityλ, generated with group's generating algorithm and close number rank Bilinear Groups GN,GNFor Gp×Gq×Gr,
Wherein N is p × q × r, p, q, and r is to meet security parameter 1 respectivelyλIt is required that prime number, Gp、Gq、GrIt is G respectivelyNSubgroup;From N rank
Multiplicative groupMiddle random selection integer α, integer x and integer vectorsFor (x1,…,xd), wherein d is vectorLength
For limited positive integer;Output system overall situation common parameter and openly:
WhereinFor bilinear map, GTBe target complex be message space, gp、grIt is subgroup respectively
Gp, subgroup GrGeneration member,ForSetting system master key MSK are as follows:
It is maintained secrecy by trusted authority.
2, data owner's encryption data and Cloud Server is uploaded
Data owner generates ciphertext attribute to clear data M to be encryptedCiphertext attributeForm be one group it is whole
The vector that number is constituted:
WhereinClear data M and its ciphertext attribute to be encrypted are generated with data ciphering methodIt is close
Literary C, by ciphertext binary groupIt is uploaded to Cloud Server, is saved, whereinFor
3, decruption key is generated for data user
Data user submits key attributeKey attributeForm be one group of integer constitute vector (k1,…,
kd), whereinTrusted authority receives the key attribute of data user's submissionWith decruption key generation method
Decruption key is generated for data userReturn to data user.
4, Cloud Server carries out cipher text searching and returns the result
Data user submits search token TK;Cloud Server receives the search token TK of data user's upload, and traversal checks
The ciphertext binary group of all storagesIt is matched with cipher text searching method, the ciphertext returned data of successful match is used
Family indicates no matched data without successful match.
5, data user is returned ciphertext is simultaneously decrypted
Data user obtains the ciphertext of Cloud Server return, is decrypted in local with decryption method, obtains clear data
M。
In step 2 of the invention, data ciphering method are as follows:
It takes in common parameter PPgP、With clear data M to be encrypted, ciphertext attribute
From N rank multiplicative groupMiddle random selection integer s exports ciphertext C as the following formula:
C=(C0,C1)
Wherein C0ForC1For
In step 3 of the invention, decruption key generation method are as follows:
Take the g in common parameter PPP、gr、Take the key attribute of system master key MSK and userTrusted authority
TA is from N rank multiplicative groupMiddle random selection integer y, integer vectorsDecruption key is exported as the following formula
WhereinIt indicatesWithInner product.
In step 4 of the invention, cipher text searching method are as follows:
Search token TK is arranged in data userAnd Cloud Server is uploaded, Cloud Server receives searching for data user's upload
Rope token TK, traversal check the ciphertext binary group of all storagesIfIt is 1, i.e.,It is 1, that is,It is 0, then successful match;It is not 1, it fails to match.
In step 5 of the invention, the decryption method of data user's execution are as follows:
Data user's decruption keyThe ciphertext C of successful match is returned to Cloud Server, as the following formula
Obtain clear data;Wherein
WhenWhen being 0, clear data M is correctly recovered.
Data owner assigns corresponding ciphertext attribute to data and encrypts in the present invention, is stored in Cloud Server
On;Data user retrieves specific data, submits the key attribute of oneself to trusted authority, and trusted authority is close for its generation decryption
Search token is issued Cloud Server and retrieved by key, data user, and the data of successful match are returned to data by Cloud Server
User completes cipher text searching, and data user is locally using decryption key decryption;The foundation of successful match is that data user provides
Key attribute (vector form) and associated ciphertext attribute (vector form) inner product of ciphertext are zero.Due to present invention employs with it is existing
The decryption side that the data ciphering method that has technology different, decruption key generation method, cipher text searching method, data user execute
Method, relative to " Two-Input Functional Encryption for Inner Products from Bilinear
Maps " in encipherment scheme, the method that proposes obviously has shorter common parameter, shorter ciphertext size, more in the present invention
Short keys sizes, faster encryption and decryption speed.The present invention has many advantages, such as that arithmetic speed is fast, highly-safe, can add
Ciphertext data library, the technical field of memory for encrypting file use.
Detailed description of the invention
Fig. 1 is the flow chart of the embodiment of the present invention 1.
Fig. 2 is the flow chart of cipher text searching method in Fig. 1.
Specific embodiment
Present invention will be further explained below with reference to the attached drawings and examples, but the present invention is not limited to following embodiments.
Embodiment 1
The support inner product operation of the present embodiment it is as follows the step of can search for public key encryption method:
1, system initialization
Security parameter 1 is arranged in trusted authorityλ, generated with group's generating algorithm and close number rank Bilinear Groups GN,GNFor Gp×Gq×Gr,
Wherein N is p × q × r, p, q, and r is to meet security parameter 1 respectivelyλIt is required that prime number, Gp、Gq、GrIt is G respectivelyNSubgroup;From N rank
Multiplicative groupMiddle random selection integer α, integer x and integer vectorsFor (x1,…,xd), wherein d is vectorLength
For limited positive integer;Output system overall situation common parameter and openly:
WhereinFor bilinear map, GTBe target complex be message space, gp、grIt is subgroup respectively
Gp, subgroup GrGeneration member,ForSetting system master key MSK are as follows:
It is maintained secrecy by trusted authority;
2, data owner's encryption data and Cloud Server is uploaded
Data owner generates ciphertext attribute to clear data M to be encryptedCiphertext attributeForm be one group it is whole
The vector that number is constituted.
WhereinClear data M and its ciphertext attribute to be encrypted are generated with data ciphering methodIt is close
Literary C, by ciphertext binary groupIt is uploaded to Cloud Server, is saved, whereinFor
Above-mentioned data ciphering method is as follows:
It takes in common parameter PPgP、With clear data M to be encrypted, ciphertext attribute
From N rank multiplicative groupMiddle random selection integer s exports ciphertext C as the following formula:
C=(C0,C1)
Wherein C0ForC1For
3, decruption key is generated for data user
Data user submits key attributeKey attributeForm be one group of integer constitute vector (k1,…,
kd), whereinTrusted authority receives the key attribute of data user's submissionWith decruption key generation method
Decruption key is generated for data userReturn to data user.
Above-mentioned decruption key generation method is as follows:
Take the g in common parameter PPP、gr、Take the key attribute of system master key MSK and userTrusted authority
TA is from N rank multiplicative groupMiddle random selection integer y, integer vectorsDecruption key is exported as the following formula
WhereinIt indicatesWithInner product.
4, Cloud Server carries out cipher text searching and returns the result
Data user submits search token TK;Cloud Server receives the search token TK of data user's upload, and traversal checks
The ciphertext binary group of all storagesIt is matched with cipher text searching method, the ciphertext returned data of successful match is used
Family indicates no matched data without successful match.
Above-mentioned cipher text searching method is as follows:
Search token TK is arranged in data userAnd Cloud Server is uploaded, Cloud Server receives searching for data user's upload
Rope token TK, traversal check the ciphertext binary group of all storagesIfIt is 1, i.e.,It is 1, that is,It is 0, then successful match;It is not 1, it fails to match.
5, data user is returned ciphertext is simultaneously decrypted
Data user obtains the ciphertext of Cloud Server return, is decrypted in local with decryption method, obtains clear data
M。
Above-mentioned decryption method is as follows:
Data user's decruption keyThe ciphertext C of successful match is returned to Cloud Server, as the following formula
Obtain clear data;Wherein
WhenWhen being 0, clear data M is correctly recovered.
Initial method of the present invention only needs to be implemented d+3 exponent arithmetic, and obtained common parameter length is only
Comprising 3+d group element, the data ciphering method of use only needs to be implemented 2d+1 exponent arithmetic, 1 multiplying, obtains
Ciphertext size only includes 2+d group element, the decruption key generation method of use only need to be implemented d+2 exponent arithmetic, 1 multiply
Method operation and 1 pairing operation, the decryption method that data user executes only needs to be implemented 2d+1 multiplying and 2d+1 are matched
To operation, relative to " Two-Input Functional Encryption for Inner Products from
Bilinear Maps " in encipherment scheme, the method that proposes obviously has shorter common parameter, shorter close in the present invention
Literary size, shorter keys sizes, faster encryption and decryption speed.
Working principle of the present invention is as follows:
Data owner assigns corresponding ciphertext attribute to data and encrypts, and is stored on Cloud Server;Data are used
Specific data is retrieved at family, submits the key attribute of oneself to trusted authority, and trusted authority generates decruption key, data user for it
Search token is issued Cloud Server to scan for, the data of successful match are returned to data user and complete ciphertext by Cloud Server
Search, data user are locally using decryption key decryption, and the foundation of successful match is the key attribute (vector that data user provides
Form) and associated ciphertext attribute (vector form) inner product of ciphertext be zero.