France's external intelligence service, the DGSE, has sponsored a school competition to find the nation's most talented young code-breakers.
It is the first time the DGSE has got involved in such a project in schools.
The first round drew in 18,000 pupils, and just 38 competed in the final on Wednesday, won by a Parisian team.
A DGSE spokesman said the aim was to spread awareness about intelligence work. Security is a major concern after last year's jihadist attacks in Paris.
DGSE stands for Directorate-General for External Security. It has 6,200 staff - 63% of them civilians - and an annual budget of about €750m (£575m; $839m).