Angela Lang/CNET

Encryption should have limits. That's the message FBI Director Christopher Wray had for cybersecurity experts Tuesday. The technology that scrambles up information so only intended recipients can read it is useful, he said, but it shouldn't provide a playground for criminals where law enforcement can't reach them.

"It can't be a sustainable end state for there to be an entirely unfettered space that's utterly beyond law enforcement for criminals to hide," Wray said during a live interview at the RSA Conference, a major cybersecurity gathering in San Francisco.

Now playing: Watch this: FBI chief says US law enforcement will keep indicting...

His comments are part of a back-and-forth between government agencies and security experts over the role of encryption technology in public safety. Agencies like the FBI have repeatedly voiced concerns like Wray's, saying encryption technology locks them out of communications between criminals. Cybersecurity experts say the technology is crucial for keeping data and critical computer systems safe from hackers. Letting law enforcement access encrypted information just creates a backdoor hackers will ultimately exploit for evil deeds, they say.

Wray, a former assistant attorney general in the US Department of Justice who counts among his biggest cases prosecutions against Enron officials, acknowledged Tuesday that encryption is "a provocative subject." As the leader of the nation's top law enforcement agency, though, he's focused on making sure the government can carry out criminal investigations.

Investigations of foreign hackers have been numerous, resulting in indictments of several in the past year, including hackers associated with the Chinese government who're accused of IP theft, as well as hackers believed to be connected with the North Korean government who're accused of creating the malware behind the WannaCry ransomware virus.

Wray also leads the FBI at a time when special counsel Robert Mueller, who headed the agency from 2001 to 2013, is investigating allegations that Russian spy agencies orchestrated a hacking campaign against the Democratic National Committee and other political organizations in the lead-up to the 2016 presidential election.

Hackers in other countries should expect more investigations and indictments, Wray said.

"We're going to follow the facts wherever they lead, to whomever they lead, no matter who doesn't like it," he said. To applause, he added, "I don't really care what some foreign government has to say about it."

He also countered claims that FBI employees are unhappy since the firing of former FBI Director James Comey. The agency has seen a spike in applications since October, the beginning of the federal government's fiscal year, Wray told the room.

"Rumors about our morale have been grievously overstated," he said.