There are systems for most of these things, but to my knowledge in the end you still have a box pretending to do this, while it doesn't.
That would result in cast votes not in the final count. Anyone in possession of such a cast vote could demonstrate that it was not in the final count. So while a machine could do that, it would be detectable. So long as the system ensures all cast votes come into the possession of some auditors (which is not difficult to do) all such votes would ultimately be counted.
A lot of these systems can be read upon on Wikipedia or books about cryptography. Only problem is that even if it works, I think it is too easy to trick most people or be lied to. You know, it is like Bitcoin. Everything works by mathematical rules and could show them, but also create a program that does something completely different, but still looks like that. And while you can find out by disassembling, having a closer look or something like that it can be hard to do that with a voting machine.
That's why the voting machine wouldn't be the device you'd trust. The voting *machine* would be like the Bitcoin network. You don't have to trust it because it *can't* break the rules. It *can't* generate a spend for your coins without your key and it doesnt' have your key. If it doesn't process a transaction, you have that transaction and you can demonstrate that it wasn't processed.
The idea is not to convince everyone that the voting system is sound. The goal is to product a voting system that actually *is* sound.