Giter Site home page Giter Site logo

internet-voting's People

Contributors

sirex avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

iakovleva

internet-voting's Issues

Mix-net node deamon

For this, I think you can use aiohttp it seems to fit our needs as a mix-net node very well.

For this task just create simplest possible server implementation, that outputs It works! on each request to /.

Ability to publish public key for observer

As an observer I would like to be able to publish my public key in order to be able to participate in mixnet (all participants should be reliable in mixnet).

Technical details:
use python-cryto module (not shell sshkey-gen).

Generate and serialize private and public keys

Generate primary and public keys and return serialized values of these keys.

For this we need a wrapper functions with following API:

serialized_private_key, serialized_public_key = generate(password)
primary_key = load_private_key(serialized_private_key, password)
public_key = load_public_key(serialized_public_key)

serialization.Encoding.DER serialization encoding should be used. And for the encoding use serialization.PrivateFormat.PKCS8 for private key and serialization.PublicFormat.SubjectPublicKeyInfo for public key.

See: https://cryptography.io/en/latest/hazmat/primitives/asymmetric/rsa/

Public key fingerprint

Use this:

encoding = serialization.Encoding.DER
format = serialization.PublicFormat.SubjectPublicKeyInfo
public_key_bytes = public_key.public_bytes(encoding, format)
fingerprint = hashlib.sha1(public_key_bytes).hexdigest()

Command line voting client argument parser

First, you need to create setup.py file for internet voting library. This repository will be used for library purposes, together with basic command line client. So thing about this repository more like a library rather than command line client.

For command line script use console scripts entry point.

Use Python 3.

For command line script arguments use argparse.

Basically what you need to do is this:

$ voter <id> <subcommand>[ <arguments>]

For example:

$ voter 1 register
{'id': '1', 'command': 'register', 'args': []}

$ voter 1 verify voters
{'id': '1', 'command': 'verify voters', 'args': []}

$ voter 1 vote
{'id': '1', 'command': 'vote', 'args': []}

$ voter 1 verify my vote
{'id': '1', 'command': 'verify my vote', 'args': []}

$ voter 1 verify all votes
{'id': '1', 'command': 'verify all votes', 'args': []}

$ voter 1 count votes
{'id': '1', 'command': 'count votes', 'args': []}

As you see, subcommand can have more than one word, also there should be fixed list of known commands if an unknown command will be entered, show error message.

I would suggest to pop arguments and take voter id and subcommand and then pass arguments of subcommand to be process using argparse.

Incremental signing

There are several places, where CEC has to sign something. For this, we need a function that can incrementally sign data stream.

Function signature could look something like this:

for hash, signature in sign(data, state):
    pass

Here hash is SHA-1 hash, signature is a hash of hash signature made with CEC private key. hash and signature both have to be incremental, meaning that if you will hash all data you will get hash from the last sign call with last passed data.

data is an iterable of strings.

state is an optional argument and if state is given, then it should continue hashing from where it left. I'm not sure how to implement this, if will have to find-out it yourself. But the idea, that it should be enough to hash only new items, not everything from the beginning.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.