The reasoning may initially seem a little off, but it does make sense in the end.

Abertay University has launched a masters course that will teach students how to hack into computers so that they can then go out and be computer security experts.

It's the old addage - to understand a criminal - you have to get into his/her mind, and so lecturers on the MSc Ethical Hacking and Computer Security course will explore the methods criminals use to attack networks.

As part of their course, students will be taught how to test systems for vulnerabilities and then they will have to come up with ways to protect against this weaknesses.

The university already runs an undergraduate course in Ethical Hacking and Countermeasures.

Head of Computing Lachlan MacKinnon told the BBC: "One of the assumptions that people make is that if they buy virus protecting software that will protect them from all known viruses".

"That may well be true but there's an awful lot out there that we don't know about."

"So designing more effective systems and designing security models to ensure that we don't have these problems is what the course is based around."

MacKinnon added that the university is "very careful" about the people that it takes on for the course.

"We have a strong vetting procedure - in the UK we use things like Disclosure Scotland to ensure that people that we're taking on aren't coming from a criminal background."

"We're very careful to make sure that the people who are coming through are doing it for the right reasons", he concluded.