Partly offsetting the positive trend is an explosion in ransomware attacks, which rose 311% from 2019.