CN111277406A - Block chain-based safe two-direction quantity advantage comparison method - Google Patents

Block chain-based safe two-direction quantity advantage comparison method Download PDF

Info

Publication number
CN111277406A
CN111277406A CN202010019019.6A CN202010019019A CN111277406A CN 111277406 A CN111277406 A CN 111277406A CN 202010019019 A CN202010019019 A CN 202010019019A CN 111277406 A CN111277406 A CN 111277406A
Authority
CN
China
Prior art keywords
vector
equal
node
bob
alice
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.)
Granted
Application number
CN202010019019.6A
Other languages
Chinese (zh)
Other versions
CN111277406B (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.)
Sun Yat Sen University
National Sun Yat Sen University
Original Assignee
National Sun Yat Sen University
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 National Sun Yat Sen University filed Critical National Sun Yat Sen University
Priority to CN202010019019.6A priority Critical patent/CN111277406B/en
Publication of CN111277406A publication Critical patent/CN111277406A/en
Application granted granted Critical
Publication of CN111277406B publication Critical patent/CN111277406B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/085Secret sharing or secret splitting, e.g. threshold schemes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0207Discounts or incentives, e.g. coupons or rebates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • H04L9/3006Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters
    • H04L9/3013Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters involving the discrete logarithm problem, e.g. ElGamal or Diffie-Hellman systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Development Economics (AREA)
  • Finance (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Accounting & Taxation (AREA)
  • Computing Systems (AREA)
  • Strategic Management (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Game Theory and Decision Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention belongs to the field of cryptography and information security, and particularly relates to a block chain-based security two-direction quantity advantage comparison method. The method adopts the block chain and cloud outsourcing computation as a basic framework, utilizes the block chain as a driving tool, and replaces a trusted third party to manage and supervise the whole computation process, thereby ensuring that the vector can normally run. By utilizing cloud outsourcing computation, heavy computing tasks are transferred from users to outsourcing servers with enough computing power, the burden of the users is reduced, and extra computing resources are fully utilized. The cloud outsourcing computation and the block link are combined, a reliable reward punishment mechanism is provided, the computing overhead of a user is reduced, meanwhile, the attack cost of a malicious server is greatly increased, and therefore the semi-honest model protocol which is severely limited in actual operation originally is guaranteed.

Description

Block chain-based safe two-direction quantity advantage comparison method
Technical Field
The invention belongs to the field of cryptography and information security, and particularly relates to a block chain-based security two-direction quantity advantage comparison method.
Background
With the rapid development of information technology, the internet becomes more and more important in people's daily life. In recent years, internet applications and services have emerged as bamboo shoots in the spring after rain. Although these internet applications bring great convenience to people's lives, many applications also collect a large amount of user data in the process, and thus this also raises concerns about the disclosure of private information. As a technology for effectively protecting privacy, multi-party security computing is one of the major concerns of researchers, and it focuses on how to utilize private information of participants to complete related computing tasks in a distributed scenario. The advantage comparison of two directional quantities is a sub-topic of multi-party safety calculation, is an extension of single digital comparison, and simultaneously adds new limiting conditions. Assuming that Alice and Bob respectively hold private vector a and vector B, which require Alice and Bob to be able to compare to see if there is a situation where all elements in one vector are larger than the corresponding elements in the other vector, and in this process, neither the element information in the vector nor the size relationship of the corresponding elements can be exposed to the other. The advantage comparison of the two directional quantities is used as a sub-topic of multi-party security calculation, a large number of technologies based on the knowledge of cryptography are used, and the method belongs to the fields of cryptography and information security.
In 2001, Atallah et al first proposed a definition of the comparison of the superiority of two directional quantities and presented a method of using permutation and obfuscation inputs to accomplish the comparison. By obfuscating the input and permutation, Atallah expands the two n-dimensional vectors A and B into a 4 n-dimensional vector A 'and a vector B', and then compares the elements one by one with A 'and B'. In 2006, Ibrahim proposed a new algorithm, which first calculates whether there is a vector advantage by using elements of corresponding positions, and after determining that there is a vector advantage, the second calculates the sum of elements of respective vectors, and then compares the sum to determine which vector is the advantage. In 2008 Jin et al proposed a bitwise ratio-based approach to solve the vector dominance problem. Firstly, Alice sends an encryption key and encrypted vector bits to Bob, and Bob calculates the difference value of corresponding bits of corresponding elements in an encrypted environment after receiving Alice data and accumulates the difference value. And Bob sends the accumulated result to Alice after confusion, and the Alice judges whether the vectors have advantage comparison or not according to the difference after decryption.
Although the above methods can solve the problem of comparing the two directional quantities, they are only applicable to a semi-honest model, that is, participants must honestly execute each step and cannot resist malicious behaviors. Meanwhile, the method proposed by Atallah uses a trusted third party, and the feasibility is lacked in practical use. The Ibrahim method is lack of the condition of equal vector nodes, and may cause the privacy of the user to be revealed on the premise of not performing preprocessing. Meanwhile, the user needs to do a large amount of calculation and communication operations by the method, and more expenses are brought to the user.
Disclosure of Invention
In order to overcome the defects in the prior art, the invention provides a block chain-based safe two-direction quantity advantage comparison method, which transfers heavy computing tasks from users to outsourcing servers with enough computing power by using cloud outsourcing computing, reduces the burden of the users and fully utilizes additional computing resources.
In order to solve the technical problems, the invention adopts the technical scheme that: a block chain-based safe two-direction quantity advantage comparison method comprises the following steps:
s1, assuming that Alice holds vector A ═ a1... an]Bob holds a vector B ═ B1... bn]Each element may be represented as a K-bit integer;
s2, key agreement: alice and Bob communicate to negotiate parameters p, q required for ELGamal encryption, each in group ZqIn the random element SA、SBAnd calculate
Figure BDA0002360025000000021
To obtain
Figure BDA0002360025000000022
At GqSelecting f as element, using h, f and group GqThe generator g constructs an encryption key (g, h, f); wherein p and q are two large prime numbers, and satisfy the condition that p is 2q +1, GqIs a group
Figure BDA0002360025000000023
The q-order multiplier subgroup of (1), whose generator is g;
s3, secret sharing is carried out on own data by Alice according to bits, and a matrix A is equal to [ a ]1... an]Each element a ofiIs divided into K shares, wherein i is more than or equal to 1 and less than or equal to n,each share comprising the element aiA bit of (a) can be expressed as [ a ]i]p=[[ai1]p[ai2]p... [aik]p]Wherein [ a ]ik]pE {0, 1 }; at the same time, Alice calculates aiOf longest prefix of a'iLength J ofiAnd Alice shares the data JiAnd encryption keys (g, h, f) are uploaded to the blockchain;
s4.Bob calculates the prefix set of each element according to the vector B of the Bob, and for each element BiWhere 1 ≦ i ≦ n, Bob calculates b using a zero-coding algorithmiAll prefixes are obtained to contain KiSet of individual elements
Figure BDA0002360025000000024
Bob will each
Figure BDA0002360025000000025
Bit-wise secret sharing
Figure BDA0002360025000000026
Wherein
Figure BDA0002360025000000027
mjTo represent
Figure BDA0002360025000000028
Then upload the data to the blockchain;
s5, the block chain receives the data uploaded by Alice and Bob, the data and the calculation tasks are distributed to the calculation nodes for calculation, and the encrypted data y is obtained through calculationi,KWherein i is more than or equal to 1 and less than or equal to n;
s6. in step S5, the ith round can obtain yi,KAnd after the last n rounds of calculation are finished, the block chain and the calculation node can obtain Y through communication and calculation1,K·y2,K...·yn,K(x, Y), returning the result Y to Alice and Bob;
s7, according to the requirement of ELGamal cryptosystem, utilizing the step S2 by Alice and BobS ofA、SBAnd x in Y obtained in step S6, respectively
Figure BDA0002360025000000031
And
Figure BDA0002360025000000032
and exchange, then decrypt Y, if the result of decryption
Figure BDA0002360025000000033
Then a > B, i.e. vector a has vector dominance to vector B, otherwise vector a has no vector dominance to vector B.
Further, the step S5 specifically includes: firstly, a block chain randomly selects 2K computing nodes, and each node acquires aiAnd
Figure BDA0002360025000000034
then the 2K nodes repeat the following operations n times, where i is 1, 2.. n;
s51, responsible for [ a ]i]pNode of (2) from group ZqTwo random numbers are selected
Figure BDA0002360025000000035
And
Figure BDA0002360025000000036
let node hold
Figure BDA0002360025000000037
This bit, i corresponds to the position of the element in A, j corresponds to the number of rounds, l denotes the position in element aiThe position of (1);
when J is 1, it is responsible for the former JiThe nodes of the bits are calculated as follows, wherein l is more than or equal to 1 and less than or equal to K:
if it is
Figure BDA0002360025000000038
Generating vectors
Figure BDA0002360025000000039
If it is
Figure BDA00023600250000000310
Generating vectors
Figure BDA00023600250000000311
Node-generated vector of other bits
Figure BDA00023600250000000312
When J > 1, it is responsible for the first JiThe node of the bit is based on the received yi,j-1The following calculation is carried out, wherein l is more than or equal to 1 and less than or equal to K:
if it is
Figure BDA00023600250000000313
Generating vectors
Figure BDA00023600250000000314
If it is
Figure BDA00023600250000000315
Generating vectors
Figure BDA00023600250000000316
Node-generated vector of other bits
Figure BDA00023600250000000317
S52, responsible for [ a ]i]pThe node(s) sends the calculated vector(s) to the blockchain, which forwards the vector(s) to the corresponding blockchain
Figure BDA00023600250000000318
A node of (2);
s53, is responsible for
Figure BDA00023600250000000319
After receiving the vector, the node ofSelecting a certain element in the vector according to own data; let node hold
Figure BDA00023600250000000320
i and j correspond to
Figure BDA00023600250000000321
In the middle position, l, 1 is not less than l but not more than mjIs shown in the element
Figure BDA00023600250000000322
The position of (1); when j is more than or equal to 1 and less than or equal to KiWhen, if
Figure BDA00023600250000000323
Then select z [ i, j, l]=z[i,j,0]If, if
Figure BDA00023600250000000324
Then select z [ i, j, l]=z[i,j,1](ii) a The node communication is calculated to obtain yi,j=z[i,j,mj]·z[i,j,mj-1]...·z[i,j,1]E (0); when (K)iJ is more than or equal to +1) and less than or equal to K, in ZnIn the random selection of element rjCalculating
Figure BDA0002360025000000041
Node then will yi,jReturning to the block chain;
and S54, when j is 2, 3.. K, returning to the step S51 and performing the next round of calculation, and after the K-th round is finished, obtaining the encrypted data y by the node through calculationi,KWherein i is more than or equal to 1 and less than or equal to n.
In the present invention, the ELGamal encryption framework includes:
and (3) key generation: p and q are two large prime numbers, and satisfy the condition that p is 2q + 1; gqIs a group
Figure BDA0002360025000000042
The q-order multiplier subgroup of (1), whose generator is g; alice in group ZqIn the method, an element S is randomly selectedABob in group ZqIn the method, an element S is randomly selectedB(ii) a Alice and Bob respectivelyComputing
Figure BDA0002360025000000043
And
Figure BDA0002360025000000044
and exchange to obtain
Figure BDA0002360025000000045
At GqSelecting an element f to obtain an encrypted public key (g, h, f);
encryption operation: given plaintext m ∈ ZqThe encryption can obtain E (m) (x, y) (g)α,hαfm) Wherein α is at ZqRandom elements selected from (1);
and (3) decryption operation: given the ciphertext, c ═ x, y, Alice and Bob respectively compute and share
Figure BDA0002360025000000046
And
Figure BDA0002360025000000047
can be decrypted to obtain
Figure BDA0002360025000000048
In the method, the block chain and cloud outsourcing computation are used as a basic framework, the block chain is used as a driving tool to replace a trusted third party to manage and supervise the whole computation process, and the vector can be ensured to normally run. By utilizing cloud outsourcing computation, heavy computing tasks are transferred from users to outsourcing servers with enough computing power, the burden of the users is reduced, and extra computing resources are fully utilized. Each computing server must register in the blockchain and mortgage certain electronic assets in the blockchain as a guarantee deposit. If the server does not calculate according to the protocol in the calculation process, the block chain can punish the electronic assets of the server, deduct the electronic assets of the server and compensate the honestly operated nodes and users. While the electronic assets of the honestly running nodes can be freely retrieved after the computing task and can receive the honest rewards from the blockchain and the service fee of the user. Therefore, cloud outsourcing computation and block linking are combined, a reliable reward punishment mechanism is provided, computing overhead of a user is reduced, meanwhile, attack cost of a malicious server is greatly increased, and accordingly, the semi-honest model protocol which is severely limited in actual operation originally is guaranteed. Servers may prefer to operate honestly rather than breaking agreements in order to obtain rewards, causing their assets to be compromised.
And (3) analyzing efficiency: the overhead of the scheme is divided into two parts, namely calculation overhead and communication overhead. For users Alice and Bob, the main overhead comes from key agreement and uploading data, and their communication overhead is o (nk). For the cloud servers, data of users need to be received and encrypted for comparison, the communication overhead position O (nK) of a single server is calculated, the overhead position O (nK) is calculated, and the total overhead of all the cloud servers is O (nK)2) N represents the number of user vector elements, and K represents the length of a single element.
And (3) safety analysis: the scheme uses zero coding and privacy protection prefix detection. Assuming vector A has a vector dominance over vector B, then element B in vector BiZero-code-set of
Figure BDA0002360025000000051
Must contain the corresponding element aiThe prefix of (2). In step S5 of the present scheme, for each element aiAnd
Figure BDA0002360025000000052
each element in (1)
Figure BDA0002360025000000053
All carry out privacy protection prefix test if
Figure BDA0002360025000000054
Element aiFor the resulting yi,j=E(Ri,j) In which is Ri,j0. If there is a vector dominance of A over B, the final aggregated results
Figure BDA0002360025000000055
Figure BDA0002360025000000056
And d (y) 1. Whereas if the vector dominance of A over B does not hold, then there is i ', j' such that Ri′,j′Not equal to 0, and thus the final result
Figure BDA0002360025000000057
While
Figure BDA0002360025000000058
Due to Ri′,j′Randomly generated by the server, so that there is only a very small probability Ri′,j′0, so the scheme is complete.
Compared with the prior art, the beneficial effects are: according to the block chain-based safe two-direction quantity advantage comparison method, the block chain and cloud outsourcing calculation are used as a basic framework, the block chain is used as a driving tool, a trusted third party is replaced to manage and supervise the whole calculation process, and the vector can be ensured to normally run. By utilizing cloud outsourcing computation, heavy computing tasks are transferred from users to outsourcing servers with enough computing power, the burden of the users is reduced, and extra computing resources are fully utilized. The cloud outsourcing computation and the block link are combined, a reliable reward punishment mechanism is provided, the computing overhead of a user is reduced, meanwhile, the attack cost of a malicious server is greatly increased, and therefore the semi-honest model protocol which is severely limited in actual operation originally is guaranteed.
Detailed Description
A block chain-based safe two-direction quantity advantage comparison method comprises the following steps:
s1, assuming that Alice holds vector A ═ a1... an]Bob holds a vector B ═ B1... bn]Each element may be represented as a K-bit integer;
s2, key agreement: common to Alice and BobThe parameters p, q required for the ELGamal encryption are negotiated, each in the group ZqIn the random element SA、SBAnd calculate
Figure BDA0002360025000000059
To obtain
Figure BDA00023600250000000510
At GqSelecting f as element, using h, f and group GqThe generator g constructs an encryption key (g, h, f); wherein p and q are two large prime numbers, and satisfy the condition that p is 2q +1, GqIs a group
Figure BDA00023600250000000511
The q-order multiplier subgroup of (1), whose generator is g;
s3, secret sharing is carried out on own data by Alice according to bits, and a matrix A is equal to [ a ]1... an]Each element a ofiIs divided into K shares, wherein i is more than or equal to 1 and less than or equal to n, and each share contains an element aiA bit of (a) can be expressed as [ a ]i]p=[[ai1]p[ai2]p... [aik]p]Wherein [ a ]ik]pE {0, 1 }; at the same time, Alice calculates aiOf longest prefix of a'iLength J ofiAnd Alice shares the data JiAnd encryption keys (g, h, f) are uploaded to the blockchain;
s4.Bob calculates the prefix set of each element according to the vector B of the Bob, and for each element BiWhere 1 ≦ i ≦ n, Bob calculates b using a zero-coding algorithmiAll prefixes are obtained to contain KiSet of individual elements
Figure BDA0002360025000000061
Bob will each
Figure BDA0002360025000000062
Secret sharing by security position
Figure BDA0002360025000000063
Wherein
Figure BDA0002360025000000064
mjTo represent
Figure BDA0002360025000000065
Then upload the data to the blockchain;
s5, the block chain receives the data uploaded by Alice and Bob, the data and the calculation tasks are distributed to the calculation nodes for calculation, and the encrypted data y is obtained through calculationi,kWherein i is more than or equal to 1 and less than or equal to n;
s6. in step S5, the ith round can obtain yi,KAnd after the last n rounds of calculation are finished, the block chain and the calculation node can obtain Y through communication and calculation1,K·y2,K...·ynK(x, Y), returning the result Y to Alice and Bob;
s7, according to the requirement of an ELGamal cryptosystem, utilizing the S in the step S2 by Alice and BobA、SBAnd x in Y obtained in step S6, respectively
Figure BDA0002360025000000066
And
Figure BDA0002360025000000067
and exchange, then decrypt Y, if the result of decryption
Figure BDA0002360025000000068
Then a > B, i.e. vector a has vector dominance to vector B, otherwise vector a has no vector dominance to vector B.
Wherein, the step S5 specifically includes: firstly, a block chain randomly selects 2K computing nodes, and each node acquires aiAnd
Figure BDA0002360025000000069
then the 2K nodes repeat the following operations n times, where i is 1, 2.. n;
s51, responsible for [ a ]i]pNode of (2) from group ZqTwo random numbers are selected
Figure BDA00023600250000000610
And
Figure BDA00023600250000000611
let node hold
Figure BDA00023600250000000612
This bit, i corresponds to the position of the element in A, j corresponds to the number of rounds, l denotes the position in element aiThe position of (1);
when J is 1, it is responsible for the former JiThe nodes of the bits are calculated as follows, wherein l is more than or equal to 1 and less than or equal to K:
if it is
Figure BDA00023600250000000613
Generating vectors
Figure BDA00023600250000000614
If it is
Figure BDA00023600250000000615
Generating vectors
Figure BDA00023600250000000616
Node-generated vector of other bits
Figure BDA00023600250000000617
When J > 1, it is responsible for the first JiThe node of the bit is based on the received yi,j-1The following calculation is carried out, wherein l is more than or equal to 1 and less than or equal to K:
if it is
Figure BDA0002360025000000071
Generating vectors
Figure BDA0002360025000000072
If it is
Figure BDA0002360025000000073
Generating vectors
Figure BDA0002360025000000074
Node-generated vector of other bits
Figure BDA0002360025000000075
S52, responsible for [ a ]i]pThe node(s) sends the calculated vector(s) to the blockchain, which forwards the vector(s) to the corresponding blockchain
Figure BDA0002360025000000076
A node of (2);
s53, is responsible for
Figure BDA0002360025000000077
After receiving the vector, the node selects a certain element in the vector according to own data; let node hold
Figure BDA0002360025000000078
i and j correspond to
Figure BDA0002360025000000079
In the middle position, l, 1 is not less than l but not more than mjIs shown in the element
Figure BDA00023600250000000710
The position of (1); when j is more than or equal to 1 and less than or equal to KiWhen, if
Figure BDA00023600250000000711
Then select z [ i, j, l]=z[i,j,0]If, if
Figure BDA00023600250000000712
Then select z [ i, j, l]=z[i,j,1](ii) a The node communication is calculated to obtain yi,j=z[i,j,mj]·z[i,j,mj-1]...· z[i,j,1]E (0); when (K)i+1)≤j≤K is at ZnIn the random selection of element rjCalculating
Figure BDA00023600250000000713
Node then will yi,jReturning to the block chain;
and S54, when j is 2, 3.. K, returning to the step S51 and performing the next round of calculation, and after the K-th round is finished, obtaining the encrypted data y by the node through calculationi,KWherein i is more than or equal to 1 and less than or equal to n.
The following are some algorithms relevant to the present invention:
the ELGamal encryption framework comprises:
and (3) key generation: p and q are two large prime numbers, and satisfy the condition that p is 2q + 1; gqIs a group
Figure BDA00023600250000000714
The q-order multiplier subgroup of (1), whose generator is g; alice in group ZqIn the method, an element S is randomly selectedABob in group ZqIn the method, an element S is randomly selectedB(ii) a Alice and Bob calculate separately
Figure BDA00023600250000000715
And
Figure BDA00023600250000000716
and exchange to obtain
Figure BDA00023600250000000717
At GqSelecting an element f to obtain an encrypted public key (g, h, f);
encryption operation: given plaintext m ∈ ZqThe encryption can obtain E (m) (x, y) (g)α,hαfm) Wherein α is at ZqRandom elements selected from (1);
and (3) decryption operation: given the ciphertext, c ═ x, y, Alice and Bob respectively compute and share
Figure BDA00023600250000000718
And
Figure BDA00023600250000000719
can be decrypted to obtain
Figure BDA00023600250000000720
2. Zero coding: suppose that there is a binary string of length k, s ═ s(s)1s2...sk) Wherein s isi(i∈[1,k]) Representing a bit, its zero encoding can be expressed as:
Figure BDA00023600250000000721
Figure BDA00023600250000000722
zero coding plays an important role in digital comparison, and has the following properties: given two binary strings a and b of length k, zero-coding of b if and only if a > b
Figure BDA0002360025000000081
The set contains the prefix of a.
3. Privacy protection prefix detection:
the magnitude relationship of the two numbers can be detected according to the nature of the zero-coding. Suppose Alice has a binary string a ═ akak-1...a1) Bob has a binary string of b ═ bkbk-1...b1) And Alice and Bob can judge whether the zero code of b is the prefix of a through privacy protection prefix detection, so as to judge the size relationship between a and b. The complete process is as follows:
1) bob calculates the zero code of b according to the character string b to obtain the code containing kjSet of individual elements
Figure BDA0002360025000000082
Figure BDA0002360025000000083
Setting a binary representation of one of the elements to be measured as
Figure BDA0002360025000000084
Length of it
Figure BDA0002360025000000085
2) Alice calculates the longest prefix a 'of a using a zero-coding algorithm, and the length is | a' | ═ JaAnd in ZqIn randomly selecting two elements r0、r1Constructing a 2 xK matrix
Figure BDA0002360025000000086
Wherein each element of Z is as follows:
when k is more than or equal to i and more than or equal to JaAnd a isiWhen the content is equal to 0, the content,
Figure BDA0002360025000000087
when k is more than or equal to i and more than or equal to JaAnd a isiWhen the number is equal to 1, the alloy is put into a container,
Figure BDA0002360025000000088
when J isaWhen i is more than or equal to 1 and more than or equal to-1,
Figure BDA0002360025000000089
alice sends the matrix Z to Bob;
3) bob is based on the matrix Z,
Figure BDA00023600250000000810
Computing
Figure BDA00023600250000000811
Then Bob and combine yjSending the data to Alice;
4) alice and Bob will be yjDecryption is performed if D (y)j) 1, then
Figure BDA00023600250000000812
Is a prefix of a, and can be deduced as a > b.
4. Secret sharing: secret sharing is generally divided into two parts, sharing and reconstructing. The sharing is to decompose the secret into several shares, and the reconstruction is to recombine the several shares into the secret. The (n, t) secret sharing means that the secret is divided into n shares, any t +1 shares can be used for reconstructing the secret, and the secret cannot be reconstructed if the shares are less than or equal to t. In the invention, a secret sharing mechanism of bit sharing is used, namely, an integer of k bits is shared into k shares, and each share has one bit.
It should be understood that the above-described embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. And are neither required nor exhaustive of all embodiments. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the claims of the present invention.

