memories.repair
Repair a photoSign in

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:

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:

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:

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:

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

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.