I have a question after reading the discussion here: Ransomware encryption keys

So I understand the process of WannaCry encryption now, thanks to the accepted answer given by the community on the security.stackexchange page linked above. However, what I do not understand is why generate a different AES key to encrypt each file on victim's computer? The attacker could generate just one AES key and encrypt all files using that and then protect that key using the mechanism discussed in the page linked.

Why use different AES keys? Does it have any cryptographic, strategic, or operational advantage at all for the attacker? Or is it out of pure paranoia?

  • If I locked you into a house with a thousand doors, wouldn't it be a lot harder to break out (or in), if all doors had different locks?
    – Tom K.
    Jan 25, 2018 at 22:35
  • 1
    Not if the lock that you used on all doors is "impossible" to break into. AES encryption has no known weakness and so whether you use same key on all doors or different, in the end, result is same -- no one can get in.
    – whoami
    Jan 25, 2018 at 22:39
  • 3
    First thing that comes to mind is if the victim notices the ransomware and immediately hibernates they may be able to extract the key from swap, but if there's a different key for each file they'll only be able to extract keys for files that were still being encrypted. Jan 25, 2018 at 22:43
  • @AndrolGenhald Ah that does make sense. Can other users confirm that this is indeed the reasoning behind it? Are there any other theories?
    – whoami
    Jan 25, 2018 at 22:44
  • 4
    @amirootyet I'm not sure we can ask the devs to get a definitive answer.
    – schroeder
    Jan 25, 2018 at 22:50

1 Answer 1


The criminals who created the ransomware can't be consulted for comment. But we can look at the tradeoffs involved.

By using different keys for different files it allows the attackers to decrypt the files on a file-by-file basis, without providing the key to ALL the files.

I don't have a reference for this right now, but I recall that the ransomware perpetrators will offer to decrypt one file as a demonstration that they have the keys (one might call this "good faith"). They can only do this if each file is encrypted with a different password. If all files were encrypted with the same password, decrypting one file would allow ALL files to be decryped.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.