Despite losing ground in Iraq and Syria, Islamic State is still able to organize terrorist attacks across the world and can draw on large numbers of Westerners in its ranks, CIA Director John Brennan warned lawmakers.

Contradicting the positive messages coming from the White House and the Pentagon about the state of the fight against IS (also known as ISIS/ISIL), the CIA chief told the Senate Intelligence Committee on Wednesday that the group remained “a formidable, resilient, and largely cohesive enemy.”

“Unfortunately, despite all our progress against ISIL on the battlefield and in the financial realm, our efforts have not reduced the group's terrorism capability and global reach,” Brennan said in his opening statement. “The resources needed for terrorism are very modest, and the group would have to suffer even heavier losses of territory, manpower, and money for its terrorist capacity to decline significantly.”

As IS continues to lose ground and funding, the CIA believes the group will “intensify its global terror campaign to maintain its dominance of the global terrorism agenda,” Brennan added.

Of particular concern to the intelligence agency are the Western IS fighters, who can infiltrate back into their countries of origin through a variety of means, “including refugee flows, smuggling routes, and legitimate methods of travel,” according to Brennan.

Even without such infiltrators, the agency is dealing with the “exceptionally challenging” issue of the so-called lone wolves such as Omar Mateen, who killed 49 people at a gay nightclub in Orlando, Florida on Sunday. The CIA has not been able to uncover “any direct link” between the attacker and foreign terrorist groups. Mateen had claimed allegiance to IS in a phone call to the authorities during his rampage.

To disseminate its propaganda, IS “primarily uses Twitter, Telegram, and Tumblr, and it relies on a global network of sympathizers to further spread its messages,” Brennan told lawmakers.

Asked what the CIA was doing to counter the group’s ability to inspire terrorist, he said the agency goes “upstream” to identify the source of the propaganda, and then “appropriate actions” are taken against the individuals in Syria and Iraq.

Many of the senators were concerned about Brennan’s continued support for the initiative to defeat encryption by giving “backdoor” access to applications so they could be accessed by US intelligence and law enforcement agencies.

With encryption, terrorists are “taking advantage of liberties we have fought so hard to defend.” - #CIA Dir. Brennan to Senate Intel Cmte.

Requiring back doors will put the personal safety of Americans at risk, argued Senator Ron Wyden (D-Oregon). If US companies restrict encryption, foreign companies will step in. Brennan shrugged the concern off, saying that US companies “dominate” the market and will continue to do so.

At that point, Senator Mark Warner (D-Virginia) pointed out that the attackers in France used an encrypted app from Belgium, and that half the apps that appear on the market every day are of foreign origin. It would “make America less safe” to impose a legal mandate that would push bad actors to use foreign-based software, Warner said.