Huddled around their computers, two dozen French 20-somethings have been typing away feverishly for seven hours.

Their objective is clear: eliminate a virus crippling the systems of a government environmental agency.

"Mission accomplished! They have done what they were asked to do. Analyse, identify and then develop a code that wipes it out," says Patrice, a French military officer testing potential recruits at a cyber defence centre in western France.

The exercise was one of dozens held across the country between March 20 and 31, involving 240 people from 12 elite technology colleges, part of a plan to create an army of talented cyber spies to counter digital destabilisation efforts.

Officials want them to be ready to face cyber warfare that could target civil infrastructure such as water, electricity, telecommunications and transport.

They will also be expected to protect French democracy itself, amid allegations that Russia interfered in the US presidential election last year.

Cyber defence has become one of France's national security priorities as states like Russia, China and Iran, criminal groups and even some allies sharpen their own digital abilities.

"The threats will grow. The frequency and sophistication of attacks is increasing without respite," Defence Minister Jean-Yves Le Drian said in December after unveiling the army's new cyber operational command.

"The next challenge in cyber defence will not just be detecting the attacks, but to continue our military operations amid a cyber attack, while using cyberspace to launch our own counter operations."

The "fourth army", as it has now been labeled, will see an initial billion euros invested up to 2019. The objective is to have 3200 digital soldiers in place by then, from just 100 six years ago.

Another 4400 reservists will be waiting in the wings if required.

Seeking nuggets

At Cesson-Savigne, a centre for French cyber defence excellence, the 20 budding digital soldiers know this could be the opportunity to defend their country.

They are put through intense workouts on tasks ranging from tackling basic infiltration efforts via system compromise to full loss of control of the network.

"It really is the opportunity to spot the golden nuggets," said Eric, a colonel who heads the operations pole of the army's cyber defence command centre.

In line with French military rules, officers are not allowed to give their family names.

The annual exercise, which has been running since 2013, has so far enabled France to recruit 35 percent of the reservists it needs.

More and more students are also seeking full-time posts, with starting salaries of €3000 euros (A$3967) a month.

"The profile we're after is someone young who enjoys rummaging around a little and is extremely curious in the digital world," said Stephane, a commander who heads up a cyber unit that trains about 1000 people each year.

On the other side of the Atlantic, there is concern that the US National Security Agency risks a brain-drain of hackers and cyber spies due to tumultuous reorganisation and worries about the acrimonious relationship between the intelligence community and President Donald Trump.

Cyber security executives in the United States said they had witnessed a marked increase in the number of US intelligence officers and government contractors seeking employment in the private sector since Trump took office on Jan. 20.

Among the French potential recruits was David, an engineering graduate who at 30 is too old to join the army. He said signing up to do his bit for his country was a no-brainer.

"In the future, we'll see more and more cyber attacks instead of terrestrial ones. The army will need ground troops, but they will also need people like us for the logistics and the technological side so we'll be there to help them carry out their mission," he said.