Driverless cars could be hacked and deployed as "fully loaded weapons", according to the chief executive of Blackberry, the Canadian technology company.

The technology company, best known for its smartphones, is currently developing software for driverless cars in partnership with Baidu, the Chinese internet search giant.

John Chen, Blackberry's chief executive, said driverless cars were programmed with more lines of code than a typical fighter jet, offering enormous scope for hackers to exploit vulnerabilities to insert malware.

"A car could easily be infected with viruses [and] is literally a fully loaded weapon. If hackers can get hold of it, you can imagine what they could do."

He added that the industry was working hard to reduce the risks.

"I can create a car I think is 90 per cent virus free but as soon as that car gets on the road and is being used, those conditions need to be regularly checked," Mr Chen said.

Unlike a jet, all of the code comes from different sources, which can exacerbate its vulnerabilities to cyber attacks.

Despite huge investment from tech giants like Google, Apple or Tesla, Mr Chen claimed that driverless cars would take at least another five years to take off commercially

Mr Chen has called for governments to set safety standards that tech giants can adhere to as they develop driverless vehicles.