Can a voting machine be hacked?

It took a $4 computer chip, and an Ivy League Ph.D, to apparently hack a voting machine.

"If you replace the computer program in a voting machine, then it will add up the votes in a different way," said Princeton University Professor Andrew Appel.

Appel, who is the Eugene Higgins professor of computer science and until last year the director of the graduate program, focuses on computer security and voting systems -- and says he needs just "seven minutes alone" with a voting machine to tamper with it.

"[Replacing the program] could shift votes around from one candidate to another, before the polls close ... There is the potential for fraud in touch-screen voting machines that are still used in six to ten states," he said.

Appel in 2008 first conducted a demonstration on how to hack a touch-screen voting machine, as part of a lawsuit against New Jersey officials. His test, though, recently has gained renewed attention in the wake of the hacks of Democratic National Committee emails, and the suspected hacking of state election systems in Arizona and Illinois this summer.

While Appel notes there has been no documented case of a voting machine actually being hacked in the manner that he did, he warns it could happen simply by replacing the machine's computer chip -- which costs about $4 -- with one that is pre-programmed to change the votes. In his demonstration, he changed the votes by swapping out the machine's computer chip for one that he was able to reprogram to display another tally.

"I figured out how to make a slightly different computer program that just before the close of the polls shifts some votes around from one candidate to another, and I wrote that computer program onto a memory chip ... and now to hack the voting machine, you have to get seven minutes alone with it with a screwdriver."

Appel's video shows that while voters cast ballots for the candidate of their choice, the machine allotted different results when the votes were counted.

John Brzozowski, the deputy superintendent of elections in Hudson County, N.J., insists that in real life, such chip-switching cannot really be done.

"In our experience here in this office, we all concur that we have not seen one documented case of a machine being compromised," he said.

"I believe that you would have to go through an enormous amount of time and energy, and I don't know how you could possibly do that to 500 machines and get the secrecy and time to do so. I don't believe that's possible," he said.

Brzozowski and his staff took Fox News on a tour of the security area of their Jersey City headquarters where machines are stored. He pointed to multiple safeguards and safety procedures that protect machines. They are locked in secure areas, under 24-hour 7-day-a-week camera surveillance. Broken security tape on vital parts would show any violation of a machine.

For security reasons, he would not detail all the measures that authorities take to protect the machines and the integrity of the voting process.

"We have so many security measures I don't see how it would be possible," he said. "We have a product that works, and is reliable and is secure."

But the professor insists he exposed a loophole.

"While the machines are stored in a voting machine warehouse, the doors are locked and they have security cameras, but many people have to have access to those machines to maintain them," he said, noting that machines are often delivered days before an election to various polling sites. He worries about the level of security at polling locations.

Officials insist those machines are properly protected as well.

The Bergen County, N.J., Board of Elections said, "We take great security measures in New Jersey. We are very confident in our system and in our machines."

The voting machine company, Dominion Voting Systems, issued a statement to Fox News faulting Appel's demonstration, citing his use of a "de-commissioned machine."

The company says it "is not a realistic assessment of the security of a voting terminal as it is used in actual elections. The physical and operational security of voting devices and the overall election platform is paramount -- regardless of the technology ... a hack of any voting terminal that is not conducted in a real-world election environment -- with its physical security, pre-election testing and audit processes in place, is simply not a credible test."

But even the 'winner' of Appel's vote-changing demonstration thinks he is onto something.

Former Congressman Dennis Kucinich won the rigged vote tally. For the purposes of his demonstration, Appel used some of the 2008 presidential candidates' names as samples. In the machine that was compromised, Kucinich received four votes to 16 for former New Mexico Gov. Bill Richardson.

But the professor's reprogrammed computer chip simply changed the results, so that the machine counted a tally that put Kucinich on top, 12 votes to Richardson’s eight.

"Once again we learn that the integrity of the election process can be put at risk through manipulating technology," said Kucinich, who is now also a Fox News contributor. "This story indirectly makes a case for paper balloting, with the count occurring on the spot as soon as the polls are closed."

"The good news is that it is not something that you can easily do from Russia," Appel said. "But the bad news is that it really is possible to do locally."

Follow Eric Shawn on Twitter: @EricShawnTV

Fox News' Marta Dhanis contributed to this report.