PARIS — France's Interior Ministry presented plans for new anti-terrorism legislation Wednesday, seeking to extend and in some cases expand controversial measures that took effect after the Charlie Hebdo attack in 2015.

The proposals drew sharp criticism from privacy advocates who say France’s terrorism laws already test the boundaries of liberal democracy and in certain respects dwarf the scope of many other countries’ surveillance programs. Some of the new proposals would allow authorities to more systematically monitor the Internet-browsing behavior of people who access extremist content and to retain data longer.

“Terrorists have changed the methods of communication. We continue to be blind, monitoring phone lines that nobody uses any more,” Interior Minister Gérald Darmanin said.

Elements of the French proposal and practices that are already in place bear similarities to a program by the U.S. National Security Agency that collected millions of Americans’ phone records and was ruled by a federal appeals court to have been illegal last year. Privacy activists say the French measures may similarly violate a ruling by the Court of Justice of the European Union, which found last year that mass surveillance programs are unlawful unless they are restrained.

Arthur Messaud, a lawyer with French digital rights group La Quadrature du Net, called recent moves to expand surveillance “disturbing.”

Macron’s allies have defended the measures as necessary, saying self-radicalized attackers are posing a growing threat and are difficult to track down through traditional intelligence work.

But privacy activists say there is no evidence that the proposed law will prevent future attacks. They see the latest proposals as a political ploy and part of a broader effort by Macron’s government to ward off criticism from the right and far right, a year out from the next presidential election. Early polls have raised the possibility of a narrower repeat of the 2017 election, when Macron comfortably beat far-right leader Marine Le Pen in the second round.

Le Pen and her allies see security as a key advantage, as polling has shown that two-thirds of the French say their country has become less secure over the past years. In an open letter, 20 retired French generals and hundreds of other servicemen and -women warned last week that Islamist extremism and other factors could prompt a “civil war” in the country — a warning the far right quickly seized on.

The far right has also sought to capitalize on a string of attacks, including the beheading in October of a French teacher who had shown his students caricatures of the prophet Muhammad. The specter of terrorism returned last Friday, when a man fatally stabbed a female administrative worker at a police station in Rambouillet, a town near Paris, in what government officials called a terrorist attack.

“The measures taken by the government over the last four years do not measure up to the danger and the Islamist threat,” Le Pen said on French television in response to the incident.

Over the past year, Macron and his government have proposed a number of laws that appeared aimed at winning over right-wing voters, including one law to expand police powers. An “anti-separatism” bill has been portrayed by the government as tackling extremism. But left-wing critics fear it will stigmatize Muslims.

“Macron wants to position himself as Mr. Law and Order,” said Nicholas Dungan, a senior fellow with the Atlantic Council, adding that the most receptive audiences for such a message were probably Le Pen voters and conservatives who fear that French values, including secularism, are under threat.

In an interview with the Journal du Dimanche, Darmanin, the interior minister, cited last week’s attack in Rambouillet to justify the latest counterterrorism bill, saying that individuals “without necessarily any link to established Islamist networks” are posing a growing risk. The suspect behind last Friday’s attack watched extremist content online before committing the attack, according to prosecutors.

Darmanin said that in addition to expanding surveillance online, the newly proposed bill would also allow authorities to monitor prisoners convicted over terrorism offenses after their release for longer periods.

Terrorism researcher Peter Neumann said the bill is an acknowledgment of how the nature of attacks is changing in the country.

“It’s a reflection of the fact that we have attackers who no longer operate within hierarchical structures, and for whom communication with others isn’t as important anymore,” he said.

Neumann said he welcomed efforts to adapt counterterrorism laws to changing threats, but he wondered how much further Macron and his ministers can go.

“If you want to keep calling it a democracy, you can’t really make a lot more changes in the French system,” he said.

Some fear that efforts to compete with the far right on security issues will ultimately backfire.

Despite Macron’s shift toward the right on certain issues, he would still be seen as the centrist candidate in a potential runoff with Le Pen. Facing the same choice in 2017, many left-wing voters supported Macron after their own preferred candidates failed to make it into the second round. But early polls suggest that the same level of support next year may not be a foregone conclusion.