Skip to content

Commit

Permalink
Merge pull request #22 from agoravoting/next
Browse files Browse the repository at this point in the history
version 3.3.0
  • Loading branch information
Findeton committed Jul 26, 2016
2 parents 809755f + da81619 commit cc0d8b4
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 59 deletions.
8 changes: 6 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
'use strict';

var pkg = require('./package.json');
var AV_CONFIG_VERSION = '3.2.0';
var AV_CONFIG_VERSION = '3.3.0';

//Using exclusion patterns slows down Grunt significantly
//instead of creating a set of patterns like '**/*.js' and '!**/node_modules/**'
Expand Down Expand Up @@ -81,6 +81,9 @@ module.exports = function (grunt) {

// Project configuration.
grunt.initConfig({
variables: {
elections_html_body_include: ''
},
connect: {
main: {
options: {
Expand Down Expand Up @@ -150,7 +153,7 @@ module.exports = function (grunt) {
htmlmin:'<%= htmlmin.main.options %>'
},
cwd: 'bower_components/avCommon',
src: ["avRegistration/**/*.html", "avUi/**/*.html" ],
src: ["avRegistration/**/*.html", "avUi/**/*.html"],
dest: 'temp/templates-common.js'
}
},
Expand Down Expand Up @@ -208,6 +211,7 @@ module.exports = function (grunt) {
options: {
remove: ['script[data-remove!="false"]','link[data-remove!="false"]'],
append: [
{selector:'body',html:'<%= variables.elections_html_body_include %>'},
{selector:'body',html:'<!--[if lte IE 8]><script src="/election/libcompat-v3.0.1.min.js"></script><![endif]--><!--[if gte IE 9]><script src="/election/libnocompat-v3.0.1.min.js"></script><![endif]--><!--[if !IE]><!--><script src="/election/libnocompat-v3.0.1.min.js"></script><!--<![endif]-->'},
{selector:'body',html:'<!--All the source code of this program under copyright. Take a look at the license details at https://github.com/agoravoting/agora-core-view/blob/master/README.md -->'},
{selector:'body',html:'<script src="/election/lib-v3.0.1.min.js"></script>'},
Expand Down
4 changes: 4 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ angular.module('agora-gui-elections').config(
templateUrl: 'avElection/public-controller/legal.html',
controller: "PublicController"
})
.state('election.public.show.documentation', {
url: '/documentation',
template: '<div class="col-xs-12 top-section" documentation-directive></div>'
})
.state('election.results', {
url: '/:id/results',
templateUrl: 'avElection/results-controller/results-controller.html',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ <h1 class="text-center election-title">{{election.title}}</h1>
</div>
</div>

<div av-admin-foot class="hidden-xs">
<div av-foot class="hidden-xs">
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
</span>
</a>
</li>
<li ng-class="{selected: name().indexOf('legal-terms') !== -1}">
<li ng-class="{selected: name() === 'documentation'}">
<a
ui-sref="election.public.show.legal"
ng-i18next="avElection.legal.title">
ui-sref="election.public.show.documentation"
ng-i18next="avDocumentation.documentation.title">
</a>
</li>
</ul>
16 changes: 8 additions & 8 deletions avElection/public-controller/legal.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<div class="col-xs-12 top-section">
<h2 class="text-center text-av-secondary" ng-i18next="avElection.legal.title"></h2>
<div ng-bind-html="helpInfo">
<div class="text-center">
<!-- Legal info -->
<span ng-if="election.extra_data.legal_name">{{election.extra_data.legal_name}}, </span>
<span ng-if="election.extra_data.legal_org">{{election.extra_data.legal_org}} </span>
<span ng-if="election.extra_data.legal_id">({{election.extra_data.legal_id}}). </span>
<a ng-if="election.extra_data.legal_contact" href="mailto:{{election.extra_data.legal_contact}}" ng-i18next="avElection.legal.contact"></a>
<!-- End legal info -->
</div>
<div>
<!-- Legal terms -->
<span ng-if="election.extra_data.name">{{election.extra_data.name}}, </span>
<span ng-if="election.extra_data.org">{{election.extra_data.org}} </span>
<span ng-if="election.extra_data.nif">({{election.extra_data.nif}}). </span>
<a ng-if="election.extra_data.contact" href="mailto:{{election.extra_data.contact}}" ng-i18next="avElection.legal.contact"></a>
<!-- End legal terms -->
<div ng-bind-html="legal_html_include">
</div>
</div>
29 changes: 15 additions & 14 deletions avElection/public-controller/public-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,29 @@ angular.module('avElection').controller('PublicController',
};
$("#theme").attr("href", "election/themes/" + ConfigService.theme + "/app.min.css");
//window.avThemes.change(ConfigService.theme);

$scope.helpInfo = ConfigService.help.info;
$scope.layout = mapLayouts["simple"];
$scope.statePrefix = "election.public.show.home";
$scope.inside_iframe = InsideIframeService();
$scope.inside_iframe = InsideIframeService();
$scope.legal_html_include = ConfigService.legal_html_include;

// get election config
$http.get(ConfigService.baseUrl + "election/" + $stateParams.id)
.success(function(value) {
$scope.election = value.payload.configuration;
var extra_data = $scope.election.extra_data;
if (extra_data && typeof extra_data === 'string') {
$scope.election.extra_data = JSON.parse(extra_data);
} else {
$scope.election.extra_data = {};
var extra_data = {};
$http.get(ConfigService.authAPI + "legal/" + $stateParams.id + "/")
.then(function(value) {
if(value.data) {
extra_data = value.data;
}
return $http.get(ConfigService.baseUrl + "election/" + $stateParams.id);
})
.then(function(value) {
$scope.election = value.data.payload.configuration;
$scope.election.extra_data = extra_data;
$scope.layout = mapLayouts[$scope.election.layout];
$scope.electionState = value.payload.state;
$scope.results = angular.fromJson(value.payload.results);
$scope.electionState = value.data.payload.state;
$scope.results = angular.fromJson(value.data.payload.results);
})
// on error, like parse error or 404
.error(function (error) {
.catch(function (error) {
$state.go("election.public.error");
});

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "agoraGuiElections",
"version": "3.2.0",
"version": "3.3.0",
"main": "index.html",
"ignore": [
"**/.*",
Expand Down
25 changes: 0 additions & 25 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,31 +34,6 @@
<!-- avCommon -->
<script src="bower_components/avCommon/dist/appCommon-v3.0.1.js" class="app"></script>

<!-- registration -->
<script src="bower_components/avCommon/avRegistration/init.js" class="app"></script>
<script src="bower_components/avCommon/avRegistration/auth-method-service.js" class="app"></script>
<script src="bower_components/avCommon/avRegistration/login-controller/login-controller.js" class="app"></script>
<script src="bower_components/avCommon/avRegistration/login-directive/login-directive.js" class="app"></script>
<script src="bower_components/avCommon/avRegistration/logout-controller/logout-controller.js" class="app"></script>
<script src="bower_components/avCommon/avRegistration/register-controller/register-controller.js" class="app"></script>
<script src="bower_components/avCommon/avRegistration/register-directive/register-directive.js" class="app"></script>
<script src="bower_components/avCommon/avRegistration/validate-controller/validate-controller.js" class="app"></script>
<script src="bower_components/avCommon/avRegistration/validate-directive/validate-directive.js" class="app"></script>
<script src="bower_components/avCommon/avRegistration/patterns-service.js" class="app"></script>
<script src="bower_components/avCommon/avRegistration/field-directive/field-directive.js" class="app"></script>
<script src="bower_components/avCommon/avRegistration/fields/email-field-directive/email-field-directive.js" class="app"></script>
<script src="bower_components/avCommon/avRegistration/fields/password-field-directive/password-field-directive.js" class="app"></script>
<script src="bower_components/avCommon/avRegistration/fields/text-field-directive/text-field-directive.js" class="app"></script>
<script src="bower_components/avCommon/avRegistration/fields/dni-field-directive/dni-field-directive.js" class="app"></script>
<script src="bower_components/avCommon/avRegistration/fields/code-field-directive/code-field-directive.js" class="app"></script>
<script src="bower_components/avCommon/avRegistration/fields/tel-field-directive/tel-field-directive.js" class="app"></script>
<script src="bower_components/avCommon/avRegistration/fields/bool-field-directive/bool-field-directive.js" class="app"></script>
<script src="bower_components/avCommon/avRegistration/fields/int-field-directive/int-field-directive.js" class="app"></script>
<script src="bower_components/avCommon/avRegistration/fields/captcha-field-directive/captcha-field-directive.js" class="app"></script>
<script src="bower_components/avCommon/avRegistration/fields/textarea-field-directive/textarea-field-directive.js" class="app"></script>
<script src="bower_components/avCommon/avRegistration/fields/image-field-directive/image-field-directive.js" class="app"></script>
<script src="bower_components/avCommon/avRegistration/plugins.js" class="app"></script>

<script src="app.js" class="app"></script>

<!-- election -->
Expand Down
2 changes: 1 addition & 1 deletion locales/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"verifiableResultsLink": "Recuento verificable"
},
"legal": {
"title": "Documentación",
"title": "Legal",
"contact": "contacto"
}
}
Expand Down
2 changes: 1 addition & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"verifyText": "<p>In this page we will describe the process through which it is possible to verify that the result of an election is valid. Each voter can verify that his/her cast ballot is included in the tally, and can also verify mathematically the result of the tally.</p><p>\n\n<strong>To perform that verification it is required to have a technical background. If you do not have it, we recommend to execute this verification process with the help of somebody with a technical background.</strong></p><p>\n\nThe first thing you need to verify the tally is to download the &quot;agora-verifier&quot; software. This is the program that performs the needed verifications over an __name__ election. You can download agora-verifier from here:<p>\n\n<p>\n\n<p><a href=\"{{verifier.link}}\" target=\"_blank\">agora-verifier</a><span class=\"special\"> (sha256sum: {{verifier.hash}})</span></p>\n\n<p>or you can <a href=\"https://github.com/agoravoting/agora-verifier\">install it manually from the source code, following the instructions in github</a>.</p><p>\n\nagora-verifier has been tested to work in Linux, and requires:</p>\n<ul>\n<li>A 64 bits Linux Operative System.</li>\n<li>Python 3.3 o later</li>\n<li>Java v7 o later installed.</li>\n<li>uuencode (&quot;sudo apt-get install sharutils&quot; en Debian/Ubuntu).</li>\n</ul>\n\n<p>The file that contains the data of the election, that we usually call \"tally.tar\" is the following one:</p>\n\n<p><a class=\"tally-link\" href=\"{{publicURL}}{{electionId}}/{{electionId}}.tar\" target=\"_blank\">Election tally ({{electionId}}.tar)</a></p>\n\n<p>To verify the tally, you can simply execute:</p>\n\n<p>\n<code>\nsh agora-verifier {{electionId}}.tar\n</code>\n</p>\n\n<p>The output of the that execution will be something similar to the following:</p>\n\n<code>\nsh agora-verifier {{electionId}}.tar<br/><br/>\n\n* extracted to /tmp/tmp9c2r5e3jtally<br/>\n* extracted raw tally to /tmp/tmp9c2r5e3jtally/tally-raw-0<br/>\n* running ['./agora-results', '-t', '/tmp/tmp9c2r5e3jtally/0.tar.gz', '-c', '/tmp/tmp9c2r5e3jtally/config.json', '-s', '-o', 'json']<br/>\n* results hash verification OK<br/>\n* processing /tmp/tmp9c2r5e3jtally/tally-raw-0<br/>\n# Results ##########################################<br/>\ntotal number of votes (including blank/invalid votes): 37<br/>\nQuestion #1: Secretario General<br/>\n<br/>\nnumber of options available: 2<br/>\n<br/>\nRaw winning options (position):<br/>\n...<br/>\n<br/>\n<br/>\n####################################################<br/>\n<br/>\n* verifying proofs of knowledge of the plaintexts...<br/>\n* ..finished. Verified 37 votes (0 invalid)<br/>\n* proofs of knowledge of plaintexts OK (0 invalid)<br/>\n* running './pverify.sh .rnd /tmp/tmp9c2r5e3jtally/tally-raw-0'<br/>\n* initializing random source..Successfully initialized random source!<br/>\n* begin proof verification on '/tmp/tmp9c2r5e3jtally/tally-raw-0'<br/>\n* processing /tmp/tmp9c2r5e3jtally/tally-raw-0/0-089b56b3-3ffc-4f91-ace5-eef571162d8c..<br/>\n*<br/>\n* ============ Read and derive common values. ====================<br/>\n* 150101 18:46:10 Read joint public key... * done.<br/>\n* 150101 18:46:11 Read individual El Gamal public keys... * done.<br/>\n* 150101 18:46:11 Verify relation between public keys... * done.<br/>\n* 150101 18:46:11 Read input ciphertexts... * done.<br/>\n* 150101 18:46:11 Derive independent generators... * done.<br/>\n*<br/>\n* ============ Verify shuffle of Party 1. ========================<br/>\n* 150101 18:46:11 Read output of Party 1... * done.<br/>\n* 150101 18:46:11 Verify proof of shuffle... * done.<br/>\n*<br/>\n* ============ Verify shuffle of Party 2. ========================<br/>\n* 150101 18:46:12 Read output of Party 2... * done.<br/>\n* 150101 18:46:12 Verify proof of shuffle... * done.<br/>\n*<br/>\n* ============ Verify decryption of Party 1. =====================<br/>\n* 150101 18:46:12 Read decryption factors... * done.<br/>\n* 150101 18:46:12 Verify decryption proof... * done.<br/>\n*<br/>\n* ============ Verify decryption of Party 2. =====================<br/>\n* 150101 18:46:13 Read decryption factors... * done.<br/>\n* 150101 18:46:13 Verify decryption proof... * done.<br/>\n*<br/>\n* ============ Verify finalization. ==============================<br/>\n* 150101 18:46:13 Decrypt using verified decryption factors... * done.<br/>\n* 150101 18:46:13 Read and verify plaintexts... * done.<br/>\n*<br/>\n* Verification completed SUCCESSFULLY after 0h 0m 4s.<br/>\n* verification is OK<br/>\n* processing question_dir 0-089b56b3-3ffc-4f91-ace5-eef571162d8c<br/>\n* running '/tmp/tmp.J9d7GWUECw/agora-verifier/vmnc.sh .rnd -plain -outi json proofs/PlaintextElements.bt plaintexts_json2'<br/>\n* initializing random source..Successfully initialized random source!<br/>\n* calling mixnet interface with vmnc .rnd -plain -outi json proofs/PlaintextElements.bt plaintexts_json2..<br/>\n* vmnc call succeeded<br/>\n* plaintexts_json verification OK<br/>\n* running '/tmp/tmp.J9d7GWUECw/agora-verifier/vmnc.sh .rnd -ciphs -ini json ciphertexts_json ciphertexts_raw'<br/>\n* calling mixnet interface with vmnc .rnd -ciphs -ini json ciphertexts_json ciphertexts_raw..<br/>\n* vmnc call succeeded<br/>\n* ciphertexts_json verification OK<br/>\n<br/>\n</code>\n\n<p></p>\n<p>The most important thing is that the command finishes saying &quot;OK&quot;. If there is any failure, the command will not finish saying OK but FAILED. We will now list the steps involved in the verification. For technical reasons the command doesn't follow the exact same order as listed in here, but we still list them this way for clarity:</p>\n<ol>\n<li>Extract the file in a directory whose path is printed in the screen</li><li>\nShow in the screen briefly the most important data of the tally: number of votes and the list of winning options (NOT in order).</li><li>\nRead the result_json file that corresponds with the results of the tally shown in the previous step and hash it.</li><li>\nRead the publick keys with which the ballots where encrypted (file pubkeys_json)</li><li>\nRead the ballots from the file ciphertexts_json and check the validity of the Zero Knownledge Proofs (ZKP) mathematical proofs that prove that the person that encrypted the ballot knew the plain text content of the ballot.</li><li>\nThe next step is to verify some elements from each question. Each question is encrypted separately, and thus the tally and some verifications are made also separately:<ol><li>\nVerify that starting with the ballot of the file &quot;ciphertexts_json&quot; it can be obtained the encrypted ballot in raw format. A hash of both files is made and it is checked that the result is the same. If this verification fails, the script prints on the screen &quot;ciphertexts_json verification FAILED&quot;.</li><li>\nRead the ZKP proofs that mathematically prove that starting with the encrypted ballots of this question, the result is the decrypted ballots in raw format. If these proofs fail, the script prints &quot;verification FAILED&quot;.</li><li>\nVerify that the decrypted ballots in raw format can be converted in the result ballots in text format of the file &quot;plaintexts_json&quot;. A hash of both files is made and it is checked that both match. If this check fails, the script prints &quot;plaintexts_json verification FAILED&quot;.</li>\n</ol><li>\nRead the file that contains the decrypted votes, and calculate the tally of the election from that data.</li><li>\nCheck that the hash of that file matches the hash of result_json obtained in step 3. If the comparison fails, the script prints &quot;tally verification FAILED&quot;.</li>\n</p>\n<p>As can be seen, <strong>it is mathematically and univocally proved</strong> that starting with the encrypted ballots, the election tally is correct. Some questions might be raised: where are all those ballots coming from? is my ballot included?</p><p>\n\nFirst, we have to say that the voting system implies the need of some trust in the organizations running the election, especially it is assumed that no ballot stuffing has not happened. This is a limitation (reflected in the <a href=\"https://agoravoting.com/static/generic_tech_overview_20_08_15.pdf\">tecnical overview</a>, section 6.3.3) that stems from the fact the ballots are not digitally signed, and they are not because very few people have a digital certificate that they can easily use in an election of this kind.In other european countries like for example Estonia, <a href=\"http://www.vvk.ee/voting-methods-in-estonia/engindex/statistics\">e-ID seems to have widespread use and thus 24,3% of the electorate voted through Internet in 2011 elections</a>.</p><p>\n\nNevertheless, it can be mathematically proved that your individual ballot, the one that you cast as voter, is included in the list of encrypted ballots, in that list we have verified to generate the correct election result. To verify your vote, you need to have saved the ballot tracker, which is just a hash of the ballot. </p><p>\n\nThis ballot tracker appears in the screen when you finish the voting process of the voting booth. If you do not saved your ballot tracker, remember that you have to save it if you want to be able to perform this verification. </p><p>\n\nTo check that your ballot is included in the tally, you simply need to execute the same command as before, adding as a parameter your ballot tracker:</p>\n\n<code>\nsh agora-verifier {{electionId}}.tar [ballot-tracker]\n</code>\n"
},
"legal": {
"title": "Documentation",
"title": "Legal",
"contact": "contact"
}
}
Expand Down
2 changes: 1 addition & 1 deletion locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"verifiableResultsLink": "Recuento verificable"
},
"legal": {
"title": "Documentación",
"title": "Legal",
"contact": "contacto"
}
}
Expand Down
2 changes: 1 addition & 1 deletion locales/gl.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"verifiableResultsLink": "Reconto verificable"
},
"legal": {
"title": "Documentación",
"title": "Legal",
"contact": "contacto"
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "agora-gui-elections",
"version": "3.2.0",
"version": "3.3.0",
"devDependencies": {
"grunt": "~0.4",
"grunt-angular-templates": "~0.5",
Expand Down

0 comments on commit cc0d8b4

Please sign in to comment.