Ransomware is malware that encrypts the files on a computer, a server or a whole company network and then demands money, the ransom, for the key. The files are still there, but without the key nobody can read them. Many groups also copy data before they encrypt it and threaten to publish it. This is called double extortion.
How ransomware locks files
Modern ransomware combines two kinds of encryption, much like HTTPS or encrypted email:
- Each file is encrypted with a fast symmetric cipher such as AES or ChaCha20, often with a new random key for every file.
- This file key is then encrypted with the attackers’ public key (RSA or elliptic curves) and stored next to the file. Well-made ransomware wipes the plain file key from memory.
- Only the matching private key can unlock the file keys again. It never leaves the attackers’ servers. That is what the ransom buys.
Encrypted files often get a new file extension, and a ransom note with payment instructions appears in every folder.
Why it can’t be cracked
A 256-bit AES key has 2256 possible values. Trying them all would take far longer than the age of the universe, on any computer that exists. The attackers’ RSA or elliptic-curve key is just as far out of reach. A tool that decrypts any ransomware does not exist.
Be careful with paid “ransomware recovery” services. In 2019, ProPublica found two US firms that claimed to have their own decryption technology but usually paid the attackers and charged victims extra.
When files come back anyway
A free decryptor only exists when there is a way around the attackers’ key:
- Mistakes in the malware. Weak random numbers, a key left on the disk or the same key for every victim let researchers rebuild the keys.
- Seized keys. When police take over the criminals’ servers, they can give the keys to victims. In February 2024, an international operation led by the UK’s National Crime Agency took down the LockBit group and recovered more than 1,000 decryption keys. Police then released a free LockBit decryptor.
- Backups. A copy the ransomware could not reach, offline or with versions it could not delete, is the only reliable way back.
The No More Ransom project collects free decryptors in one place. Europol, the Dutch police and IT security companies started it in 2016, and it now lists tools for well over a hundred ransomware families. Its Crypto Sheriff identifies the ransomware from two encrypted files (up to 1 MB each) or the ransom note. The files are uploaded to the service, so pick files without personal data.
What to do if you are hit
- Disconnect the device from the network and Wi-Fi, so the ransomware can’t reach other computers, shared drives or backups.
- Don’t pay. Paying does not guarantee that you get your files back. Some victims never receive a working key, others are attacked again. Police and national agencies such as CISA in the US and the NCSC in the UK advise against paying.
- Keep the evidence. Keep a copy of the encrypted files and the ransom note. If there is no decryptor today, one may appear later, as it did for LockBit.
- Look for a decryptor on No More Ransom. Remove the malware first, or it may encrypt the files again.
- Restore from a backup once the system is clean.
- Report it to the police. Companies should also contact their national cyber security agency and check whether they have to report a data breach under data protection law.
How to protect yourself
- Back up regularly to a drive or service that ransomware can’t overwrite: unplug the drive after the backup, or use storage with versions that can’t be deleted. Test that you can restore.
- Install updates quickly, especially for anything that is reachable from the internet.
- Be careful with attachments and links in unexpected emails.
- Use multi-factor authentication for email, remote access and admin accounts.
Try it
See why the wrong key gets you nowhere: encrypt a sentence with AES-256-CBC, then decrypt it with a secret that differs by one character. The guide What are you trying to decrypt? shows what can be decrypted and what can’t.
Where to get help
- No More Ransom: free decryption tools (Europol, police and security companies)
- Crypto Sheriff: find out which ransomware it is
- CISA #StopRansomware: I’ve been hit by ransomware (US)
- NCSC: ransomware guidance (UK)
- BSI: ransomware attacks (Germany)