Only a few hours after the officials’ testimony, the White House said the dismissal on Tuesday of the F.B.I. director, James B. Comey, should help the bureau’s investigation of the Russian hacking come to a speedy conclusion. The intelligence officials, by contrast, said the inquiries into the matter must delve deeply into the question of how to prevent future attacks.

Mike Pompeo, the director of the Central Intelligence Agency, told the Senate Intelligence Committee that the Russians and others would try to meddle again in future elections and added, “I hope we learn from it as well and will be able to more effectively defeat it.”

Also on Thursday, Mr. Trump signed a long-delayed executive order on cyberissues, one that places more responsibility on cabinet officials to secure their agencies’ systems but also sets up a series of rapid-fire reviews of the federal efforts. Among them is a study of how to deter cyberattacks — an issue that has confounded the Pentagon, the National Security Agency and the Department of Homeland Security, among others, and was the focus of extensive, if inconclusive, efforts by the Obama administration.

At the heart of the problem, as Russia’s hacking showed, is that few of the techniques used to deter either nuclear or conventional armed attacks work in cyberspace, where both the identity and the location of the attacker are often hidden for long periods of time. President Barack Obama used a variety of methods to respond to attacks — indictments of Chinese and Iranian hackers, counterattacks on North Korea, the expulsion of diplomats and relatively mild economic sanctions against Russia — but none proved especially effective.

The new order “creates a certain sense of urgency,” said Stevan Bunnell, a former general counsel at the Department of Homeland Security. But though the executive order — which Mr. Trump had planned to issue shortly after taking office — was drafted and redrafted for months, “there is nothing much new here,” Mr. Bunnell concluded.