Claims (3)

1. A block chain-based safe two-direction quantity advantage comparison method is characterized by comprising the following steps:
s1, assuming that Alice holds vector A ═ a1...an]Bob holds a vector B ═ B1...bn]Each element may be represented as a K-bit integer;
s2, key agreement: alice and Bob communicate to negotiate parameters p, q required for ELGamal encryption, each in group ZqIn the random element SA、SBAnd calculate
Figure FDA0002360024990000011
To obtain
Figure FDA0002360024990000012
At GqSelecting f as element, using h, f and group GqThe generator g constructs an encryption key (g, h, f); wherein p and q are two large prime numbers, and satisfy the condition that p is 2q +1, GqIs a group
Figure FDA0002360024990000013
The q-order multiplier subgroup of (1), whose generator is g;
s3, secret sharing is carried out on own data by Alice according to bits, and a matrix A is equal to [ a ]1...an]Each element a ofiIs divided into K shares, wherein i is more than or equal to 1 and less than or equal to n, and each share contains an element aiA bit of (a) can be expressed as [ a ]i]p=[[ai1]p[ai2]p...[aik]p]Wherein [ a ]ik]pE {0, 1 }; at the same time, Alice calculates aiOf longest prefix of a'iLength J ofiAnd Alice shares the data JiAnd encryption keys (g, h, f) are uploaded to the blockchain;
s4.Bob calculates the prefix set of each element according to the vector B of the Bob, and for each element BiWhere 1 ≦ i ≦ n, Bob calculates b using a zero-coding algorithmiAll prefixes are obtained to contain KiSet of individual elements
Figure FDA0002360024990000014
Bob will each
Figure FDA0002360024990000015
Bit-wise secret sharing
Figure FDA0002360024990000016
Wherein
Figure FDA0002360024990000017
mjTo represent
Figure FDA0002360024990000018
Then upload the data to the blockchain;
s5, the block chain receives the data uploaded by Alice and Bob, the data and the calculation tasks are distributed to the calculation nodes for calculation, and the encrypted data y is obtained through calculationi,KWherein i is more than or equal to 1 and less than or equal to n;
s6. in step S5, the ith round can obtain yi,KAnd after the last n rounds of calculation are finished, the block chain and the calculation node can obtain Y through communication and calculation1,K·y2,K...·yn,K(x, Y), returning the result Y to Alice and Bob;
s7, according to the requirement of an ELGamal cryptosystem, utilizing S in the step S2 by Alice and BobA、SBAnd x in Y obtained in step S6, respectively
Figure FDA0002360024990000019
And
Figure FDA00023600249900000110
and exchange, then decrypt Y, if the result of decryption
Figure FDA00023600249900000111
Then a > B, i.e. vector a has vector dominance to vector B, otherwise vector a has no vector dominance to vector B.
2. The block chain-based secure two-direction quantity advantage comparison method according to claim 1, wherein the step S5 specifically includes: firstly, a block chain randomly selects 2K computing nodes, and each node acquires aiAnd
Figure FDA0002360024990000021
then the 2K nodes repeat the following operations n times, where i is 1, 2.. n;
s51, responsible for [ a ]i]pNode of (2) from group ZqTwo random numbers are selected
Figure FDA0002360024990000022
And
Figure FDA0002360024990000023
let node hold
Figure FDA0002360024990000024
This bit, i corresponds to the position of the element in A, j corresponds to the number of rounds, l denotes the position in element aiThe position of (1);
when J is 1, it is responsible for the former JiThe nodes of the bits are calculated as follows, wherein l is more than or equal to 1 and less than or equal to K:
if it is
Figure FDA0002360024990000025
Generate vector [ [ z [ i, l, 0 ]]=E(0),
Figure FDA0002360024990000026
If it is
Figure FDA0002360024990000027
Generating vectors
Figure FDA0002360024990000028
Node-generated vector of other bits
Figure FDA0002360024990000029
When J > 1, it is responsible for the first JiThe node of the bit is based on the received yi,j-1The following calculation is carried out, wherein l is more than or equal to 1 and less than or equal to K:
if it is
Figure FDA00023600249900000210
Generating vectors
Figure FDA00023600249900000211
If it is
Figure FDA00023600249900000212
Generating vectors
Figure FDA00023600249900000213
Node-generated vector of other bits
Figure FDA00023600249900000214
S52, responsible for [ a ]i]pThe node(s) sends the calculated vector(s) to the blockchain, which forwards the vector(s) to the corresponding blockchain
Figure FDA00023600249900000215
A node of (2);
s53, is responsible for
Figure FDA00023600249900000216
After receiving the vector, the node selects a certain element in the vector according to own data; let node hold
Figure FDA00023600249900000217
i and j correspond to
Figure FDA00023600249900000218
In the middle position, l, 1 is not less than l but not more than mjIs shown in the element
Figure FDA00023600249900000219
The position of (1); when j is more than or equal to 1 and less than or equal to KiWhen, if
Figure FDA00023600249900000220
Then select z [ i, j, l]=z[i,j,0]If, if
Figure FDA00023600249900000221
Then select z [ i, j, l]=z[i,j,1](ii) a The node communication is calculated to obtain yi,j=z[i,j,mj]·z[i,j,mj-1]...·z[i,j,1]E (0); when (K)iJ is more than or equal to +1) and less than or equal to K, in ZnIn the random selection of element rjCalculating
Figure FDA00023600249900000223
Node then will yi,jReturning to the block chain;
and S54, when j is 2, 3.. K, returning to the step S51 and performing the next round of calculation, and after the K-th round is finished, obtaining the encrypted data y by the node through calculationi,KWherein i is more than or equal to 1 and less than or equal to n.
3. The block chain-based secure two-direction quantity advantage comparison method according to claim 2, wherein the ELGamal encryption framework comprises:
and (3) key generation: p and q are two large prime numbers, and satisfy the condition that p is 2q + 1; gqIs a group
Figure FDA00023600249900000222
The q-order multiplier subgroup of (1), whose generator is g; alice in group ZqIn the method, an element S is randomly selectedABob in group ZqIn the method, an element S is randomly selectedB(ii) a Alice and Bob calculate separately
Figure FDA0002360024990000031
And
Figure FDA0002360024990000032
and exchange to obtain
Figure FDA0002360024990000033
At GqSelecting an element f to obtain an encrypted public key (g, h, f);
encryption operation: given plaintext m ∈ ZqThe encryption can obtain E (m) (x, y) (g)α,hαfm) Wherein α is at ZqRandom elements selected from (1);
and (3) decryption operation: given the ciphertext, c ═ x, y, Alice and Bob respectively compute and share
Figure FDA0002360024990000034
And
Figure FDA0002360024990000035
can be decrypted to obtain
Figure FDA0002360024990000036
CN202010019019.6A 2020-01-08 2020-01-08 Block chain-based safe two-direction quantity advantage comparison method Active CN111277406B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010019019.6A CN111277406B (en) 2020-01-08 2020-01-08 Block chain-based safe two-direction quantity advantage comparison method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010019019.6A CN111277406B (en) 2020-01-08 2020-01-08 Block chain-based safe two-direction quantity advantage comparison method

