This is simple file encryption and decryption code which encrypts all the files present in the folder the code is run from, and generates a key.key file which stores the decryption key and once the decryption code is run, all the encrypted files gets decrypted with the key present in key.key file.
NOTE: This provides an overview of how ransomware attacks works
pip install cryptography- Clone this repository in a New folder.
- Add any file you want to add in the folder.
- Add any filename of the file that is present in the folder that you don't want to be encrypted in this portion
if file == "encrypt.py" or file == "key.key" or file == "decrypt.py": - Repeat step 3 for decrypt.py file too.
- Make any file that you want to encrypt or you can make changes to previous files too.
- Voila you are ready to run the code.