At the world’s largest hacking conference, there was good news and bad news for fans of free and fair elections.

The good news is that hacking the US midterms – actually changing the recorded votes to steal the election for a particular candidate – may be harder than it seems, and most of the political actors who could pose a threat to the validity of an election are hesitant to escalate their attacks that far.

The bad news is that it doesn’t really matter. While the actual risk of a hacker seizing thousands of voting machines and altering their records may be remote, the risk of a hacker casting the validity of an election into question through one of any number of other entry points is huge, and the actual difficulty of such an attack is child’s play. Literally.

“The most vulnerable part of election infrastructure is the websites,” explained the security expert Jake Braun. Braun, a former White House liaison on cybersecurity, is one of a small group of volunteer IT professionals who have been testing the security – or lack thereof – of the US voting infrastructure every year at the Def Con hacking conference, where he co-founded the Voting Village, a sort of conference-within-a-conference.

Unlike a voting machine, Braun explains, websites represent a compelling target because they are, by their nature, connected to the internet 24/7. And, whether they are used for voter registration, online campaigning or announcing the results at the end of the election, they can be used to sow havoc.

“We know that Russia has done this before,” Braun says. “They did it in the Ukraine, where they hacked Ukrainian election results on the government website. Fortunately, the Ukrainians caught it and shut the website down. But then the Russians announced that their candidate had won on RT, when he hadn’t.” Disarray ensued, and the Russian press had a foothold from which to begin spreading the allegation that the winner of the election wasn’t legitimate.

It took an 11-year-old girl 10 minutes to do it Security expert Jake Braun

Unfortunately for Braun, unlike voting machines, there’s not a lot of interest in testing the security of the various states’ election websites. “It’s really important, it’s a huge vulnerability, but the adult down in the Village wouldn’t find this interesting, because they could do it in two minutes.”

Instead, Braun turned to Rootz, another Def Con staple, where the children of attendees experience their own mini hacking convention. Armed with facsimiles of the websites of 13 battleground states and a child-friendly guide to basic hacking techniques, the kids were set loose on critical infrastructure – and proceeded to tear it apart.

“It took an 11-year-old girl 10 minutes to do it,” Braun says, “and she was the first one.” After that, the convention cycled to a new state’s website every 30 minutes, and another child would break it in less than a quarter-hour, over and over. At the point I arrived in the room, the website for the state of Colorado was being projected on the wall, declaring that the candidate for the “Comnnunism” party, Kim Jong-un, had won the state’s election with one quadrillion votes. (The runner-up, the rapper Lil Pump, apparently standing for the Democratic party, had just under 46m votes.)

As the number of flaws discovered by Def Con attendees, young and older, mounts, the US government has taken an interest. This year, Jeanette Manfra, assistant secretary at the Department of Homeland Security’s office of cybersecurity and communications turned up to reassure attendees – partly.

DHS, she said, put itself in the shoes of America’s adversaries. “What are they trying to do? They are trying to undermine our democratic process, and the confidence that we have in our democratic process. And there’s a lot of ways to do that without actually hacking the vote.”

Take, for instance, registration data. If the database isn’t secure, an attacker could delete, say, every 10th entry. The resulting chaos, as millions of people attempt to secure provisional ballots, or are turned away at the polling station, would certainly undermine confidence. “This is about more than just voting machines,” Manfra told attendees.

As if to demonstrate Manfra’s words, just days after Def Con, another attack was reported on American democracy, through the campaign computer of a Democratic congressional candidate, California’s David Min. The four-person campaign team, which first learned of a potential attack in March, couldn’t even afford the minimum price of hiring a security team to investigate, according to Reuters.

But Manfra did have some good news. “We found that it’s actually really, really difficult to manipulate the actual vote count itself. There’s a lot of reasons for that: voting machines are physically secure, we’ve got thousands of jurisdictions across the country that all use different things. And so while you may be able to get into a few voting machines, you can’t really affect that at scale without detection, and it would be really hard.”

