Photos encrypted by ransomware (.lalo, .djvu and the like): what can be saved
Your photos suddenly have a strange new ending, none of them opens, and a text file asks for money. With the most common ransomware for home computers, the photos are not as lost as they look: it encrypts only the beginning of each file. Here is what that means, what to try first, and how the rest of each picture can be brought back.
Which ransomware this is about
It is called STOP or Djvu, and it mostly arrives with pirated programs, "cracks" and key generators. You can recognise it like this:
- every file got an extra ending of a few letters after its own: IMG_0042.jpg became IMG_0042.jpg.lalo. There are hundreds of these endings (.djvu, .lalo, .boot, .kitz, .jjww and many more), and new ones keep appearing;
- each folder has a note, usually called _readme.txt, that asks for a few hundred dollars and offers to decrypt one file for free.
Not sure? Uploading one photo here tells you: the check recognises the mark this ransomware leaves in every file. The free site ID Ransomware names other kinds too.
It encrypts only the first 150 KB of each file
Encrypting every file in full would take hours, and the ransomware wants to be done before anyone notices. So it scrambles only the first 150 kilobytes of each file and moves on. A phone or camera photo is usually 2 to 8 megabytes: the other 95% or more is exactly as it was.
The photo still won't open, because those first kilobytes hold what every viewer needs first: the instructions for decoding the picture (its size and the tables the camera compressed it with), along with the date, the camera's name and the small preview. After them comes the top of the picture itself. So what is really lost is that information and a strip along the top of the photo. Everything below it is in the file, untouched.
Two limits follow from this. A photo smaller than about 150 KB is encrypted from start to end: nothing is left of it. And ransomware of other kinds, the ones that go after companies, often encrypts whole files: those can only be decrypted, not repaired.
First: look for copies it never reached
The ransomware encrypted what was on the computer and the drives plugged into it. The same photos may still be:
- on the phone or camera they were taken with, or its memory card;
- in the cloud: Google Photos, iCloud, OneDrive, Dropbox. Look at the website, not at the synced folder on the computer. Some of these keep earlier versions of files for 30 days, even after an encrypted one was synced over them;
- on a backup disk that wasn't plugged in, or in emails you sent with photos attached.
A copy that was never encrypted is always better than any repair.
Second: try the free decryptor
The security company Emsisoft gives away a decryptor for STOP/Djvu. Whether it works depends on the key your files were encrypted with. If the ransomware couldn't reach its server at that moment, it used a key that is the same for every victim of that version (an offline key), and once that key is known the decryptor gives back your files completely. If it did reach its server, the key is yours alone (an online key), and nobody but the criminals has it. The decryptor tells you which one you have. With an offline key that isn't known yet, it is worth trying again every few weeks. More free tools are collected by the police-backed project No More Ransom.
Paying is a gamble with criminals: some people get a working key, others get nothing, and the money pays for the next version.
Third: repair the photos themselves
When there is no copy and no key, the photos can still be put back together from what was never encrypted. The instructions for decoding that were lost are the same in every photo a phone or camera takes at the same size. So they can be borrowed from one photo that isn't encrypted:
- take a new photo with the same phone or camera, with the same size setting as back then. This nearly always works, and it is the easiest;
- or use one that is still on the phone, its memory card or in the cloud;
- not one that went through WhatsApp, Messenger or Facebook: they shrink photos and save them again their own way, so the instructions inside are theirs, not the camera's.
Upload the encrypted photo below, with its added ending. The page says that it was encrypted and asks for the intact photo; then it decodes everything after the encrypted part, puts it in its place and works out the colours again. In our test with a 2 MB phone photo, 93% of the picture came back; with bigger files it is more.
What you get, plainly:
- the picture from below the encrypted part down, as it was, in full quality;
- a strip along the top that is filled in (blurred from what is next to it), because that part of the picture really is gone. The bigger the file, the thinner the strip;
- no date taken and no camera name inside the file: they were in the encrypted part;
- if the colours or the position are a little off, they can be adjusted on the page before you download.
If the intact photo doesn't fit (another size, another phone), the page says why and you can try another one. Photos from different phones or cameras each need an intact photo from their own.
Before anything else
- Remove the ransomware first (a full scan with Windows Defender or another antivirus program), or it encrypts whatever you bring back.
- Keep the encrypted files, also after repairing them, and work on copies. If the key for your version becomes known one day, the decryptor gives back the complete originals, top strip and dates included.
- Don't rename them and don't let any program "fix" them by saving over them.
Other damage looks different: a photo that opens but is grey or shifted from some line down has lost a piece in the middle, not its beginning. That is another story, with the same kind of repair.