The voter receives a ballot from those managing their place of voting (after showing identification or a registration card of some sort), has their name physically crossed off a printed list and then, after moving behind a screen or other mechanism to allow for privacy, places an 'x' in the box beside the name of the individual they are voting for. The voter then folds the ballot and places it anonymously into a box used to collect the votes for their district. A ‘ballot box’, if you will.
Once the polls close, volunteers for the place of voting manually count the paper ballots for the individuals running for office and report the count to a central election office. This manual count rarely takes more than an hour or so to complete.
Simple enough? Votes remain anonymous, the paper ballots create a permanent audit trail and, as long as the ballot boxes are supervised by reliable third-parties minimally affiliated with those running for office, the voter will be assured their vote is counted towards their intended result.
This is how most of the developed world handles elections. It saves us a ton of trouble in close races.
"Premature optimization is the root of all evil -- Donald Knuth"
There are some things which should not be optimized. An extremely important, easily manipulated event prone to corruption which occurs once every few years (and only takes two hours to complete manually) might be considered one of them.