This is not really new, but it’s something I want to do more work on. Much of the code is in C++ (the topic of a current class I’m taking), so maybe this is worth looking over very closely. Analysis of an Electronic Voting System from February 27, 2004, by Tadayoshi Kohno, Adam Stubblefield, Aviel, D. Rubin, Dan S. Wallach.