WASHINGTON — Apple and the FBI will face off Tuesday for the first time since the federal government went to court to try to force the tech giant to unlock a terrorist's encrypted iPhone.

FBI Director James Comey and Apple's senior vice president and general counsel, Bruce Sewell, will testify at a House Judiciary Committee hearing titled "The Encryption Tightrope: Balancing Americans' Security and Privacy."

The difficulty of finding that balance has been underscored by the legal battle between the FBI and Apple over whether the government can force the company to create software to unlock the iPhone of a dead terrorist who shot 14 people to death and wounded more than 20 others in San Bernardino, California, in December.

Comey said the FBI's request would only affect the iPhone of terrorist Syed Farook, who was killed along with his wife in a shootout with police.

"The code the judge has directed Apple to write works only on this one phone," Comey testified at a House Intelligence Committee hearing last week.

But Apple warned that writing new code to unlock Farook's phone will create a backdoor into the encrypted iPhones of millions of consumers, making the devices vulnerable to hackers, cyber criminals and government surveillance.

"Hundreds of millions of law-abiding people trust Apple's products with the most intimate details of their daily lives — photos, private conversations, health data, financial accounts, and information about the user's location as well as the location of their friends and families," Sewell said in written testimony posted on the committee's website before the hearing. "There's probably more information stored on that iPhone than a thief could steal by breaking into your house. The only way we know to protect that data is through strong encryption."

A federal magistrate ordered Apple earlier this month to cooperate with the FBI to unlook Farook's phone. Federal agents believe the phone could contain answers about whether Farook and his wife worked with others to plot their attack.

Apple filed a motion last Thursday to dismiss the government's request, charging that it is in conflict with Americans' constitutional rights to free speech and to avoid self-incrimination. Google, Facebook, Twitter and Microsoft are among the tech companies supporting Apple's position.

As the dispute plays out in court, members of Congress are trying to decide what — if anything — they should do legislatively to try to resolve the encryption debate.

"Americans have a right to strong privacy protections and Congress should fully examine the issue to be sure those are in place while finding ways to help law enforcement fight crime and keep us safe," Judiciary Committee Chairman Bob Goodlatte, R-Va., and Rep. John Conyers of Michigan, the panel's senior Democrat, said in a joint statement.

Lawmakers are proposing two very different solutions to the dilemma.

House Homeland Security Committee Chairman Michael McCaul, R-Texas, and Sen. Mark Warner, D-Va., a former tech entrepreneur who serves on the Senate Intelligence Committee, introduced a bill Monday to create a national commission on digital security.

The 16-member panel, modeled after the 9/11 Commission that recommended how to prevent terrorist attacks, would be made up of civil liberty and privacy advocates, law enforcement and intelligence officials, professors, lawyers, tech executives, and computer science and cryptography experts. Apple has expressed support for the idea.

Taking a different approach, Sen. Dianne Feinstein, D-Calif., and Senate Intelligence Committee Chairman Richard Burr, R-N.C., plan to introduce legislation to require companies to provide encrypted data to the government if law enforcement officials have a court order.

Manhattan District Attorney Cyrus R. Vance Jr. said encryption poses a problem for state and local police as well as prosecutors who are trying to catch and convict criminals.

"Technology companies should not be able to dictate who can access key evidence in criminal investigations," Vance said in written testimony to the Judiciary Committee. "No device or company, no matter how popular, should be able to exempt itself from court obligations unilaterally. And they should not be able to write their own laws. I urge Congress to enact a national solution."

A cybersecurity expert said the best thing Congress can do is give the FBI the resources it needs to create an investigative center with agents who have "a deep technical understanding of modern telecommunications technologies."

"The FBI must learn to investigate smarter," said Susan Landau, professor of cybersecurity policy at Worcester Polytechnic Institute in Massachusetts. "Congress can provide it with the resources and guidance to help it do so. Bring FBI investigative capabilities into the 21st century. That's what is needed here — not undermining the best security that any consumer device has to date."