Security & privacy

What is ransomware, and how do you protect your files from it?

Ransomware locks your files and demands payment. Learn how it spreads, why offline backups are the real defence, and what to do if it ever hits your computer.

Cursorlane Editorial TeamSoftware & tools 5 min read
A home study with a laptop, a sturdy safe and an external drive on a shelf, with family photos on the wall

Ransomware is malicious software that encrypts the files on your computer, or a whole network, and then demands payment for the key to unlock them. The best protection against it is boring but reliable: keep software updated, be careful with attachments and links, and keep backups that the ransomware cannot reach.

This guide explains how ransomware gets in, why backups are the decisive defence, how to set up a simple backup routine at home, and what to do if your files are ever locked.

What does ransomware actually do?

Once ransomware runs on a device, it quietly encrypts documents, photos and other files using strong cryptography, then displays a message demanding payment, usually in cryptocurrency, for the decryption key. The files are still there, but they are unreadable without the key.

Many modern ransomware groups also copy data before encrypting it and threaten to publish it if the victim does not pay. This 'double extortion' mostly targets businesses, schools and hospitals, but home users are hit too, often through the same tricks used in everyday scams.

Some scams only pretend to be ransomware. A web page may fill your screen with a warning that your computer is locked and that you must call a number or pay a fine. Closing the browser, or restarting it without restoring the previous tabs, usually makes it disappear. Real ransomware leaves your files unreadable even after a restart.

How does ransomware get onto a computer?

Ransomware rarely appears out of nowhere. It usually needs someone to open a door, or it finds one left open. The most common routes are:

  • Email attachments or links that install malware, often disguised as invoices, delivery notices or shared documents.
  • Unpatched software with known security holes, especially on devices exposed to the internet.
  • Stolen or weak passwords for remote access services.
  • Pirated software, cracked games and fake download sites.
  • Fake update pop-ups on websites.
  • Infected USB drives plugged in out of curiosity.
If you have a copy of your files that the ransomware could not touch, an attack becomes an annoyance rather than a disaster.

Why are backups the best defence?

If you have a recent copy of your files that the ransomware could not touch, an attack becomes an annoyance rather than a disaster. You wipe the device, reinstall, restore your files and move on, without paying anyone.

The catch is the word 'could not touch'. Ransomware encrypts anything it can reach, including an external drive that is always plugged in and sometimes synced cloud folders. A good backup plan therefore includes at least one copy that is disconnected or versioned, so you can roll back to a point before the attack.

A widely used rule of thumb is 3-2-1: keep three copies of important data, on two different kinds of storage, with one copy kept off-site. Many people add a fourth idea: at least one copy offline or immutable, meaning it cannot be changed once written.

How do you set up a simple home backup routine?

You do not need special equipment. A built-in backup tool on your computer, an external drive and a cloud storage service with version history are enough for most households.

  • Decide what matters: photos, documents, school work, anything you could not recreate.
  • Turn on your computer's built-in backup tool and point it at an external drive.
  • Unplug the drive after each backup, or at least most of the time.
  • Use a cloud backup or storage service that keeps previous versions of files.
  • Keep a second drive at a relative's house or at work and swap it now and then.
  • Test a restore every few months by recovering a few files.

What other habits reduce the risk?

Backups limit the damage; these habits make an infection less likely in the first place. Keep your operating system, browser and apps on automatic updates. Use the built-in security protection on your device and leave it switched on. Avoid pirated software, which is a common carrier of malware.

Be careful with attachments you were not expecting, especially archives and documents that ask you to 'enable editing' or 'enable content'. Use unique passwords and two-factor authentication, particularly for any remote access to your home or work computers. On a shared family computer, use a normal user account for everyday work rather than an administrator account.

Many operating systems also include a controlled folder or similar protection feature that stops unknown programs from changing files in your documents and pictures folders. It is often off by default because it can block legitimate programs at first, but for a household computer it is worth turning on and allowing the few programs you trust.

What should you do if ransomware hits?

Act quickly to limit the spread. Disconnect the affected device from Wi-Fi and cable networks straight away, and unplug any external drives. Do not plug in your backup drive until the device has been cleaned, or it may be encrypted too.

Photograph the ransom message for reference. At work, call your IT or security team immediately. At home, report it to the police or your national cybercrime reporting service. Some ransomware families have free decryption tools published by law enforcement and security researchers, so check reputable sources such as public anti-ransomware initiatives before assuming your files are lost.

Law enforcement agencies generally advise against paying. Payment does not guarantee you get a working key, it marks you as willing to pay, and it funds further attacks. The reliable way back is to wipe the device, reinstall the system and restore from a clean backup.

Frequently asked questions

Can ransomware infect cloud storage?

+

It can encrypt files in synced folders, and the encrypted versions may sync to the cloud. Services that keep version history usually let you restore earlier copies. Check how long your service keeps old versions.

Do Macs and phones get ransomware?

+

Ransomware mostly targets Windows computers and servers, but other systems are not immune. Phones are more often hit by scams that only pretend to lock the device. Updates, official app stores and backups protect all of them.

Should I pay the ransom?

+

Police and national cyber security agencies advise against it. There is no guarantee you will get your files back, and paying funds further crime. Restore from backups and report the attack instead.

Can antivirus stop ransomware?

+

Built-in security protection blocks many known ransomware types and some include specific folder protection. It cannot catch everything, which is why updates and offline backups still matter.

How often should I back up my files?

+

Back up as often as you would mind losing work. For most households, a continuous or daily automatic backup plus a weekly offline copy is a good balance.

Is a USB stick a good backup?

+

It works for a small number of important files, but USB sticks fail and get lost easily. An external drive and a versioned cloud backup are more reliable for a whole computer.

Ransomware turns on one question: do you have a copy it cannot reach? Set up an automatic backup today, keep one copy disconnected, and test a restore so you know it works.

How we research: Guides are written from established sources and checked for accuracy. They are general information, not professional advice.

Written by

Cursorlane Editorial Team

Software & tools

Our writers are developers and heavy software users who test what they write about and update guides when the tools change.

More Stories

View all →