Credit Glen Stubbe/Star Tribune, via Associated Press
WASHINGTON â Timothy D. Cook, the chief executive of Apple, was relentless during a private meeting of tech giants and President Obamaâs top national security officials last month. Encrypted devices like the iPhone are here to stay, he insisted. Law enforcement needs to find a way to do its job in a new world.
James B. Comey Jr., the director of the F.B.I., and Attorney General Loretta E. Lynch pushed back, but Mr. Cook stood firm, several participants said.
âWith all due respect,â Mr. Cook told those around the table, including Mr. Obamaâs counterterrorism chief and the heads of the National Security Agency and the Department of Homeland Security, âI think there has been a lack of leadership in the White House on this.â
Denis R. McDonough, the presidentâs chief of staff, took exception and said so. Law enforcement officials described him as stung by what they called Mr. Cookâs ârant,â although tech executives in the room insisted that Appleâs chief executive was respectful.
Either way, what started as a cordial two-hour discussion about combating Islamic extremism ended with the White House and Mr. Cook agreeing to disagree â foreshadowing a bitter battle between a president long enamored of Apple products and Silicon Valley and a tech titan who has spoken enthusiastically of Mr. Obama.
Although the president and Mr. Cook are not personal friends, associates say they have developed a relationship of professional admiration and mutual self-interest. At the least, the two share similar traits: discipline, a cerebral nature and impatience with office drama. Now they find themselves in roles no one ever imagined, as the central antagonists in the raging debate between personal privacy and the nationâs security.
By refusing demands from Mr. Obamaâs Justice Department to help unlock a phone used by one of the San Bernardino, Calif., terrorists, Mr. Cook has become the leading voice in Silicon Valley for encryption. By voicing strong support for his F.B.I., Mr. Obama is now the effective chief prosecutor of the administrationâs case for allowing law enforcement to penetrate iPhones.
A Brief Explanation of Appleâs Showdown With the U.S. GovernmentFEB. 26, 2016
Apple Shareholders Show Their Support for Tim CookFEB. 26, 2016
Apple Goes to Court, and F.B.I. Presses Congress to Settle iPhone Privacy FightFEB. 25, 2016
Justice Department Calls Appleâs Refusal to Unlock iPhone a âMarketing StrategyâFEB. 19, 2016
If Apple had more of a presence in Washington, as do Google, Facebook and Microsoft, technology executives say there is a chance the dispute might have been quietly resolved. But few top Apple veterans have moved through the revolving door that has brought engineers and executives from other technology companies to the Obama White House to serve in a variety of security, technology and scientific positions. Appleâs lobbying budget in Washington is far smaller than its competitors.
âI have not talked to the president. I will talk to the president,â Mr. Cook said in an interview with ABC News last week, a day before his company filed legal papers opposing the government. Mr. Cook said he planned to ask Mr. Obama âfor his help in getting this on a better path.â
An Apple spokesman said he had no idea when such a call might happen, and White House officials offered no indication that Mr. Obama and Mr. Cook were scheduled to talk anytime soon.
It is unclear when Mr. Obama and Mr. Cook first met, but in the four years since Mr. Cook succeeded Steven P. Jobs as Appleâs chief executive, he has visited the White House at least a half-dozen times.
In the summer of 2013, soon after Edward J. Snowden revealed some of the governmentâs most secret surveillance programs, Mr. Cook joined 16 other technology executives and privacy advocates for a grievance session with Mr. Obama in the Roosevelt Room. Two participants said Mr. Cook told the president that the Snowden revelations had led people to believe that Apple was helping the government spy on Americans.
The exchange was an early indication of the tensions with the White House that would eventually develop.
âHe was concerned about the misperception in the public about the extent to which Apple was cooperating,â recalled Larry Lessig, a Harvard law professor and privacy activist, who was also at the meeting.
Four months later, Mr. Cook attended another meeting with Mr. Obama in the Roosevelt Room on a similar topic. The following year, in December 2014, White House visitor logs show that Mr. Cook spent two days in the West Wing, where he met with Mr. Obama in the Oval Office and shared a meal in the White House mess with John D. Podesta, who was then counselor to Mr. Obama as well as the presidentâs environmental czar.
In September 2015, Mr. Cook was again at the White House, where he had a prime seat at the state dinner for President Xi Jinping of China.
Current and former White House officials say Mr. Obama appreciated the attention that Mr. Cook brought to issues like immigration, gay marriage and climate change. When Mr. Obama solicited Apple and other companies to support his ConnectED program for technology in schools, Mr. Obama praised Mr. Cookâs decision to pledge $ 100 million worth of iPads and MacBooks, calling it âan enormous commitment.â
There were also tensions. White House officials were not happy about Appleâs decision to shelter billions of dollars in offshore accounts and have repeatedly pressed Mr. Cook to explain the companyâs need to build its blockbuster products in China rather than in the United States.
But the encryption debate, and the governmentâs legal action against Apple last week, are testing the relationship with the company more than any other.
âA company thinks very hard before it defies the government,â said Nicole Wong, who was Googleâs lead lawyer when Google resisted a Justice Department request for user data. But if a disagreement happens, âitâs not bad for this policy conversation to happen transparently in a court proceeding.â
At the same time, there was a growing alliance between this White House and Silicon Valley. Although other presidents have looked to the valleyâs innovators and venture capitalists for money, political support and ideas, this administration has wooed tech executives in far greater numbers. The president also has close ties to those in the industry who supported him early on, including Reed Hastings, the Netflix chief executive, and Reid Hoffman, the founder of LinkedIn.
Now, while Facebook, Google, Microsoft and Yahoo are expected to file papers to the court in solidarity with Appleâs encryption position, Mr. Cook stands relatively alone in his fight. This was evident at the meeting in January in Silicon Valley.
As participants recalled it, Mr. Cook was the one who shifted the conversation to encryption â prompting nods of agreement from executives at Dropbox, Facebook, LinkedIn, Twitter, Yahoo and others.
Soon after, Mr. McDonough brought the meeting to an end. âPut a pin in it,â participants recalled that he said, making it clear that the conversation would continue.
But one month later, the Justice Department sued Apple.