Publications (2)

Publication Number Publication Date
CN111277406A true CN111277406A (en) 2020-06-12
CN111277406B CN111277406B (en) 2021-09-21

Family

ID=71000092

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010019019.6A Active CN111277406B (en) 2020-01-08 2020-01-08 Block chain-based safe two-direction quantity advantage comparison method

Country Status (1)

Country Link
CN (1) CN111277406B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112328699A (en) * 2020-11-20 2021-02-05 中山大学 Security outsourcing method and system based on block chain fully homomorphic encryption algorithm
CN113792322A (en) * 2021-11-15 2021-12-14 南京可信区块链与算法经济研究院有限公司 Safe two-party comparison method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103248478A (en) * 2013-05-08 2013-08-14 天津大学 Multi-party security agreement based sealed electric auction scheme and verification method
WO2016178655A1 (en) * 2015-05-01 2016-11-10 Hewlett Packard Enterprise Development Lp Secure multi-party information retrieval
US20190155603A1 (en) * 2016-07-27 2019-05-23 Intel Corporation System and method for multiplexing vector compare
CN110071796A (en) * 2018-01-22 2019-07-30 中山大学 A kind of calculation method based on shared secret
CN110299987A (en) * 2019-06-24 2019-10-01 暨南大学 A kind of millionaires' problem solution based on homomorphic cryptography

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103248478A (en) * 2013-05-08 2013-08-14 天津大学 Multi-party security agreement based sealed electric auction scheme and verification method
WO2016178655A1 (en) * 2015-05-01 2016-11-10 Hewlett Packard Enterprise Development Lp Secure multi-party information retrieval
US20190155603A1 (en) * 2016-07-27 2019-05-23 Intel Corporation System and method for multiplexing vector compare
CN110071796A (en) * 2018-01-22 2019-07-30 中山大学 A kind of calculation method based on shared secret
CN110299987A (en) * 2019-06-24 2019-10-01 暨南大学 A kind of millionaires' problem solution based on homomorphic cryptography

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
JIN YUAN ET AL.: "《Secure Computation of the Vector Dominance Problem》", 《INTERNATIONAL CONFERENCE ON INFORMATION SECURITY PRACTICE AND EXPERIENCE》 *
YINGPENG SANG ET AL.: "《An Efficient Protocol for the Problem of Secure Two-party Vector Dominance》", 《SIXTH INTERNATIONAL CONFERENCE ON PARALLEL AND DISTRIBUTED COMPUTING APPLICATION AND TECHNOLOGIES(PDCAT"05)》 *
李顺东等: "《安全向量优势协议及其应用》", 《电子学报》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112328699A (en) * 2020-11-20 2021-02-05 中山大学 Security outsourcing method and system based on block chain fully homomorphic encryption algorithm
CN112328699B (en) * 2020-11-20 2023-07-28 中山大学 Safe wrapping method and system based on fully homomorphic encryption algorithm of blockchain
CN113792322A (en) * 2021-11-15 2021-12-14 南京可信区块链与算法经济研究院有限公司 Safe two-party comparison method and system

Also Published As

Publication number Publication date
CN111277406B (en) 2021-09-21

Similar Documents

Publication Publication Date Title
Bonawitz et al. Practical secure aggregation for privacy-preserving machine learning
Kumar et al. IEHC: An efficient image encryption technique using hybrid chaotic map
CN110795762B (en) Reserved format encryption method based on stream cipher
Jayapandian et al. Secure and efficient online data storage and sharing over cloud environment using probabilistic with homomorphic encryption
CN112769542B (en) Multiplication triple generation method, device, equipment and medium based on elliptic curve
JP2008513811A (en) Calculation conversion method and system
CN111277406B (en) Block chain-based safe two-direction quantity advantage comparison method
CN110175169A (en) A kind of encryption data De-weight method, system and relevant apparatus
CN111222645A (en) Management system and method based on Internet of things block chain quantum algorithm artificial intelligence
Alkhodaidi et al. Scalable shares generation to increase participants of counting-based secret sharing technique
CN116743713B (en) Remote online paperless conference method and device based on Internet of things
Tallapally et al. Competent multi-level encryption methods for implementing cloud security
Cui et al. A new image encryption algorithm based on DNA dynamic encoding and hyper-chaotic system
Hitaswi et al. A bio-inspired model to provide data security in cloud storage
Zhou et al. A survey of security aggregation
CN114398671A (en) Privacy calculation method, system and readable storage medium based on feature engineering IV value
CN113726512A (en) Key generation and distribution method, key generation device, and key management system
Narayana et al. Medical image cryptanalysis using adaptive, lightweight neural network based algorithm for IoT based secured cloud storage
Kuppuswamy et al. Enrichment of security through cryptographic public key algorithm based on block cipher
Al-Attab et al. Lightweight effective encryption algorithm for securing data in cloud computing
Yang et al. Cloud-assisted privacy-preserving classification for IOT applications
Hu et al. The Blockchain-Based Edge Computing Framework for Privacy-Preserving Federated Learning
Wang et al. Public-key encryption based on generalized synchronization of coupled map lattices
Zhao et al. An efficient outsourced oblivious transfer extension protocol and its applications
AlDerai et al. A Study of Image Encryption/Decryption by Using Elliptic Curve Cryptography ECC

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