A small Python proof-of-concept that demonstrates how file encryption can be implemented using the cryptography library.
Warning: This project is intentionally destructive and should only be run in an isolated virtual machine or lab environment. It encrypts files in the current directory. Never run it on real or important data.
This repository contains a basic ransomware-style example:
main.pygenerates a Fernet key and encrypts files in the working directory.decrypt.pyloads the generated key and attempts to restore the files.- The demo is designed for learning, testing, and controlled experimentation only.
main.py— encryption routinedecrypt.py— decryption routineREADME.md— project overview and usage notes- Sample text files — included for testing in a disposable environment
- Create a temporary folder.
- Copy the project files into that folder.
- Add a few test files.
- Run the encryption script:
python3 main.py- Run the decryption script:
python3 decrypt.py- Enter the required secret phrase when prompted.
- This script will encrypt files in the current directory.
- It is intended only for educational purposes and lab testing.
- Use a VM or sandbox environment to avoid affecting real files.
- Do not use this script on personal, production, or shared systems.
This repository is meant as a demonstration of encryption concepts and should not be used for malicious activity or real-world attacks.