Mr. Krebs’s workforce labored with states to scan and patch methods for vulnerabilities, lock up voter registration databases and voter rolls, change default passwords, activate two-factor authentication, and print out paper backups, all to construct up “resilience” in case of assault. He was defending, he stated, “the crown jewels of election administration.”

When the pandemic upended all the things, Mr. Krebs’s workforce shifted focus to securing vote-by-mail methods, regardless of the president’s marketing campaign in opposition to them. That was when Mr. Krebs’s company acquired within the White Home’s cross hairs.

In interviews, Mr. Krebs countered Mr. Trump by saying mail-in voting would make the election safer by making a paper path, essential for audits to determine that each authorized poll was accurately counted.

It additionally made state registration databases extra essential: an assault that froze or sabotaged voter-registration information — by switching addresses, marking registered voters as unregistered or deleting voters fully — risked mass digital disenfranchisement. Mr. Krebs made it his private mission to see to it that each final registration database was sealed up.

When Mr. Trump known as mail-in voting a “fraud” in his televised debate with Mr. Biden, now the president-elect, in September, Mr. Krebs contradicted the president at each flip, once more with out mentioning his identify.

“We’ve acquired a variety of confidence that the poll’s as safe because it’s ever been,” Mr. Krebs instructed any reporter who requested.

On Election Day, Mr. Krebs and senior officers held briefings with reporters each few hours to apprise them of any threats. Chad Wolf, the secretary of homeland safety, a Trump loyalist and Mr. Krebs’s boss, even appeared at one to reward Mr. Krebs’s work. Regardless of small hiccups, Mr. Krebs reassured journalists that there was no main overseas interference or indicators of systemic fraud.

“It’s simply one other Tuesday on the web,” he stated.