This project is for educational purposes only. Do NOT use this on any real system or against anyone without permission. Only tested in an isolated lab environment (Kali Linux VM).
A basic ransomware simulation built in Python using the Fernet symmetric encryption library. The project demonstrates how ransomware works — encrypting files and requiring a secret phrase to decrypt them.
risk.py— Encrypts all files in the current directorydecrypt.py— Decrypts files using the saved key + secret phrase
- Scans the current directory for all files
- Skips risk.py, decrypt.py and thekey.key
- Generates a random Fernet encryption key
- Saves the key to thekey.key
- Encrypts every file using the key
- Reads the saved key from thekey.key
- Prompts user for a secret phrase
- If phrase is correct — decrypts all files
- If phrase is wrong — access denied
- Python 3
- cryptography library
pip install cryptography
Run encryptor: python3 risk.py
Run decryptor: python3 decrypt.py Enter secret phrase: coffee
- How Fernet symmetric encryption works
- How ransomware targets and encrypts files
- Importance of excluding key files from encryption
- How secret phrases can gate decryption access
- Kali Linux
- Python 3
- cryptography (Fernet)