Document Key
Windows 10 & 11 Buy license · $29.95
Reference

Does Encryption Protect Against Ransomware? What It Does and Does Not Do

Does encryption protect against ransomware? Learn what encrypting your files stops, what it does not, and the backup habits that protect you.

Updated 5 minute read The Document Key team

Encryption does not protect you from ransomware locking your files. Ransomware can encrypt files that are already encrypted, wrapping them in a second layer you cannot remove, so you lose access just the same. What encryption can do is limit the other half of a modern attack: many ransomware groups steal copies of files before locking them and threaten to publish them, and files encrypted with a strong password the attacker does not have are useless to them. To recover from ransomware itself, you need backups that the ransomware cannot reach, plus the usual defenses of updates, care with attachments and Windows' built-in ransomware protection.

Here is how the two kinds of encryption interact, and the setup that actually keeps your files safe.

Two different uses of encryption

It is easy to mix these up because both use the same word:

  • Your encryption scrambles files so that only someone with your password can read them. It protects confidentiality.
  • Ransomware's encryption scrambles your files with the attacker's key so that you cannot read them. It attacks availability.

Your encryption does not stop a program running on your PC from reading the bytes of a file and writing a scrambled version back. To ransomware, an encrypted file is just another file to lock.

What encryption does and does not do against ransomware

ThreatDoes your encryption help?
Ransomware locks your filesNo. Encrypted files can be encrypted again
Attacker steals files and threatens to leak themYes, for files that were locked with a password the attacker does not have
Attacker steals files from an unlocked folder or vaultNo. Anything open while you are signed in can be read
Laptop lost or stolenYes. This is what encryption is built for
Recovering after an attackNo. Only backups do this

The important nuance is the third row. If an encrypted vault or folder is unlocked while malware is running, the malware can read the files just as you can. That is one reason auto-lock matters: folders that lock themselves when you step away spend less time exposed.

The defenses that actually stop ransomware

1. Backups the ransomware cannot reach

This is the only reliable way to get your files back. Ransomware encrypts anything it can write to, including connected USB drives and mapped network folders, so a backup that is always plugged in can be lost with everything else.

  • Keep one backup offline. Copy to an external drive, then unplug it. Rotate two drives if you can.
  • Use versioned cloud backup. Services that keep previous versions of files let you roll back to before the attack. Check how long versions are kept on your plan.
  • Test restores. A backup you have never restored from is a hope, not a plan.

Encrypted files back up just like any other file, and they stay encrypted in the backup, which protects the backup copies if a drive is lost or a cloud account is compromised.

2. Controlled folder access

Windows Security includes a ransomware protection feature that blocks unknown programs from changing files in protected folders.

  1. Open Windows Security from the Start menu.
  2. Go to Virus & threat protection.
  3. Under Ransomware protection, click Manage ransomware protection.
  4. Turn on Controlled folder access.
  5. Use Protected folders to add folders beyond the defaults, such as a second drive.

Some legitimate programs may be blocked at first. If one is, use Allow an app through Controlled folder access to permit it. This feature works with Microsoft Defender Antivirus; if you use another antivirus product, check its own ransomware settings.

3. Updates and safe habits

  • Keep Windows, browsers and Office up to date.
  • Be wary of unexpected attachments and links, even from people you know.
  • Use a standard account for everyday work where practical.
  • Do not open macros in documents you were not expecting.

Where file encryption fits

File encryption is not a ransomware cure, but it is a valuable layer for the data-theft side of attacks and for everyday privacy. Document Key encrypts files and folders with AES-256 and a password, and its auto-lock closes folders and vaults when you are idle, the PC sleeps or you sign out. Sensitive files that sit locked most of the time are unreadable if copied off your PC. Document Key's encrypted files back up like any others, and stay encrypted in the backup. Pair that with offline or versioned backups and Controlled folder access, and you are covered from both directions.

Never rely on an encryption tool, antivirus or any single product as your only ransomware defense. If you only do one thing after reading this, set up a backup that is disconnected from your PC.

Common myths

  • "My files are in the cloud, so I am safe." Sync services copy changes, including ransomware's changes, to the cloud. What saves you is version history or a separate backup, not sync itself.
  • "Encrypted files are invisible to malware." They are not. Malware sees them as files with unreadable contents, and can still overwrite or delete them.
  • "Ransomware only targets businesses." Home PCs are hit too, often through malicious email attachments or pirated software.

Encrypting files before they go to the cloud is still worthwhile for privacy. Our guide to encrypting files before uploading to the cloud explains how.

If you are hit by ransomware

  1. Disconnect the PC from the network and unplug any backup drives immediately.
  2. Do not delete anything yet. Take photos of ransom notes for reference.
  3. Get help. At work, contact IT straight away. For a business, consider your insurer and a professional incident response service, and report it to the relevant authorities.
  4. Restore from a clean backup after the PC has been wiped and reinstalled, not before.
  5. Change passwords for accounts used on the PC, from a different device.

If files were stolen, the ones you had encrypted with a strong password are the ones you will not need to worry about. For more on the difference between password-locks and real encryption, see password protect vs encrypt, and for a refresher on the cipher itself, read what AES-256 encryption is.

Frequently asked questions

Can ransomware encrypt files that are already encrypted?

Yes. Ransomware can encrypt your encrypted files a second time, so you lose access to them just the same. Backups are what let you recover.

Does encryption stop ransomware gangs leaking my files?

It can help. If stolen files were encrypted with a strong password the attacker does not have, the copies they take are unreadable.

What actually protects against ransomware?

Offline or versioned backups, keeping Windows and apps updated, Controlled folder access in Windows Security, and care with email attachments.

Get three guides like this every month, plus software update notices.Subscribe →