How to hack an election