-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust format of encrypted vote #42
Comments
Currently, the encoded vote is printed as JSON and then hashed which might be inconsistent because the first step could introduce formatting information and that would interfere with hashing. It is more desirable to directly hash the byte tree. |
Here is some python code, that would print the suggested value, where print("encrypted vote binary:")
enc_vote = ByteTree([ByteTree(first), ByteTree(second)]).to_byte_array()
pprint(enc_vote)
print("hash to sign:")
vote_hash = sha256(enc_vote).hexdigest()
print(vote_hash)
print("encrypted vote to submit:")
print(base64.b64encode(enc_vote).decode("ascii")) Once received on the back-end, after base64 decoding the byte tree would have to be destructed to get back |
That is helpful. I can make the changes in the |
This should happen on the client side. |
The verified and unverified back-ends need to accept vote submissions in the same format. A submission from the client is a json object with the keys
vote
andsignature
.The suggestion is to change the content of the
signature
field and the signed content to be based on the (binary) verificatum byte tree representation of the encrypted vote.This representation is more compact (than its current json serialisation) and independent of any other than the Javascript byte tree implementation.
The hash that is signed should be the hash of the of the binary byte tree.
The
vote
field should contain a base64 encoding of the binary byte tree.The text was updated successfully, but these errors were encountered: