Computer chips, Operating Systems and the Internet were originally designed without any concern for dealing with malice.
Ever since, the industry have, in a band-aid fashion, tacked on utterly inept approaches, such a virus scanners, to provide security, without making any fundamental changes.
The solution is to start over and design computer chips, Operating Systems and the Internet with security built in to the hardware. Everything has to be digitally signed. Everything has to be encrypted. Everything has to live in air tight boxes where it cannot corrupt anything else including disk files and the registry.
This would be a huge expense, but compared with the costs of damage from hackers, DOS (Denial of Service attack) attacks, malware, viruses, ransomware and software piracy it would pay back within a year. The most logical funder is the US military.
Trying to solve the problem with the legal system is futile, since attackers can be based anywhere on the planet, out of reach of local law. Further the rewards of computer crime are so great, even life sentences are not a deterrent.~ Roedy (1948-02-04 age:70)