Disclosure of Invention
In order to solve the problem that hidden danger exists in the privacy security guarantee of electronic voting based on a block chain technology in the background art, the invention provides a block chain-based privacy protection electronic voting method and system, wherein the method and system realize the public transparency and privacy security guarantee of the electronic voting by setting voting nodes, verification nodes and supervision nodes with different responsibilities, setting keys and based on homomorphic encryption and zero-knowledge proof; the privacy protection electronic voting method based on the block chain comprises the following steps:
determining a voting rule, and establishing a plurality of voting nodes and one or more verification nodes in the block chain according to the voting rule;
generating a voting key and a corresponding homomorphic encryption algorithm according to a preset rule;
sharing the voting key among the plurality of voting nodes; each node of the plurality of voting nodes receives the votes of the voting participants, encrypts the votes according to the voting keys and sends the encrypted votes to the verification node;
providing the homomorphic encryption algorithm to a verification node; the verification node receives the encrypted votes sent by the plurality of voting nodes, and performs voting statistical calculation according to the homomorphic encryption algorithm to obtain an encrypted voting statistical result;
and decrypting the encrypted voting statistical result according to a decryption key corresponding to the voting key to obtain the voting statistical result.
Further, the voting rules include a voting object, the number of votes by each voting participant, whether multiple votes can be cast against the same voting object, whether disclaimer is allowed, and a voting deadline.
Further, the number of the established voting nodes is greater than or equal to the number of voting participants;
each voting participant selects at most one node and votes, and the corresponding voting node receives the vote of the voting participant;
and the voting participants who do not vote within the preset deadline are regarded as the abstinence, and the corresponding voting nodes automatically generate the abstinence tickets.
Further, generating a corresponding verification rule after homomorphic encryption according to the voting rule;
the verifying node verifies whether the received encrypted votes sent by the voting nodes violate rules or not according to the verifying rules;
discarding the encrypted vote violating the rule.
Further, the nodes established in the blockchain according to the voting rules further comprise a supervision node;
the supervising node shares the voting key with the plurality of voting nodes;
and the supervision node decrypts the encrypted votes according to the voting key and screens illegal votes and corresponding illegal nodes according to a preset rule.
Further, the voting statistical result is broadcasted in the block chain in the whole network;
all receiving nodes of the whole network execute a consensus algorithm on the voting statistical result;
and after the global network consensus verification is passed, storing the voting statistical result into a block of a block chain.
The privacy protection electronic voting system based on the block chain comprises: a rule establishing unit and a key generating unit;
the rule establishing unit is used for determining a voting rule and establishing a plurality of voting nodes and one or more verification nodes in a block chain according to the voting rule;
the key generation unit is used for generating a voting key and a corresponding homomorphic encryption algorithm according to a preset rule;
the key generation unit is used for providing the voting key to each of the plurality of voting nodes; the key generation unit is used for providing the homomorphic encryption algorithm to a verification node;
each node of the plurality of voting nodes receives the votes of the voting participants, encrypts the votes according to the voting keys and sends the encrypted votes to the verification node;
the verification node receives the encrypted votes sent by the plurality of voting nodes, and performs voting statistical calculation according to the homomorphic encryption algorithm to obtain an encrypted voting statistical result;
the key generation unit is used for decrypting the encrypted voting statistic result according to a decryption key corresponding to the voting key to obtain the voting statistic result.
Further, the voting rule established by the rule establishing unit includes a voting object, the number of votes of each voting participant, whether a plurality of votes can be cast for the same voting object, whether disclaimer is allowed, and a voting deadline.
Further, the number of the plurality of voting nodes established by the rule establishing unit is greater than or equal to the number of voting participants;
each voting participant selects at most one node and votes, and the corresponding voting node receives the vote of the voting participant;
and the voting participants who do not vote within the preset deadline are regarded as the abstinence, and the corresponding voting nodes automatically generate the abstinence tickets.
Further, the rule establishing unit is configured to generate a corresponding validation rule after homomorphic encryption according to the voting rule; and providing the validation rules to a validation node;
and the verification node verifies whether the received encrypted votes sent by the plurality of voting nodes violate the rules according to the verification rules, and discards the encrypted votes violating the rules.
Further, the nodes established by the rule establishing unit in the blockchain according to the voting rules further comprise a supervision node;
the supervising node shares the voting key with the plurality of voting nodes;
and the supervision node decrypts the encrypted votes according to the voting key and screens illegal votes and corresponding illegal nodes according to a preset rule.
Further, the key generation unit performs whole network broadcasting on the voting statistic result in a block chain;
all receiving nodes of the whole network execute a consensus algorithm on the voting statistical result;
and after the global network consensus verification is passed, storing the voting statistical result into a block of a block chain.
The invention has the beneficial effects that: the technical scheme of the invention provides a block chain-based privacy protection electronic voting method and a block chain-based privacy protection electronic voting system, wherein the method and the system realize the public transparency and privacy security assurance of electronic voting by setting voting nodes, verification nodes and supervision nodes with different responsibilities, setting keys and based on homomorphic encryption and zero-knowledge proof; according to the method and the system, the voting information is monitored by the monitoring node in real time, so that malicious information is prevented; each voting node only communicates with the verification node, and the communicated voting information is encrypted, so that anonymous voting can be realized for each voting participant, and a voting result is obtained; the method and the system are based on the block chain technology, and the fairness guarantee of the electronic voting is realized according to the public transparency of the block chain and the permanent storage property and the non-tamper property of the block storage.
Detailed Description
The exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, however, the present invention may be embodied in many different forms and is not limited to the embodiments described herein, which are provided for complete and complete disclosure of the present invention and to fully convey the scope of the present invention to those skilled in the art. The terminology used in the exemplary embodiments illustrated in the accompanying drawings is not intended to be limiting of the invention. In the drawings, the same units/elements are denoted by the same reference numerals.
Unless otherwise defined, terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. Further, it will be understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and will not be interpreted in an idealized or overly formal sense.
Fig. 1 is a flowchart of a block chain-based privacy protection electronic voting method according to an embodiment of the present invention; as shown in fig. 1, the method includes:
step 110, determining a voting rule, and establishing a plurality of voting nodes and one or more verification nodes in a block chain according to the voting rule;
the determining voting rules comprise determining a voting object, the voting number of each voting participant, whether a plurality of votes can be cast on the same voting object, whether the right to be discarded is allowed and a voting deadline.
Before executing voting, determining a specific voting rule according to the rule; the rule is the basis for generating the voting key and the homomorphic encryption algorithm and is also the premise that the verification node judges whether the voting is illegal according to the verification rule.
For example, if the vote is an election vote, the rule may be set as follows: the voting objects are candidates to be voted, and the voting number of each voting participant is 1, so that the situation that the same voting object is voted for multiple times does not exist, the right is allowed to be abandoned, and the deadline time is set.
Further, the voting rule further includes: the number of the established plurality of voting nodes is more than or equal to the number of voting participants;
each voting participant selects at most one node and votes, and the corresponding voting node receives the vote of the voting participant;
and the voting participants who do not vote within the preset deadline are regarded as the abstinence, and the corresponding voting nodes automatically generate the abstinence tickets.
Step 120, generating a voting key and a corresponding homomorphic encryption algorithm according to a preset rule;
in order to ensure the communication security of the voting information and avoid seeing the plaintext of the voting information at the verification node, a voting key is generated through a preset rule, wherein the voting key can be a single key generated under a symmetric encryption algorithm or a pair of keys generated under an asymmetric encryption algorithm;
and generating a homomorphic encryption algorithm aiming at the voting key corresponding to the voting key, wherein the homomorphic encryption algorithm can perform any number of addition and multiplication operations on the encrypted data, so that the result obtained by performing the operation on the encrypted data is consistent with the ciphertext obtained by performing the same operation on the data in the encryption area and then encrypting the data.
By obtaining the homomorphic encryption algorithm, the verification node can still realize the statistical calculation of the voting result on the premise of not knowing the voting key.
Step 130, sharing the voting key among the plurality of voting nodes; each node of the plurality of voting nodes receives the votes of the voting participants, encrypts the votes according to the voting keys and sends the encrypted votes to the verification node;
the voting key is the same for each voting node, and each voting node encrypts the voting result by using the same voting key, so that the validity of voting result statistics performed by the verification node by using a homomorphic encryption algorithm is also ensured.
Step 140, providing the homomorphic encryption algorithm to a verification node; the verification node receives the encrypted votes sent by the plurality of voting nodes, and performs voting statistical calculation according to the homomorphic encryption algorithm to obtain an encrypted voting statistical result;
due to the characteristic of a homomorphic encryption algorithm, the encrypted voting statistical result obtained by calculation is equivalent to the actual voting statistical result, and the encrypted result is obtained by encrypting the voting key.
Further, before counting the calculation result, the verifying node is further configured to verify whether the vote violates a rule:
generating a corresponding verification rule after homomorphic encryption according to the voting rule;
the verifying node verifies whether the received encrypted votes sent by the voting nodes violate rules or not according to the verifying rules; discarding the encrypted vote violating the rule.
And 150, decrypting the encrypted voting statistical result according to the decryption key corresponding to the voting key to obtain the voting statistical result.
The action of decrypting the encrypted voting statistic result can be completed in any node with the voting key, such as a designated voting node; after the verification node obtains the encrypted voting statistical result, the result is transmitted back to all the voting nodes, and the voting nodes receiving the encrypted voting statistical result can decrypt according to the voting key and check the plaintext of the final voting statistical result.
Further, the voting statistical result is broadcasted in the block chain in the whole network; all receiving nodes of the whole network execute a consensus algorithm on the voting statistical result; and after the global network consensus verification is passed, storing the voting statistical result into a block of a block chain.
Further, in order to ensure the fairness of the voting process, the nodes established in the block chain according to the voting rules also comprise a supervision node;
the supervision node is used for viewing the voting process and the voting information of each voting node in real time, so that the supervision node has the highest authority, namely the supervision node shares the voting key with the plurality of voting nodes;
and the supervision node decrypts the encrypted votes according to the voting key and screens illegal votes and corresponding illegal nodes according to a preset rule.
Fig. 2 is a block diagram of an electronic voting system for privacy protection based on a block chain according to an embodiment of the present invention; as shown in fig. 2, the system includes:
a rule establishing unit 210 and a key generating unit 220;
the rule establishing unit 210 is configured to determine a voting rule, and establish a plurality of voting nodes 231 (a plurality of voting nodes 231 are identified in the figure) and one or more verification nodes 232 in the blockchain 230 according to the voting rule;
the key generation unit 220 is configured to generate a voting key and a corresponding homomorphic encryption algorithm according to a preset rule;
the key generation unit 220 is configured to provide the voting key to each of the plurality of voting nodes 231; the key generation unit 220 is configured to provide the homomorphic encryption algorithm to a verification node 232;
each of the plurality of voting nodes 231 receives the vote of the voting participant, encrypts the vote according to the voting key, and sends the encrypted vote to the verification node 232;
the verification node 232 receives the encrypted votes sent by the plurality of voting nodes 231, and performs voting statistical calculation according to the homomorphic encryption algorithm to obtain an encrypted voting statistical result;
the key generating unit 220 is configured to decrypt the encrypted voting statistic result according to a decryption key corresponding to the voting key, so as to obtain a voting statistic result.
Further, the voting rule established by the rule establishing unit 210 includes a voting object, the number of votes of each voting participant, whether a plurality of votes can be cast for the same voting object, whether disclaimer is allowed, and a voting deadline.
Further, the number of the plurality of voting nodes 231 established by the rule establishing unit 210 is greater than or equal to the number of voting participants;
each voting participant selects at most one node and votes, and the corresponding voting node 231 receives the vote of the voting participant;
voting participants who have not voted within the preset deadline are regarded as absences, and corresponding voting nodes 231 automatically generate absences.
Further, the rule establishing unit 210 is configured to generate a corresponding verification rule after homomorphic encryption according to the voting rule; and provides the validation rules to validation node 232;
the verifying node 232 verifies whether the received encrypted votes sent by the voting nodes 231 violate the rule according to the verification rule, and discards the encrypted votes violating the rule.
Further, the nodes established by the rule establishing unit 210 in the blockchain 230 according to the voting rule further include a supervision node;
the supervising node shares the voting key with the plurality of voting nodes 231;
and the supervision node decrypts the encrypted votes according to the voting key and screens illegal votes and corresponding illegal nodes according to a preset rule.
Further, the key generation unit 220 performs a network-wide broadcast on the voting statistics result in the blockchain 230;
all receiving nodes of the whole network execute a consensus algorithm on the voting statistical result;
after the global consensus is verified, the voting statistics are stored in the blocks of the block chain 230.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the disclosure may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise. Reference to step numbers in this specification is only for distinguishing between steps and is not intended to limit the temporal or logical relationship between steps, which includes all possible scenarios unless the context clearly dictates otherwise.
Moreover, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the disclosure and form different embodiments. For example, any of the embodiments claimed in the claims can be used in any combination.
Various component embodiments of the disclosure may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. The present disclosure may also be embodied as device or system programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present disclosure may be stored on a computer-readable medium or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the disclosure, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The disclosure may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several systems, several of these systems may be embodied by one and the same item of hardware.
The foregoing is directed to embodiments of the present disclosure, and it is noted that numerous improvements, modifications, and variations may be made by those skilled in the art without departing from the spirit of the disclosure, and that such improvements, modifications, and variations are considered to be within the scope of the present disclosure.