Summary of the invention
Guarantee that there are hidden danger to solve the personal secrets of the electronic voting based on block chain technology existing for background technique
The problem of, the present invention provides a kind of secret protection electronic voting method and system based on block chain, the method and system
By the different ballot node of setting responsibility, verifying node and supervisory node, pass through setting key and based on homomorphic cryptography and
Zero-knowledge proof realizes that the open and clear and personal secrets of electronic voting guarantee;A kind of secret protection based on block chain
Electronic voting method includes:
It determines voting rule, and multiple ballot nodes is established in block chain according to voting rule and one or more is tested
Demonstrate,prove node;
Ballot key and corresponding homomorphic encryption algorithm are generated according to preset rules;
The ballot key is shared between the multiple ballot node;Each node of the multiple ballot node connects
The ballot of ballot participant is received, and is encrypted according to ballot key pair ballot, encrypted ballot is sent to verifying
Node;
The homomorphic encryption algorithm is supplied to verifying node;The verifying node receives adding for multiple ballot nodes transmissions
Ballot after close, and ballot statistics is carried out according to the homomorphic encryption algorithm and is calculated, obtain encrypted ballot statistical result;
The encrypted ballot statistical result is decrypted according to the corresponding decruption key of the ballot key, is obtained
Ballot statistical result.
Further, the voting rule include vote object, it is each ballot participant ballot quantity, whether can be right
Whether same ballot object is repeatedly voted, allows to waive the right and vote deadline.
Further, multiple ballot node numbers of the foundation are greater than or equal to ballot participant's number;
Each ballot participant is to one node of more options and votes, and corresponding ballot node receives the throwing
The ballot of ticket participant;
The ballot participant not voted within default deadline is considered as abstention, and corresponding ballot node automatically generates
Abstention.
Further, according to corresponding proof rule after voting rule generation homomorphic cryptography;
The verifying node verifies the encrypted ballot that received multiple ballot nodes are sent according to the proof rule
Whether break the rules;
The discarded encrypted ballot to break the rules.
It further, further include supervision node according to the node that voting rule is established in block chain;
It votes described in the supervision node and the multiple ballot nodes sharing key;
The supervision node decrypts the encrypted ballot according to ballot key, screens illegal throw according to default rule
Ticket and corresponding illegal node.
Further, ballot statistical result is subjected to the whole network broadcast in block chain;
All recipient nodes of the whole network execute common recognition algorithm to the ballot statistical result;
After the whole network common recognition verifying, in the block of the ballot statistical result deposit block chain.
A kind of secret protection electronic voting system based on block chain includes: that rule establishes unit and key generation
Unit;
The rule establishes unit for determining voting rule, and is established in block chain according to the voting rule multiple
Ballot node and one or more verifying nodes;
The Key generating unit is used to generate ballot key and corresponding homomorphic encryption algorithm according to preset rules;
The Key generating unit is used to for the ballot key being supplied to each of the multiple ballot node;It is described
Key generating unit is used to the homomorphic encryption algorithm being supplied to verifying node;
Each node of the multiple ballot node receives the ballot of ballot participant, and according to the ballot key pair
Ballot is encrypted, and encrypted ballot is sent to verifying node;
The verifying node receives the encrypted ballot that multiple ballot nodes are sent, and according to the homomorphic encryption algorithm
It carries out ballot statistics to calculate, obtains encrypted ballot statistical result;
The Key generating unit is used for according to the corresponding decruption key of the ballot key to the encrypted ballot
Statistical result is decrypted, and obtains ballot statistical result.
Further, it includes ballot object, each ballot participant that the rule, which establishes the voting rule that unit is established,
Ballot quantity, whether can repeatedly be voted same ballot object, whether allow waive the right and vote deadline.
Further, multiple ballot node numbers that the rule establishes unit foundation are greater than or equal to ballot participant people
Number;
Each ballot participant is to one node of more options and votes, and corresponding ballot node receives the throwing
The ballot of ticket participant;
The ballot participant not voted within default deadline is considered as abstention, and corresponding ballot node automatically generates
Abstention.
Further, the rule is established unit and is advised for corresponding verifying after generating homomorphic cryptography according to voting rule
Then;And the proof rule is supplied to verifying node;
The verifying node verifies the encrypted ballot that received multiple ballot nodes are sent according to the proof rule
Whether break the rules, and the discarded encrypted ballot to break the rules.
Further, it further includes supervision section that the rule, which establishes unit according to the node that voting rule is established in block chain,
Point;
It votes described in the supervision node and the multiple ballot nodes sharing key;
The supervision node decrypts the encrypted ballot according to ballot key, screens illegal throw according to default rule
Ticket and corresponding illegal node.
Further, ballot statistical result is carried out the whole network broadcast by the Key generating unit in block chain;
All recipient nodes of the whole network execute common recognition algorithm to the ballot statistical result;
After the whole network common recognition verifying, in the block of the ballot statistical result deposit block chain.
The invention has the benefit that technical solution of the present invention, gives a kind of secret protection electricity based on block chain
Sub- voting method and system, the method and system pass through the different ballot node of setting responsibility, verifying node and supervision section
Point passes through setting key and is based on homomorphic cryptography and zero-knowledge proof, realizes that the open and clear and personal secrets of electronic voting are protected
Card;The method and system pass through supervisory node and monitor vote information in real time, prevent fallacious message;Each described ballot section
Point is only encryption with the verifying node vote information that communicate, and communicated, therefore for each votes participant, can be with
Realization votes anonymously, and obtains voting results;The method and system are based on block chain technology, according to the disclosure of block chain itself
The transparency and block storage permanently storing property and can not tamper, realize electronic voting fairness guarantee.
Specific embodiment
Exemplary embodiments of the present invention are introduced referring now to the drawings, however, the present invention can use many different shapes
Formula is implemented, and is not limited to the embodiment described herein, and to provide these embodiments be at large and fully disclose
The present invention, and the scope of the present invention is sufficiently conveyed to person of ordinary skill in the field.Show for what is be illustrated in the accompanying drawings
Term in example property embodiment is not limitation of the invention.In the accompanying drawings, identical cells/elements use identical attached
Icon note.
Unless otherwise indicated, term (including scientific and technical terminology) used herein has person of ordinary skill in the field
It is common to understand meaning.Further it will be understood that with the term that usually used dictionary limits, should be understood as and its
The context of related fields has consistent meaning, and is not construed as Utopian or too formal meaning.
Fig. 1 is a kind of process of secret protection electronic voting method based on block chain of the specific embodiment of the invention
Figure;As shown in Figure 1, which comprises
Step 110, it determines voting rule, and establishes multiple ballot nodes and one in block chain according to voting rule
Or multiple verifying nodes;
The determining voting rule, including determine ballot object, it is each ballot participant ballot quantity, whether can be right
Whether same ballot object is repeatedly voted, allows to waive the right and vote deadline.
Before executing ballot, need first to determine specific voting rule according to as above rule;The rule is that generation ballot is close
The basis of key and homomorphic encryption algorithm, and verifying node according to proof rule judge vote whether illegal premise.
For example, can be by following setting rule: ballot object be the candidate elected if the ballot is poll
The ballot quantity of people, each ballot participant are 1, therefore also with regard to there is no the feelings repeatedly voted same ballot object
Condition allows to waive the right, and deadline is arranged.
Further, the voting rule further include: multiple ballot node numbers of the foundation are greater than or equal to ballot
Participant's number;
Each ballot participant is to one node of more options and votes, and corresponding ballot node receives the throwing
The ballot of ticket participant;
The ballot participant not voted within default deadline is considered as abstention, and corresponding ballot node automatically generates
Abstention.
Step 120, ballot key and corresponding homomorphic encryption algorithm are generated according to preset rules;
It in order to guarantee the communication security of vote information, and avoids seeing vote information in plain text in verifying node, by pre-
If rule generates ballot key, the ballot key can be the single key generated under symmetric encipherment algorithm, be also possible to non-
The a pair of secret keys generated under symmetric encipherment algorithm;
It is corresponding with the ballot key, generate the homomorphic encryption algorithm for ballot key, the homomorphic encryption algorithm
Any number of additions and multiplications can be carried out on the encrypted data, so that the above-mentioned operation institute carried out to encryption data
Obtained result and the data to encrypted area carry out same operation, and to re-encrypt obtained ciphertext consistent.
Pass through obtain homomorphic encryption algorithm, so that it may realize the verifying node do not know vote key under the premise of, according to
Old realize calculates the statistics of voting results.
Step 130, the ballot key is shared between the multiple ballot node;The multiple each of node that vote
A node receives the ballot of ballot participant, and is encrypted according to ballot key pair ballot, and encrypted ballot is sent out
It send to verifying node;
The ballot key for each ballot node be it is identical, each ballot node using it is identical ballot it is close
Key encrypts its voting results, and this guarantees verifying nodes to carry out having for voting results statistics using homomorphic encryption algorithm
Effect property.
Step 140, the homomorphic encryption algorithm is supplied to verifying node;The verifying node receives multiple ballot nodes
The encrypted ballot sent, and ballot statistics is carried out according to the homomorphic encryption algorithm and is calculated, obtain encrypted ballot system
Count result;
Because of the characteristic of homomorphic encryption algorithm, the encrypted ballot statistical result obtained that calculates is the equal of practical throwing
Ticket statistical result obtains encrypted result by ballot key encryption.
Further, before counting calculated result, the verifying node is also used to verify whether ballot breaks the rules:
According to corresponding proof rule after voting rule generation homomorphic cryptography;
The verifying node verifies the encrypted ballot that received multiple ballot nodes are sent according to the proof rule
Whether break the rules;The discarded encrypted ballot to break the rules.
Step 150, the encrypted ballot statistical result is carried out according to the corresponding decruption key of the ballot key
Decryption obtains ballot statistical result.
The movement that ballot statistical result is decrypted after described pair of encryption, can be in the node of any existing ballot key
It completes, is such as completed in specified ballot node;It, can Xiang Suoyou after the verifying node obtains encrypted ballot statistical result
As a result, the ballot node for statistical result of voting after receiving the encryption, can vote key according to it described in node of voting returns
It is decrypted, checks the plaintext of final ballot statistical result.
Further, ballot statistical result is subjected to the whole network broadcast in block chain;All recipient nodes of the whole network are to described
Statistical result of voting executes common recognition algorithm;After the whole network common recognition verifying, the block of the ballot statistical result deposit block chain
In.
Further, in order to guarantee the fairness of voting process, the node established in block chain according to voting rule is also
Including supervising node;
Vote information of the supervision node for real time inspection voting process and each ballot node, therefore the supervision saves
Point should have highest permission, i.e., key of voting described in the described supervision node and the multiple ballot nodes sharing;
The supervision node decrypts the encrypted ballot according to ballot key, screens illegal throw according to default rule
Ticket and corresponding illegal node.
Fig. 2 is a kind of structure of secret protection electronic voting system based on block chain of the specific embodiment of the invention
Figure;As shown in Fig. 2, the system comprises:
Rule establishes unit 210 and Key generating unit 220;
The rule establishes unit 210 for determining voting rule, and built-in in block chain 230 according to the voting rule
Found multiple ballot nodes 231 (the ballot node be multiple, a ballot node 231 is only identified in figure) and one or more
Verify node 232;
The Key generating unit 220 is used to generate ballot key according to preset rules and corresponding homomorphic cryptography is calculated
Method;
The Key generating unit 220 is used to the ballot key being supplied to each of the multiple ballot node 231
It is a;The Key generating unit 220 is used to for the homomorphic encryption algorithm to be supplied to verifying node 232;
Each node of the multiple ballot node 231 receives the ballot of ballot participant, and close according to the ballot
Key encrypts ballot, and encrypted ballot is sent to verifying node 232;
The verifying node 232 receives the encrypted ballot that multiple ballot nodes 231 are sent, and is added according to the homomorphism
Close algorithm carries out ballot statistics and calculates, and obtains encrypted ballot statistical result;
The Key generating unit 220 is used for according to the corresponding decruption key of the ballot key to the encrypted throwing
Ticket statistical result is decrypted, and obtains ballot statistical result.
Further, it includes ballot object, each ballot participation that the rule, which establishes the voting rule that unit 210 is established,
Whether whether the ballot quantity of person can repeatedly vote to same ballot object, allow to waive the right and vote deadline.
Further, 231 numbers of multiple ballot nodes that the rule establishes the foundation of unit 210 are greater than or equal to ballot ginseng
With person's number;
Each ballot participant is to one node of more options and votes, and corresponding ballot node 231 receives institute
State the ballot of ballot participant;
The ballot participant not voted within default deadline is considered as abstention, and corresponding ballot node 231 is automatic
Generate abstention.
Further, the rule establishes unit 210 for according to corresponding verifying after voting rule generation homomorphic cryptography
Rule;And the proof rule is supplied to verifying node 232;
After the verifying node 232 verifies the encryption that received multiple ballot nodes 231 are sent according to the proof rule
Ballot whether break the rules, and the encrypted ballot to break the rules.
Further, the rule establishes unit 210 according to the node that voting rule is established in block chain 230 and further includes
Supervise node;
The supervision node and the multiple ballot node 231 share the ballot key;
The supervision node decrypts the encrypted ballot according to ballot key, screens illegal throw according to default rule
Ticket and corresponding illegal node.
Further, ballot statistical result is carried out the whole network broadcast by the Key generating unit 220 in block chain 230;
All recipient nodes of the whole network execute common recognition algorithm to the ballot statistical result;
After the whole network common recognition verifying, in the block of the ballot statistical result deposit block chain 230.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the disclosure
Example can be practiced without these specific details.In some instances, well known method, structure is not been shown in detail
And technology, so as not to obscure the understanding of this specification.
Those skilled in the art will understand that can be carried out adaptively to the module in the equipment in embodiment
Change and they are arranged in one or more devices different from this embodiment.It can be the module or list in embodiment
Member or component are combined into a module or unit or component, and furthermore they can be divided into multiple submodule or subelement or
Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it can use any
Combination is to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so disclosed
All process or units of what method or apparatus are combined.Unless expressly stated otherwise, this specification is (including adjoint power
Benefit require, abstract and attached drawing) disclosed in each feature can carry out generation with an alternative feature that provides the same, equivalent, or similar purpose
It replaces.The step of being related in this specification, which numbers, is only used for distinguishing each step, and the time being not limited between each step
Or the relationship of logic, restriction unless the context clearly, otherwise the relationship between each step includes the case where various possible.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments
In included certain features rather than other feature, but the combination of the feature of different embodiments means to be in the disclosure
Within the scope of and form different embodiments.For example, embodiment claimed in detail in the claims is one of any
Can in any combination mode come using.
The various component embodiments of the disclosure can be implemented in hardware, or to run on one or more processors
Software module realize, or be implemented in a combination thereof.The disclosure is also implemented as executing side as described herein
The some or all equipment or system program (for example, computer program and computer program product) of method.It is such
It realizes that the program of the disclosure can store on a computer-readable medium, or can have the shape of one or more signal
Formula.Such signal can be downloaded from an internet website to obtain, and perhaps be provided on the carrier signal or with any other shape
Formula provides.
The disclosure is limited it should be noted that above-described embodiment illustrates rather than the disclosure, and ability
Field technique personnel can be designed alternative embodiment without departing from the scope of the appended claims.Word "comprising" is not arranged
Except there are element or steps not listed in the claims.Word "a" or "an" located in front of the element does not exclude the presence of more
A such element.The disclosure can be by means of including the hardware of several different elements and by means of properly programmed calculating
Machine is realized.If several in these systems can be by same in the unit claim for listing dry systems
Hardware branch embodies.
The above is only the specific embodiment of the disclosure, it is noted that for the ordinary skill people of this field
Member for, do not depart from the disclosure spirit under the premise of, can make several improvements, modify and deform, these improve, modification,
It is regarded as falling within the scope of protection of this application with deformation.