January 25, 2016 By Larry Loeb 2 min read

Bleeping Computer reported that researchers have been quietly helping victims of the ransomware TeslaCrypt, which was first discovered in early 2015, recover their files. This effort used a flaw in TeslaCrypt’s encryption key storage algorithm present in version 2.0 of the ransomware. The fact that this malware could be decrypted was kept under wraps because the researchers were hoping that the developer would not learn about it and attempt to find a fix.

But somehow the cybercriminals found out they had been hosed and came up with version 3.0, which corrected the key storage so that all keys were once again encrypted. Luckily, keys and files used in older versions of the ransomware are still recoverable, provided they have certain file extensions.

Key Storage: The Weakest Link

The problem for the ransomware revolved around how the decryption keys were stored on the target’s computer. The malware encrypts the victim’s files using the AES encryption algorithm. This means that it used the same key to encrypt and decrypt a file. Researchers found that every time TeslaCrypt was restarted, a new AES key was generated. This key was stored in the files that were encrypted during each session. As Bleeping Computer pointed out, that meant some files would be encrypted with different keys than others.

To protect this variable key, the malware developers first used another algorithm to encrypt it before it was stored in each encrypted file. That’s where researchers found the chink in the malware’s armor.

How TeslaCrypt Was Cracked Open

The size of this stored key was not sufficiently strong enough to remain hidden. It was possible for victims to use specialized programs to factorize the key and retrieve their prime numbers. Once the prime numbers were identified, other programs could reconstruct the decryption key and decrypt the malware-created files. Volunteers even opened a support forum to help infected users get their files back.

The efforts of these volunteers and researchers showed that a united response to this kind of pernicious malware is possible, and it can even succeed in retrieving data that has been hijacked. The community effort should give hope to others caught up in a web of criminal activities.

More from

Topic updates

Get email updates and stay ahead of the latest threats to the security landscape, thought leadership and research.
Subscribe today