This project is a simple proof-of-concept implementation of a ransomware using Python. It uses the cryptography
library to find and encrypt files in the same directory.
This script is for educational purposes only. Do not use it for any malicious activities.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Python 3.x
-
Clone the repository (or download the files):
git clone "https://github.com/thepratikguptaa/python-ransomware" cd python-ransomware
-
Create and activate a virtual environment:
-
On Windows:
python -m venv .venv .venv\Scripts\activate
-
On macOS & Linux:
python3 -m venv .venv source .venv/bin/activate
-
-
Install the required packages:
pip install -r requirements.txt
Important: This script will encrypt files in its directory. Make sure you have backups of any important files before running it.
- Make sure you have completed the "Getting Started" steps.
- Run the encryption script:
python the_malware.py
- This will encrypt all target files (like
.txt
files, etc.) in the directory and create athekey.key
file.
If your files have been encrypted by the script, you can decrypt them using the decrypt.py
tool.
- You must know the secret phrase.
Steps:
-
Run the decryption script from your terminal:
python decrypt.py
-
You will be prompted to enter a secret phrase:
Say my name:
-
Type the secret phrase, which is
pratik
, and press Enter. -
If the phrase is correct, the script will decrypt all the files and you will see a confirmation message:
Files decrypted successfully.
Your files are now back to their original state. If you enter the wrong phrase, you will see a "Wrong name." message.