Advanced types of Ransomware generate, usually, an AES 128 bit key (used to encrypt files, some types of ransomware use a unique AES key for each file). This key is generated on the fly. In addition, the ransomware generates a client RSA 4096 bit public/private key pair (again on the fly).The Cpub is used to encrypt the symmetric key; and Cpub itself is encrypted with the RSA public key of the server, which was hardcoded.
However, what I'm wondering is... is the encrypted AES key stored in the file header/trailer (and if the answer is yes... does it overwrite the header/trailer data of the original file)?
I can't find much info on the internet about this, but what I did find:
- Phobos ransomware stores the AES key in the trailer of the file (including the IV)
- WannaCry stores the AES key in the header of the file
- Dharma stores the key in the trailer
IV|AES-KEY|Encrypted FIle