How does the machine know your secret code if it's not stored somewhere other than your card? If it doesn't know the code, it cannot create the correct hash. The only way this concept works is with public key cryptography. I'm not sure the public is ready for the care they'd need to take in creating and keeping their own public/private key pair for voting.
We'd have to do something like give out YubiKeys or similar hardware tokens that can generate and store a key pair. Even still, we'd have to walk the public through the process and still have the ability to handle people that lose them. Even if we issued two in case of hardware failure, it gets complicated.
Your concept essentially re-creates signing your vote with a private key and verifying it with the public key. It's a decent idea, but not secure in the details you've given.
The Jacksonian Party. See https://infogalactic.com/info/Jacksonian_democracy
This is concentrating power in the Federal government at a level I'm not comfortable with. We need to be wise about how we fix problems. The simple solution is to concentrate power. It is likely not the wisest or only solution.
You don't have to pay, just create an account. If you don't like that, here's ABC: https://abcnews.go.com/US/trump-administration-rejects-californias-request-wildfire-disaster-assistance/story?id=73650086
Found it: https://www.imdb.com/title/tt4006826/ & https://infogalactic.com/info/The_Fighting_Season
It's on Amazon. https://www.amazon.com/The-Fighting-Season-1/dp/B00YDJ0TGY
Looks like he did a follow-up called My Fighting Season (https://www.imdb.com/title/tt5806964/). That's on National Geographic. https://www.nationalgeographic.com/tv/shows/my-fighting-season/episode-guide/season-1