He even suggested sending nasty messages on a condolence page set up for two female police officers shot dead in Manchester.

Wilson, who is currently excelling on a Master’s degree in computers and has set up his own business programming artificial intelligence systems, was doing his degree at Northumbria University when he came to the attention of police.

After repeatedly refusing to provide his password for his encrypted computer, a judge last year ordered him to do so in the interests of national security.

However none of the 50 complex passwords he provided worked and now he has been jailed for six months for failing to provide his details.

Wilson admitted failing to disclose a password in breach of the Regulatory Investigatory Powers Act 2000, an offence under terrorism legislation.

Judge Simon Hickey told him: “What you were doing was for your own satisfaction, showing what you could do with your undoubted skill with computers.

“But this is a serious offence and I can’t avoid an immediate custodial sentence.”

Police first became aware of Wilson in October 2012, after two emails were sent to the Vice Chancellor of Newcastle University, saying a man had been making a threat to kill a member of staff on an internet chat room and that he had a handgun and ammunition.

The message was sent under the username “Catch 22”, which was linked to Wilson’s server.

Police went to his home in Washington and seized computer equipment, including one system he had built himself which allowed remote access to other computers.

Wilson denied he had made the threats to kill and said he had fallen out with a couple of Dutch men online and that the allegations were malicious.

Newcastle Crown Court heard that prosecutors accept Wilson was telling the truth, and he was not charged with threats to kill.

However police still wanted to access his main computer and the two passwords he had provided didn’t work.

Without the password the computer could not even be booted up as he had encrypted the hard drive.

During the investigation, police linked him to making a phone call to them on August 23, 2012, saying the Northumbria Police website was going to be attacked.

Prosecutor Neil Pallister said Wilson used a voice changing device while making the call.

The attack, aimed at bombarding the system to the point of collapse, lasted for eight minutes and the website began to slow down before being taken down as a precaution for four minutes.

Mr Pallister said: “The police ICT department said an incident of this type caused many hours of disruption and wasted a lot of time.”

Wilson was arrested in January last year and admitted making the call but claimed he was just warning them of a possible attack by someone else.

Wilson made the call on his Skype phone and a number of messages he had sent online were retrieved.

Using the “Catch 22” moniker, he also encouraged others to report a hoax mugging outside the Centre for Life, in Newcastle.

Wilson, 22, of Mitford Close, Washington, also discussed hacking into the university network and getting passwords for 50 other students, the court heard.

He wrote: “Nobody cares about hacking, there are real crimes to deal with.”

When his phone was examined police found references to him carrying out another online attack on the Serious Organised Crime Agency. He wrote: “They called me to stop me. I’m committing a serious organised crime.”

In another message, he wrote: “You know those two coppers that got killed in Manchester, I heard there’s a condolence book online. Let’s troll it.”

Mr Pallister said: “The prosecution don’t say he was successful in hacking the websites I have mentioned but it clearly shows he had an interest in doing so.

“It was believed to be in the interests of national security to apply for a notice requiring him to disclose the password.”

The prosecutor added: “We say the only inference to draw from his willful refusal to disclose the password was that to allow access to the computer would reveal activity of the type mentioned, namely hacking Northumbria Police, SOCA and the university websites.”