Secure Distributed Paillier Key Generation with Application to the Ordinos E-Voting System
Total Page:16
File Type:pdf, Size:1020Kb
Institute of Information Security University of Stuttgart Universitätsstraße 38 D–70569 Stuttgart Masterarbeit Secure Distributed Paillier Key Generation with Application to the Ordinos E-Voting System Felix Truger Course of Study: Informatik Examiner: Prof. Dr. rer. nat. Ralf Küsters Supervisor: Julian Liedtke, M.Sc. Commenced: November 5, 2019 Completed: June 30, 2020 Abstract Ordinos is a novel verifiable tally-hiding e-voting system. At its heart, a homomorphic encryption scheme and secure multi-party computation (MPC) are used to tally votes and securely determine the voting result, without necessarily revealing the full tally (e.g., the number of votes per candidate). The proof of concept implementation of Ordinos is based on a threshold variant of the Paillier encryption scheme and two MPC protocols for the comparison of encrypted numbers (greater-than and equality). Due to the threshold construction, the decryption key is shared among a set of trustees. The MPC protocols for comparison require precomputed encrypted randomness of certain shape. Formerly, a trusted party was employed to generate the key shares and randomness and distribute them to the trustees. In this thesis, the trusted party was replaced by MPC protocols that allow to generate the key shares and randomness among the trustees. The protocols provide security against malicious parties in the honest-majority setting. The key generation follows a proposal by Nishide and Sakurai (2010) that is based on verifiable secret sharings and zero-knowledge proofs for committed values. We introduce a few adaptations to reduce its runtime using mostly standard techniques. The generation of randomness is based on the Paillier encryption scheme as an arithmetic black box and standard zero-knowledge proofs for Paillier encrypted values. The protocols were implemented and their performance was evaluated in a local network. Most notably, the implemented key generation protocol for threshold Paillier showed an expected average runtime around 95 minutes for generating 2048-bit keys among 3 trustees with a threshold of 2. Since existing implementations provide security only in the semi-honest setting, this is the first time that an approach with security against malicious parties was implemented and evaluated. Overall, the distributed generation of both key shares and randomness takes considerably more time compared to the use of a trusted party, but avoids security risks and trust problems that occur with trusted parties. Zusammenfassung Ordinos ist ein neuartiges verifizierbares E-Voting System mit der sogenannten Tally-Hiding- Eigenschaft. Im Kern werden ein homomorphes Verschlüsselungsschema und sichere Multi-Party Computations (MPC) verwendet, um Stimmen zu zählen und das Ergebnis einer Abstimmung zu bestimmen, ohne notwendigerweise das vollständige Auszählungsergebnis (z. B. die Anzahl der Stimmen je Kandidat) preiszugeben. Die Proof of Concept Implementierung von Ordinos basiert auf einer Threshold-Variante des Paillier-Verschlüsselungsschemas und zwei MPC-Protokollen für den Vergleich von verschlüsselten Zahlen (größer-als und Gleichheit). Aufgrund der Threshold-Variante wird der private Schlüssel unter mehreren Trustees verteilt aufbewahrt (engl.: sharing). Die MPC-Protokolle für die Vergleiche erfordern vorberechnete verschlüsselte Zufallszahlen bestimmter Form. Bisher wurde eine Trusted Third Party eingesetzt, um die Schlüssel-Shares und Zufallszahlen zu generieren und an die Trustees zu verteilen. In dieser Arbeit wurde die Trusted Third Party durch MPC-Protokolle ersetzt mit denen die Schlüssel-Shares und Zufallszahlen unter den Trustees generiert werden. Die Protokolle bieten Sicherheit gegen aktive Angreifer im Honest-Majority Szenario. Die Schlüsselgenerierung basiert auf einem Paper von Nishide and Sakurai (2010), wobei hierzu verifizierbare Secret-Sharings und Zero-Knowledge Beweise für Commitments eingesetzt werden. Um die Laufzeit zu reduzieren, werden einige Anpassungen vorgestellt, die sich überwiegend an Standardtechniken orientieren. Die Generierung der Zufallszahlen basiert auf dem 3 Paillier-Verschlüsselungsschema als arithmetische Black Box und Zero-Knowledge Beweisen für Paillier-Chiffren. Die Protokolle wurden implementiert und ihre Performance in einem lokalen Netzwerk evaluiert. Hervorzuheben ist, dass die implementierte Schlüsselgenerierung eine zu erwartende durchschnittliche Laufzeit von etwa 95 Minuten zwischen 3 Trustees mit einen Threshold von 2 und der Schlüssellänge 2048 Bit benötigt. Bestehende Implementierungen bieten Sicherheit gegen passive Angreifer. Somit setzt diese Arbeit zum ersten Mal ein Ansatz mit Sicherheit gegen aktive Angreifer um und evaluiert diesen. Insgesamt benötigt die verteilte Generierung der Schlüssel-Shares und Zufallszahlen zwar erheblich mehr Zeit verglichen zum Einsatz einer Trusted Third Party, vermeidet aber Sicherheitsrisiken und Vertrauensprobleme, die mit solchen auftreten. 4 Contents 1 Introduction 11 2 Fundamentals 15 2.1 Public-Key Encryption Schemes.......................... 15 2.2 The Paillier Encryption Scheme.......................... 16 2.2.1 Prerequisites................................ 16 Z∗ 2.2.2 The Group n2 ............................... 16 2.2.3 Definition of Paillier’s Encryption Scheme................ 18 2.2.4 Homomorphicity.............................. 19 2.3 Threshold Public-Key Encryption......................... 20 2.4 Building blocks................................... 21 2.4.1 Secret Sharing............................... 21 2.4.2 Lagrange Interpolation........................... 22 2.4.3 Commitment Schemes........................... 22 2.4.4 Verifiable Secret Sharing.......................... 24 2.4.5 Zero-Knowledge Proofs.......................... 25 2.4.6 Random Oracle Model........................... 31 2.4.7 Non-Interactive Zero-Knowledge Proofs.................. 31 3 Related Work 33 4 Secure Distributed Paillier Key Generation 35 4.1 Local Key Generation................................ 35 4.2 Distributed Key Generation with Semi-Honest Security.............. 36 4.2.1 Overview.................................. 36 4.2.2 Biprimality Test.............................. 37 4.2.3 Efficiency.................................. 39 4.2.4 Security................................... 40 4.3 Robust Distributed Key Generation......................... 40 4.3.1 Instantiation of the Pedersen Commitment Scheme............ 40 4.3.2 Robust Modulus Generation........................ 41 4.3.3 Robust Biprimality Test.......................... 42 4.3.4 Robust Sharing of the Secret Key..................... 43 4.3.5 Verifiable Shared Decryption........................ 45 5 Implementation 47 5.1 Adaptations..................................... 47 5.1.1 Omitting Distributed Trial Division.................... 47 5.1.2 Bulk Generation of Candidates....................... 47 5.1.3 Switching Pedersen Commitment Schemes................ 48 5 5.1.4 Postponement of Proofs During Modulus Generation........... 50 5.1.5 Postponement of Proofs in Biprimality Tests................ 52 5.2 Evaluation...................................... 52 5.2.1 Parameters................................. 52 5.2.2 Performance................................ 53 5.3 Comparison of Results for Semi-Honest Protocol................. 60 6 Generation of Randomness for MPC Protocols 63 6.1 Comparing Encrypted Numbers.......................... 64 6.1.1 Equality of Encrypted Numbers...................... 64 6.1.2 Greater-Than Comparison of Encrypted Numbers............. 65 6.2 Paillier as an ABB................................. 66 6.3 Securely Generating Randomness......................... 68 6.3.1 Composing Random l-bit Values...................... 69 6.3.2 Generating Randomness in ZN ....................... 71 6.3.3 Inverting a Random Secret......................... 71 6.4 Implementation & Evaluation............................ 71 7 Conclusion 75 Bibliography 77 A ZK-Proof of Equality of Commitments 81 B Computing the Coefficients of Pl¹xº 83 6 List of Figures κ 2.1 πdlog: Zero-knowledge proof of knowledge of discrete logarithm......... 26 2.2 πrange: Zero-knowledge range proof for committed value............. 27 2.3 πmrel: Zero-knowledge proof of multiplicative relation............... 28 2.4 πVKeq: Zero-knowledge proof for verification keys................. 29 2.5 πpartDec: Zero-knowledge proof for partial decryption shares........... 30 2.6 πcomEq: Zero-knowledge of equality of committed values............. 31 5.1 Average, minimum, and maximum runtime of semi-honest protocol version for 2048-bit moduli and bulk sizes b = 1 to 100 000 .................. 54 5.2 Average, minimum, and maximum runtime of semi-honest protocol version for 2048-bit moduli and bulk sizes b = 1 000 to 10 000 ................ 55 5.3 Average, minimum, and maximum runtime of robust protocol version for 512-bit moduli and bulk sizes b = 1 to 10 000 ....................... 56 5.4 Average, minimum, and maximum runtime of robust protocol version for 512-bit moduli and bulk sizes b = 1 to 10 000 with switching of commitment scheme.. 57 5.5 Measured runtime of robust protocol version for 2048-bit moduli......... 60 5.6 Observed number of failed trial divisions in runs of robust protocol version for 2048-bit moduli................................... 61 5.7 Observed number of failed biprimality tests in runs of robust protocol version for 2048-bit moduli................................... 61 5.8 Distribution of average runtime on different sub-protocols............. 62 κ