Presidential candidates from both parties came together at the weekend to call for beefed-up government surveillance programs in the wake of recent terrorist attacks in Paris and San Bernardino, California.

The candidates did not agree, however, on what kind of surveillance – new dragnet metadata collection, tools to fight encryption or some even more powerful capability – was needed.

The debate broke out as the contrasting methods of communication – and possibly encryption – used by attackers in the two assaults demonstrated the difficulty of detecting and interrupting nascent plots, whether involving suspects known to authorities, as in Paris, or unknown, as in California.

The attackers in Paris, at least three of whom had been subject to surveillance, used Facebook to communicate and coordinated using unencrypted SMS text messages. The California suspects were revealed to have communicated with surveillance targets or suspects, but were not targets themselves, Republican hopeful John Kasich said on Sunday.

Hillary Clinton, the Democratic frontrunner, said that big technology companies and social sharing sites were “going to have to help us” in the effort to interrupt potential plots.

“We’re going to need help from Facebook, and from YouTube, and from Twitter,” Clinton said on ABC News. “They cannot permit the recruitment and the actual direction of attacks, or the celebration of violence by this sophisticated internet user.

“They’re going to have to help us take down these announcements and these appeals as quickly as they get up.”

The female suspect in the California shooting, Tashfeen Malik, had reportedly posted a message in praise of the Isis leader before the attack. Facebook executives later suspended her account because it violated the company’s policy of preventing terror groups from using the site to organize and disseminate propaganda.

Donald Trump, the Republican frontrunner, said the San Bernardino attack, in which a couple killed 14 people and injured 21 at a community center, displayed a need for “very tough” surveillance measures including tracking entire families.

“We have to start looking at families now,” Trump said at a Saturday whistle stop in Iowa, referring to suspect Syed Rizwan Farook. “I think his mother knew what was going on. She went into the apartment. Anybody that went into that house or that apartment knew what was going on. We better get a little tough and a little smart, or we’re in trouble.”

Trump has called for surveillance of some mosques and has not ruled out the government maintaining a database of American Muslims.

Jeb Bush, who has previously called the Muslim database suggestion “abhorrent”, said on Sunday that he stood by that assessment.

“We have all of the capabilities to monitor people that are in our country trying to attack us,” Bush said on ABC News. “That already exists, and I think that’s more than appropriate.

“We don’t have to target the religion, we just have to target those that have co-opted the religion and make sure we’re fully aware of the radicalizations taking place not just here, but around the world.”

The Republicans diverged notably in their diagnoses of what new surveillance was needed to prevent future attacks. Kasich said the California attackers’ ability to escape detection at a time of sweeping bulk collection in previous years indicated that the suspects had used encryption technology.

Marco Rubio, the Florida senator also running for president, said restrictions on dragnet collection of metadata was the problem, blaming Barack Obama for signing legislation last summer, the Freedom Act, that forced the government to rely on phone companies to keep data on customers.

Though metadata collection and analysis had apparently failed to identify Farook, who was born in the United States, and his wife, Tashfeen Malik, as security risks, the program should be redoubled, Rubio said.

“[Analysts] can’t put together the broader picture of who these people are, who they’ve been dealing with – particularly the man who’s been in this country his whole life. Wouldn’t we want to know as much about him as possible, in an effort to perhaps identify others that were of assistance in this attack?” Rubio said on CNN.

“That’s exactly why the metadata program is so critical. People wind up on your radar who perhaps wouldn’t have been on your radar.”

Both Clinton and Kasich called for a new deal between the government and tech companies to circumvent encryption – but the companies have been resistant to such a deal, arguing that it would put too much private customer information at risk. In June, Apple CEO Tim Cook attacked rivals Google and Facebook for being too willing, he said, to turn over customer information.

Clinton called on “the best minds in the private sector and public sector” to “come together to help us deal with this evolving threat”.

“Nobody wants to be feeling like their privacy is invaded,” Clinton said. “But I also know what the argument is on the other side from law enforcement and security professionals. So please, let’s get together and figure out the best way forward.”