Malware is malicious software that gets installed on users' computers without their consent. After getting installed, it is activated and starts sending your confidential and sensitive information to the hacker. Malware is of different types, including viruses, trojans, worms, adware, rootkits, ransomware, etc. Ransomware is a type of malware that can lock your computer. Hence, if we talk about the difference between a virus and malware, a virus is a type of malware.