Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/frankhereford/encryption-demo
dual custody asymmetric homomorphic encryption
https://github.com/frankhereford/encryption-demo
Last synced: about 1 month ago
JSON representation
dual custody asymmetric homomorphic encryption
- Host: GitHub
- URL: https://github.com/frankhereford/encryption-demo
- Owner: frankhereford
- Created: 2023-09-19T23:14:38.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-09T01:52:38.000Z (11 months ago)
- Last Synced: 2024-11-09T06:40:29.505Z (3 months ago)
- Language: Python
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dual-custody Asymmetric Homomorphic Encryption
## Table of Contents
- [Dual-custody Asymmetric Homomorphic Encryption](#encryption-demo-dual-custody-asymmetric-homomorphic-encryption)
- [Table of Contents](#table-of-contents)
- [Overview](#overview)
- [How It Works](#how-it-works)
- [Key Generation](#key-generation)
- [Voting](#voting)
- [Tallying](#tallying)
- [Revealing Results](#revealing-results)
- [Getting Started](#getting-started)
- [Giving the demo](#giving-the-demo)
- [Voting](#voting-1)
- [Requirements and Parameters](#requirements-and-parameters)
- [Tech Stack](#tech-stack)
- [FAQ](#faq)## Overview
This demo provides a simplified example of a secure voting system that incorporates dual-custody asymmetric homomorphic encryption. It aims to demonstrate that a fair and verifiable election can be conducted even when the involved parties do not fully trust each other.## How It Works
### Key Generation
- Script: `1_key_generation.py`
- Generates a pair of public and private keys using Paillier encryption.
- The private key is divided into two parts: one for Alice and one for Bob.
### Voting
- Script: `2_voting.py`
- Voters can cast their votes for either Alice or Bob.
- Each vote is encrypted using the public key generated during key generation.
- Encrypted votes are saved as .json files and hashed for verification.### Tallying
- Script: `3_tally_the_results.py`
- Aggregates the encrypted votes.
- The poll conductor can tally the votes without revealing (to themselves!) the actual votes cast.### Revealing Results
- Script: `4_reveal_results.py`
- Both Alice's and Bob's partial keys are needed to decrypt the final tally.
- The final tally is revealed only when both parties agree to decrypt it.## Getting Started
### Giving the demoTo give the demo:
```
docker compose run demo
```### Voting
```
docker run -it frankinaustin/dev-sync-demo:latest
```
## Requirements and Parameters
- Alice and Bob do not trust each other but can cooperate for a fair election.
- Voters should be able to verify that their vote is counted and remains private.
- The poll conductor can aggregate the encrypted votes but cannot see the actual results.
- Decryption and result revelation require the consent of both Alice and Bob.## Tech Stack
- Python 3.x
- Docker
- Paillier Cryptosystem
- SHA-1 Hashing## FAQ
Q: Can the person conducting the poll see individual votes?
A: No, they can only see the encrypted votes.Q: What happens if one of the parties refuses to reveal their part of the private key?
A: The results cannot be decrypted and will therefore not be revealed.