U.S. Attorney General William Barr delivers opening remarks at a summit on "Combating Anti-Semitism" at the Justice Department in Washington, July 15, 2019.

U.S. Attorney General William Barr warned technology companies on Tuesday that they need to immediately start working with law enforcement, helping agencies gain access to encrypted messages during critical investigations.

In a keynote address at the International Conference on Cyber Security in New York, Barr said that the inability for law enforcement to tap into communication among dangerous actors is a major threat to public safety and national security.

"Obviously, the Department would like to engage with the private sector in exploring solutions that will provide lawful access," Barr said, according to his prepared remarks. "While we remain open to a cooperative approach, the time to achieve that may be limited."

His message touched on a key source of conflict between law enforcement officials and tech executives. While investigators argue that access to encrypted messages can be critical to national security, tech companies warn that providing a backdoor into encrypted services is a slippery slope.

The attorney general didn't call out Apple by name, but his address sounds familiar to anyone who followed the aftermath of the 2015 mass shooting in San Bernadino, California, which left 14 people dead. During the investigation, a federal judge asked Apple to help the FBI unlock an iPhone belonging to the alleged shooter. But Apple denied the request, with CEO Tim Cook saying it would require the company to write code that would be "a master key, capable of opening hundreds of millions of locks."