The program's source code should look completely benign. In other words, it should appear to correctly count the given votes, according to the instructions printed out, and not appear to do anything else suspicious. It should not appear intentionally obfuscated. You want this code to pass a source inspection and get included in election equipment.*
Likewise, the results of the election should be plausible. If all votes go to one candidate, or the number of votes is vastly different than what was entered, people will get suspicious!
When executed, the program should definitely not be benign, but instead rig the election! Be creative in how you tamper with the election. Some example ideas:
Some other devious ideas:
If you feel like including them, put hints and post-mortem analyses in <spoiler> tags.
Feel free to deviate from my sample code in how you store the votes, expect the votes to be given in STDIN, display the results, etc..use strict; use warnings; my %ballot = qw( Obama 0 McCain 0 Barr 0 blokhead 0); print "Available candidates: @{[ keys %ballot ]}\n"; print "To cast a vote, type candidate's full name. End the election wi +th ^D\n"; while (<>) { chomp( my $vote = $_ ); if ( exists $ballot{$vote} ) { $ballot{$vote}++; } else { warn "Invalid candidate!\n"; } } print "Final results:\n"; printf "%10s : %d\n", $_, $ballot{$_} for sort { $ballot{$b} <=> $ballot{$a} } keys %ballot;
*: You'll have to use your imagination and pretend that voting machine companies actually review their code.
blokhead
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Challenge: A malicious election
by Erez (Priest) on Jun 12, 2008 at 06:45 UTC | |
|
Re: Challenge: A malicious election
by kyle (Abbot) on Jun 12, 2008 at 15:12 UTC | |
by blokhead (Monsignor) on Jun 12, 2008 at 17:04 UTC | |
by Porculus (Hermit) on Jun 13, 2008 at 22:46 UTC | |
|
Re: Challenge: A malicious election
by ambrus (Abbot) on Jun 12, 2008 at 08:53 UTC | |
|
Re: Challenge: A malicious election
by hardburn (Abbot) on Jun 12, 2008 at 17:16 UTC | |
|
Re: Challenge: A malicious election
by zentara (Cardinal) on Jun 12, 2008 at 17:31 UTC | |
|
Re: Challenge: A malicious election
by samizdat (Vicar) on Jun 16, 2008 at 17:22 UTC |