Hackers try to access and alter voter data at the Def Con convention last year. Photograph: Steve Marcus/Reuters

Not everyone agrees. “That’s bullshit,” Braun says when I put Manfra’s words to him. “The No 1 thing we found last year wasn’t a hack at all, it was the fact that we opened up the back of the machine, and of course, no surprise, all the parts are made across the world, especially China.

“This isn’t conjecture, this isn’t my dystopian fantasy world, this is something we know they do … The fragmentation argument is absolute horseshit, because once you’re in the chips, you can hack whole classes of machines, nationwide, from the fucking Kremlin.”

The University of Michigan’s J Alex Halderman is one of the world’s experts on the weaknesses of voting machines. He too is not prepared to dismiss the risk of a direct threat to the integrity of a US election. In the course of a 30-minute talk in the Voting Village, he demonstrates two direct attacks on a popular class of voting machine, stealing a mock election in front of an audience of 50.

He agrees with Manfra that the diversity of US election technology poses a challenge for an attacker, but says “that helps in some ways and hurts in some ways”. A real threat, he points out, doesn’t need to steal every vote in every county in every state in the country. The bad actor just needs to steal enough votes in a few counties in America’s battleground states – just enough to swing a close election. “So rather than diversity protecting us, we have a diversity of strength and weakness, and that’s a weakness for everybody.”

What’s more, Halderman notes, the system isn’t as decentralised as it looks. While individual voting machines aren’t (or shouldn’t be) connected to the internet, the PCs that are used to program the individual elections are. “One large vendor codes the system for 2,000 jurisdictions across 31 states,” Halderman says. “Many other places, like Michigan, use small businesses” – some with just six or seven employees. Hack those businesses, and an attacker could theoretically reprogram thousands of election machines at once.

For now, according to the security policy expert Mara Tam, perhaps the strongest defence that US elections have is simply that actually intervening in them isn’t something most attackers want to do.

“Under international law, intervention and interference have specific meaning – they imply coercion and they imply denial of sovereignty by force,” Tam told attendees of Black Hat, another security conference in Las Vegas this month. “Because the United States still has self-determination, and because this” –Russia’s meddling – “was influence, not intervention, it’s not illegal under international law. In fact, international law doesn’t even touch it.

“If you’re Russia, you actually don’t want to be caught violating international law. You want to be legitimate. And you can see operational red lines not being crossed … Unless there’s a shooting war going on, in which case all bets are off.”

Of course, that’s cold comfort to the defenders. Because there’s another threat that’s just as dangerous, and which international law provides no defence to at all, notes Carsten Schürmann, another vote hacking expert. “This is the threat of an alleged cyber-attack, where people claim that there was a cyber-attack but there actually wasn’t one.”

That factor, notes Tod Beardsley, research director at the security firm Rapid7, is one thing that separates election defence from many other areas. “It’s in the attackers’ best interest to be obvious, be foreign, be noisy. If your goal is about fear and doubt, you don’t even need to throw elections.”

An election wrongly perceived as illegitimate is just as damaging to democracy as one correctly perceived as such. That’s why Halderman calls for a very simple solution to at least this part of election defence: issuing and counting paper ballots. Most, but not all, US voting machines do maintain a separate record on paper of whom a ballot was cast for. But while that record, at least, is unhackable, it’s also rarely considered. In 2016, Halderman spearheaded an effort to encourage the state of Michigan to perform a statistically valid check of the paper ballots – which would have involved counting just a few hundred of the ballots to ensure with a high degree of certainty that tampering had not occurred.

That effort failed, but Halderman isn’t giving up. “This is one of the cheapest cyber defences imaginable, and would cost less than $25m a year” to provide a strong defence across the US. That, he notes, is a fraction of the $380m that the US government has already earmarked for improving election security, but without standards or strict guidance about how states should use it – meaning that some of that money can be ploughed straight into the buying the same insecure voting machines that led to the trouble in the first place.

“I’ve only one conclusion,” said Schürmann: “Use paper and do your audits.”