The fiendish code devised by GCHQ in a bid to recruit new young spies has been
solved by "about 50" people.

But those who made it through to the final stages of the job application were disappointed to find that the post paid £25,000 and could be found through a simple Google search.

One mathematical brain who cracked the code admitted that he used to work at GCHQ but quit when he realised he could more than double his salary working for the private sector.

The 23-year-old, who did not wish to be identified, is one of “a number” of would-be spies who have solved the baffling puzzle.

But he admitted that the problem facing the secret service was its inability to match the salaries paid by private cyber security companies and leading internet specialists.

The cyber expert, who studied maths and computer science at Imperial College London, before been snapped up by the intelligence service, said: “There is an incredibly high turnover at GCHQ and that is simply down to pay.

“Those who can do that challenge could easily earn up to £80,000 a year in the private sector. It’s disappointing that as a society, we are not willing to acknowledge those skills by spending more money.”

Iain Lobban, the director of GCHQ, has admitted that while he can offer his staff a “fantastic mission” he struggles to retain the best staff.

He told the parliamentary Intelligence and Security Committee earlier this year: “They will be working for Microsoft or Google or Amazon or whoever. And I can’t compete with their salaries. I can offer them a fantastic mission, but I can’t compete with their salaries.

“Month-on-month, we are losing whizzes who’ll basically say: ‘I’m sorry, I am going to take three times the salary and the car and whatever else’."

Professor Peter Sommer, an expert on cyber security at the London School of Economics, said the agency was forced to rely on its reputation and the fact that its staff would be using some exceptionally interesting technology.

"You meet people who seem to enjoy it, but you also meet people who find the combination of low pay and very high secrecy more than they can bear,” he said.

"It's very much a question of temperament and these people are in very high demand in the private sector. At GCHQ they're normally stuck in Cheltenham, cut off from much of the outside world and only able to really talk to other people in the same secret field."

The online challenge does not lead to a job at GCHQ, or even a guaranteed interview, as the final application page can be accessed by anyone.

It has baffled some of the country’s top mathematical brains but was designed to attract a new generation of spies equipped with the right kind of mathematical skills to help Britain step up its security, in the face of “disturbing” levels of cyber crime.

The code, a cryptic series of letters and numbers, was released on social networking sites as a part of a viral campaign that directed users to an unbranded website called canyoucrackit.co.uk.

The page invites users to submit a “keyword” to unlock the puzzle, but the Daily Telegraph can disclose that the test is far more complex than it originally appears and contains three separate stages.

To the untrained eye the code appears meaningless, but to mathematicians and computer scientists, it is obviously a code written in hexadecimal, a numeral system widely used in computing.

It can readily be turned into a decryption program written in the basic language used by most home computers.

The message that must then be decrypted is hidden within the image on the website; an example of a technique for secret communication called steganography. It is discovered by downloading the image and viewing it as a text file.

That leads to the second stage of the challenge, which requires would-be spies to build a virtual computer which in turn provides another web address directing them to a software program for which they must create a specific input file.

The file begins with the letters GCHQ, the first clue that the code has been designed by the secret service.

Once the file is cracked, it produces a code which is the keyword required by the very first page of the challenge.

This enables the codebreaker to access a GCHQ page declaring: “So you did it! Well done.” It asks whether the user would be capable of using their “skills and ingenuity” to combat terrorism before directing the user to a job application page advertising a vacancy for a cyber security specialist based at its Cheltenham headquarters.

A GCHQ spokesman said "more than 50" had cracked the code since it was published on November 3.