A three-day “cyber war” ended in victory for a team from the U.S. Air Force Academy, who beat off attacks from hackers from the National Security Agency in the 13th annual Cyber Defense Exercise (CDX).

The simulated “war” pits teams from the five U.S. service academies against 60 veteran security experts from the NSA. The NSA experts worked round the clock to break into networks built by students from the Air Force, Army Navy, Coast Guard and Merchant Marine academies.

"Our nation is under attack. We need to train up a new generation of leaders," said Dr Martin Carlisle of the U.S. Air Force’s Department of Computer Science, after his 28-member team's victory.

The students must manage operational networks of computers, using several computing platforms such as Windows and Linux, and offering services such as web and email - all while keeping “secret data” safe. The hackers use Trojans and other malicious software to penetrate the networks.

The “battle” takes place on a private network - and the “secret codes” are long, meaningless numbers created for the exercise.

“The students tackle the same types of threats our nation faces daily in cyber security,” said Darrell Durst, vice president of cyber solutions for Lockheed Martin’s Information Systems & Global Solutions, which provided a private network for the exercise. “Whether detecting intruders, or adapting to sophisticated threats, NSA leverages this opportunity to educate the next generation of cyber professionals.”

The NSA’s Shawn Turskey said that the goal of the programme was to raise awareness of cybersecurity.

"The real payoff of this program is going to be seen 10, 15 years down the road when these individuals are admirals and generals," he said.