Computer and smartphone viruses are holding an increasing number of devices hostage using ransomware.