From universities and hospitals to small charities and businesses, criminals using ransomware aren't picky about targets — as long as they pay.

Ransomware is the name given to software or computer viruses that spread by email attachments or compromised websites and encrypt the host computer's files, holding them hostage until the perpetrators are paid.

Avner Levin

Avner Levin is a professor and chair of the law and business department of the Ted Rogers School of Management at Ryerson University. (Supplied)

So what can you do to avoid having your data held hostage? And if it happens, what can you do to protect yourself?

Avner Levin, the director of Ryerson University's privacy and cyber crime institute, was on CBC Radio's Ontario Today at 12 p.m. ET to discuss how ransomware works and how to avoid it.

He later took part in a live chat to answer questions about how to avoid having your computer or business held hostage by ransomware.