WASHINGTON — The F.B.I. director, James B. Comey, said Wednesday that investigators could not read more than 100 text messages exchanged by one of the attackers in a shooting this year in Garland, Tex., because they were encrypted, adding fuel to law enforcement agencies’ contention that they need a way to circumvent commercially available encryption technology.

Mr. Comey, who two months ago appeared to have lost a battle inside the Obama administration over forcing companies like Apple and Google to give investigators a way to decode messages, told the Senate Judiciary Committee that one of the attackers “exchanged 109 messages with an overseas terrorist” the morning of the shooting.

“We have no idea what he said because those messages were encrypted,” Mr. Comey said. “And to this day, I can’t tell you what he said with that terrorist 109 times the morning of that attack. That is a big problem. We have to grapple with it.”

The testimony was the first time Mr. Comey, a longtime critic of the technologies that he contends are creating a “going dark” problem for law enforcement agencies, had cited a specific example of a terrorist using encrypted communications. He said he would not comment on whether similar technology was involved in the time before the Paris attacks or the shooting rampage in San Bernardino, Calif.