AUSTIN, Tex. — President Obama said Friday that law enforcement must be legally able to collect information from smartphones and other electronic devices, making clear, despite divisions in his administration, that he opposes the stance on encryption taken by technology companies like Apple.
Speaking to an audience of about 2,100 technology executives and enthusiasts at the South by Southwest festival here, Mr. Obama delivered his most extensive declarations on an issue that has split the technology community and pitted law enforcement against other national security departments. Mr. Obama declined to comment specifically on the efforts by the F.B.I. to require Apple’s help in gaining data from an iPhone used by one of the terrorists in the December attack in San Bernardino, Calif.
But the president said that America had already accepted that law enforcement can “rifle through your underwear” in searches for those suspected of preying on children, and he said there was no reason that a person’s digital information should be treated differently.
“If, technologically, it is possible to make an impenetrable device or system, where the encryption is so strong that there is no key, there is no door at all, then how do we apprehend the child pornographer?” Mr. Obama said. “How do we disrupt a terrorist plot?”
If government has no way into a smartphone, he added, “then everyone is walking around with a Swiss bank account in your pocket.”
By weighing in forcefully on the side of law enforcement for the first time since the Apple case came into public view last month, Mr. Obama may have added to the deep tensions between his administration and Silicon Valley executives.
Mr. Obama has repeatedly declared his support for civil liberties, especially after Edward J. Snowden’s disclosures about government surveillance. But his efforts to straddle the widening gulf between privacy and security became more difficult in the wake of the Apple case, and they largely came to an end during his remarks here.
The comments, which were greeted with polite silence, made clear that Mr. Obama supports the F.B.I. and his Justice Department despite differences among his advisers, including military and intelligence officials, who are wary of weakening the encryption they regularly use.
Mr. Obama said he too supports the development of strong encryption to make sure that government can protect banks and critical infrastructure. And he said he wanted proper oversight of law enforcement. But, he said, technology executives who are “absolutist” on the issue are just wrong.
“This notion that somehow our data is different and can be walled off from those other trade-offs we make, I believe, is incorrect,” he said.
Mr. Obama’s comments on encryption came as he spoke broadly at the music, film and technology festival about the need for technology to be used to support civic life and the functioning of democracy.
Mr. Obama became the first sitting president to visit the festival, which in the last three decades has become a mecca for the high-tech, social-media set. He made his comments during an hourlong conversation with Evan Smith, the editor of The Texas Tribune.
Aides said the president was eager to make the case that the technologies behind today’s entertainment and communication apps should also be directed at solving problems of voter turnout, access to information and civic engagement.
“Technology has the power to enhance this work,” Jason Goldman, the chief digital officer for the White House, said in an article posted on the Medium website on Thursday. “When it puts users first, it enables Americans to find their voice, for our government to deliver better services, and make our country more just.”
Mr. Obama is something of a technology geek, so his presence at the festival does not come as much of a surprise. He enjoys dinners with technology moguls and has tapped the wealth of Silicon Valley for his two presidential campaigns.
Mr. Obama has also talked to his closest advisers about creating a high-tech presidential center when he leaves office, in part to help visitors engage with his legacy and in part to encourage better use of technology in society.
He has also sought to lure more tech executives and engineers to government to make federal agencies more responsive to their customers. Mr. Obama created the United States Digital Service as a kind of troubleshooting team to upgrade the technology associated with government services, and he has filled its staff largely with veterans of Google, Microsoft and other such firms.
“The work they’re doing is impactful — and it’s hard to see how they don’t become a permanent feature of our government,” Mr. Goldman wrote. “Indeed, this might be President Obama’s most important accomplishment as the First Tech President: establishing a lasting legacy of service that will carry on long after he leaves office.”
Still, questions about how to harness the power of Twitter, Facebook and Snapchat to help government are not always clear, especially when the companies involved are, above all, designed to make money for their shareholders.
This spring, the White House will host what it is calling a summit meeting on civic engagement, and aides said the president will use it to continue the conversation about the role that technology can play.