President Barack Obama gestures as he speaks at the South by Southwest Festival (SXSW), Friday, March 11, 2016, at the Center for Performing Arts in Austin, Texas. (AP Photo/Pablo Martinez Monsivais)

President Barack Obama is siding with law enforcement in the debate pitting encryption and personal privacy against national security, arguing that authorities must be able to access data held on electronic devices because the "dangers are real."

Appearing Friday at an annual tech festival in the Texas capital, Obama delivered his most extensive comments to date on an issue currently being played out in federal court. Apple, one of the world's largest technology companies, is challenging the government's request that it help the FBI access data on a cellphone that was used in the San Bernardino, California, attack that killed 14 people.

The issue has roiled the tech industry and divided Obama's advisers, but the president appeared to side with law enforcement despite also saying the matter would not be settled by adopting an "absolutist view."

Obama restated his commitment to strong encryption but also raised the question of how would authorities catch child pornographers or disrupt terrorist plots if smartphones and other electronic devices are designed in ways that keep the data on them locked away forever.

"My conclusion so far is that you cannot take an absolutist view on this," Obama said. "So if your argument is strong encryption, no matter what, and we can and should, in fact, create black boxes, then that I think does not strike the kind of balance that we have lived with for 200, 300 years.

President Barack Obama waves to the audience after taking part in a South by Southwest Interactive, Friday, March 11, 2016, in Austin, Texas. (AP Photo/Eric Gay)

"And it's fetishizing our phones above every other value. And that can't be the right answer," he said.

At the end of a nearly hourlong, question-and-answer session with Evan Smith, CEO and editor in chief of The Texas Tribune, Smith asked the president "where do you come down" on the privacy versus security debate. He was not asked to comment on specifics of the dispute with Apple.

Obama said government shouldn't be able to "just willy nilly" access smartphones that are full of very personal data. But at the same time, while asserting that he's "way on the civil liberties side," Obama said "there has to be some concession" to be able to get the information in certain cases.

President Barack Obama, center, waves to members of the audience after answering question from Evan Smith, left, CEO / Editor in Chief of The Texas Tribune, at the South by Southwest Festival (SXSW) at the Center for Performing Arts in Austin, Texas, Friday, March 11, 2016. (AP Photo/Pablo Martinez Monsivais)

"I am not interested in overthrowing the values that have made us an exceptional and great nation simply for expediency," Obama added. "But the dangers are real. Maintaining law and order and a civilized society is important. Protecting our kids is important."

Apple and the federal government are embroiled in a legal fight over Apple's refusal to help the FBI access the iPhone used in San Bernardino. The FBI has been unable on its own to unlock the phone and wants Apple to create a program specifically for that phone to help the bureau get to the data on it. But Apple has refused, and says that to do what the government is asking would set a terrible precedent.

Rep. Darrell Issa, R-Calif., who has sharply questioned FBI Director James Comey during congressional hearings on the matter, released a statement in which he said Obama's comments showed his "fundamental lack of understanding of the tech community, the complexities of encryption and the importance of privacy to our safety in an increasingly digital world."

President Barack Obama places his taco order with Torchy's Tacos owner Aaron Sego, right, during an unannounced stop at Torchy's Tacos, Friday, March 11, 2016, in Austin, Texas. Obama traveled to Austin, to speak at South by Southwest Festival (SXSW) and attend two Democratic National Committee fundraisers. (AP Photo/Pablo Martinez Monsivais)

Issa said the solution, or key, that the government wants Apple to create could eventually compromised.

"There's just no way to create a special key for government that couldn't also be taken advantage of by the Russians, the Chinese or others who want access to the sensitive information we all carry in our pockets every day," Issa said.

Obama used his appearance at the decades-old festival to encourage the audience of tech enthusiasts to step forward and use their skills and imagination to "tackle big problems in new ways." He said the administration already is using technology to make people's lives better, and cited as an example the streamlining of federal applications. Offering up a problem in need of a solution, he urged industry leaders and entrepreneurs to use technology to help increase voter participation.

"The reason I'm here, really, is to recruit all of you. It's to say to you, as I'm about to leave office, how can we start coming up with new platforms and new ideas, new approaches across disciplines and across skill sets, to solve some of the big problems that we're facing today."

South by Southwest Interactive is part of South by Southwest, a movie, music and interactive media festival that has been held in Austin for the past 30 years. Obama's appearance was the first at the festival by a sitting U.S. president.